Display date-clock with simple bash command and while loop

Here is a simple example on how to display date/watch with simple bash command:

$ while true; do clear; date; sleep 1; done

List only hidden files with ls command

We all know how to list non-hidden and hidden files with ls command on shell. However I could not find out how to list only hidden files ( starting with “.” ) with only ls command. One, but not complete solution could by to using TAB key. For example ls . and pressing 2xTAB will [...]

Extract STDERR and redirect STDOUT to /dev/null with bash

I always keep forgetting this bash syntax redirection. This is because of my short memory and also because I do not use it often. In many cases we need to remove a STDERR from the command output and keep only STDOUT. On the other hand there are times that we want to see STDERR and [...]

Lost screen resolution after restart with ubuntu and nvidia

I have been using my current kubuntu installation for many months already and I never had a problem with my nvidia driver settings except today. From no apparent reason I have started my linux box and my default and maximum resolution was 1024×768 instead my standard 1680×1050. I have tried reinstall envy packages, doing dpkg-reconfigure [...]

Recreating z25_persistent-net.rules file manually on debian

If from some reason you need to recreate networking udev z25 rules file you would use the following cammed to achieve that:
/lib/udev/write_net_rules all_interfaces
this will recreate a z25_persistent-net.rules and include all interfaces.

List all files and directories recursively but do not include full path

ls -R will list all files recursively. The output of such a command will produce a output containing not only a files but also full path the the each file or directory. One way to clean this output is to use grep and invert selection with -v option. Each path from ls -R command contains [...]

invalid byte sequence for encoding “UTF8″: 0×8b – storing binary data

This error message took me lots of effort and time to solve it. The problem is that before storing binary data strings in the postgresql database the binary strings need to be escaped before storing them. There is on the google available subroutine for per which is doing this job. It is called escape_bytea. Anyway [...]

vim – vi text editor tutorial

Here is a very nice vim / vi text editor tutorial for beginnes as well as for more advanced users. Its very easy to follow as it has flash video attached to every section. vi editor tutorial

Create and install linux debian package for missing perl module with dh-make-perl

Sometimes you encounter situation when you need a perl module to support your program but perl module is not available from standard linux repositories. Installing perl module from source code is not always good idea so what would be the best is to create package for a particular module using dh-make-perl command. In my case [...]

Get list of the installed packages from debian distributions for documentation

When documenting my server installation I needed to have a list of packages installed on my server. dpkg –get-selections is great help but it returns values/packages each on separate line including “installed” keyword. This command returns list of installed packages in the single block separated with single space:
dpkg –get-selections | awk ‘{ print $1; }’| [...]