How to execute commands when you log out .logout file – 2010-12-11 09:03:46-05
Introduction
I like all about automation, and who no?. How about automatically run
commands when you logout from a shell session in Linux.
You can use this to erase temp files you may have use during your
session, or anything you may want to execute each time you logout from
your Linux Operating system.
The .logout file
If you are using tcsh you can use the .logout file, where you can
write all the commands you want to be executed at logout…
Click the title to see the rest
Read more: http://l.g2lx.co/hjYPAr
setsid how to keep commands running after you exit shell prompt –
2010-12-11 12:33:02-05#
Introduction
If you need to run any program or command, and then leave the shell
session or ssh session, but be sure to leave the command running
behind you, then you can use setsid.
I know you are going to mention screen and nohup, and yes they are
maybe better options, but setsid is another option.
setsid creates a new session id for the command you run using it, so
it does not deppend on your shell session, therefore if that shell
session…
Click the title to see the rest
Read more: http://l.g2lx.co/fEvHNb
Which runlevel am I in | Linux – 2010-12-12 10:28:00-05
Introduction
Linux’s runlevels are:
From Wikipedia:
The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six; though up to ten, from zero to nine, may be used.
Depending on your distribution runlevels may differ
Whick runlevel am I in?
So, to find out which runlevel are you In just…
Click the title to see the rest
Read more: http://l.g2lx.co/dKsHXW
How to stop / disable ping response in Linux – 2010-12-12 16:52:40-05
Introduction
Ping is really useful, when you want to diagnose a network, to be sure
you are able to reach a given computer, the good thing about ping is
that it lets you know that both ways uplink and downlink are working.
Ping works by sending a package from the originating computer to the
receiving one, once it reach the receiving computer, that “computer”
(better call it device), respond with a similar message.
That way you are…
Click the title to see the rest
Read more: http://l.g2lx.co/e4ossV
How to encrypt text files with vi or vim in Linux – 2010-12-13 08:09:39-05
Introduction
We all sometimes needs to encrypt files, but if you are just
encrypting text files, there are easier options. One of them is vi or
vim.
I’m a fan of vim and it is my favorite text editor, it can encrypt
files, check spelling, etc.
We’ll now learn how to encrypt files using vim or vi.
How to encrypt text files with vim/vi
Encrypt a file using Linux vi / vim, is easy just use the -x option
when you create the file.
vim…
Click the title to see the rest
Read more: http://l.g2lx.co/eAnoF3
How to debug shell scripts – 2010-12-15 14:35:44-05
Introduction
Debugging is an important part of programming in any language, and so
it is the same for Bash, one of the most easy way to debug is to run
the program line by line.
This way you can check what is happening with each line, and you can
then find where is the error.
Debugging shell scripts
If you are using bash, you can debug using this command
bash -x
This way bash will print each line and then execute it, this…
Click the title to see the rest
Read more: http://l.g2lx.co/i5A9O4
How to compile from sources in Ubuntu or Debian – 2010-12-16 20:07:03-05
Introduction
There are times when you need to compile software from sources, maybe
because you need to compile the package with some specific option that
is not enabled in the default package.
Do that in Debian is really easy.
Compile software from sources in Debian
Fetch the dependencies
The first thing you need, is to be sure that your Linux has all
dependencies installed, so run:
apt-get update
Then,
apt-get build-dep htop
I’m…
Click the title to see the rest
Read more: http://l.g2lx.co/gElazW