Complete Dose of Linux Poison

Monday, July 13, 2009

Getting System Information (OpenSuSe) - phpSysInfo

phpSysInfo is a PHP script that displays information about the host being accessed.
It will displays things like Uptime, CPU, Memory, SCSI, IDE, PCI, Ethernet, Floppy, and Video Information.

Why I need the phpSysinfo?, Like the description above. I need to know everything about the server with one click and the important is I could check them with the browser. So, now the phpSysinfo is the best choice.

Installation:
Download phpSysInfo - here

Extract the package and copy it to the web server directory

# tar -zxvf phpSysInfo-3.0-RC8.tar.gz
# cp -r phpsysinfo /srv/www/htdocs/phpsysinfo
Rename the config.php.new to config.php (inside phpsysinfo directory)
# mv config.php.new config.php
Now go to browser and access the "index.php" from within phpSysInfo directory and you should see something like ...

Sunday, July 12, 2009

Squid Authentication using RADIUS

Radius is a server for remote user authentication and accounting. Its primary use is for Internet Service Providers, though it may as well be used on any network that needs a centralized authentication and/or accounting service for its workstations.

In this article I wont go into detail about installation and configuration of RADIUS or Squid server and will assume that both are installed and configure properly.

Download the squid authenticating module -- Here.
Unpack it and compile it

# tar -zxvf squid_radius_auth-1.10.tar.gz
# cd squid_radius_auth-1.10/
# make
You will get a squid_radius_auth executable that you can move to a safe place. It needs a config file, squid_radius_auth that should contain the name of the RADIUS server and the secret:
    server radius_server
    secret secret_phrase
Now, configure Squid to use RADIUS server for Authentication, open your squid.conf file and find and replace the auth section with following ...
    auth_param basic program /path_to_auth/squid_radius_auth
    auth_param basic children 5
    auth_param basic realm Please enter your domain credentials
    auth_param basic credentialsttl 8 hours
Next you have to condition Squid to allow only authenticated users. In the following example users that are in the local LAN are allowed without logging in but users that don't show up in the local users file (localusers) are asked to login:
    acl passwd proxy_auth
    acl localusers src "/etc/squid/localusers"

    http_access allow localusers
    http_access allow all passwd
    http_access allow all
You'll also have a log of who and when logged on to use the web services on the RADIUS server's logs.

SQL client and front-end for multiple database- crunchyfrog

CrunchyFrog is a SQL client and schema browser mainly (but not solely) for the GNOME desktop. It's written in Python (PyGTK) and licensed under the GNU General Public License v3.

Features
    * Supports various databases (PostreSQL, MySQL, SQLite, Oracle, SQLServer, Firebird, Informix, MaxDB).
    * Lightweight user interface for daily tasks.
    * SQL editor with syntax highlighting, auto completion and SQL formatting.
    * Export results to CSV and OpenOffice.
    * Inspect database objects.
    * Supports multiple database connections at once (e.g. for switching between development and production environments).

Ubuntu / Debian:
To install CrunchyFrog add the following lines to /etc/apt/source.list:

deb http://ppa.launchpad.net/crunchyfrog/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/crunchyfrog/ppa/ubuntu jaunty main

Replace "jaunty" with "intrepid" or "karmic" if you're running Intrepid or karmic.

To import the repositories GPG key:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 266d5f41c7f166d8

Finally to install CrunchyFrog run:
sudo aptitude update
sudo aptitude install crunchyfrog crunchyfrog-gnome

Saturday, July 11, 2009

Limit the CPU usage of an application (process) - cpulimit

cpulimit is a simple program that attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.

Installation:
Download last stable version of cpulimit
Then extract the source and compile with make:

    tar zxf cpulimit-xxx.tar.gz
    cd cpulimit-xxx
    make

Executable file name is cpulimit. You may want to copy it in /usr/bin.

Usage:
Limit the process 'bigloop' by executable name to 40% CPU:

    cpulimit --exe bigloop --limit 40
    cpulimit --exe /usr/local/bin/bigloop --limit 40

Limit a process by PID to 55% CPU:

    cpulimit --pid 2960 --limit 55

cpulimit should run at least with the same user running the controlled process. But it is much better if you run cpulimit as root, in order to have a higher priority and a more precise control.

Note:
If your machine has one processor you can limit the percentage from 0% to 100%, which means that if you set for example 50%, your process cannot use more than 500 ms of cpu time for each second. But if your machine has four processors, percentage may vary from 0% to 400%, so setting the limit to 200% means to use no more than half of the available power. In any case, the percentage is the same of what you see when you run top.

Tuesday, July 7, 2009

Windows "Screen Of Death" now on Linux (GDM Theme)

Here is fantastic GDM Theme based on the famous M$ Screen Of Death.


Download "Screen Of Death" GDM

Linuxpoison Archive

Add to Technorati Favorites http://www.wikio.com Software Computers blogs TopOfBlogs Unix-Linux Blogs Computers (Software) - TOP.ORG Computer Software Blog Directory Computer Blogs - Blog Catalog Blog Directory Blog Flux Directory Technology Blogs - Blog Rankings

Copying and distribution of the articles is permitted in any medium as long as the author and source are quoted.
E-mail contact: njauhari@cybage.com
All trademarks are the property of their respective owners.