random goodies
python-pulseaudio: code for interfacing with the pulse-audio libraries from python.Warning: loss of data guaranteed! Do not run any of this code unless you are happy to restore your data from backups.
Hardcore reboot
Ever got your remote system in such a spin that all the reboot commands would not work (init 6
,
shutdown -r now
, reboot
, sysrq
...)
In other words: completely stuck!
If you still have the ability to execute commands and access to
/proc
, this did the
trick for me once: dd if=/dev/zero of=/proc/kmem
This is very dangerous to use and could do all sorts of damage... You have been warned!
busybox rules
I once accidentally removed the real /lib/libc* when building/deleting CHROOTs... ouch!
Needless to say, it becomes impossible to launch any new commands as everything on the system
is likely to be linked with the C library.
Therefore it is impossible to login, impossible to use tar
or cp
to restore the file...
As this was a remote system and I was thousands of miles away from the data-center, I was really desparate
to find a solution that did not involve paying for remote hands.
After establishing a security cordon around the router
that was providing my one and only remaining ssh connection to the live system, I had to move quickly,
this link was not going to stay up forever...
bash command completion allowed me to browse the filesystem
by repeatedly hitting [tab]
in all the directories I was interested in.
Eventually, I remembered that one of my test user accounts had a static build of busybox,
so I eventually found:
/home/testuserNN/build/busybox/_install/busybox
Then it was just a matter of running busybox tar
to restore the deleted files... Hurray!
Since then, a statically linked copy of busybox has become mandatory on all the servers I break^W maintain.