Posts Tagged ‘Linux’

vnstat

Thursday, November 18th, 2010

vnStat is a wonderful tool that will allow you to grab traffic information from you network interfaces.

From its homepage…

vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won’t actually be sniffing any traffic and also ensures light use of system resources. However, in Linux at least a 2.2 series kernel is required.

(more…)

Debian GNU/Linux 5.0 released

Sunday, February 15th, 2009

From the Debian Project site:

This release includes numerous updated software packages, such as the K Desktop Environment 3.5.10 (KDE), an updated version of the GNOME desktop environment 2.22.2, the Xfce 4.4.2 desktop environment, LXDE 0.3.2.1, the GNUstep desktop 7.3, X.Org 7.3, OpenOffice.org 2.4.1, GIMP 2.4.7, Iceweasel 3.0.6 (an unbranded version of Mozilla Firefox), Icedove 2.0.0.19 (an unbranded version of Mozilla Thunderbird), PostgreSQL 8.3.6, MySQL 5.0.51a, GNU Compiler Collection 4.3.2, Linux kernel version 2.6.26, Apache 2.2.9, Samba 3.2.5, Python 2.5.2 and 2.4.6, Perl 5.10.0, PHP 5.2.6, Asterisk 1.4.21.2, Emacs 22, Inkscape 0.46, Nagios 3.06, Xen Hypervisor 3.2.1 (dom0 as well as domU support), OpenJDK 6b11, and more than 23,000 other ready-to-use software packages (built from over 12,000 source packages).

With the integration of X.Org 7.3 the X server autoconfigures itself with most hardware. Newly introduced packages allow the full support of NTFS filesystems and the use of most multimedia keys out of the box. Support for Adobe® Flash® format files is available via the swfdec or Gnash plugins. Overall improvements for notebooks have been introduced, such as out of the box support of CPU frequency scaling. For leisure time several new games have been added, including puzzle games as well as first-person shooters. Also notable is the introduction of “goplay”, a graphical games browser offering filters, search, screenshots and descriptions for games in Debian.

The availability and updates of OpenJDK, GNU Java compiler, GNU Java bytecode interpreter, Classpath and other free versions of Sun’s Java technology, into Debian GNU/Linux 5.0 allow us to ship Java-based applications in Debian’s “main” repository.

Further improvements in system security include the installation of available security updates before the first reboot by the Debian Installer, the reduction of setuid root binaries and open ports in the standard installation, and the use of GCC hardening features in the builds of several security-critical packages. Various applications have specific improvements, too. PHP for example is now built with the Suhosin hardening patch.

For non-native English speaking users the package management systems now support translated package descriptions and will automatically show the description of a package in the native language of the user, if available.

More info can be found here.

15th birthday of the Debian project

Saturday, August 16th, 2008

On 16 August 1993 Ian Murdock issued the first announcement of the Debian Project on comp.os.linux.development. Since then Debian has established itself as one of the most stable Linux distros and commited to the FOSS.

More info:

Is Linux less costly for web infrastructure than Solaris a myth?

Wednesday, April 30th, 2008

This is an interesting point of view of Robin Goldfarb, a blogger from Sun’s blog hub. He points out why he and others from Sun consider Solaris to be less costly than Linux. Check it out!

Debian: record boot messages

Sunday, April 6th, 2008

Debian allows you to record boot messages by means of the bootlogd daemon. According to man pages:

Bootlogd runs in the background and copies all strings sent to the /dev/console device to a logfile. If the logfile is not accessible, the messages will be kept in memory until it is.

This feature is not enabled by default. Edit /etc/default/bootlogd and modify it to enable recording of boot messages:

# Run bootlogd at startup ?
BOOTLOGD_ENABLE=Yes

Now bootlogd will start sending boot messages to /var/log/boot.

Debian apt-file

Sunday, January 27th, 2008

According to man pages:

apt-file is a command line tool for searching packages for the APT packaging system.

So let’s proceed:

apt-get install apt-file

apt-file update

The first command will install apt-file and the second command will fetch the content of the packages from the repositories specified in /etc/apt/sources.list and will resynchronize the contents from the sources.

Now give it a try:

apt-file -v search /usr/sbin/postfix

