...making Linux just a little more fun!

2-Cent Tips

[2 cent tips] Better reboot using magic SysRq

Mulyadi Santosa [mulyadi.santosa at gmail.com]

Tue, 27 Apr 2010 07:26:47 +0700

What is a better way to reboot your system in case it hangs? I mean rather than three finger salute or kicking the power switch? :)

Let's assume you have enable the magic SysRq before. Make sure this feature is compiled in the kernel (CONFIG_MAGIC_SYSRQ) and you enable it (echo 1 > /proc/sys/kernel/sysrq). Then when the disaster strike, you can try pressing these key combos in the following order: 1. Alt-SyRq-s (sync the buffer with the disk) 2. Alt-SysRq-u (remount all filesystem as read-only) 3. Alt-SysRq-e (kill all tasks, except init) 4. Alt-SysRq-b (finally, reboot system)

If your keyboard doesn't have SysRq, use PrintScreen instead. The way I do it is like this: press alt, hold, press sysrq, hold, then press s (or other key), then release them all. You might also try, press alt, hold, press sysrq, release it, press s or other key, release all.

In most cases, the above sequence could reboot your system better. But if not, just fall back to the "traditional" one :)

Reference: sysrq.txt in Documentation directory inside kernel source code's tree.

Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com

[ Thread continues here (5 messages/3.52kB) ]

2-cent Tip: Screen Shots

Ben Okopnik [ben at linuxgazette.net]

Tue, 13 Apr 2010 15:56:07 -0400

----- Forwarded message from Henry Grebler <henrygrebler at optusnet.com.au> -----

I was writing an article. I needed more than words; I needed screen shots. Over the years, I've done this in different ways. Of late, I've used ImageMagick(1) for this sort of work, in particular,

import - saves any visible window on an X server and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen.

I was capturing parts of web pages. Then I came to a roadblock. I clicked on a button and it produced a drop-down list. I wanted to capture the contents of the drop-down list. But, some drop-down lists are unfriendly. For example, in Firefox, if I click on File, the usual drop-down list appears, but now my keyboard is deactivated. I also lose most mouse functions, except for moving the cursor. And, if I click anywhere, the drop-down list disappears.

So how to take the screen shot?

I started up a vncserver and a vncviewer (client); and then invoked Firefox inside the VNC client.

Click on File, move the cursor out of the VNC client, and, voila - I can now use import to take a screen shot of the menu of the Firefox running in vncviewer.

----- End forwarded message -----

[ Thread continues here (3 messages/5.74kB) ]

Talkback: Discuss this article with The Answer Gang

Copyright © 2010, . Released under the Open Publication License unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 174 of Linux Gazette, May 2010