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

Stupid Trick: How to find the uptime in Windows

With Unix (and therefor Linux) we are given a neat tool called “uptime”, what it does is it tells you how long the machine is on. This can be helpful for many reasons. In Windows.. there is no Uptime, but there is a way to tell.
Method 1
In the Command Prompt you type:
net stats srv
and you will get some information at the top of with will say something like:
Statistics since 5/16/2011 6:31 PM
This is the date | time the machine was last started.
Method 2
At a command prompt type
systeminfo
This displays many things, and one of them is “System Up Time” in days.