pkgAge <- read.table(file="http://people.debian.org/~lucas/arch-age/arch-age.log", col.names=c("pkg","yyyymmdd"))
read the data into a data.frame which we have given two column names.
pkgAge[,"date"] <- as.Date(as.character(pkgAge[,"yyyymmdd"]), "%Y%m%d") pkgAge[,"age"] <- as.numeric(difftime(Sys.Date(), pkgAge[,"date"], units="day")) pkgAge[,"prop"] <- (1:nrow(pkgAge)) / nrow(pkgAge) * 100We then create three new columns. First is a date, by parsing the (integer) dates (after first casting them into characters) by supplying the format in standard C notation:
"%Y%m%d" for year, date and month without
any separators or formatters. Now, having the date as an actual date
object inside a real data analysis language we can do
things as e.g. computing date differences. The difftime function
does just that, using the current date as other point. We ask for the return
to be in days, and cast this down to a purely numeric vector (instead of
datediff object). Lastly, we quickly compute the date proportion in
percentages.
We can then view the date. Before we plot,
png("packageAges.png", quality=100, width=640, height=480, pointsize=10)
oldpar <- par(mfrow=c(2,2), mar=c(2.5,2.5,3,1))
we direct the charts to a png file of given dimensions, and ask for all
plots in one figure (using mfrow with two rows by two) with
somewhat smaller figure margins using the mar argument to par.
The first chart shows again proportion over date:
with(pkgAge, plot(date, prop, type='l', main="Standard Plot"))(The with() function simply allows us to refer to the columns by their names without explicit subsetting.
plot(pkgAge[,"date",],
pkgAge[,"prop"]) is equivalent, but more cumbersome.)
As it clear that the data has a fairly long tail in the older dates, we can
also try to plot the plot over logarithmic time differences. This doesn't
work for dates, but it works for our (positive-valued) age variable:
with(pkgAge, plot(age, prop, type='l', log="x", main="More linear as log(age in days)"))The very far left tail below 0.5 percent is interesting as the one very old package is clearly an outlier within an outlier region. We use the subset function to take just one portion of the data, use logs, and explicit plotting symbols '+' in a points-and-lines plot:
with(subset(pkgAge, prop0.5), plot(date, prop, type='b', log="y", pch="+", main="Detail in left tail, up to 0.5%"))Lastly, the upper quartile is fairly linear.
with(subset(pkgAge, prop>75), plot(date, prop, type='l', pch=".", main="Yet fairly linear in top 25%"))At the end
oldpar <- par(mfrow=c(2,3)) dev.off()we restore the graphics paramters and close the device (here the file). All this then yields the following chart:
Updated to correctly display the assignment operator <-
The FSF may have got the orthodoxy wrong, and the OSI may have got the interpretation wrong, but we both agree that prohibition of commercial use without special permission is antithetical to both positions.There is a unmistakable kernel of agreement and it is great to see the OSI taking such a strong stance in this regard. Now, David Richard’s response, who seeks, I think, to essentially dilute the term open source, is as (or perhaps even more) fascinating for in a nut shell, and using a lot of florid religious imagery, it accuses the OSI of being too rigid! In his own words:
I believe the OSI has a wonderful opportunity to continue being relevant and helping to lead the movement forward. If, however, y’all choose to define your denomination of this religion in a way that we don’t fit in, that’s fine. No hard feelings. It’s your choice. You’ll ultimately be excluding a large congregation and we for one will continue trying to build a church made up of others like ourselves.In response, I would say that the goal of F/OSS is not to be inclusive of anyone who wants to release bits of source code, but to create the conditions under which software, as it has been defined by the community, can be created. Join the church if you would like to make free/open source software as defined and you can go elsewhere (i.e., create a different term) if you are creating something different, even if it is only slightly different. Integrity matters. And again inclusiveness, if it comes at the expense of the main goal, is not a boon but a danger to F/OSS. The OSI will remain relevant by halting the dilution of the term OSI, not by expanding the definition so that it is left with no substance. And in contradistinction to what David Richard maintains, however, there is a great degree of flexibility within this domain but it does not lie in the strict definition of F/OSS but in the realm of interpretation. You are also free, as Mako and I have argued elsewhere to interpret the significance of F/OSS in multiple ways. And I think this is where the political strength of free software lies. There is interplay between a well-defined goal (in this case for creating free software) and a more flexible realm of interpreting the significance of these technical practice. And we wold lose and I might add, a lot if we became flexible about the strict definition of F/OSS and inflexible about its political significance. I get irked with folks like David Richards who would like to bend open source rules to meet their (often commercial) interests and I find it pretty na ve when folks say the political significance of F/OSS is just x (or worse should be x) for in reality its political significance lies in the fact that it has spawned multiple types of political and economic projects. And there is something almost playfully ironic, (or at least it makes me smile) in this fact. Though there is strict definition contained withing F/OSS, this strictness has, at least to some extent, encouraged by an extreme and very healthy form of political proliferation and promiscuity. More than anyone else I know, Mako has most passionately and thoughtfully argued for the importance of what I would call political clarity and integrity. That is, the importance of having a well articulated definition for social movements, for they act, as he says a rallying point to realize a social movement. Urging the Creative Commons to learn from F/OSS and dare to simultaneously narrow and more clearly define their goals, he states it quite nicely in the following terms:
Free software advocates have been able to use the free software definition as the rallying point for a powerful social movement. Free software, like the concept of freedom in any freedom movement, is something that one can demand, something that one can protest for, and something that one can work toward. Working toward these goals, free and open source software movements have created the GNU/Linux operating system and billions of lines of freely available computer code.In essence, a definition that people can abide by, respect, and perhaps eventually cherish is the condition of possibility to make working political code. And given how hard it is to make social change happen (at least in comparison to build computer code), we should learn from what F/OSS has to offer. And at the same time there is another lesson embedded in F/OSS. The Free Software Definition is well defined; but it must be emphasized, narrowly so. It does not try to do everything and have everyone pledge allegiance to an inordinately complex set of commitments. Clarity, narrowness, and well-defined goals –> these three attributes have powered it far and wide and I hope it remains so. Now, since the term open source is not trademarked, we are left with the problem of how to challenge the current hijacking of the term. For the solution, I will leave you with Karl Fogel, who I think proposes a good solution:
Note that the OSI s objection is not to the Zimbra license per se. The objection is just to Zimbra s calling that license open source . They can use any license they want, but they shouldn t call it open source unless it actually is. Freedom is freedom, and no amount of spin will change that. So what should we do about this? The term open source isn t trademarked. Years ago, the OSI tried to register it, but it was apparently too generic. …But there is public opinion. What Danese and Michael are proposing doing is organizing a lot of open source developers (and I mean open source according to the traditional definition, the one the OSI and I and most other open source developers I know adhere to) to stand up and, basically, say All of us agree on what the definition of open source is, and we reject as non-open source any license that does not comply with the letter and spirit of the Open Source Definition.
set -e
dev=$1
luks=$(mktemp)
cryptdev=$(basename $dev)_crypt
pvsize=$(pvs -o pe_start,pv_size --units s --noheadings --nosuffix "$dev" awk ' print $1 + $2 ')
devsize=$(blockdev --getsz "$dev")
mchunk=8
The script takes the physical volume device to convert as an argument. Note there is no check for the validity of its value.
dd of="$luks" seek=$devsize count=0 bs=512 2> /dev/null
luksdev=$(losetup -f)
losetup "$luksdev" "$luks"
trap "losetup -d \"$luksdev\"; rm -f \"$luks\"" EXIT
Next, we create a sparse luks file the same size as the device (in case luksFormat would use the size somehow, but I believe it doesn’t), and a loopback device on this file. The trap is here to avoid leaving the loopback device and the file when an error occurs later (though during the conversion itself, it will be pointless).
cryptsetup luksFormat -q "$luksdev"
cryptsetup luksOpen "$luksdev" $ cryptdev _real
read start length crypt format key IVoff cdev offset <<EOF
$(dmsetup table $ cryptdev _real)
EOF
We create a LUKS device, so that we can get the encryption key ($key), and the size of the LUKS header ($offset). Note you need to add –showkey to the dmsetup table command on sid.
if [ $(expr $devsize - $pvsize) -lt $offset ]; then
echo Not enough free space after LVM physical volume
cryptsetup luksClose $ cryptdev _real
exit
fi
Check we have enough space after the LVM physical volume to offset everything by the size of the LUKS header. If not, you can still try again after you reduce the size of the LVM physical volume by an extent.
if [ $(expr $devsize % $offset % $mchunk) -gt 0 ]; then
echo Last
cryptsetup luksClose $ cryptdev _real
exit
fi
This is another check to avoid surprises at the end, when dealing with the last chunk. As the script is written for the moment, it doesn’t support cases where this last chunk is not a multiple of $mchunk. So we need to abort in these.
read major minor <<EOF
$(stat -t "$dev" awk ' print $10,$11 ')
EOF
maps=$(dmsetup deps awk -F: "/\($major, $minor\)/ print \$1 ")
dmsetup create $cryptdev <<EOF
0 $length linear $dev 0
EOF
dmsetup reload $ cryptdev _real <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume $ cryptdev _real
for map in $ maps ; do
dmsetup table "$map" sed s,$major:$minor,/dev/mapper/$cryptdev, dmsetup reload "$map"
dmsetup resume "$map"
done
Here, we create the dev_crypt device mapper that is our fake LUKS device, which starts as a simple linear mapper and will end as a complete crypt mapper. This fake LUKS device is inserted as an intermediate mapper between the LVM device mapper and the real device. So, the LVM device mapper will have this fake LUKS device as backend, and, at the beginning, the fake LUKS device maps linearly to the real device.
Note we look for all device mappers using the real device as backend before creating the fake LUKS device to avoid finding the fake LUKS device in the list.
Also note dmsetup reload only loads a new table in the INACTIVE slot, and dmsetup resume makes this inactive table LIVE.
cursor=$length
chunk=$offset
while [ $cursor -gt 0 ]; do
cursor=$(expr $cursor - $chunk)
if [ $cursor -lt 0 ]; then
chunk=$(expr $chunk + $cursor)
cursor=0
fi
(
[ $cursor -ne 0 ] && echo 0 $cursor linear $dev 0
echo $cursor $chunk mirror core 1 $mchunk 2 $dev $cursor /dev/mapper/$ cryptdev _real $cursor
[ $cursor -lt $(expr $length - $chunk) ] && echo $(expr $cursor + $chunk) $(expr $length - $cursor - $chunk) crypt $format $key $(expr $IVoff + $cursor + $chunk) $dev $(expr $offset + $cursor + $chunk)
) dmsetup reload "$cryptdev"
dmsetup resume "$cryptdev"
chunks=$(expr $chunk / $mchunk)
while ! dmsetup status "$cryptdev" grep "$chunks/$chunks"; do
true
done
done
This is where the main work is done : moving the data around. We actually just let the device mapper deal with the data duplication, $offset blocks by $offset blocks ($offset being the LUKS header size), using a mirror target for the chunk being moved. So our disk looks like the following:
dmsetup status, dmsetup wait doesn’t seem to be very helpful here.
dmsetup reload "$cryptdev" <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume "$cryptdev"
dmsetup remove "$ cryptdev _real"
dd if="$luks" of=$dev count=$offset bs=512 2> /dev/null
Final steps of the conversion : our dev_crypt device becomes a full LUKS volume, so we can remove dev_crypt_real and add the LUKS headers at the top of the device we converted.
At this moment, the LUKS volume is setup just as if it had been setup by cryptsetup. For LVM to recognize the change properly, you need to run pvscan. Once you ran it, you can do whatever you want with LVM.
Now, you may want to add the following to your /etc/crypttab file:
$cryptdev $dev none luks
i.e. hda5_crypt /dev/hda5 none luks if the device was /dev/hda5.
And if the LVM volume you converted contains your root filesystem, you should run (for Debian systems):
update-initramfs -u
I tested this successfully under qemu and will give it a shot on my laptop some time soon.
Now, because I had a hard time not finding much about the mirror target of the device mapper, here is what I could gather about it. The target syntax is as follows:
<logical_start_sector> <num_sectors> mirror [ core disk ] <num_params> <param> ... <num_mirrors> [ <destination > <start_sector> ] ...
logical_start_sector, num_sectors, destination and start_sector have the same meaning as in other targets.core and disk are two different log types (to track differences between mirrors), respectively in memory and on disk.num_params and params depend on the log type:
core, num_params can be either 1 or 2.region_size, which is the size (in blocks) of the chunks the mirror log tracks for synchronization. It can’t be less than the page size divided by 512, i.e. 8 on x86, must be a power of 2, and must not exceed num_sectors. Apparently, it is not a problem if num_sectors is not a multiple of region_size.sync or nosync, meaning of which I’m not sure. I think it determines whether the mirror should do the initial synchronization (sync) or not (nosync).disk, num_params can be either 2 or 3, with params being log_device (device where the logs are kept), region_size, as above, and an optional sync or nosync, as above too.num_mirrors is the number of mirrors and for each mirror, we have a pair destination and start_sector.
[ Update: after a quick look at the device mapper source code in Linus’s git tree, updated the mirror target description ]

