I’ve just backported qemu 0.9 to Mandriva 2007. This release include the kqemu 1.3.0pre11 kernel module, which was released under the GPL some weeks ago.
As usual, this package is available in my RPM repository.
I’ve just backported qemu 0.9 to Mandriva 2007. This release include the kqemu 1.3.0pre11 kernel module, which was released under the GPL some weeks ago.
As usual, this package is available in my RPM repository.
Three months after the last version, here is a big update of my backup scripts for websites. The script was greatly improved and among new features, the most important is the support of backups over SSH and backups of MySQL databases.
Change log:
backup_list must specify the type property (FTP, FTPs, SSH, MySQLdump or MySQLdump+ssh).site is now host./ftp-mirror folders renamed to /mirror.rsync whenever it’s possible for bandwidth efficiency.lftp make the decision for you to send your clear password on the net.mysqldump.pexpect lib to simulate user password input.If you were using a previous version of my backup script and want to use this updated version, take care of changes, especially the ones describes in the first 3 items of the change log above.
Disclaimer: this is a dirty hack ! To parse HTML or XML, use a dedicated library.
Tonight I found the ultimate regex to get HTML tags out of a string. It was written a year ago by Phil Haack on his blog. His regex is quite bullet-proof: it’s able to parse HTML tags written on multiple lines which contain any sort of attributes (with or without a value, with single or double quotes).
Unfortunately his regular expression was designed for Microsoft .NET, so I’ve spend some time to convert it to PHP. Here is the result:
$regex = "/<\/?\w+((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i";
And finally, my version based on the one above:
$regex = "/<\/?\w+((\s+(\w|\w[\w-]*\w)(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i";
The latter include the following enhancement:
Yesterday I’ve build a new K2 style based on the legacy Sapphire 1.0 WordPress theme by Michael Martine. This is the result of my love to the blue bend of Sapphire and the versatility of K2.
As you can see in the footer of that blog, I’m using my Sapphire 0.1 style right now. So if you like the look and feel of that blog, don’t ask yourself and download Sapphire 0.1 for for K2 !
To install it, unzip the archive to your /wp-content/themes/k2/styles/ folder.
I’ve released a new version of my e107 migration script for WordPress. This release is numbered v0.7.
Here is the change-log:
Warning 2” on the screenshot) to make the import process easier.Because of its de-facto standard status, my import script is now packaged as a .zip file. It can be downloaded from my Linux Scripts section.
Today mdadm send me a mail to warn that one of my hard drive (/dev/hdd1) was ejected from my RAID-5 array. After some manipulations (no writes, just reads on the file system to get informations) and reboots, I ended up with a file system in a strange state: the folder structure was totally messed up and lots of files disappeared.
Assuming that this situation was about an inconsistent file index, I decided to reset the superblocks of the remaining physical disks:
mdadm --zero-superblock /dev/hdc1 mdadm --zero-superblock /dev/hdb1
I don’t know why I decided to do so, but it was the stupidest idea of the week. After such a violent treatment, my array refused to start:
[root@localhost ~]$ mdadm --assemble /dev/md0 --auto --scan --update=summaries --verbose mdadm: looking for devices for /dev/md0 mdadm: no RAID superblock on /dev/hdc1 mdadm: /dev/hdc1 has wrong raid level. mdadm: no RAID superblock on /dev/hdb1 mdadm: /dev/hdb1 has wrong raid level. mdadm: no devices found for /dev/md0
At this moment I was sure that all my data assets were lost. I was desperate. My only alternative was to ask Google. So I did.
I spend several minutes browsing the web without hope. I finally found someone in the same situation as mine (sorry, in french) on debian-user-french mailing list.
The solution was to recreate the RAID array. This sound counter-intuitive: if we recreate a raid array over an existing one, it will be erased ! Right ? Wrong ! As it is said on debian-user-french, mdadm is smart enough to “see” that HDD of the new array were elements of a previous one. Knowing that, mdadm will try to do its best (i.e. if parameters match the previous array configuration) and rebuild the new array upon the previous one in a non-destructive way, by keeping HDD content.
So, here is how I finally recovered my RAID array:
[root@localhost ~]$ mdadm --create /dev/md0 --verbose --level=5 --raid-devices=3 /dev/hdc1 missing /dev/hdb1 mdadm: layout defaults to left-symmetric mdadm: chunk size defaults to 64K mdadm: size set to 312568576K mdadm: array /dev/md0 started.
Of course this doesn’t solve my initial problem about the /dev/md0 file system: it is still in an altered state. Maybe it’s too late to recover data. But at least I reverted all my today’s mistakes, and the situation will not deteriorate until I power up my RAID ! ![]()