Java applet that displays time.
Welcome on Jérôme Boismartel home page
Version française English version
Home
Home Page
My C.V.s
French C.V.
English C.V.
SysAdmin corner
Tips and tricks
Java Programs
L280 Configuration
4900Z and Linux
Barcode generation
Date conversion
Unix Scripts
Unix Monitoring
Progress Monitoring
Alarm System
My pictures
Baby pictures
-------------
England
France
Taiwan
Haiti
My links
Ressources

Few unix commands which might be usefull...
AIX Mailing list :

https://new-lists.princeton.edu/listserv/aix-l.html

Solaris : Disable root login from tty

vi /etc/default/login
#console=/dev/console -> console=/dev/console

Unarchive files

zcat ./archive.tar.Z | tar xvf -
gzcat ./archive.tar.gz | tar xvf -
gunzip inf_sign archive.tar.gz | tar xvf -

Solaris : Display current run level

who -r
run level S Jan 17 12:13 S 1 3
S is the current run level. 1 is the number of times at run level S since last reboot. 3 is the previous run level.

Find files belonging to a user and delete them

find / -user 1015 -print
find / -user 1015 -exec rm -f {} \;

Solaris : remote backup

rsh myremotehost mt -f /dev/rmt/0 rewind
rsh myremotehost mt -f /dev/rmt/0cn fsf 5 : cn means Compression No rewind. fsf 5 will go the the 5th backup
ufsrestore bivf 128 myremotehost:/dev/rmt/0 : will restore files from the tape in myremotehost to the current dir. Then we use some commands : add, extract and quit.

rsh between 2 hosts

if mycomputer needs to send rsh command to myserver with root user :
Log to myserver and perform the following tasks :
create /.rhosts and add hostname "mycomputer"
edit /etc/hosts and add hostname ip -> "mycomputer 111.222.333.444"

See which version of file we're using

which filename
/dir1/dir2/filename

AIX : Show tape drive config

lscfg -vl rmt0
mt -f /dev/rmt0 status

Sendmail : send a test message

sendmail -v username "minus sign"/dev/null

Display process info

Linux : ps -eo "%p %P %y %U %C %c %x %z" | sort +4 -r | more
Solaris : ps -A -o pid,fname,user,pcpu,rss,vsz,etime,ppid,comm,s
Solaris : ps -A -o pid=PID -o user=OWNER -o etime=STARTED -o s=STATE ....

AIX : Which fileset is not up to date

oslevel -l 4.3.3.0

vi : replacing all instances of textA with testB

:g/textA/s//textB/g

Date : playing with format

date -> 24 08 2000
date "+%s" -> 967140091
date -d '1970-01-01 967140091 sec' "+%d %m %Y" -> 24 08 2000

SAMBA

Mounting an NT share on a linux box :
mount -t smbfs -o username=myNTusername,password=myNTpassword, uid=myUNIXusername,gid=myUNIXgroup //myNTserver/directory /mnt/mymountpoint

AWK : traitement conditionnel

cat myfile.txt | awk'{if (match($1,/^F/)) {print $6} else {print $3} fi}'

CPIO : moving directory from one server to another

umask 000
rcmd myremotesystem "cd /mydirectory find . -depth -mount -print | cpio -ocvB" cpio -icvBdum

AWK : Dos to Unix text file

Awk '{sub("\r$",""); print}' dosfile.txt > unixfile.txt
awk 'sub("$","\r")' unixfile.txt > dosfile.txt

FTP : multiple get

ftp>prompt
ftp>mget *

SCO : backup

find /directory -print | cpio -ocv > /dev/rStp0

SCO : kill

kill `ps -u reuters | grep Freutserv | awk '{print $1}'`

Commandes VI :

Removing all blank characters at beginning of all lines
:g/^ */s///g
page down
<CTRL>F
Infos sur le fichier et la position du curseur
<CTRL>G
substitution de TOTO par TITI
:g/TOTO/s//TITI/g
Affichage des numeros de ligne
:set number
Masquer les numeros de ligne
:set nonumber
inserer avant la position courante du curseur
i
inserer apres la position courante du curseur
a
inserer au debut de la ligne courante
I

Renaming all files in dir :

let index=1;for i in `ls photo*`
do
  if [[ $index -lt 10 ]] then
    cp $i Pictures00$index.jpg
  else
    if [[ $index -lt 100 ]] then
      cp $i Pictures0$index.jpg
    else
      cp $i Pictures$index.jpg
    fi
  fi
let index=index+1
done

Opened window on Montréal
To contact me...
My prefered email address is jerome.boismartel@gmail.com.
St-Malo time
Java applet that displays time.
Kaohsiung time
Java applet that displays time.
Samoa time
Java applet that displays time.