egrep -o "svm vmx" /proc/cpuinfo
If that command outputs either svm or vmx (depending on whether you have Intel
or AMD hardware) then your CPU supports virtualization.
I'm working on a host machine called chicken, which has a logical volume called
vg_chicken0. All vservers on chicken operate on a root filesystem that is
backed by their own logical volume.
In this post, I'll describe the steps to convert the vserver hobo (which
operates on a filesystem mounted on the host in /var/lib/vservers/hobo and
is backed by the logical volume called vg_chicken0-hobo_root).
Both chicken and hobo are running debian squeeze.
vservers don't have a kernel installed or grub. KVM virtual servers need both.
I was hoping I could simply enter the vserver, install both a kernal and grub
and be ready to go. However, grub installation will fail miserably because grub
can't figure out how to install on the underlying disk (which is hidden from the
vserver).
Next, I tried launching a kvm instance, passing a
debirf generated ISO with the -c
(cdrom) option. However, grub recognized that it was being installed onto a
device that did not have a partition table (the logical volume was directly
formatted with a file system).
So, since I had disk space to spare, I created a new logical volume:
lvcreate --size 5GB --name hobo_root_new vg_chicken0
I then added a gpt
partition table (why not prepare for the coming 2TB disks?) and created two
partitions. One partition for grub2 and one for everything else:
parted /dev/mapper/vg_chicken0-hobo_root_new mklabel gpt
parted /dev/mapper/vg_chicken0-hobo_root_new unit s mkpart biosboot 2048 4095
parted /dev/mapper/vg_chicken0-hobo_root_new set 1 bios_grub on
parted /dev/mapper/vg_chicken0-hobo_root_new unit s mkpart primary 4096
When prompted for the end of the last partition, choose: -1 and accept the adjustment.
I had to eyeball cat /proc/partitions to figure out which dm device was the
second partition (dm-19).
I then created a file system:
mkfs -t ext3 /dev/dm-19
Mounted it:
mount /dev/dm-19 /mnt
And rsync'ed the data:
rsync -a /var/lib/vservers/hobo/ /mnt/
With the data in place, I chroot'ed and installed the packages I needed. When prompted, I chose not to install grub to the disk, because I wanted to wait until I had an environment in which the proper disk would be available to grub as it will when the virtual server boots (see below):
chroot /mnt
mount /proc
aptitude install linux-image-2.6-amd64 grub2
umount /proc
exit
Then, I cleaned up:
umount /mnt
umount /var/lib/vservers/hobo
lvremove vg_chicken0/hobo_root
lvrename vg_chicken0/hobo_root_new hobo_root
dmsetup remove /dev/mapper/vg_chicken0-hobo_root_newp1
dmsetup remove /dev/mapper/vg_chicken0-hobo_root_newp2
kpartx -d /dev/mapper/vg_chicken0-hobo_root
And I removed it from /etc/fstab.
Next, I created a new kvm virtual server, using the disk /dev/mapper/vg_chicken0-hobo_root and passing a debirf cd image with -c:
virt-install --name hobo --ram 512 --disk /dev/mapper/vgchicken0-hoboroot -c /usr/local/share/debian/ISOs/debirf-rescuesqueeze2.6.32-5-vserver-amd64.iso
After logging in, I installed grub2 (aptitude update; aptitude install grub2) and then I installed grub:
mount /dev/sda2 /mnt/
grub-install --no-floppy --root-directory=/mnt /dev/sda
After running grub-install, edit /mnt/boot/grub/device.map so it reads:
(hd0) /dev/sda
Then, rerun grub-install command.
I tried generating the grub.cfg file, but got an error message indicating that
grub-probe would not detect the device providing / (because I was running on a
ram file system from debirf).
I added the following to /mnt/etc/fstab:
/dev/sda2 / ext3 errors=remount-ro 0 1
proc /proc proc defaults 0 0
And then re-generate the initrd image:
chroot /mnt
mount /proc
update-initramfs -u
So, I rebooted the virtual machine by typing:
exit
reboot
This dropped me into a grub shell. I manually typed:
root (hd0,gpt2)
linux /vmlinuz root=/dev/sda2 ro
initrd /initrd.img
boot
Once booted, I logged in a completed the task with:
update-grub
I ve been sitting on this one since more than a month. I ve contacted upstream on the 19.08.2010 and the Debian maintainer on the 02.09.2010. No reaction from them till today, and no, my spamfilter does not eat mail ;)
Still, I won t tell you the name of the software (but you could easily guess or check )
So let s put the grey hat on and begin ;)
Foreword: when I write spam-filter, I mean some DNSBL/SPF/blah filter, not SpamAssassin, crm114 or other content-based filters.
common spam-filters
There are plenty of spam-filters out there which work after the following schema:
for check in checks:
if check(mail) == BAD:
reject(mail)
break
And the checks often look like this:
def check(mail):
errors = False
result = some_magic(mail)
if not errors: return result
else: return GOOD
Here some_magic is a function that do the actual checks (DNSBL lookups etc) and which stores possible happened errors in errors. If an error occurred, it s safer to say the mail was good (or at least not bad) than bad.
the problem
This looks like a sane approach on the first sight: iterate over all checks and execute them until a mail is found to be spam (and the corresponding check did not end up in an error (imagine some weird DNS error for DNSBL or SPF checks here)). But then the author realizes that the errors might be global , like with DNS: when the first check notices that it can t resolve anything (ie. it ran into a DNS timeout three times in a row), the second check (which also utilizes DNS queries) will most probably result in an error too. After this he adds a global counter for DNS errors and skips all the checks that use DNS if this counter is >=3. Great idea , you say, saving resources is good . Bad idea , I say
The reason is simple: DNSError != DNSError. Why? The local resolver might be broken, then every DNS query will end up with an error and DNS-based checks should be really disabled. The first three (out of eg. ten) DNSBLs might be down, but that s not a reason to skip the other seven and the SPF check. Etc
Now let s assume all configured DNSBLs are working properly, so is the local resolver and the checks are:
checks = [check_HELO, check_SPF, check_DNSBL]How could one attack this filter? the attack Set up the following zone
spam.example.com IN NS ns1.example.com spam.example.com IN NS ns2.example.com spam.example.com IN NS ns3.example.com spam2.example.com IN MX mx1.spam.example.com spam2.example.com IN MX mx2.spam.example.com spam2.example.com IN MX mx3.spam.example.com spam2.example.com IN MX mx4.spam.example.com ns1.example.com IN A 10.1.1.1 ns2.example.com IN A 10.2.2.2 ns3.example.com IN A 10.3.3.3and greet the to-be-spammed-MTA with
EHLO client1.spam.example.comspam2.example.com), sender-domains etc.
conclusion
If you want to save resources by skipping DNS-based checks after another (DNS-based) check failed don t! Think whether this is really the same error you are seeing
Additionally this can be used as a sort of DoS against the not said software: according to the logs each of my tries needed between 30 and 36 seconds (!) to complete imagine some hundred simultaneous requests
the end
You think I did something wrong with that post? Throw the first stone then, I don t care.
class MyTest(TestCase):
def setUp(self):
foo = Foo()
bar = Bar()
self.quux = Quux(Foo(), Bar())
self.addCleanup(self.quux.done)
You can make it reusable across your code base simply by moving it into a fixture like this:
class QuuxFixture(fixtures.Fixture):
def setUp(self):
foo = Foo()
bar = Bar()
self.quux = Quux(Foo(), Bar())
self.addCleanup(self.quux.done)
class MyTest(TestCase, fixtures.TestWithFixtures):
def setUp(self):
self.useFixture(QuuxFixture)
I do hope that the major frameworks (nose, py.test, unittest2, twisted) will include the useFixture glue themselves shortly; I will offer it as a patch to the code after giving it some time to settle. Further possibilities include declared fixtures for tests, and we should be able to make setUpClass better by letting fixtures installed during it get reset between tests.
There are corners of the Internest where foolish people congregate, and invent stories. These foolish stories are then read as gospel by trusting people, and reposted, until the original made-up source is concealed from view. As an attempt to stem this flow of disinformation, here are some commonly held but incorrect beliefs about the Mono framework, and an explanation of the reality of the situation, as far as I understand it.
The next Mono version is co-developed with Microsoft
There is a grain of truth behind this one, but it s a gross mischaracterisation. Mono 2.8, when it ships, will bundle, for convenience, a number of Free Software libraries, which are released by Microsoft under a license considered Free Software by the Free Software Foundation, the Ms-PL. These are:
kernel: mptscsih: ioc0: attempting task abort! (sc=ffff880018320100)
kernel: sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 00 00 38 00 00 08 00
kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff880018320100)
kernel: mptscsih: ioc0: attempting target reset! (sc=ffff880018320100)
kernel: sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 00 00 38 00 00 08 00
kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff880018320100)
kernel: mptscsih: ioc0: attempting task abort! (sc=ffff880018320100)
kernel: sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 00 00 38 00 00 08 00
kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff880018320100)
kernel: mptscsih: ioc0: attempting task abort! (sc=ffff88001eefcc00)
kernel: sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 98 01 a7 00 00 08 00
kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff88001eefcc00)
kernel: mptscsih: ioc0: attempting target reset! (sc=ffff880018320100)
kernel: sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 00 00 38 00 00 08 00
kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff880018320100)
While the NFS transient issues are probably a real bug, I have this
image of a state machine inside the driver trying over and over the
same error paths, in a futile attempt at fixing the hardware , and
not locking onto/matching the real hardware behaviour.
Or, this most recent case during boot and resource probing:
kernel: e1000: 0000:00:08.0: e1000_probe: The EEPROM Checksum Is Not Valid
kernel: /*********************/
kernel: Current EEPROM Checksum : 0x031a
kernel: Calculated : 0x031a
kernel: Offset Values
kernel: ======== ======
kernel: 00000000: 08 00 27 f6 f3 9b 00 00 ff ff 00 00 00 00 00 00
kernel: 00000010: 00 00 00 00 08 44 1e 00 86 80 0e 10 86 80 40 30
kernel: 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
kernel: 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
kernel: 00000040: 00 00 61 70 0c 28 c8 00 c8 00 00 00 00 00 00 00
kernel: 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 06
kernel: 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
kernel: 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 03
kernel: Include this output when contacting your support provider.
kernel: This is not a software error! Something bad happened to your hardware or
kernel: EEPROM image. Ignoring this problem could result in further problems,
kernel: possibly loss of data, corruption or system hangs!
kernel: The MAC Address will be reset to 00:00:00:00:00:00, which is invalid
kernel: and requires you to set the proper MAC address manually before continuing
kernel: to enable this network device.
kernel: Please inspect the EEPROM dump and report the issue to your hardware vendor
kernel: or Intel Customer Support.
kernel: /*********************/
kernel: e1000: 0000:00:08.0: e1000_probe: Invalid MAC Address
kernel: e1000: 0000:00:08.0: e1000_probe: (PCI:33MHz:32-bit) 00:00:00:00:00:00
kernel: e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
This is an emulated Intel NIC under VirtualBox. I have never seen it
before, and it went away after a reboot. The most funny thing is the
This is not a software error! message well, it definitely is :),
but the driver has no way to know that.
I think that these software-driven failures probably trigger some
obscure error handling paths; I assume that the usual failures for
real versus virtual hardware are quite different in nature, and that
recovery is again different. This leads to using the wrong strategy
for recovery, but fortunately nothing is really broken, just in the
wrong state Since I'm not familiar with low-level driver details, I
might be wrong of course; I'm just speculating on what I think goes on
inside the driver.
I'm not even mentioning virtual clock issues, as those are no longer
funny
Last month I gave a presentation on the interaction between Android and kernel upstream at Linuxcon. The video for that is now available here (requires registration). Contrary to stories you may have heard, I do not dropkick anyone through a window.
I always wondered why backups of my sever using duplicity are so huge, but simply looking at list of files to include seemed to be correct. However I should really spend more time by reading documentation, because now it was obvious to me that the file list is simply wrong.
What a small difference in file list:
- /var/lib/vservers/
+ /var/lib
Versus the old one:
+ /var/lib
- /var/lib/vservers/
So I don't forget it, since recent sudo package resets
environment even for $HOME, the working sudoers (5) for me is:
Cmnd_Alias PBUILDER = /usr/sbin/pbuilder,
/usr/sbin/cowbuilder
Defaults!PBUILDER env_keep+=HOME
You may have to adjust the commands, YMMV.
[Nothing related to Debian here, move on if you don't care about my recurring obsession with the end of the world, Cassandra pains, or Big Phat Living Room Revolution yearnings].[Emphasis mine]
At what point does human culture depart from the Natural? With the invention of computers? TV? Cars? The cotton gin? Electricity? Taco stands? Gunpowder? The printing press? Written language? Shoes? Crop cultivation? Yurts? The wheel? Did humans become unnatural when the good old days of picturesque, endless agrarian toil, feudal oppression, unchecked disease, ignorance, and death from dysentery at 35 turned into the bad new days of urban post-industrial capitalism where a pound of fair-trade organic coffee costs $12.99 and your email inbox is full of spam?
ah. Everything humans do, or have ever done, is natural. We can t do anything else. The idea that modern culture is un-natural is nostalgic and inaccurate. Living off the grid in a yurt is good in some absolute sense, whereas driving an SUV from a suburban bungalow to the stripmall is bad ? Come on. This a romantic, but misguided view. The cosmic reaction to a 20 Ford Expedition is the same as to a sanctimonious Prius: bupkis. The universe doesn t give a fuck about you or your lifestyle choices. It doesn t give a fuck about the economy, oil spills, or civil unrest in Blargistan. It doesn t give a fuck about katydids. Eventually our whole planet will be erased from space, and the galaxy won t bat an eye. The inevitable extinction of our species (imminent, according to research here at Spinster Laboratories) via the exhaustion of available resources is as natural as a fresh-picked peach. As Andre 3000 and other dude philosophers have observed, nothing is forever.
Yes, yes, when people use the word natural what they really mean is free of chemical additives and maybe some of the assorted hippie concepts that go with that narrative. Barter economies, home furnishings made from bamboo, vegan cookbooks, living in the country. While I would argue that it is just as natural for people to put chemical additives in things as it is to not put chemical additives in things, I admit that it is appealing to fantasize that the source of human misery is an unnatural isolation from Nature, and that doing yoga on an organic rubber mat and drinking organic spinach smoothies will put me back in sync with the cosmos.
But alas, I m already in sync with the cosmos, and so are you. In other words, this is it. This is what we ve become, and this is what we get. Which is not to say that a person can t fantasize about a verdant paradise full of songbirds and polar bears and Bengal tigers, untouched by human influence. Only, that world isn t a world we could actually live in. The minute you add contented children, lazy from a carefree day at the swimming hole, eating ripe plums on the porch at sunset to that scenario, natural history changes, and it s right back to our scorched-earth dystopia. Our giant brains use up resources, it s as simple as that.
As long as we re still here, though, we might as well try to make the best of it.
http://blog.iblamethepatriarchy.com/2010/06/19/heads-up-art-week-starts-on-monday/
At some point in the past my bookmarks broke in such a way that I wasn't able anymore to alter in any way the bookmarks, deletions, additions, reorganisation, nothing worked.XPC.mfasl
XUL.mfasl
cookies.sqlite
localstore.rdf
places.sqlite
pluginreg.dat
urlclassifier3.sqlite
I thought it's about time to write a short report on my RC bug squashing
activities again; nothing spectacular, but maybe it motivats others *hint*
Second Sunday in September -- time for the annual
Chicago Half Marathon now in
its fourteenth edition
(and I have been running it in
2003,
2004,
2005,
2006,
2007,
2008
and
2009
making this and the
JPM
Chase Corporate Challenge the races I've run most often).
And the course was altered this year, alongside with an earlier start as the Bears
have their season home opener today. So we started north towards 57th, then
running down to 67th, turning east towards the lake at around three miles ---
and having the remaining ten miles along the lakefront running up to 31st
(the usual turn) and back down to 63rd. I like this course better; let's
hope it sticks.
Race conditions were fantastic. We had a rainy and gray day yesterday but
today is pure bliss. Temperatures around 60 degrees at the 7:00am start, no wind,
sunshine and not a cloud in the sky.
The race itself went well. I had a pretty brutal running year suffering most
of the time from some archilles tendon inflammation. It has gotten better in
the last few weeks possibly thanks to some heel cups I now put in the
shoes. But I had exactly one run longer than ten miles since the
Boston Marathon.
So I lost a lot of speed, as well as endurance and was a little nervous as to
how I'd do. And considering all this, it went pretty well. I fininished in 1;41:50
or a 7:47 pace. While is easily the slowest half in a number of years, at
least I got to run it evenly, pain free and with a negative split (== faster
second half) and some gas left for a fast last half mile or so. So maybe I
don't have to retire from running just yet. We'll see if I get some speed back in 2011.
A lot is being said on how Ruby is packaged in Debian and Ubuntu. In this post, I m trying to go through the most common myths and give my position as a Debian Ruby maintainer. Note that those are my views, not necessarily those of the other Debian Ruby maintainers.
Myth: Ruby is completely outdated in Debian and Ubuntu
There s a culture in the Ruby community of always using the latest bleeding-edge version. There s also a culture (though this one has recessed a bit, I think) that it s perfectly fine to change APIs in incompatible ways if it makes the software slightly better.
In Debian (and Ubuntu) stable releases, we try to provide a rock-solid version of Ruby that won t be allowed to change API during the support lifetime of a release. Bugfixes for important bugs can be applied, but that s basically all. So it s not surprising that Ruby in released versions of Debian and Ubuntu is behind the latest upstream version.
In development branches, we are following the latest upstream versions quite closely. Debian 6.0 squeeze , to be released by the end of the year, includes Ruby 1.8.7-p302, and will include 1.9.2-p0 (the currently of Ruby 1.9.2 in squeeze is currenty a SVN snapshot from beginning of august).
There are people interested in installing a packaged Ruby that just works, and other people interested in installing their own version of Ruby (through RVM and such). People in the Ruby community tend to forget about the first category, and consider that, because they install Ruby from source or with RVM, that should be the solution for everybody.
We need the Ruby community to respect that different people have different ways of using Ruby, and to stop recommending that everyone using Debian and Ubuntu should install Ruby from source.
We also need to leverage the backports services for both Debian and Ubuntu to provide a way to install the latest upstream version on stable releases. The only reason why we are not doing it yet is lack of time.
Myth: Ruby is split into a myriad of packages in Debian
In the past (pre-2005), a decision was made to split some libraries from the standard library into separate packages. This was motivated by:
gem update --sytem is disabled in the Debian package, because that would replace code from the Rubygems Debian package with code downloaded from the Internet, and can break your system in subtle ways. We have changed this (in SVN, not in any package in the archive yet) to allow gem update --system if a specific environment variable is set, which gives us the opportunity to display a warning message.
Myth: Ruby is slow on Debian
Ruby is built with the pthread threading code, because not using it breaks many native Ruby libraries (Ruby-gnome2, for example). And other Linux distributions are doing the same.
There are some very old benchmark results floating around in some blogs that show that the pthread code has a performance impact of about 20%. There are been patches for that for a long time (applied in Ruby Enterprise Edition), but they were never properly sent back. Actually, all the discussions about this issue were rumors and blog posts, and there wasn t even a bug report about it!
After the bug was reported properly, it was fixed in a timely manner. The fix is not yet included in the Ruby 1.8.7, but is being applied as a patch to the Debian package since 1.8.7.299-2. (So the Debian package is actually newer and faster than upstream Ruby in that regard).
What makes Ruby so difficult to maintain in Debian?
The main problems we have with Ruby are portability issues. The only officially supported platform for Ruby is IA32 (i386 in Debian), and everything else is best effort. It means that it is not even supported officially on x86_64/amd64! Debian supports a dozen of architectures, and the Ruby package has to work on each of them. Ruby 1.8 is mostly OK nowadays thanks to the help of Debian porters, but we still have serious problems with 1.9.2, since the test suite fails on sparc, hppa, ia64 and Debian GNU/kFreeBSD.
Why doesn t Ruby use the alternatives system on Debian?
The alternatives system provides a way to switch between different software providing the same functionality. Currently, if you want to use Ruby 1.9.2, you need to use the ruby1.9.1 executable (1.9.1 = ruby compatibility version here). The alternatives system would allow to switch ruby to ruby1.9.1 on a system-wide basis.
However, the situation of applications and libraries working only with Ruby 1.8 should be clarified: those should use /usr/bin/ruby1.8 instead of /usr/bin/ruby. Another problem is that the way to specify packages dependencies still need to be determined. There s nothing impossible to do about that, it just needs someone to do the work.
Where do we go from here?
The Ruby developers (or expert users) community is generally very hostile towards Debian. Many harsh words and insults are used in discussions mentioning Debian in the ruby-core@ mailing list, and there are frequent recommendations to avoid the Debian packages and install from sources, which is quite demotivating (Actually, what prompted that blog post is someone calling Debian-specific changes unforgivable).
This atmosphere makes it hard to recruit people, and the Debian Ruby teams are completely understaffed, which is clearly the major blocker to improving the situation further. We are 3 co-maintainers for the interpreter packages, and I m the only Debian Developer that is really active on a regular basis in the pkg-ruby-extras team (that does libraries and applications packaging). We desperately need help, but at the same time I have no time to improve our documentation and make it easier to join the team.
While I haven t reached a final decision yet, I am also likely to stop doing Ruby work in Debian after squeeze is released, as I am getting increasingly tired and demotivated.
I've heard, over the years, of people spending insane amounts of money on office chairs.
On the one hand I accept that you spend a lot of time sitting in chairs when you're working upon a computer. On the left I find the idea of spending 750+ on a chair a little insane.
For the past few years I've had a kneeling chair over time this has gotten pretty "squished" and "flat". (Specifically the part where my knees go.)
So I decided to get a new chair. What did I buy? a large rubber ball!
It's a little weird to walk into the room and see this green ball in front of the keyboard, but it's actually pretty great to sit on.
I'm gonna ignore all claims of "excercise" and "healthyness". Sure I find myself shifting around slightly to retain balance, but I'm not at all convinced that such small movements, even over the course of many days, will make any appreciable different to my muscles.
Anyway .. That is all I have to say today.
ObQuote: "Don't tell anyone we went to war over a woman. " - Mongol (2007)
Next.