Enrico Zini: shops
Shops
Christmas songs should only ever be played on Christmas day.
In church.
At midnight.
Unless I happen to be there.
BackupPC is a pretty good backup system. Its configuration is rather
flexible, it has nice expiry policies, and it can store duplicated
file contents only once (for files that are shared across hosts or
don't change in time) within a compressed pool of data. However, it
doesn't do much to help pushing the data to off-site storage, or at
least not very efficiently. So if you have a BackupPC instance
running on a Raspberry Pi or a plug computer at home, it's a bit
tricky to protect your data against loss due to burglary or home fire.
The obvious solution would be to rsync the storage pool to a remote
site. However, the current pooling system relies heavily on
hardlinks, and rsync is notoriously inefficient with those. In the
home backup server scenario, this means that even if the computer is
more powerful than a Pi and can handle the memory requirements of
rsync, you'll often end up transferring way too much data.
So, since the obvious solution doesn't work straight away, what do we
do? Why, we fix it, of course. With a little look into the storage
pool, we notice that the bulk of the data is stored in files with an
abstract name (related to the contents) within a $prefix/pool
directory; the files with concrete names looking much like their
original are stored within $prefix/pc, and they're actually the same
files because they're hardlinks. Knowing this (that rsync doesn't),
we can make a smarter replication tool, by
rsync -aH; step 2 can be
implemented using the following two scripts. Run
store-hardlinks.pl locally, push the links file, then run
restore-hardlinks.pl on the remote server. This will ensure that
files already present in the pool are also hardlinked in their natural
location.
store-hardlinks.pl:
#! /usr/bin/perl -w use strict; use Storable qw(nstore); use File::Find; use vars qw/$prefix $poolpath $pcpath %i2cpool %todo $store/; $prefix = '/var/lib/backuppc'; $poolpath = '$prefix/cpool'; $pcpath = '$prefix/pc'; $store = '$prefix/links'; # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; # Scan pool File::Find::find( wanted => \&wanted_pool , $poolpath); # Scan PC dirs File::Find::find( wanted => \&wanted_pc , $pcpath); nstore \%todo, $store; exit; sub wanted_pc my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && ($nlink > 1) && do $name =~ s,$pcpath/,,; if (defined $i2cpool $ino ) $todo $name = $i2cpool $ino ; sub wanted_pool my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && ($nlink > 1) && do $name =~ s,$poolpath/,,; $i2cpool $ino = $name;
restore-hardlinks.pl:
The initial transfer can still take forever if the pool is large (and if you're pushing it through the small end of an ADSL link ), but at least the files are only transferred once. Note: This is only useful for current versions of BackupPC. Apparently BackupPC 4 will have a different pooling system without hardlinks, and the following hack will no longer be required. For now, though, here it is.#! /usr/bin/perl -w use strict; use Storable; use File::Path qw/make_path/; use vars qw/$prefix $poolpath $pcpath %todo $store/; $prefix = '/srv/backuppc-mirror'; $poolpath = "$prefix/cpool"; $pcpath = "$prefix/pc"; $store = "$prefix/links"; %todo = % retrieve ($store) ; my ($dev,$ino,$mode,$nlink,$uid,$gid); foreach my $src (keys %todo) my $inode; my $dest = $todo $src ; my $dpath = "$poolpath/$dest"; my $spath = "$pcpath/$src"; my $sdir = $spath; $sdir =~ s,/[^/]*?$,,; make_path ($sdir); next unless -e $dpath; if (! -e $spath) link $dpath, $spath; next; (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($spath)); $inode = $ino; (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($dpath)); if ($ino != $inode) unlink $spath; link $dpath, $spath;
In early October, I had an opportunity to talk about
Rcpp and
RcppArmadillo
at the Statistical Computing Seminar at the
Booth School of Business at the
University of Chicago.
And then two weeks ago, I had an invitation to talk at the
Center for Research Methods and Data Analysis
at the University of Kansas where I covered similar
material as well as ongoing work on the
RcppZiggurat
package (for which I should have an updated version soon).
Slides from both talks are now at the top of my
talks / presentations page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Replacing my phone
My first Android phone was
a ZTE Blade
(sold as Orange San Francisco here in the UK). It originally
shipped with Android 2.1 but was upgradable to 2.3 thanks to
CyanogenMod (or other unofficial mods). However there's little
sign of an upgrade to 4.x; the apps I want to use are pushing the
limits of its CPU, RAM and internal storage; and I've never got very
good at typing on a soft keyboard. So it seemed like time to get a
newer phone with a hard keyboard (and still with a SD slot).
After a little research with the CyanogenMod compatibility list and
some time looking at reviews, I settled on the
Samsung
Galaxy S Relay 4G, which was exclusive to T-Mobile USA but is
being resold through eBay. It shipped with Android 4.0 but I
immediately installed CyanogenMod 10.2 (Android 4.3). This was a
bit of an adventure as I bought the Blade with CM already installed
and wasn't familiar with the multiple steps that were necessary.
Copying my data
The last step, and the real subject of this entry, was to move my
data across. Much of this was on a SD card which I could simply
plug into the Relay. The internal files had to be backed up onto
this card and then restored, using the recovery environment
(ClockworkMod) on each phone. After rebooting the Relay into the full
Android system, my apps and settings were mostly present but I was
immediately confronted with a series of error dialogs reporting
that 'Unfortunately, Dialler has stopped' - and the same for 'Clock'
and 'the process android.process.acore' (whatever that is).
What went wrong
There are thankfully more detailed error logs in the filesystem,
under /data/system/dropbox (this is for logging at the Java
level; if a process is terminated by a fatal signal it's logged
to /data/tombstones). There are several ways to get at
them, but I used recovery mode and adb to get a root shell where I
could easily read and write files as necessary.
The Contacts (aka People) database upgrade fails with
an SQLiteException, apparently because it doesn't account
for upgrading from the schema used in 2.3:
Process: android.process.acore
Flags: 0x883e45
Package: com.android.providers.applications v18 (4.3.1-f963020e38)
Package: com.android.providers.contacts v18 (4.3.1-f963020e38)
Package: com.android.providers.userdictionary v18 (4.3.1-f963020e38)
Build: samsung/apexqtmo/apexqtmo:4.1.2/JZO54K/T699UVBMC5:user/release-keys
android.database.sqlite.SQLiteException: no such column: phonebook_label (code 1): , while compiling: UPDATE raw_contacts SET display_name_source=?,display_name=?,display_name_alt=?,phonetic_name=?,phonetic_name_style=?,sort_key=?,phonebook_label=?,phonebook_bucket=?,sort_key_alt=?,phonebook_label_alt=?,phonebook_bucket_alt=? WHERE _id=?
...
at com.android.providers.contacts.ContactsDatabaseHelper.updateRawContactDisplayName(ContactsDatabaseHelper.java:5344)
at com.android.providers.contacts.ContactsDatabaseHelper.upgradeToVersion504(ContactsDatabaseHelper.java:3580)
at com.android.providers.contacts.ContactsDatabaseHelper.onUpgrade(ContactsDatabaseHelper.java:2261)
...
Clock fails somewhat similarly though it apparently didn't
try to upgrade:
Process: com.android.deskclock
Flags: 0xc8be45
Package: com.android.deskclock v203 (2.0.3)
Build: samsung/apexqtmo/apexqtmo:4.1.2/JZO54K/T699UVBMC5:user/release-keys
android.database.sqlite.SQLiteException: no such column: incvol (code 1): , while compiling: SELECT _id, hour, minutes, daysofweek, alarmtime, enabled, vibrate, message, alert, incvol, profile FROM alarms WHERE (enabled=1)
...
at com.android.deskclock.AlarmProvider.query(AlarmProvider.java:73)
at android.content.ContentProvider.query(ContentProvider.java:744)
at android.content.ContentProvider$Transport.query(ContentProvider.java:199)
at android.content.ContentResolver.query(ContentResolver.java:414)
at android.content.ContentResolver.query(ContentResolver.java:357)
at com.android.deskclock.Alarms.getFilteredAlarmsCursor(Alarms.java:165)
at com.android.deskclock.Alarms.calculateNextAlert(Alarms.java:344)
at com.android.deskclock.Alarms.setNextAlert(Alarms.java:417)
at com.android.deskclock.Alarms.saveSnoozeAlert(Alarms.java:510)
at com.android.deskclock.AlarmInitReceiver$1.run(AlarmInitReceiver.java:49)
...
The media player fails with a NullPointerException:
Process: com.andrew.apollo:main
Flags: 0x98be65
Package: com.andrew.apollo v2 (1.1)
Build: samsung/apexqtmo/apexqtmo:4.1.2/JZO54K/T699UVBMC5:user/release-keys
java.lang.NullPointerException
at com.andrew.apollo.MusicPlaybackService.stop(MusicPlaybackService.java:878)
at com.andrew.apollo.MusicPlaybackService.openCurrentAndMaybeNext(MusicPlaybackService.java:1048)
at com.andrew.apollo.MusicPlaybackService.openCurrentAndNext(MusicPlaybackService.java:1031)
at com.andrew.apollo.MusicPlaybackService.access$1500(MusicPlaybackService.java:74)
at com.andrew.apollo.MusicPlaybackService$MusicPlayerHandler.handleMessage(MusicPlaybackService.java:2337)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:61)
Fixing the problem
Maybe I could have worked out how to upgrade the relevant databases
myself, but I went for simpler solutions. The clock settings are
easy to re-enter and most of the media player state is regenerated
by scanning files on the SD card. So I just deleted those on the
Relay:
rm -rf /data/data/com.android.deskclock rm -rf /data/data/com.android.providers.mediaThe contacts were what I really cared about, and there are actually specific menu items in Contacts to export and import those (using VCF format), side-stepping the database upgrade. So I did:
This is my monthly summary of my free software related activities. If you re among the people who made a donation to support my work (44.52 , thanks everybody!), then you can learn how I spent your money. Otherwise it s just an interesting status update on my various projects.
The Debian Administrator s Handbook
Wheezy update completed. Roland and I completed the update of the Debian Administrator s Handbook for Debian 7 Wheezy. We still have some proofreading work to do but you can already enjoy the result here: http://debian-handbook.info/browse/wheezy/
Feel free to report back any problem that you discover. You can also submit us patches ready to apply if you want to go one step further.
Publican contributions. The book is generated with publican and I maintain its Debian package. This month I got a release critical bug because it stopped working it turns out that the problem lied in libxml-treebuilder-perl and I thus reassigned #728885 while providing a tentative patch to the upstream author. After a few days without action from the pkg-perl team, and after having received a FTBFS bug on debian-handbook (of course publican was broken in unstable!), I prepared a fixed package myself and I uploaded it (I m still part of the pkg-perl team although I m inactive).
Since I used publican heavily this month, I filed two tickets in its bugzilla. I requested a new feature in #1034836 (the possibility to keep around the former string for fuzzy strings to update), and I reported a problem with the handling of \n in PO files in #1036150.
Debian France
Galette update. I updated the galette package and its paypal plugin, and I deployed those on france.debian.net. It had some fixes for the reminder mails sent to members.
Bylaws update. I also resumed my work on preparing new bylaws for Debian France. Sylvestre Ledru came up with a draft (with the help of a lawyer) a few months ago and I m reviewing/improving them now. The main goal is to clarify that Debian France is meant to be a Trusted Organization for the Debian project.
Debian France Shop. We had the idea since a few months already but Sylvestre did the leg work to open a Debian France shop with the help of EnVenteLibre. I asked our members to prepare some CSS that better match the Debian colors and this should be fixed in a few days. The first goodies will also start to appear shortly, just in time for Christmas!
Misc Debian work
Distro Tracker. In the continuation of the Google Summer of Code, I asked the DSA team to setup a new virtual machine to host tracker.debian.org, an instance of Distro Tracker, the rewritten Package Tracking System. They have done their part of the job (except the mail setup), it s now waiting on me to find some time to complete some cleanups and deploy the thing.
WordPress. I packaged wordpress 3.7.1 and sent a call for help on debian-mentors. I got 3 replies, I gave them some initial direction but I haven t heard back anything since. WordPress 3.8 is expected in a few days, hopefully one of the new volunteers will take care of preparing the next update.
Dpkg regressions. I haven t done anything for multiple months but at least I keep running the git version of dpkg and I detected two regressions. Good to have them squashed before the upcoming 1.17.2 upload to unstable.
PTS fix. I fixed some warnings that the PTS code started generating since the upgrade of its host to wheezy. They were generating some annoying backscatter mails to users of the pts@qa.debian.org bot.
Ruby security update. I helped the ruby team to prepare the required security updates of ruby1.8 and ruby1.9.1 (see #730178 and #730189). This work was sponsored by Kali/Offensive Security.
Smartcard setup. I bought 2 OpenPGP smartcards with a reader and I moved all my private keys on those devices (one card with the master key for signature/certification to be kept at home, one card for daily/mobile usage with the subkeys for encryption/signature/authentication). My laptop s harddrive doesn t contain any private key anymore. I have kept the required offline backup in a safe place, but in the end, my private keys are much harder to steal. I should write down my findings in another article
Thanks
See you next month for a new summary of my activities.
2 comments Liked this article? Click here. My blog is Flattr-enabled.
I recently bought a Cubieboard to replace my old Sheevaplug which has finally blown a power supply capacitor (this appears to be a common defect of Sheevaplugs), so I am publishing these instructions which show how to install Debian on sunxi systems (i.e. based on the Allwinner A10 SoC or one of its newer versions) with no need for cross compilers, emulators or ugly FAT partitions.
This should work on any sunxi system as long as U-Boot is at least version 2012.10.
The first step is to erase the beginning of SD card to remove anything in the unpartitioned space which may confuse U-Boot, partition and format it as desired. The first partition must begin at 1MB (1024*1024/512=2048 sectors) because the leading unpartitioned space is used by the boot loaders.
dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=1 parted /dev/mmcblk0 mklabel msdos mkpart primary ext4 2048s 15G unit s print mkpart primary linux-swap ... -1 mkfs.ext4 -L root /dev/mmcblk0p1 mkswap --label swap /dev/mmcblk0p2Download the boot loaders and an initial kernel and install them:
tar xf cubieboard_hwpack.tar.xz dd if=bootloader/sunxi-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 dd if=bootloader/u-boot.bin of=/dev/mmcblk0 bs=1024 seek=32 mount /dev/mmcblk0p1 /mnt mkdir /mnt/boot/ cp kernel/script.bin kernel/uImage /mnt/boot/
script.bin is Allwinner's proprietary equivalent of the device tree: it will be needed until sunxi support will be fully merged in mainline kernels.
U-Boot needs to be configured to load the kernel from the ext4 file system (join the lines at \\, this is not a supported syntax!):
cat << END > /mnt/boot/uEnv.txt # kernel=uImage root=/dev/mmcblk0p1 rootwait boot_mmc=ext4load mmc 0:1 0x43000000 boot/script.bin && ext4load mmc 0:1 0x48000000 boot/$ kernel \\ && watchdog 0 && bootm 0x48000000 ENDNow the system is bootable: add your own root file system or build one with debootstrap. My old Sheevaplug tutorial shows how to do this without a working ARM system or emulator (beware: the other parts are quite obsolete and should not be trusted blindly). If you have an old armel install around it will work as well, and you can easily cross-grade it to armhf as long as it is up to date to at least wheezy (the newer, the better). You can also just use busybox for a quick test:
mkdir /mnt/bin/ dpkg-deb -x .../busybox-static_1.21.0-1_armhf.deb . cp bin/busybox /mnt/bin/ ln -s busybox /mnt/bin/shAfter booting the busybox root file system you can run
busybox --install /bin/ to install links for all the supported commands.
Until Debian kernels will support sunxi (do not hold your breath: there are still many parts which are not yet in mainline) I recommend to install one of Roman's kernels:
dpkg -i linux-image-3.4.67-r0-s-rm2+_3.4.67-r0-s-rm2+-10.00.Custom_armhf.deb mkimage -A arm -O linux -T kernel -C none -a 40008000 -e 40008000 \ -n uImage -d /boot/vmlinuz-3.4.67-r0-s-rm2+ /boot/uImage-3.4.67-r0-s-rm2+It is not needed with these kernels for most setups, but an initramfs can be created with:
update-initramfs -c -k 3.4.67-r0-s-rm2+ mkimage -A arm -T ramdisk -C none -n uInitrd \ -d /boot/initrd.img-3.4.67-r0-s-rm2+ /boot/uInitrd-3.4.67-r0-s-rm2+
/boot/uEnv.txt will have to be updated to load the initramfs.
Since the Cubieboard lacks a factory-burned MAC address you should either configure one in script.bin or (much easier) add it to /etc/network/interfaces:
iface eth0 inet dhcp
hwaddress ether xx:xx:xx:xx:xx:xx
To learn more about the Allwinner SoCs boot process you can consult 1 and 2.
Blogging from a phone... first time ever. I don't want to forget some specifics for this :)
I have just completed an exam to try to enter a postgraduate program (I'll talk more about it once it becomes real ). The exam is administered by CENEVAL, the same evaluation agency Where I presented my graduation equivalency exam some years ago - Only this exam is for all of the postgraduate studies on many national universities and is thus basically just a psychometric test.
The exam had 162 questions, all to be filled in a optical reader sheet, on five subjects: mathematical reasoning, Spanish grammar and comprehension, Project management, Computers and technology, And English reading and understanding.
It was all in all a fun exam to take, mostly due to the math reasoning part. But... on the Subject I Know I am an expert, I have to complain (and intend to find a easy to do so formally). First, I spotted two absolute mistakes (and answered based on What I knew others would, but knowing the answer is wrong technically). One was a subtlety, on how and why have hard drives should be defragmented (and part of my quip is that it's an obsolete habit, but besides, the answers were all erroneous), but a second one was... just wrong. It asked on what should not be part of an "Internet link" (can only guess they meant An URL). The 4 options were valid parts of a URL - including one very seldom used by most people, but very often by many of us: the @ sign.
Anyway, answered it, but my other main gripe is that most of the section was in specific use of Office software. Not only In Office-like, which would be bad enough to begin with, but on specific ways of using Mainly Excel And PowerPoint. Syntax issues, or the name of the menu under which to look for specific functions.
Backups are fun and exciting! Restores are exciting, in a terrifying
and stressful way. Fixing serious bugs is gratifying, in a depressing
way.
I am glad to announce two software releases: Obnam version 1.6.1 and
larch version 1.20131130. Obnam is my backup application, larch is a
Python copy-on-write B-tree implementation that Obnam uses. I've
uploaded the new versions to Debian unstable and to my own apt
repository at [code.liw.fi] (also for wheezy). (I don't have the
energy to upload to Debian backports: help is welcome there.)
These are mainly bug fix releases, and minor improvements. The larch
release fixes serious problems, and everyone should be upgrading.
NEWS for larch:
obnam-benchmark can now use an installed version of larch.
Patch by Lars Kruse.list-keys, client-keys, and list-toplevels commands now
obey a new option, --key-details, to show the usernames attached
to each public key. Patch by Lars Kruse.--ssh-command to set the command Obnam runs
when invoking ssh. patch by Lars Kruse.obnam clients can now be used without being an existing client.
Patch by Itamar Turner-Trauring.--ssh-host-keys-check to better specify how SSH
host keys should be checked. Patch by Itamar Turner-Trauring."obnam list-toplevels so it doesn't give an error when it's
unable to read the per-client directory of another client, when
encryption is used. Fix by Lars Kruse.obnam list-toplevels got confused when the repository contained
extra files, such as "lock" (left there by a previous, crashed Obnam
run). It no longer does. Fix by Lars Kruse./~/ path prefix in SFTP URLs works again, at least with
sufficiently new versions of Paramiko (1.7.7.1 in Debian wheezy is
OK). Reported by Lars Kruse.obnam ls now handles trailing slashes in filename arguments.
Reported by Biltong.
Right on the heels of release 0.2.1
of RcppCNPy, a new version 0.2.2 is now on CRAN.
RcppCNPy uses the CNPY library by Carl Rogers to
provide R with easy read and write access to NumPy files.
The reason for the new version that I had experimented with a different way to test endianness (as needed for the
NumPy file headers) but accidentally sent an interim tarball to CRAN which
still wanted to include endian.h promptly breaking Windows
builds. So now we do something even simpler and just rely on the (even more
complete) test for endianness when R is built, which prevents all sorts of
complications for us and builds everywhere (with thanks to Brian Ripley for the suggestion).
While we were at it, we also added a new unit test.
Full changes are listed below.
Changes in version 0.2.2 (2013-11-29)CRANberries also provides a diffstat report for 0.2.2 relative to 0.2.1. As always, feedback is welcome and the rcpp-devel mailing list off the R-Forge page for Rcpp is the best place to start a discussion.
- Switched to using the result from the compile-time configuration for R to determine big or little endian (as needed for the
NPyheaders)- Added a new test (and test validation result file) for a complete save-reload cycle and comparison
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Following up on my port of the crystalhd plugin to the
gstreamer 1.0 api I realized that the CrystalHD repo is pretty
dormant. After reading slomo's nice article about GStreamer and
hardware integration and a short off list mail exchange I decided to
split the GStreamer part out of the CrystalHD repo and to try to
get the plugin into gst-plugins-bad.
Since the kernel part is already in linux kernel's staging area
there would not be much left in the repo except for the libcrystalhd
library itself and the firmware blobs. So I split them out as
well and started to clean them up a bit by moving it to
autoconf/automake, dropping the need for a C++ compiler and adding
symbol versioning among other things.
So up to know video is still smooth with:
gst-launch-1.0 filesrc location=sample.mp4 ! decodebin ! xvimagesink
after jhbuilding up to gst-plugins-bad.
There are #ifdefs for macosx and windows but I doubt they're
functional but in case anybody is building libcrystalhd on these these
platforms it'd be great to know if it still works.
Should these efforts lead to the crystalhd plugin being merged into GStreamer
getting the kernel driver out of staging would be a great next step.
This blog is flattr enabled.
Today was my last day working at Bytemark, and I found it a lot harder than expected.
For better or worse I finished earlier than expected; having been gradually removing my accounts and privileges over the past few weeks I'd revoked my OpenVPN key this morning.
Mid-afternoon my openvpn connection tried to renegotiate session keys, or similar, and failed. So I stopped work a few hours early. That meant I managed to avoid sending my "goodbye world" email, which is probably for the best - after all a lovely company, lovely people, and a good environment, what can you say besides things that are lovely?
I think I largely wrapped things up neatly, and I'm pleased that one of my photos is hanging on the office wall. (I look forward to seeing that actually, I've only rarely made canvas prints.)
The only other thing of note this week has been the sharp rise in blogspam I've detected. Black Friday alive and well, on the internets ..
Axel just said that PDiffs are really useful for stable because it changes seldom. The truth is that there are no PDiffs for stable. I consider this a bug because you need to download a huge blob on every point release even though only few stanzas changed.
Appointed to the Debian Tech Committee
I m pleased to announce that I ve been appointed to serve on the
Debain Technical Committee.
I d like to thank the other committee members and the Debian project
leader, Lucas Nussbaum, for giving me this opportunity to serve. I
look forward to working within the committee to further Debian s goals
as the universal operating system.
This is one thing I have wanted to do for a long time: configure Mutt
to encrypt all messages sent to addresses for which I have a valid
public key. Well, here is an awk-based script to generate that
configuration.
(Yes, I know, a similar script was already written. But I did
not see it at first, and I find mine more readable. :-) )Code
#! /bin/sh
set -e
# Specific hooks set global configuration values for Mutt, which are not
# reset for new messages, so a default hook is needed to set the default
# value (do not try encrypting all messages).
printf "send-hook . unset crypt_autoencrypt\n\n"
cat <<EOF
# This group contains all known PGP users, and can be used to define
# hooks, for instance to encrypt all messages sent to PGP users, or to
# add a specific signature to promote PGP usage to non-PGP users.
EOF
# Generate a machine-readable list of known keys
gpg2 --batch --with-colons --list-keys \
awk -- '
BEGIN
FS = ":"
# A flag that indicates whether or not we are in a public
# key with usable encryption capability
usable = 0
# Detect beginning of public keys with usable encryption
# capability
$1 == "pub" && $12 ~ /E/ usable = 1
# Detect beginning of public keys without usable encryption
# capability
$1 == "pub" && $12 !~ /E/ usable = 0
# Only consider user IDs from public keys with usable encryption
# capability and with regular, marginal, full or ultimate
# validity (n, m, f or u in the second field)
usable && $1 == "uid" && $2 ~ /[nmfu]/ && $10 ~ /@/
# Remove everything before and after the email address in
# brackets
sub(/^[^<]*</, "", $10)
sub(/>[^>]*$/, "", $10)
# Finally print the email address
print $10
' \
sort -u \
# Group addresses by ten to reduce the number of Mutt commands
finished=0
while [ $finished -ne 1 ]
do
addresses=""
for i in 0 1 2 3 4 5 6 7 8 9
do
if read address
then
addresses="$addresses $address"
else
finished=1
break
fi
done
# Add PGP users' addresses to a pgp-users group
printf "group -group pgp-users -addr %s\n" \
"$addresses"
done
# Build a hook to try encrypting messages sent to PGP users
printf "\n# Encrypt all messages sent to known PGP users\n"
printf "send-hook \"%%C pgp-users\" set crypt_autoencrypt\n" \
printf "\n# Add a specific signature to promote PGP usage to non-PGP users\n"
printf "#send-hook \"!%%C pgp-users\" set signature=~/.signature.use-pgp\n"
Usage
Script usage
This script generates uses GnuPG to print a list of all known keys,
takes only valid ones, and uses them to build a series of configuration
instructions for Mutt, that define hooks
that are triggered when you write a message to them. This configuration
has to be written to your Mutt configuration file:
$ bin/gen-pgp-hooks.sh >> ~/.muttrcOr better (far better, in fact), to a dedicated configuration file you will refer to in your main one:
$ bin/gen-pgp-hooks.sh > ~/.muttrc.crypt-recipients $ echo "source ~/.muttrc.crypt-recipients" >> ~/.muttrcYou may want to adapt this script to it directly writes to that file rather than having to redirect it. Also, remember to run it when you refresh your public keyring or add new keys to it. Mutt usage These hooks will make Mutt try to encrypt all messages you send to at least one known PGP user. That means it will try it even for messages you send to a PGP user and to non-PGP ones. In these cases, it will not find keys for all the recipient, and ask you which key to use; as you have none, you will have to quit that prompt by typing ^G, and manually disable encryption by accessing the PGP options menu with the key p.
I'm running a local unbound instance on my laptop to get working
DNSSEC. It turns out that with the captive portal NSB (the Norwegian
national rail company), this doesn't work too well and you get into an
endless series of redirects. Changing resolv.conf so you use the
DHCP-provided resolver stops the redirect loop and you can then log
in. Afterwards, you're free to switch back to using your own local
resolver.
Back on Black (Friday) Event
Altus Metrum is pleased to announce our Back on Black (Friday) event!
For the first time since the Black Forest fire in June, we re re-opening
our web store this weekend with a host of new and classic Altus Metrum
products, including a special pre-order discount on our latest-and-greatest
flight computer design, TeleMega.
This weekend only, Friday, 29 November 2013 through Monday, 2 December,
2013, the first 40 TeleMega direct orders placed through our web store will
receive a special $50 pre-order discount (regular $400, now only $350!).
probably just not as default.
I do agree with
Richi and with Michael that disabling PDiffs by default gives the big
majority of Debian Testing or Unstable users a speedier package list
update.
I m though not sure, if disabling PDiffs by default would
Version 0.2.1 of RcppCNPy is now on CRAN earlier. This version is a
minor upgrade with a few small changes as detailed in the NEWS file:
Changes in version 0.2.1 (2013-11-28)CRANberries also provides a diffstat report for 0.2.1 relative to 0.2.0. As always, feedback is welcome and the rcpp-devel mailing list off the R-Forge page for Rcpp is the best place to start a discussion.
- Synchronized code with the
cnpyrepository- Added new function to test from R whether integers supported
- Updated tests for integer support, if available
- Updated vignette and discussion about need for rebuilding only RcppCNPy with the
-std=c++11flag if integer support is desired- Updated tests for integer support, if available
- Updated THANKS file
- Ensure that inclusion of
Rinternal.hdoes not affect other headers by addingRF_NO_REMAP
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Next.