D: got ‘deb http://192.168.1.2:9999/debian/ etch main contrib non-free’
D: kept ‘deb http://192.168.1.2:9999/debian/ etch main contrib non-free’
D: regexp: ^(.*?usr/sbin/postfix[^s]*)s+(S+)s*$
D: Search in /var/cache/apt/apt-file/192.168.1 .2_debian_dists_etch_Contents-i386.gz

postfix: usr/sbin/postfix
postfix-policyd: usr/sbin/postfix-policyd
postfix-policyd: usr/sbin/postfix-policyd-cleanup

Note that you can get similar information by typing this:

dpkg -S /usr/sbin/postfix

postfix: /usr/sbin/postfix

The difference, however, is that apt-file provides information even if the package is not installed or was uninstalled.

Linux: skip or force fsck on reboot

Tuesday, April 11th, 2006

shutdown is the typical way to bring your system down in a Unix environment. It takes care of notifying logged in users that the system is going down, takes care of sending SIGTERM to processes and more.

One interesting feature of shutdown is the ability to force or skip the check and repair of the filesystem after a reboot. This is done by two flags that could be passed to the command. According to the man pages:

The -f flag means 'reboot fast'. This only creates an advisory file /fastboot which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide not to run fsck(1) since the system has been shut down in the proper way. After that, the boot process should remove /fastboot.

The -F flag means 'force fsck'. This only creates an advisory file /forcefsck which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide to run fsck(1) with a special 'force' flag so that even properly unmounted file systems get checked. After that, the boot process should remove /forcefsck.

Package management in Debian

Friday, February 24th, 2006

I use Debian since a while and i must say that i consider that it is the simpler distribution that i know. Well you can ever become some difficulties to install some drivers from proprietary stuff or new brand hardware but once you have your system running, believe me it is the simplest for maintaining, installing and removing in your system. And dpkg/apt are not least in the last assumption.

The first front-end at which you will stick is dselect, which is a menu based program.

I will not be extended with it because it is simple. What you need to know is that you can update the list of available packages with update, you can select which of them you will install with select. In this option, you go out of the help (going out of the help is the more tricky part) with the space bar (ubuntu like i thing it is with “enter”).

You can look for a package named for example firebird tipping “/fire” (without quote), and it will look for the first in the list named fire-something package and typing “n” you go through this list. Of course it is better typping “firebird”. If you want to select for installing you tip “+” (“-” for deinstalling) and dselect present you the list of conflicting, recommended … packages that you can choose with the same +- method (you go out of the list by typing enter). Once you’re satisfied, you tip “enter” and it go through the install process.

dselect is easy, not always the more flexible but the more secure and stable you can dream about. But let me present you the second soft of the debian classical tools collection: DPKG.

dpkg is a command line based tool. You can save the list of the installed packages on your system with:

dpkg –get-selections > selections.dpkg

Don’t be so shy and edit this text file. If you want to recover the state of your package selections you type:

dpkg –set-selections (no description available)
pn lynx-cur-wrapp (no description available)
un lynx-ssl (no description available)

and if you wish to know all the files that install or simply modify the installation of a package:

dpkg -L lynx

/.
/usr
/usr/bin
/usr/bin/lynx.stable
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/lynx.1.gz

/etc
/etc/lynx.cfg

You want the information on a package (lynx for example)?

dpkg -p lynx

Package: lynx
Priority: optional
Section: web
Installed-Size: 4292
Maintainer: James Troup
Architecture: i386