Agua para todos...
During the walk, we witnessed what the people from the Delta have been
warning about for decades: the Delta is disappearing. The progressive overuse
of the river's flow, excessive irrigation, damm construction and degradation
is killing this unique place. The waters are slowly claiming what once was
theirs. An electricity line, at the beginning of our trip being at the end
of the beach starts approaching the sea, or viceversa, as you move southward,
to end up many metres inside the water. The old people in the Delta still
remember the 200m tall lighthouse in the Illa de Buda, which the sea
managed to devour.

Sunset at the salines del Delta
When we reached the Punta we could watch a beautiful sunset
over the mountains of Els Ports, and when it got dark and cold we
headed to Tortosa, the area's capital, which I had recently visited for the
first time for one of Softcatal 's
meetings. There, we had dinner at a bar and met Jordi and Anna for a while,
before going back to Ampolla, going to bed relatively early due to everyone
being very tired.

On Saturday, we decided to have a look at the Delta... from above. So we
drove to the top of the Cim del Caro, where we could admire a great
view over the flat farmlands of the Delta, and then found a nice trail which
took us to a nice forest, where we had lunch. After a visit to Alfara de
Carles, we went back to the house, had a great dinner and played fun games at
the table.
Unfortunately, Sunday morning was dedicated to cleaning up the mess in the
appartment and packing, as part of the group, the Jordis from Alcoi and the
twins, had to leave early. The remaining four Valencians decided to go to
Deltebre to have a local paella. It was quite good, although the bar
tender laughed at our request to eat directly from the paella, rejecting
dishes. Small cultural clash. ;)
I remember downloading and viewing the pictures of the trip a few days
after getting back in Val ncia, and then losing track of them. Last week,
while testing an EPIA board with some random hard drive, I suddenly realised
there was a big chance the pictures would be on that drive, and after some
search, I found them; I had been close to mkfs the disk a few minutes
before. I hadn't stopped blaming myself for misplacing these pictures, as they
remind me of this wonderful weekend. Luckily, they are back!
Going back to the state of the Delta, experts say it will be mostly gone
in 200 years. All of the Terres de l'Ebre have fought against the previous
government's "PHN" plan to divert part of the river's flow to the North and
South, to supply Barcelona, and specially the South of Val ncia, where the
developing of the coastal areas is out of control. I fear that whenever PP
regains power in Madrid, they will retake this idea. There is a lot of money
involved in building a 700 km long scar in our land. The Delta de
l'Ebre is a fantastic place which doesn't deserve a terrible fate like
this, only for the benefit of the usual suspects. As the good people of this
land would say...
Lo riu s vida. No al transvasament!

