Archive for 2004

GRUB: menu options selection

Tuesday, April 20th, 2004

If you are at…

grub> root ([TAB]

Type “(” + TAB keys and this will give you the options that can be in this option place. The same goes for…

grub> setup ([TAB]

Transfer data or login from Windows to Linux machine

Tuesday, April 20th, 2004

If you want to transfer files from Windows to Linux machines you can use the pscp utility. Other related utilities can be found on this page . Here you will also find the putty utility that can be used to login to Linux machines and create ssh tunnels.

Usefull screen command

Monday, April 19th, 2004
  1. if you are doing installation on remote machine through ssh, there may be a chance that your ssh connection break up and your installation terminates, to avoid this problem after doing ssh to host run #screen and do your installation work.
  2. if you want to download/long compilation, and then exit from ssh connection without termination download/compilation you can do:

screen -S your_screen_name

Now start downloading/compilation. To exit without teminating download/compile session press CTRL+A then D, it will only detach you from screen. Now after that you want to check the status you do:

screen -x

choose the screen name you gave above:

screen -x your_screen_name

Editing remote files with OpenSSH

Sunday, April 18th, 2004

As you know, the main feature of OpenSSH is to establish secure connections to remote machines, so you get interactive sessions against them. However, OpenSSH also allows you to execute commands on remote machines. You can execute commands and have the output returned to the screen without logging in to the remote machine.

To execute a command remotely simply type:

ssh user@remote_host ‘ls -al /etc’

However, some commands require a terminal to run properly. For example, if you want to edit a remote file using vi you probably will try something like this:

ssh user@remote_host ‘vi /etc/passwd’

And you’ll get warnings like this:

Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal

To avoid such warnings and cleanly edit your remote files type the following:

ssh -t user@remote_host ‘vi /etc/passwd’

The -t option will… (from OpenSSH man pages)

Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

Listing bash variables

Saturday, April 17th, 2004

If you want to quickly see the environment variables defined in bash, simply type the following in the prompt:

$<TAB><TAB>

Type $ and then hit the TAB key twice.

Other useful commands to see these variables are:

export

or…

export | cut -d ‘ ‘ -f 3-

or…

set | less

Auto logout

Wednesday, April 14th, 2004

The bash shell provides an environmet variable that allows you to control the maximum number of seconds it will wait to automatically logout.

For example try to set the TMOUT environment variable to an integer value and login to your system. Once you are logged in, bash will wait for input the time specified by this environment variable. If the time is exceeded, the shell exits.

(more…)

What is Unix

Saturday, March 27th, 2004

Unix is a multiuser, multitasking operating system. It is the glue that holds together the various parts of a computer: memory, processor, disks, etc. Unix by itself is not a single operating system but a term that includes dozens of different implementations commonly referred to as Unix flavors.

Unix was designed to provide simple and flexible, yet powerful tools to perform a wide variety of tasks.

Basically a Unix operating system is made up by three pieces:

  • The kernel is the core (the heart) of the system that sits in memory and controls computer resources.
  • The shell that interacts with the user and the kernel. Interprets and executes commands.
  • The applications that run on top of the shell.

Unable to boot a Solaris box

Saturday, March 27th, 2004

A few days ago one of my Solaris box’s filesystem got full of space so I was unable to get the system working properly and I was unable to boot it. This tip will show you how I got rid of this issue.

First of all insert the Solaris installation CD-ROM and boot your machine. Then press STOP-a and type the following in the prompt:

boot cdrom -s

After a few minutes you’ll get a prompt where you could start your job. In my case I did the following to free some space:

mount /dev/c0t0d0s0 /mount_point
find /mount_point -size +1000000 | sort -nr | more

Once you’ve done…

reboot

Note that this tip is also valid in other circumstances where you are unable to boot your system.

Monitoring Apache activity

Wednesday, March 24th, 2004

The Apache mod_status module provides useful information to find out the activity and performance of the HTTP daemon.

To watch the activity of your Apache webserver edit httpd.conf or apache2.conf or whatever is named in your environment and add the following:

(more…)

Gentoo and rc.local

Wednesday, March 17th, 2004

Most GNU/LInux distros have an initialization script called rc.local. This script will be executed after all other init scripts, I mean, it will be run by the system at the end of the boot process . This will allow you to add certain programs so they can be executed at boot time after all system services are started.

Gentoo Linux does not provide such a file. Instead we have an equivalent script called /etc/conf.d/local.start where you can put all your initialization stuff. Even more, Gentoo provides an /etc/conf.d/local.stop where you can place… guess what?