lunes, 4 de mayo de 2009

The Magic "System Request" key in Linux

There's something useful that I keep forgetting when I'm using Linux, something that I would like to keep a record about, and I thought that a good way to do it would be by writing it in this blog.

The System Request key, "SysRq" in English keyboards ("Pet Sis" in Spanish ones, short for "Petición de Sistema") is the useless-looking key that is sitting right next to your (also useless-looking) "Pause" key.

However, this key plays an important role for a Linux System administrator, because it can be used to send system calls directly to the kernel. Sometimes, speaking directly to the kernel is the only way to save the day.

For example... imagine that suddenlty your whole system hangs. It's frozen... there's some process using 100% of the resources of the system.. your mouse doesn't move.. the Control+Alt+F2 key doesnt work... you can't do anything! Arghh!! what to do!!??

In Windows the only possible solution to this situation would be to forcefully disconnect your PC, make it loose any data you had sent and take the risk to damage your hard disk, motherboard, CPU and all the hardware that you were using at that time.

However, if you are using the Linux kernel, there's still some chance for salvation.... sending a System Request...

Press AltGr+SysRq+R (unRaw, releasing your keyboard from X control)
Press AltGr+SysRq+E (tErminate, sending a SIGTERM to close gracefully the running programs)
Press AltGr+SysRq+I (kIll, send a SIGKILL to inmediatelly close the remaining programs)
Press AltGr+SysRq+S (Sync, saving the data to the disk so that you won't loose the last changes)
Press AltGr+SysRq+U (Unmount all the disks, so that they won't be damaged)
Press AltGr+SysRq+B (reBoot the system)

Mnemotecnics


If you are like me, you'll forget this shortcuts easily.
You can do like me, and write in a blog about that... or try to remember it by using some hints. Here are some of them:
"Reboot Even If System Unbelievably Broken"
BUSIER backwards
"Raising Elephants Is So Utterly Boring"
You can also Sync the disks before terminating programs if you want:
"Raising Skinny Elephants Is Utterly Boring" (because if they are fat it would rather be utterly deadly...)


Note: if you are not using a QWERTY keyboard the keys can be different for you
You can also read more about other SysRq shorcuts here: lxr.linux.no/linux/Documentation/sysrq.txt

sábado, 2 de mayo de 2009

Heroes



Lately I've started watching a series that has kept me stuck to the screen the whole day!

"Heroes" is a science fiction drama about normal people who suddenly start discovering that they have some special abilities. Even thought the series is called "Heroes" you won't see the stereotypical superhero that wear bright colors, long panties and is wearing the underwear on top, this people is just normal people... they just suddenly discover that they have special abilities, slowly growing on them.

The plot of each season has small story arcs built into the series' overall large story arc plot. Each season of Heroes is designed to involve ordinary people who discover extraordinary powers, and how these abilities take effect in the character's lives. There's a mix of small stories that create a tangled pattern that keeps you wondering how they relate each other...

I'm not really very fond of American comics about superheroes (with only a few exceptions...) but this series is really cool!! ...I specially like some characters like the japanese guy (Hiro Nakamura) who is a funny boy (you may say "otaku") who one day discovers that he can control time and goes screaming YATAAAA!!! running all around his workplace. There are also some charismatic characters like a painter who can paint scenes from the future when he is on drugs. I won't say much more to avoid any more spoiling...

So... in case you want to start watching a bit.. I'll post here the first 3 episodes (I've always thought that you have to watch at least 3 episodes of a series before being able to judge). However... be warned.. they are long (40min each!)... but they are also addicting!


(Note: The videos in Tu.TV (you can find also more episodes there) are low quality, and sometimes they suddenly stop. If that happens you can also find the videos in seriesyonkis, but if you don't know spanish you'll have to choose the english audio version with spanish subtitles)


Heroes Season 1 Episode 01



Videos tu.tv


Heroes Season 1 Episode 02



Videos tu.tv


Heroes Season 1 Episode 03



Videos tu.tv



There are also some graphic novels (comics) about Heroes.

You can find the comics in the official page or also in the wikipedia article about this comics.

There's also a wiki where you can find a lot more information about the Heroes series, but I recommend you all to not enter if you have not watched at least a few seasons, because it's filled with spoilers.

Now I'll go.. I still have much to watch ;) ...see ya! -Teleports himself- >.<