mysqldump, the right way

If you need to do mysqldumps while a system is using the DB, take care regarding your parameters. Especially on Debian-based Distros there
are a few default flags you maybe do not want to be active.

An appropriate line could look like this:

mysqldump –single-transaction –skip-opt –add-drop-table –add-locks –create-options –disable-keys –extended-insert –quick –set-charset

Especially –quick seems kind of important. No buffering in memory.
You don’t want locking either, or your db “freezes” until the dump is ready.
Have fun.

Firefox 9 and Debian Squeeze

Recently I struggled with the new FF9 on Debian stable (squeeze). There are certain things to keep in mind. Assume you put the content of ff9.tar.gz to /usr/local/bin/ff9

- Make sure you have ia32-libs and ia32-libs-gtk installed.
- Put a new entry to your /etc/ld.so.conf -> /usr/local/bin/ff9
- Hit “ldconfig”
- Create a small starter shell-script for your browser that includes
export GTK_PATH=/usr/lib32/gtk-2.0/
(Otherwise it tries to use the 64Bit versions, which don’t work…)

Finalize with some flash plugin:
- Visit http://get.adobe.com/de/flashplayer/ and take the .tgz for 32Bit(!) with you.
- Use your favorite way of putting/linking it to /usr/lib/mozilla/plugins/

Voila.

OpenBTS – Playing with GSM networks

If you’re interested in learning more about GSM networks and playing around with them yourself, you should probably take a look at the OpenBTS project.

A much cheaper approach is followed by the OsmocomBB project. Here you start with a 15 EUR phone and an 5 EUR interface!

The Cuckoo’s Egg – Cliff Stoll

True story about an astronomer helping tracking down some hackers. I really recommend this one. Got mine recently signed by the author. Thanks Cliff!
He also produces some crazy zero-volume bottles. This link gets you there.

The PC Weenies comic

Have you ever checked out this regular?

He even draws custom ones for you if one e.g. want to surprise someone with an uncommon present :)

 

SSH connect back tunnel

Just as a reminder for situations in which you need to connect to a host which is e.g. firewalled. Here is how. On the machine that can only do OUTBOUND connections, type:

ssh -f -N -R 10000:localhost:22 user@your_outside_machine

So now, you can ssh to port 10000 on your outside machine and you will actually be connecting to port 22 on the firewalled server:
ssh user@outside_machine -p 10000

Voila.

Optimizing your KVM virtualization setup using KSM

Playing around with KVM virtualization on e.g. Debian Squeeze and ever wondered if there’s a way to optimize memory usage? It’s possible!
KSM (Kernel Samepage Merging) is the magic phrase. To make it short: On a recent installation (> 2.6.32) you possibly only need to:

# echo 1 > /sys/kernel/mm/ksm/run

If KSM is running, and there are pages to be merged (i.e. more than one similar VM is running), then /sys/kernel/mm/ksm/pages_shared should be non-zero. From the kernel documentation in Documentation/vm/ksm.txt:

The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/:

pages_shared     - how many shared unswappable kernel pages KSM is using
pages_sharing    - how many more sites are sharing them i.e. how much saved
pages_unshared   - how many pages unique but repeatedly checked for merging
pages_volatile   - how many pages changing too fast to be placed in a tree
full_scans       - how many times all mergeable areas have been scanned

A high ratio of pages_sharing to pages_shared indicates good sharing, but
a high ratio of pages_unshared to pages_sharing indicates wasted effort.
pages_volatile embraces several different kinds of activity, but a high
proportion there would also indicate poor use of madvise MADV_MERGEABLE.