linux poison RSS
linux poison Email
1

How to Restart a Unresponsive Linux System with Reisub

It may sometime happen that our Linux system hangs completely and the only option available is to shut down the system via the power button.

The power button to reboot could cause a problem if your hard drive is still being written to, and usually causes more problems than it solves. The Linux kernel includes a secret method of restarting your PC

 * Hold down the Alt and SysRq (Print Screen) keys.
 * While holding those down, type the following in order: REISUB
Alt + PrintScreen + r + s + e + i + u + b
 * With above key combination your frozen Linux system will go for a reboot.

Here is what the individual keys do in that sequence
R:Switch the keyboard from raw mode to XLATE mode
E:Send the SIGTERM signal to all processes except init
 I:Send the SIGKILL signal to all processes except init
S:Sync all mounted filesystems
U:Remount all mounted filesystems in read-only mode
B:Immediately reboot the system, without unmounting partitions or syncing
Read more
0

How To Setup Squid Proxy Server to use outgoing IP address

SQUID is a powerful and fast object cache server. It proxies FTP and WWW sessions making it relatively safe. Squid would be very hard to use to actually compromise the system and runs as a non root user (typically 'nobody'), so generally it's not much to worry about. Your main worry with Squid should be improper configuration. For example, if Squid is hooked up to your internal network (as is usually the case), and the internet (again, very common), it could actually be used to reach internal hosts (even if they are using non-routed IP addresses). Hence proper configuration of Squid is very important.

The simplest way to make sure this doesn't happen is to use Squid's internal configuration and only bind it to the internal interface(s), not letting the outside world attempt to use it as a proxy to get at your internal LAN. In addition to this, firewalling it is a good idea. Fortunately Squid has very good ACL's (Access Control Lists) built into the squid.conf file, allowing you to lock down access by names, IP’s, networks, time of day, actual day. Remember however that the more complicated an ACL is, the slower Squid will be to respond to requests.

Example where requests from 10.0.0.0/24 will be forwarded with source address 10.1.0.1,

10.0.2.0/24 forwarded with source address 10.1.0.2 and the rest will be forwarded with source address 10.1.0.3.

acl abc src 10.0.0.0/24
acl xyz 10.0.2.0/24


tcp_outgoing_address 10.1.0.1 abc
tcp_outgoing_address 10.1.0.2 xyz
tcp_outgoing_address 10.1.0.3

This will prevent anyone from using Squid to probe your internal network.
Read more
2

How to view the contents of an initrd image

Linux uses the initrd or initial ram-disk during the boot process. Linux kernel is very modular as you know. While the kernel main file contains only the most needed stuff, rest of the kernel, drivers included, reside in separate files – the kernel modules.

It would be impossible to create a single kernel binary image that would suit all the hardware configurations out there. Instead, kernel supports the initrd. initrd is a virtual file-system that contains drivers (kernel modules) needed to boot the system. For instance, very often a SCSI controllers drivers reside inside of the initrd. Kernel needs a SCSI controller driver to boot the operating system, but it does not include it, nor it can read it from hard-disk (you’d need a driver for the hard-disk, right?). And this is when the initrd becomes very handy.

To extract the content of initrd file, use the following command:

gunzip < initrd-2.6.31.5-0.1-desktop | cpio -i --make-directories

Read more
3

Sharing Directory Content over HTTP using python "SimpleHTTPServer"

Hosting a web server and sharing the content among the users using Python is very simple. Any default installation of Python includes a module called SimpleHTTPServer. We can make use of this module to start python and host a web server on any port as we wish. Practically speaking this is very useful to share files inside your local network, implementing this tiny but hugely useful HTTP server is very simple, its just a single line command.

This serves files from the current directory and any of its subdirectories.  It assumes that all files are plain text files unless they have the extension ".html" in which case it assumes they are HTML files, The GET and HEAD requests are identical except that the HEAD request omits the actual contents of the file.

If you want to serve files from the current directory, just give following command on the shell prompt and open a browser at http://localhost:8080.
$ python -m SimpleHTTPServer 8080
If you have a cgi script located in /cgi-bin/myscript.py, you can test it by giving
$ python -m CGIHTTPServer
and going at http://localhost:8080/myscript.py

Notice that this will work for non-Python CGI scripts too!

The advantage of using CGIHTTPServer is that you will get the logs and the error messages in a shell window and not in a log file. This is of invaluable help during debugging.

The server ignores drive letters and relative path names (such as ‘..’). However, it does not implement any other access control mechanisms, so be careful how you use it.
Read more
0

Installing KDE 4.4 on openSuSe

On 9th February KDE announced the availability of the KDE Software Compilation 4.4, "Caikaku", bringing an innovative collection of applications to Free Software users. Major new technologies have been introduced, including social networking and online collaboration features, a new netbook-oriented interface and infrastructural innovations such as the KAuth authentication framework. According to KDE's bug-tracking system, 7293 bugs have been fixed and 1433 new feature requests were implemented.



KDE 4.4 Installation on openSuSe:
The KDE:KDE4:Factory:Desktop Build Service project offers currently KDE 4.x packages as they are under development for openSUSE 11.3. These are releases from the KDE project with openSUSE patches. They should be mostly usable, but have bugs

Click on one of these One Click Install files to install the required packages and optionally register the repository for future. If you get a message that dependencies cannot be resolved, follow the KDE/Upgrade instructions instead.

KDE 4.4 for openSUSE 11.2
KDE 4.4 for openSUSE 11.1
KDE 4.4 for openSUSE 11.0

Here are some screen-shot of my desktop running openSuSe 11.2 with KDE 4.4


Read more
Related Posts with Thumbnails