Sometimes you have a tiny file you wish to include in a block of plain text, perhaps an email. When I was young(er), -in the era of UUCP and modems, before the world wide web and HTML were invented, when RFC-821 was still new, -there were no MIME attachments to email.
If you wanted to send a file by mail, you had to encode it in a way that could be included in plain text without breaking. That meant 7-bit ASCII only, max 72 chars on each line, and a lot of other limitations.
Bandwidth and storage were limited, so uuencode was invented to “efficiently” encode 3 bytes of binary data into 4 printable characters. Pretty clever.
I recently had a need for uuencode, and it was not installed on my CentOS/RedHat system by default. The package containing uuencode is called “sharutils”. The name comes from the “shar” utility to encode binaries into a shell script, shell archive (shar file).
“yum install sharutils” – and voila, I have uuencode and uudecode available.
I recently had some very nice experiences with gandi simple hosting (where the story tellers guild is located), which is in effect a “hosted VPS”, that is, a hosted solution, but with a private set of apache, mysql, APC and Varnish threads. Very cool indeed.
So I’m now moving this blog to the same platform.
10 minutes of work, and all appears to be working as expected.
- create the vhost(s) (with/without www.)
- add temp /etc/hosts entries while testing
- mysqldump the database (I took one of the cron-generated ones that was only an hour old)
- copy the files from the old DocumentRoot (put -r in sftp works in ubuntu for a recursive put, which was needed due to the amount of files)
- remove temporary /etc/hosts entry
- update DNS records to point to the new host
To finalize, I installed the varnish http purge plugin.
Looking forward to seeing the impact on performance in google webmaster tools.
Have you ever forgotten a tomato in a window, or perhaps a banana skid in a not-so-well-closed container? Has it resulted in a family of fruit flies? (Also called vinegar flies)?
Do you want to get rid of them? Here’s how…
1. take away everything they can eat and lay their eggs in. This is important, since the females can produce up to 1000 eggs each day, and it takes only a week for them to hatch.
2. take a glass or metal container you don’t love that much – this will be their graveyard
3. add 2 part of something sweet, for instance honey or syrup
4. add 1 part of vinegar (guess why they’re called vinegar flies?)
5. add 1 or 2 parts of water, and make sure everything blends well.
6. Place it near the flies to see if they’re interested in the treat. The purpose is to mimic the smell of old/ripe fruit, where they prefer to lay their eggs and breed.
7. Finally, add a drop or two of washing-up liquid. This will get rid of the surface tension, making a nasty surprise for the flies when they try to land on the drink you prepared for them. They will sink to the bottom and drown.
8. wait and enjoy the show. Silly flies.
# setterm -powersave off -blank 0
Useful on the console of virtual hosts in vmware or virtualbox, for example.
Hey! I just discovered the new features in the classic brain game ApeBroker! They have trophies, advanced toplists, facebook integration and more. Most recently, they added a visible marker of the companies you own shares in. That’s a nice improvement.
The game is a classic boardgame with the strict turn-based gameplay relaxed into a “number of moves per day (and person) along with a minimum time between each move by the same player”. I think this is great, because it means the game will not come to an end when someone goes for a long vacation or whatever. It’s more like in the real-world. 🙂
Check it out. There’s usually lots of games to join.
When performing the db2move load -lo replace to continue the “restore” from my previous post, I failed once more, this time with first SQLSTATE SQL2036N, “The path for the file or device path/device is not valid.”, and later (after chmod o+x on the directory), SQLSTATE SQL1652N, “File I/O error occurred”.
Why does IBM write this kind of misleading error messages? What’s wrong with a simple ENOPERM, ENOENT, “Permission Denied”, or “No such file or directory” message?
I am logged in as user ‘root‘, but the db2move command simply seem to tell another DB2 process to load the import files, and this is probably a privilege separated process that can’t open the directory containing my *.ixf files.
So, chmod o+x on the directory to the rescue! (Solved the SQL2036N) – Only to have it fail with another error when it is the actual files that cannot be opened by the unprivileged user.
chmod o+r on the files to the rescue, then! 🙂 (Solved the SQL1652N).
Yes, both these error messages were due to the fact that the files were not readable by anyone but root. Hope this helps someone! (Feel free to investigate the advertisements if you find any of my tips useful!) Nudge, nudge, know what I mean, know what I mean? 🙂
I created a new db2 database, updated LOGARCHMETH1, LOGFILSIZ and some other things, then tried to import data created with db2move and db2look with a command like this:
db2 -tvf filename.dat
It failed, with SQLSTATE=57019, because of BACKUP PENDING.
I didn’t feel like performing a backup on an empty database, so I did this to solve the problem:
db2dart databasename /CHST /WHAT DBBP off
where “databasename” was obviously the name of my database. This successfully changed the state of the DB Backup Pending flag to “off”, which allowed me to do my import! Yay!
Proudly announcing the new facebook app at https://apps.facebook.com/apebroker/ !
Now featuring 24 different trophies/achievements to compete for with your friends or complete strangers!
Be the first with the latest, play apebroker today!
Note to self… Has 1 disk (/dev/sda) and want to “find” newly added disk (/dev/sdb) without reboot:
echo 'scsi add-single-device 0 0 1 0' > /proc/scsi/scsi
The first “0” is the controller, next “0” is the SCSI channel, the “1” is the target ID, and the last “0” the H-LUN.
After repartitioning with fdisk, the kernel remembers the old partition table, so remove the device and add it again to refresh it:
echo 'scsi remove-single-device 0 0 1 0' > /proc/scsi/scsi
echo 'scsi add-single-device 0 0 1 0' > /proc/scsi/scsi
I decided that it was time to upgrade our spam filters today. It runs on 4 virtual gentoo installations, and it’s based on postfix and amavisd-new.
Most of the time, I find gentoo is really as beautiful as a distro can get. They try to do TheRightThing, and don’t fail as bad as the debian gang does most of the time.
Perl with CPAN is of course never going to be “compatible” with a package-based distro, but in Gentoo the developers are clever and caring, and they make tools like perl-cleaner that actually does a remarkable job.
As always, I’m employing the lazy upgrade methodology, (also known as ad-hoc patching, or on-demand upgrading, or more bluntly: I upgrade whenever I feel like it and have the time). This approach and gentoo is not always the best combination, but because gentoo is as good as it is, things usually work out very well for me, even when upgrading gblic, or, as recently, the init/baselayout. Gentoo is amazing. I still love it.
Anyway… After upgrading perl, spamassassin, and some other dependencies, spamassassin wouldn’t start, and the error message was a very cryptic:
child process  exited or timed out without signaling production of a PID file: exit 25 at /usr/local/bin/spamd line 3334.
The solution? Just run “sa-update” to download new rules. Then it started just fine.