Description: Text-mode WWW Browser
Lynx is a fully-featured World Wide Web (WWW) client for users
running cursor-addressable, character-cell display devices (e.g.,

That is what a look at /var/lib/dpkg/available will give you after a painful search.

The status of the package can be found with:

dpkg -s lynx

Imagine that you find a strange file in you system (bad news…), and you want to make sure which package it comes from:

dpkg -S /etc/lynx.cfg

lynx: /etc/lynx.cfg

And you can run again the pre-installation process thanks to:

dpkg-reconfigure xserver-xfree86

It will replay the pre/post install script at wich you can take a look at /var/lib/dpkg/info/. For example, we had in my company a problem with bacula director’s instalation because there was a mistake in /var/lib/dpkg/info/bacula-director-mysql.postinst. We had this faultly line:

MYSQL_PSWD_STRING=”-p”$MYSQL_ROOT_PASSWORD”"

So the given root password was never the one bacula use to connect to mysql as root, we had to transform in:

MYSQL_PSWD_STRING=”-p $MYSQL_ROOT_PASSWORD”

(without the escaped quote)

Of course we have tried to reach the packager. But that’s not all folks. Now comes the bestpart: <i>apt</i>. You do not have to download the lynx_2.8.5-sarge1_i386.deb and after install with dpkg -i. No! Just lauch your branded 16k modem to become the line up and type:

apt-get install lynx

You have heard about a new security update, retrieve it with…

apt-get update

Same effect as…

dselect upgrade

…with:

apt-get upgrade

If you wish to look into the code:

apt-get source lynx

And all the magic stuff is controlled through /etc/apt/sources.list.

deb file:///cdrom/ sarge main
deb http://ftp.de.debian.org/debian/ sarge main non-free contrib
deb-src http://ftp.de.debian.org/debian/ sarge main non-free contrib
deb http://security.debian.org/ sarge/updates main contrib non-free

Or better with a mirror:

deb http://ftp.rediris.es/debian/ stable main non-free contrib
deb-src http://ftp.rediris.es/debian/ stable main non-free contrib

Or the best, an apt-proxy which proxies your downloads (karkoma, will you write an apt-proxy article, don’t you?):

deb http://aptserv.dmz:9999/debian/ sarge main non-free contrib
deb-src http://aptserv.dmz:9999/debian sarge main non-free contrib
deb http://aptserv.dmz:9999/debian-volatile sarge/volatile main
deb http://aptserv.dmz:9999/security/ sarge/updates main contrib non-free

Note the debian-volatile: this is for the highly upgraded packages like clamav, dcc,…

Another file that can be quite useful is /etc/apt/apt.conf. For example if you have an http proxy for going out in internet you will add in this file:

Acquire::http::Proxy “http://proxy.yourcompany:3128″;;

Or you can simply set the http_proxy=http://proxy.yourcompany:3128 in your environment). In the precedent case of the apt-proxy, if you have an http_proxy and of course you don’t want to proxy your apt-proxy you can control it by adding in this file:

Acquire
{
http
{
Proxy::no_proxy=comm.dmz;
}
}

Or add no_proxy=http://aptserv.dmz:9999 in your environment). Note that you have two syntaxes (the first one is the old one and the second one is the new). Don’t be confused with upgrade and update: update is when the source-list has been changed to synchronize the list of the mirrors and upgrade is to synchronize the list of the new availables packages.

One good tool in case of problems with apt is apt-config. dump> will dump for you your configuration with all the parameters (the defaults too):

$ apt-config dump
APT “”;
APT::Architecture “i386″;
APT::Build-Essential “”;

DPkg::Pre-Install-Pkgs:: “/usr/sbin/dpkg-preconfigure –apt || true”;
Acquire “”;
Acquire::http “”;

Caution! When you upgrade to a new distribution of debian (it occurs once every two years more or less, that could be the only criticism of debian), change your source-list, perform an apt-get update, an apt-get upgrade and after that an apt-get dist-upgrade.

One last word. Comes aptitude, a new tool (there is a lot of graphical tools that i don’t know…). but for sarge it seems to me that the old ones do a better works (i must take a closer look…).

Enjoy Debian without moderation…

Debian deborphan

Wednesday, February 8th, 2006

As you install packages in your Debian system it is possible that you end up with a bunch of packages that are not needed. These are orphaned packages, packages that are not required by another package. To handle this situation you have the deborphan utility. From the man pages:

deborphan finds packages that have no packages depending on them. The default operation is to search only within the libs and oldlibs sections to hunt down unused libraries.

To install deborphan proceed as usual:

apt-get install deborphan

Now to see orphaned packages simply type…

deborphan

Note that it will not remove the packages listed, it will simply list packages that should be removed. If you want to definitely remove the package…

deborphan | xargs apt-get –purge remove -y

An advice: be carefull to first check what packages are to be removed to avoid potential mistakes of deborphan. For more information take a look at man pages.