The SysRq key is used to give input to the operating system without interfering with the software running (or rather hanged, which you can figure out later in the post) on your system. In essence it's a BIOS routine that triggers INIT 15, bypassing INIT 9 from reading the scan code, and thus the key pressed thereafter is not stored in the keyboard buffer, and to which the kernel will respond to. This will work unless the kernel is completely locked up, in which case you can give another try after tapping the Alt keys a couple of times or will have to head to the nearest "power" button.
In the Linux world the Alt + SysRq key is termed the Magic SysRq key that can be used to fix or debug a frozen system.
It's required to turn on SysRq in order to use it. So make sure this is done after your system installation in case you forecast (pun intended) a system hang. You can do this by setting the kernel parameter, which is in extension of my previous post on linux proc fs
# echo 1 > /proc/sys/kernel/sysrq
On X86 machines you can press ALT-SysRq-(command) to send useful commands (also listed in the wiki article) to the kernel.
ALT-SysRq-C can be used to manually trigger a 'C'rashdump when the system has hanged.
ALT-SysRq-REISUB can be used to manually trigger a neat and safe reboot when your machine has hanged, instead of pounding on the power button and risking HDD problems in the event where data is being written when the system hanged. Its easier remembered as BUSIER spelled in reverse.
And here is what's happening under the hood
R turns off keyboard raw mode and sets it to XLATE / gives back control of the keyboard
E send a SIGTERM to all processes, except for init.
I send a SIGKILL to all processes, except for init
S attempt to sync all mounted filesystems
U mounts all filesystem as read-only to prevent a fsck at reboot
B reboots the system no matter what
__tipped__
Showing posts with label opensource. Show all posts
Showing posts with label opensource. Show all posts
Friday, July 25, 2008
Wednesday, July 23, 2008
ATAD #3 - linux Access Control Lists (ACLs)
File permissions on linux are traditionally Read (r), Write (w), and Execute (x) permissions associated with users and groups. Providing appropriate permissions, especially as an ordinary user, is more often complicated than we think.
Let me illustrate this with an example. User "tom" creates a file named "hoohaha" and wants to give "dick" and "harry" permissions to read and execute it. Ofc this is fairly simple if dick and harry were exclusively part on one group. What if that group dosent exist? tom will have to ask the "already overloaded" system administrator to create a group consisting of just dick and harry. This, like you can see dosent sound too good.
To overcome this limitation, Linux has implemented support for Access Control Lists (ACLs). ACLs serve as an extension to traditional Unix permissions, giving end-users the ability to specify special access rights to a file and provide desired users and groups with appropriate permissions. To use ACLs you should have at least kernel version 2.6.x (some manual steps are required with older kernel versions), a filesystem that supports ACL, and additional user tools to create, view and modify ACLs. ext3 filesystems natively support ACLs, and support can be added to ext2 filesystem by performing some additional steps. ACL support is native on RHEL5, Fedora 9, Ubuntu Fiesty and SuSE 8.1 (there would be more).
The setfacl utility sets ACLs for files and directories, and getfacl can be used to determine the existing ACLs for a file or directory. The cp and mv commands do preserve the ACLs. tar and dump dont, so use star instead.
tom $ getfacl hoohaha
# file: hoohaha
# owner: tom
# group: tom
user::rwx
group::r--
other::r--
The requirement is realized when tom sets ACLs for the file hoohaha
tom $ setfacl -m user:dick:rx hoohaha
tom $ setfacl -m user:harry:rx hoohaha
__tipped__
Let me illustrate this with an example. User "tom" creates a file named "hoohaha" and wants to give "dick" and "harry" permissions to read and execute it. Ofc this is fairly simple if dick and harry were exclusively part on one group. What if that group dosent exist? tom will have to ask the "already overloaded" system administrator to create a group consisting of just dick and harry. This, like you can see dosent sound too good.
To overcome this limitation, Linux has implemented support for Access Control Lists (ACLs). ACLs serve as an extension to traditional Unix permissions, giving end-users the ability to specify special access rights to a file and provide desired users and groups with appropriate permissions. To use ACLs you should have at least kernel version 2.6.x (some manual steps are required with older kernel versions), a filesystem that supports ACL, and additional user tools to create, view and modify ACLs. ext3 filesystems natively support ACLs, and support can be added to ext2 filesystem by performing some additional steps. ACL support is native on RHEL5, Fedora 9, Ubuntu Fiesty and SuSE 8.1 (there would be more).
The setfacl utility sets ACLs for files and directories, and getfacl can be used to determine the existing ACLs for a file or directory. The cp and mv commands do preserve the ACLs. tar and dump dont, so use star instead.
tom $ getfacl hoohaha
# file: hoohaha
# owner: tom
# group: tom
user::rwx
group::r--
other::r--
The requirement is realized when tom sets ACLs for the file hoohaha
tom $ setfacl -m user:dick:rx hoohaha
tom $ setfacl -m user:harry:rx hoohaha
__tipped__
Monday, July 21, 2008
ATAD #1 – linux /proc filesystem
It’s been a long time since i really sat down to read something, apart from what work demanded, technology round ups and reviews. Its this strange time in my life when academic acumen kicks in, and I wonder; “why not spend a few minutes each day to learn something new”.
I will log my learning’s with A Tip A Day.
Over the years I have understood that the /proc directory (also called the proc file system) contains files that store information about the state of the linux kernel and the running applications. The files can be interpreted by applications and the users (though a few are restricted only to the ‘root’ user) to gain a whole wealth of information about the running system. The contents of the files under the proc directory can be easily read using the cat program
OK, this is probably stale news for a few. But an interesting find was that a few files under /proc/sys can actually also be used to adjust settings to the kernel.
Eg, here im changing the hostname of the linux system to hoohaha
# echo hoohaha > /proc/sys/kernel/hostname
A few others store boolean information, for example the /proc/sys/net/ipv4/ip_forward when set to 1 will immediately start forwarding network packets.
# echo 1 > /proc/sys/net/ipv4/ip_forward
__tipped__
I will log my learning’s with A Tip A Day.
Over the years I have understood that the /proc directory (also called the proc file system) contains files that store information about the state of the linux kernel and the running applications. The files can be interpreted by applications and the users (though a few are restricted only to the ‘root’ user) to gain a whole wealth of information about the running system. The contents of the files under the proc directory can be easily read using the cat program
OK, this is probably stale news for a few. But an interesting find was that a few files under /proc/sys can actually also be used to adjust settings to the kernel.
Eg, here im changing the hostname of the linux system to hoohaha
# echo hoohaha > /proc/sys/kernel/hostname
A few others store boolean information, for example the /proc/sys/net/ipv4/ip_forward when set to 1 will immediately start forwarding network packets.
# echo 1 > /proc/sys/net/ipv4/ip_forward
__tipped__
Saturday, March 29, 2008
Why we use Linux
Vlad Dolezal blogs about "Why we use Linux"
I can't agree any lesser.
Since the day i migrated to this brighter face of the planet, ive been spending more fun, 1 on 1 time with my computer in tweaking stuff to my likes. Of course there were the troughs with undesired effects, but recovering from them and bringing about the desired change was a cherished learning experience by itself.
Open up and live free.
We tell people we use Linux because it's secure. Or because it's free, because it's customizable, because it's free (the other meaning), because it has excellent community support...
But all of that is just marketing bullshit. We tell that to non-Linuxers because they wouldn't understand the real reason. And when we say those false reasons enough, we might even start to believe them ourselves.
But deep underneath, the real reason remains.
We use Linux because it's fun!
I can't agree any lesser.
Since the day i migrated to this brighter face of the planet, ive been spending more fun, 1 on 1 time with my computer in tweaking stuff to my likes. Of course there were the troughs with undesired effects, but recovering from them and bringing about the desired change was a cherished learning experience by itself.
Open up and live free.
Tuesday, January 01, 2008
Photography and Open Source
Thanks to a popular photo sharing platform flickr, and the
Creative Commons license, my photography, finds its way here http://www.delivr.net/independance+day.html and http://bagel.tumblr.com/page/11
Creative Commons provides free tools that let authors, scientists, artists, and educators easily mark their creative work with the freedoms they want it to carry. You can use CC to change your copyright terms from "All Rights Reserved" to "Some Rights Reserved."
This could well be called the GPL equivalent for creative thoughts and material. .
Open Source is here to stay.
Creative Commons license, my photography, finds its way here http://www.delivr.net/independance+day.html and http://bagel.tumblr.com/page/11
Creative Commons provides free tools that let authors, scientists, artists, and educators easily mark their creative work with the freedoms they want it to carry. You can use CC to change your copyright terms from "All Rights Reserved" to "Some Rights Reserved."
This could well be called the GPL equivalent for creative thoughts and material. .
Open Source is here to stay.
Sunday, August 26, 2007
Ubuntu'd and luvin it
More experiments with Ubuntu are up on Gadget7 and you can check it out here
For sheer expandability and customization, im totally addicted to this OS. This is fun :)
For sheer expandability and customization, im totally addicted to this OS. This is fun :)
Thursday, July 26, 2007
Rough tide leads to pleasant discovery
The last month was a period of experiments with my computer, starting with the fact that I was running on a ‘going to break’ HDD and the DST short test was failing repeatedly. So before anything, I backed up all my data (which also includes my windows partition) after running openSUSE in recovery mode; and trust me it was quite a breeze, reinforcing my crush on Linux. Later that day I called DELL support and they promptly shipped me a replacement hard drive one working day later, but the OEM OS that id also asked them to ship was going to take a few days longer as the package which includes WinXP, device drivers, sonic, win backup and a few others were flying in from Netherlands. Nevertheless I was happy with their prompt and ‘no questions asked’ service, afterall I guess ive already paid them quite a sum when I took the 3 yr complete care support for my inspiron 6400.
A few months before this day I had installed the vista transformation pack just to see what the hype was all about. Must say, I was impressed by the freshness it gave to the aeging, yet stable XP. So I decided to head to the nearest and dearest electronics shop to get the Vista Home Premium. I like the way it installed, M$soft finaly decided to keep it simple and voila!! I also have my disk management utility inbuilt right into the installer, and without second thought retained 20gigs of free space for Linux. Two weeks passed and I liked the way vista felt, till I realized that I need more memory for what started to seem like a dying computer. I think I can quite easily point the finger at vista that required ~500 MB just to boot and get running. I ‘tried’ installing Halo for vista, and not to my surprise it didn’t quite go on well. You already get the picture, don’t you? Nevertheless 2Gigs of memory is on its way..
A jobless Sunday afternoon, and what more could I do when I find the ubuntu feisty fawn media lying around, 10GB of free space and a geeky mind. No prizes for guessing right, im now happily ubutun’d with a fresh and functional desktop. And here is a trailer of what could be done with Ubuntu and Beryl
Tell me that you still aren’t impresses by just the eye candy, and then here is more from a functionality pov. The ubuntu installation is done with a couple of user inputs that loads off a Live CD making life much easier, then comes the best part, the apt-get application is used to install any application from the command prompt, all u need to know is the name of the application and a simple `apt-get app_name` will look for the application online, download it, resolve dependencies and install the app. Ive got two words, “luvin it”
Next adventure would be tweaking and compiling the G15 drivers to get my Logitech Z10 working, and then Vmware to get virtual servers running. More later …
Live free, or die.
Linux!!
A few months before this day I had installed the vista transformation pack just to see what the hype was all about. Must say, I was impressed by the freshness it gave to the aeging, yet stable XP. So I decided to head to the nearest and dearest electronics shop to get the Vista Home Premium. I like the way it installed, M$soft finaly decided to keep it simple and voila!! I also have my disk management utility inbuilt right into the installer, and without second thought retained 20gigs of free space for Linux. Two weeks passed and I liked the way vista felt, till I realized that I need more memory for what started to seem like a dying computer. I think I can quite easily point the finger at vista that required ~500 MB just to boot and get running. I ‘tried’ installing Halo for vista, and not to my surprise it didn’t quite go on well. You already get the picture, don’t you? Nevertheless 2Gigs of memory is on its way..
A jobless Sunday afternoon, and what more could I do when I find the ubuntu feisty fawn media lying around, 10GB of free space and a geeky mind. No prizes for guessing right, im now happily ubutun’d with a fresh and functional desktop. And here is a trailer of what could be done with Ubuntu and Beryl
Tell me that you still aren’t impresses by just the eye candy, and then here is more from a functionality pov. The ubuntu installation is done with a couple of user inputs that loads off a Live CD making life much easier, then comes the best part, the apt-get application is used to install any application from the command prompt, all u need to know is the name of the application and a simple `apt-get app_name` will look for the application online, download it, resolve dependencies and install the app. Ive got two words, “luvin it”
Next adventure would be tweaking and compiling the G15 drivers to get my Logitech Z10 working, and then Vmware to get virtual servers running. More later …
Live free, or die.
Linux!!
Wednesday, August 31, 2005
the future is OPEN
Gone are the days of monopoly; OPEN SOURCE is in. All you have to do is to log onto the web page (which obviously will be slow if you are on IE), download the small installer, install it in a flash and live happily ever after..... story does not end here, feel bored or wanna do some fiddling, download the source code, get the compiler and an editor, all windows are broken, doors open and its a wide open world out there.
Ever since i migrated to Unix and subsequently to the flavours of Linux, life has become so easy without the need for using my microsoft leg pad (a small leg pad having the three most important keys ==> Ctrl, Alt and Delete). The first open source freeware i fell in love with is Firefox. A review called it "Best of 2003", no doubt.
FIREFOX is a free alternative web browser that is faster, safer and easier to use than Microsoft Internet Explorer. Recent security exploits make Internet Explorer unsafe. Reduce the risk of viruses, worms, spyware and other malicious software by switching to the most customizable and secure browser in the world! Enjoy features such as tabbed browsing, a popup blocker, built in search and a feed reader (RSS) to keep up with the latest news headlines.
THUNDERBIRD is the perfect companion for Firefox, featuring one of the most advanced junk mail filters available. Both Firefox and Thunderbird can be easily customized for the way you browse the web and read your e-mail.
http://www.mozilla.org/
Ever since i migrated to Unix and subsequently to the flavours of Linux, life has become so easy without the need for using my microsoft leg pad (a small leg pad having the three most important keys ==> Ctrl, Alt and Delete). The first open source freeware i fell in love with is Firefox. A review called it "Best of 2003", no doubt.
FIREFOX is a free alternative web browser that is faster, safer and easier to use than Microsoft Internet Explorer. Recent security exploits make Internet Explorer unsafe. Reduce the risk of viruses, worms, spyware and other malicious software by switching to the most customizable and secure browser in the world! Enjoy features such as tabbed browsing, a popup blocker, built in search and a feed reader (RSS) to keep up with the latest news headlines.
THUNDERBIRD is the perfect companion for Firefox, featuring one of the most advanced junk mail filters available. Both Firefox and Thunderbird can be easily customized for the way you browse the web and read your e-mail.
http://www.mozilla.org/
Subscribe to:
Posts (Atom)