Archive for Linux

Raising Skinny Elephants is Utterly Boring – The Magic SysReq key

Ever have a linux box seemingly freeze on you?  Ever gripe aloud that you may have to hard boot the machine to get it back up?  Well.. Give this a try:

on a keyboard connected to the machine press and HOLD

ALT + PrtScrn/SysRq

then type in this order:

R S E I U B

While holding them, one at a time. The machine may restart after the B.

Why? It’s explained better in the Wikipedia Article, but essentially..

It takes back the keyboard from X, shuts things down gracefully.. and allows you to reboot.

unRaw (take control of keyboard back from X),
tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
kIll (send SIGKILL to all processes, forcing them to terminate immediately),
Sync (flush data to disk),
Unmount (remount all filesystems read-only),
reBoot.

Extract / Compress Cheat Sheet Part 1

In Linux / Unix you get alot of compressed files.. and I’m too old to remember how to compress or extract sometimes.. but thats what Google is for right??

tar
To Make:
tar -cvf foo.tar /foldertoarchive
To Extract:
tar -xf foo.tar

tar.gz
It’s worth mentioning that if you already have a tar file, you can use gzip to make it a tar.gz with:
gzip foo.tar
But you can do both with:
tar -cvzf foo.tar.gz /foldertoarchive
To Extract:
tar -zxvf foo.tar.gz

tar.bz2
tar.bz2 has a real good compression ratio, but takes longer to create, which for me is fine tbh.
To Make:
tar -cvjf foo.tar.bz2 /foldertoarchive
To Extract:
tar -jxvf foo.tar.bz2

Mounting AFP File shares with Ubuntu Linux and Debian 6

I’m moving things from one machine to another and I setup an AFP share and not an SMB share on a mac where I need to transfer my files.. I could just turn on SMB.. but whats the fun in that?

To install AFP support for Ubuntu you must first install these packages:

sudo apt-get install libfuse-dev libreadline-dev libgcrypt-dev libgmp3-dev

Then you need to download the AfpFs-Ng source files from sourceforge and compile them.

http://sourceforge.net/projects/afpfs-ng/

you unzip those files into a directory, and cd into it, then type::
./configure
make
sudo make install
sudo ldconfig

Then to mount your share you type, as a regular user:

mount_afp 'afp://user:password@servername/sharename' /placewhereyouwannamountit/

To unmount you type:

afp_client unmount /mountname/