Create Linux user with password

Sometimes it’s necessary to create Linux user accounts in batch mode (fully automatic) but often newbies ask how to set password for a new user without entering it manually. Thanks to heaven command useradd can get password as an input parameter, but it should be encrypted. In other words, to create Linux user account with password the following command will be useful: useradd -m -p encryptedPass username I know at least two ways to get password encrypted. The first one is to use perl crypt(); … Read more

Ping range of IP addresses in parallel with fping

fping is a program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up. fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying one host until it timeouts or replies, fping will send out a ping packet and move on to the next host in a round-robin fashion. If a host replies, it is noted … Read more

Get changelog information from RPM and DEB package

Here is a nice Linux tip: to get change information of some RPM package it’s enough to execute the following command rpm -q –changelog package for example rpm -q –changelog openssh will output something like: * Fri Mar 03 2006 Tomas Mraz <[email protected]> – 4.3p2-4 – allow access if audit is not compiled in kernel (#183243)</[email protected]> * Sat Feb 25 2006 Tomas Mraz <[email protected]> – 4.3p2-3 – enable the subprocess in chroot to send messages to system log – sshd should prevent login if audit … Read more

Nokia E-series sync with Evolution via Bluetooth in Ubuntu

nokiaThe Nokia E-series consists of business-oriented smartphones, with emphasis on support for corporate e-mail. Currently Nokia e-series includes: E60, E61, E70, E50, E61i, E65, E90.

This is a howto (provided by Nailor) shows how to sync Nokia E-series phone (Symbian 9.1, Series60 3rd edition) with Gnome Evolution in Ubuntu Edgy Eft (6.10) and Feisty Fawn (7.04). This has been tested with Nokia E50. Information on how to sync Nokia E65 is available here. Kubuntu users may be interested in this.

Read more

Web server oneliner with bash

It’s amazing but it’s possible to write little web server on bash shell script. Here is it’s source code: :;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed ‘s/[^a-z0-9_.-]//gi’`;h=”HTTP/1.0″;o=”$h 200 OK\r\n”;c=”Content”;if [ -z $f ];then($e $o;ls|(while $r n;do if [ -f “$n” ]; then $e “`ls -gh $n`”;fi;done););elif [ -f $f ];then $e “$o$c-Type: `file -ib $f`\n$c-Length: `stat -c%s $f`”;$e;cat $f;else $e -e “$h 404 Not Found\n\n404\n”;fi)’;done You can download it here. Just … Read more

Find out where Unix/Linux executable binary is located

There are two commands that may help you to find where executable binary is located regardless it’s Unix or Linux system. They are whereis and type. First locates source/binary and manuals sections for specified files and second tells what exactly shell executes when you type a certain command. The next picture shows examples of these commands work.

Vmware Server at Ubuntu Feisty 7.04

This step-by-step manual provides instructions on how to install freely available VMWare Server at Ubuntu Feisty Fawn Linux (7.04). First of all download installation package here and get free serial code. To get VMWare Server working at Ubuntu 7.04 I recommend to download this patch. To make sure there are all necessary tools installed to get VMWare Server running, execute: sudo aptitude install linux-headers-`uname -r` build-essentia xinetd After it’s done unpack installation package and patch: tar -xvzf VMware-server-1.0.3-44356.tar.gz tar -xvzf vmware-any-any-update109.tar.gz Then: cd vmware-server-distrib ./ … Read more

Access to sqlite3 database through perl (script example)

By publishing this post I try to help people who want to get access to popular and simple database engine sqlite through perl script. I use sqlite to store e-mails statistics at small mail server in order to retrieve information about users’ mail activity like average response time, sent and received messages and etc. There is perl script that is used to get this data per every user or get summary statistics. This script is to be run by web server (I use Apache) and … Read more

Move linux to another hard drive (dump, restore, backup)

There are several methods to move running Linux to another hard drive at the same server. But I used Unix dump/restore utility to perform this… First of all it’s necessary to partition new hard drive in the same way as it’s done with old drive (Linux is running at). I usually use ‘fdisk’ utility. Let’s assume that old drive is /dev/hda and new one is /dev/hdb. To view hda’s partition table please run ‘fdisk -l /dev/hda’ which should show something like this: Disk /dev/hda: 60.0 … Read more