Agua para todos...
During the walk, we witnessed what the people from the Delta have been
warning about for decades: the Delta is disappearing. The progressive overuse
of the river's flow, excessive irrigation, damm construction and degradation
is killing this unique place. The waters are slowly claiming what once was
theirs. An electricity line, at the beginning of our trip being at the end
of the beach starts approaching the sea, or viceversa, as you move southward,
to end up many metres inside the water. The old people in the Delta still
remember the 200m tall lighthouse in the Illa de Buda, which the sea
managed to devour.

Sunset at the salines del Delta
When we reached the Punta we could watch a beautiful sunset
over the mountains of Els Ports, and when it got dark and cold we
headed to Tortosa, the area's capital, which I had recently visited for the
first time for one of Softcatal 's
meetings. There, we had dinner at a bar and met Jordi and Anna for a while,
before going back to Ampolla, going to bed relatively early due to everyone
being very tired.
On Saturday, we decided to have a look at the Delta... from above. So we
drove to the top of the Cim del Caro, where we could admire a great
view over the flat farmlands of the Delta, and then found a nice trail which
took us to a nice forest, where we had lunch. After a visit to Alfara de
Carles, we went back to the house, had a great dinner and played fun games at
the table.
Unfortunately, Sunday morning was dedicated to cleaning up the mess in the
appartment and packing, as part of the group, the Jordis from Alcoi and the
twins, had to leave early. The remaining four Valencians decided to go to
Deltebre to have a local paella. It was quite good, although the bar
tender laughed at our request to eat directly from the paella, rejecting
dishes. Small cultural clash. ;)
I remember downloading and viewing the pictures of the trip a few days
after getting back in Val ncia, and then losing track of them. Last week,
while testing an EPIA board with some random hard drive, I suddenly realised
there was a big chance the pictures would be on that drive, and after some
search, I found them; I had been close to mkfs the disk a few minutes
before. I hadn't stopped blaming myself for misplacing these pictures, as they
remind me of this wonderful weekend. Luckily, they are back!
Going back to the state of the Delta, experts say it will be mostly gone
in 200 years. All of the Terres de l'Ebre have fought against the previous
government's "PHN" plan to divert part of the river's flow to the North and
South, to supply Barcelona, and specially the South of Val ncia, where the
developing of the coastal areas is out of control. I fear that whenever PP
regains power in Madrid, they will retake this idea. There is a lot of money
involved in building a 700 km long scar in our land. The Delta de
l'Ebre is a fantastic place which doesn't deserve a terrible fate like
this, only for the benefit of the usual suspects. As the good people of this
land would say...
Lo riu s vida. No al transvasament!
When people like Dawkins attack wimpy agnostics or moderate believers, they forget that many atheists aren’t uber-rationalists. They carry around tarot cards, not The Selfish Gene.Jonah also makes a good point that science and religion may not have irreconcilable differences:
It’s important to note that science isn’t necessarily in conflict with our need to believe in some sort of mystery. Modern science, after all, has discovered some of the craziest ideas around, from the principles of quantum physics to the fact that our head holds a trillion cells trafficking in minor jolts of electricity. These ideas are both materialist and mysterious, since they hint at a universe that exceeds the current capacities of our imagination. What Hamlet said to Horatio is still true.This sort of analysis seems to me far more nuanced and interesting than that advanced by what I’ll call the “vulgar atheists” — Dawkins, Hitchens, Dennett, et al.
Possibly the finest science fiction novel I have ever read.It is hard for me to disagree with that statement (including the qualifier, in all honesty), having recently read this book. Mote is a complex first-contact story, set in Pournelle’s alternate history (originally future history) universe. It begins in the year 3017. The recently created Second Empire of Man gets a visit from the aliens, leading to a counter-visit by humans to the aliens’ star system. The aliens seem friendly, but are they? What could they possibly be hiding? In retrospect, the Moties remind me (in style, not in detail) of Orson Scott Card’s Piggies (Speaker for the Dead and sequels); I would be surprised if Card had not read this book before writing his. The sequel, The Gripping Hand is not the masterpiece that Mote is, but I had no trouble enjoying it. The solution to the Motie problem has held for decades, but it won’t hold forever, and it might actually be breaking down now. The mission: save both humans and Moties from an eventual assured mutual destruction. * * * I actually started reading Pournelle’s alternate/future history from the cronological beginning. This is another series where reading order becomes a complicated matter, as many of the books tell parallel subthreads of the story; and it becomes even more complicated by the fact that there is an omnibus edition in which the story is told in chronological order, this having been accomplished by breaking the books down into chunks and then arranging the chunks in chronological order. My reading order went as follows: West of Honor, The Mercenary, Prince of Mercenaries, Go Tell the Spartans and Prince of Sparta. This is a good reading order; my only problem with it is that the protagonist of West of Honor fails to appear in most of the other books. The following is not in my opinion a real spoiler, even though it reveals certain key events of the series. The premise is that sometime between the 1970’s and the early decades of the 21st Century the United States and the Soviet Union form a union, called the CoDominium, which dominates the international politics of the Earth for most of the 21st Century. In early 21st Century, faster-than-light travel is discovered, and the CoDominium starts to colonise other star systems, first with voluntary colonists and then with convicts and involuntary colonists. The series takes place in the final decades of CoDominium, and focuses on the actions of one John Christian Falkenberg (though he is not the protagonist of all the books), first as an officer in the CoDominium (extraterrestrial) military, and then as the Colonel of a mercenary outfit, Falkenberg’s Legion. The Legion is at the center of events that eventually (after the events described in these books) leads to the creation of the first Empire of Man. The books are entertaining military science fiction, solid, enjoyable journeyman pieces.
usb 1-1: new full speed USB device using uhci_hcd and address 8 usb 1-1: configuration #1 chosen from 1 choice drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected drivers/usb/serial/ftdi_sio.c: Detected FT232BM usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0 usbcore: registered new driver ftdi_sio drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters DriverI then fooled around with minicom, and discovered that the little transistor thing I'd been ignoring was indeed the temperature sensor, as I got a reading of zero back (when using this program I found on the 'net). So I went to bed, and this morning did a bit of messing around with the sensor, and with a bit of creative bending, I've got it sitting in the S1 holes without requiring any soldering. It tells me the linen cupboard is about 44 degrees Celsius. Warm, but I don't think it's in any immediate danger of bursting into flames. Wouldn't surprise me if some of the gear in there isn't too keen about the temperature though. At least we won't have to worry about mold. Next step is to convince cacti to graph it, and nagios to monitor it, and we're in business. Here's a little Python program I knocked up to grab the temperature. pyserial is nice. Read on, Macduff!
Next.