Building packages is a task that every system administrator will end up doing. Most of the time this is not a very interesting task but someone has to do it, right? Normally you will end up modifying and tweaking based on your own needs an existing package that was built by the maintainers of the Linux distribution that you are using. In time you might even become familiar with the packaging system you are using (rpm, deb, etc.) and you will be able to write a spec file and start from scratch and build a new package if you need to. Still, this process is complicated and requires a lot of work.
Luckily, Jordan Sissel has built a tool called FPM (Effing Package Management), exactly for this: to ease the pain of building new packages; packages that you will use for your own infrastructure and you want them customized based on your own needs; and you don’t care about upstream rules and standards and other limitations when building such packages. This can be very useful for people deploying their own applications as rpms (or debs) and can simplify a lot of the process of building those packages.
FPM can be easily installed on your build system using rubygems:
gem install fpm
Once installed you can use fpm to build packages (targets):
from any of the following sources:
- directory (of compiled source of some application)
- gem
- python eggs
- rpm
- node npm packages
Read the rest of this entry »
Tags: deb, debian_packages, FPM, rpm, Tools
iotop does for I/O usage what top does for CPU usage. It watches I/O usage information output by the Linux kernel (requires 2.6.20 or later) and displays a table of current I/O usage by processes on the system. This tool is written by Guillaume Chazarain and requires Python >= 2.5 and a Linux kernel >= 2.6.20 to run. This post introduces this very useful tool and shows how we can install it and use it.
iotop can be downloaded either as source package or a rpm package. Starting with lenny, debian includes iotop in the main repository and it can be installed just as simple as running:
aptitude install iotopThis is very cool indeed and kudos to the debian team to include iotop in lenny 
Read the rest of this entry »
Tags: iotop, Tools, vmstat
We all know and love vmstat, but wouldn’t it be nice to get such information on a per process basis, to be able to better understand what is causing i/o problems? This is exactly what iopp, written by Mark Wong and released as open source does:
“It’s a custom tool to go through the Linux process table to get i/o statistics per process. It is open source and can be downloaded from: http://git.postgresql.org/?p=~markwkm/iopp.git;a=summary“
Now this sounds interesting, and I am sure anyone that has dealt with i/o issues in the past will probably find this very useful. Let’s see how we can install it and what kind of reporting we get. We will install this from source and here are some quick steps to do this (you will need git and cmake for this):
git clone git://git.postgresql.org/git/~markwkm/iopp.git
cd iopp
cmake CMakeLists.txt
make
Read the rest of this entry »
Tags: iopp, Tools, vmstat
For various reasons, I have to look from time to time at one particular IP and try to find out some information about it. Until I have found out about geoiplookup, this was something like: nslookup to get the reverse of the IP, and then whois to find out more details (maybe also traceroute/mtr, etc.). But now I will always start with geoiplookup as it instantly shows me the location (read country) of the respective IP.
Read the rest of this entry »
Tags: country-database, geoip, mtr, nslookup, Tools, traceroute, whois
Installing lshw on a Debian system is very easy since it is packaged and can be found in the official debian repositories:
http://packages.debian.org/lshw
Installation:
aptitude install lshw
That’s it… You might want to return to the main article on lshw.
Tags: Debian, install, Tools
There are many situations when you will need regular users to have more privileges than the normal user account they have. What situations? This will depend very much on a case by case basis but believe me there will be such cases… For example if a regular user needs to run a program that will change some some protected folder or file, or just a special root command (like shutdown for example).
What can be done in such situations? Well this depends: if you can go around it by assigning proper file/folder permission then this is great. But if not:
- you can give them the root password and place them in the group allowed to ‘su’ and you are done. I never liked this option as it will allow them to do anything on the system, and this is not what we were trying to achieve.
- you can use a program like sudo, to fine tune the proper commands that you will allow the user to run. This is more likely what I would do in this situation…
So the magical solution to this problem is sudo (superuser do), a program that allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root or another user. And all the commands will be logged for your reference.
The installation, in case you don’t already have sudo on the system, is very simple, but in case you want it you can check out some simple details about installing sudo on Debian, or Rhel, Fedora, Centos, and some details about the configuration files location and default state.
Read the rest of this entry »
Tags: Security, shell, sudo, Tools
If you are using RHEL (any version of Redhat from what I know, but if I am wrong please let me know) Fedora or Centos, you don’t have to do anything special. sudo is installed by default and you will already have it on the system.
Read the rest of this entry »
Tags: Centos, Fedora, install, redhat, RHEL, sudo, Tools
In case you don’t have sudo installed already the installation is very simple as it is part of the official debian package repository:
http://packages.qa.debian.org/s/sudo.html
Read the rest of this entry »
Tags: Debian, install, sudo, Tools
Even if the Debian package system works extremely well, after running a system and keeping it updated for some longer time, there will remain some orphaned packages. What I am interested is to clean up the remaining orphaned libraries that are no longer in use.
This is exactly what the deborphan package does. From its description:
“deborphan finds “orphaned” packages on your system. It determines which packages have no other packages depending on their installation, and shows you a list of these packages. It is most useful when finding libraries, but it can be used on packages in all sections.”
Just install it:
aptitude install deborphan
Normally I use it by simply typing:
deborphan
and this will show a list of the libraries that are obsolete and then I clean them using aptitude with purge. I prefer to use it like this, because it will give me the control on future actions (it will only report the orphaned packages without taking any action). If I choose, I can remove, if not they can stay.
There are many other options that can be used (just check the man page or help for full usage). Read the rest of this entry »
Tags: Debian, deborphan, Tools
Well this is the first tool I would install on any new server. What is MC? It is a text-mode full-screen file manager. It uses a two panel interface and a subshell for command execution. It includes an internal editor with syntax highlighting and an internal viewer with support for binary files. Also included is Virtual Filesystem (VFS), that allows files on remote systems (e.g. FTP, SSH, SMB servers) and files inside archives to be manipulated like real files.
Even if I consider that MC should be installed by default on any system, for some reason, not all the distributions install it by default. In fact some don’t provide a package for it at all… Here I will show you how easy it can be installed.
Debian
As any debian package this is very easy to install. Just use:
aptitude install mc
and you are all set.
RHEL4/Centos4
We can install MC with up2date as long as it is available in the packages (as it is for rhel4, cetos4):
up2date mc
Fedora
If you don’t have up2date, we can use yum to retrieve the package:
yum install mc
Others
You can always install it from sources on any linux distribution. Still I would prefer to have it in the package system that will provide the advantage of automatically updates. Anyway if anyone is interested on details on how this can be done, just let me know.
On some older distributions like RHEL3 for example the MC package is missing.
Update 20060605: In case you are looking on how to install MC on RHEL3, please see this post: “Install Mc (Midnight Commander) on RHEL3/Centos3″.
Tags: Linux, mc, Tools