Feb 01 2007

Bash Shell Tips

Catégorie : Tips and tricks, sysadmin, LinuxCharles Collier @ 10:51 pm

Native Windows users are reluctant to use Bash shell, even some linux geeks don’t know everything about the very useful shortcuts available in bash shell. But when you use all these shortcuts you can go very quickly ;-)

I’ve tried to compile all of them:
for example
$ Tab Tab –> press ‘$” then ‘Tab’ and another time ‘Tab’

Ctrl + r —> press at the same time ‘Ctrl’ key and ‘r’ key

special ones:

! - repeats the last command
! - execute the (num)th command in history

with TAB

Tab Tab - gives you all the main commands (eventually strating with )
/ Tab Tab - list complete directory structure
* Tab Tab - list directory without hidden one
~ Tab Tab - list users from /etc/passwd
$ Tab Tab - list the System variables
@ Tab Tab - list host(s) from /etc/hosts
= Tab Tab - list the content of a directory like ‘ls’

with CTRL Key

Ctrl + a - Jump to the beginning of the line
Ctrl + b - Move back one char
Ctrl + c - Interrupt the command
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward one char
Ctrl + h - Backspace
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen
Ctrl + n - Scroll next command line (read ctrl + p tips)
Ctrl + p - Scroll previous command line
Ctrl + r - Search the history backwards
Ctrl + R - Search the history backwards with multi-occurrence
Ctrl + t - Swap of the last two chars
Ctrl + u - Delete backward from cursor
Ctrl + w - Delete the last word
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions (the same like ‘@ Tab Tab’)
Ctrl + y - paste
Ctrl + z - Suspend/ Stop the command

with ALT Key

Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u - Make word uppercase
Alt + backspace - Delete the last word (like Ctrl + w)


Feb 01 2007

JBoss - open source J2EE application server

Catégorie : Jboss, Tutoriaux, LinuxCharles Collier @ 10:45 pm

* What is Jboss?
* Downloading Jboss
* Installing JBoss
-with command line
-with graphical mode
* Running JBoss
* Exploring the Directory Structure
* Configuration
* Deploying an application to JBoss
* Summary

JBoss is an open source J2EE application server. It is J2EE 1.4 spec-compliant, which means that it offers the same level of functionality as its more expensive commercial counterparts such as Oracle Application Server, Websphere (IBM) or Weblogic (BEA). The main difference is the price and to be honest the main admin interface.For example, an absolute beginner would find more comfortable to have a web interface to declare a jdbc datasource, instead of declaring it with “VI” editing an xml file. Considering the reliability of other open source products like Apache web server, Jboss should also become more popular and reliable, but it has already begun to become a serious competitor for the market leaders.

Although the term application server applies to all platforms, it has become heavily identified with the Sun Microsystems J2EE platform; we should always say Jboss is a J2EE application server

What is Jboss?

Go to the JBoss Application Server Downloads page. -> http://labs.jboss.com/portal/jbossas/download

Choose the latest production version of the JBoss Application Server package. (4.0.5 Production 2006-10-18) Since the 4.0.3 SP1 version, you can try a “Run Installer” http://jboss.sourceforge.net/jnlp/jems-installer-1.2.0.GA.jnlp or download it. You must have a X console or a graphical interface to use it.


Jan 23 2007

CV - Architecte technique - Administrateur Systeme Linux et Base de données

Catégorie : LinuxCharles Collier @ 12:38 am

Mon CV est de nouveau à jour et disponible: http://cv.nuxora.com/

Architecte technique
Administrateur Systeme Linux
DBA Oracle
Administrateur Web et serveur J2EE (Jboss et OAS - Oracle application Server)
Chef de projet


Jan 22 2007

Enterprise Linux - Graphic Install

Catégorie : Oracle, LinuxCharles Collier @ 10:41 pm

This post explains how to perform an Oracle Enterprise Linux, using the graphical, mouse-based installation program (from the CD-ROM)

Enterprise Linux Install 1

Lire la suite de “Enterprise Linux - Graphic Install”


Jan 22 2007

vi - tips

Catégorie : LinuxCharles Collier @ 12:28 am

# searching
/joe/e : cursor set to End of match
/joe/e+1 : cursor set to End of match plus 1
/joe/s-2 : cursor set to Start of match minus 2
/^joe.*fred.*bill/ : normal
/^[A-J]\+/ : search for lines beginning with one or more A-J
/begin\_.*end : search over possible multiple lines
/fred\_s*joe/i : any whitespace including newline
/fred\|joe : Search for FRED OR JOE
/\([^0-9]\|^\)%.*% : Search for absence of a digit or beginning of line
/.*fred\&.*joe : Search for FRED AND JOE in any ORDER!
/\/i : search for fred but not alfred or frederick
/\<\d\d\d\d\> : Search for exactly 4 digit numbers
/\D\d\d\d\d\D : Search for exactly 4 digit numbers
/\<\d\{4}\> : same thing
# finding empty lines
/^\n\{3} : find 3 empty lines
# Specify what you are NOT searching for (vowels)
/\c\v([^aeiou]&\a){4} : search for 4 consecutive consanants
# using rexexp memory in a search
/\(fred\).*\(joe\).*\2.*\1
# Repeating the Regexp (rather than what the Regexp finds)
/^\([^,]*,\)\{8}
# visual searching
:vmap // y/” : search for visually highlighted text
:vmap // y/=escape(@”, ‘\\/.*$^~[]’) : with spec chars
# searching over multiple lines \_ means including newline
/ : search for multiple line comments
/fred\_s*joe/i : any whitespace including newline
/bugs\(\_.\)*bunny : bugs followed by bunny anywhere in file
:h \_ : help
# search for declaration of subroutine/function under cursor
:nmap gx yiw/^\(sub\function\)\s\+”
# multiple file search
:bufdo /searchstr
:argdo /searchstr
# How to search for a URL without backslashing
?http://www.vim.org/ : search BACKWARDS!!! clever huh!
—————————————-
#substitution
:%s/fred/joe/igc : general substitute command
:%s/\r//g : Delete DOS returns ^M
# Is your Text File jumbled onto one line? use following
:%s/\r/\r/g : Turn DOS returns ^M into real returns
:%s= *$== : delete end of line blanks
:%s= \+$== : Same thing
:%s#\s*\r\?$## : Clean both trailing spaces AND DOS returns
:%s#\s*\r*$## : same thing
# deleting empty lines
:%s/^\n\{3}// : delete blocks of 3 empty lines
:%s/^\n\+/\r/ : compressing empty lines
# IF YOU ONLY WANT TO KNOW ONE THING
:’a,’bg/fred/s/dick/joe/igc : VERY USEFUL
# duplicating columns
:%s= [^ ]\+$=&&= : duplicate end column
:%s= \f\+$=&&= : same thing
:%s= \S\+$=&& : usually the same
# memory
:s/\(.*\):\(.*\)/\2 : \1/ : reverse fields separated by :
:%s/^\(.*\)\n\1/\1$/ : delete duplicate lines
# non-greedy matching \{-}
:%s/^.\{-}pdf/new.pdf/ : delete to 1st pdf only
# use of optional atom \?
:%s#\<[zy]\?tbl_[a-z_]\+\>#\L&#gc : lowercase with optional leading characters
# over possibly many lines
:%s/// : delete possibly multi-line comments
:help /\{-} : help non-greedy
# substitute using a register
:s/fred/a/g : sub “fred” with contents of register “a”
:s/fred/\=@a/g : better alternative as register not displayed
# multiple commands on one line
:%s/\f\+\.gif\>/\r&\r/g | v/\.gif$/d | %s/gif/jpg/
# ORing
:%s/suck\|buck/loopy/gc : ORing (must break pipe)
# Calling a VIM function
:s/__date__/\=strftime(”%c”)/ : insert datestring
# Working with Columns sub any str1 in col3
:%s:\(\(\w\+\s\+\)\{2}\)str1:\1str2:
# Swapping first & last column (4 columns)
:%s:\(\w\+\)\(.*\s\+\)\(\w\+\)$:\3\2\1:
# filter all form elements into paste register
:redir @*|sil exec ‘g#<\(input\|select\|textarea\|/\=form\)\>#p’|redir END
:nmap ,z :redir @*sil exec ‘g@<\(input\select\textarea\/\=form\)\>@p’redir END
# increment numbers by 6 on certain lines only
:g/loc\|function/s/\d/\=submatch(0)+6/
# better
:%s#txtdev\zs\d#\=submatch(0)+1#g
:h /\zs
# increment only numbers gg\d\d by 6 (another way)
:%s/\(gg\)\@<=\d\+/\=submatch(0)+6/
:h zero-width
# find replacement text, put in memory, then use \zs to simplify substitute
:%s/"\([^.]\+\).*\zsxx/\1/
# Pull word under cursor into LHS of a substitute
:nmap z :%s#\<=expand("")\>#
# Pull Visually Highlighted text into LHS of a substitute
:vmap z :%s/\<*\>/


Jan 22 2007

ultravnc - beginners

Catégorie : LinuxCharles Collier @ 12:27 am

Démarrer avec UltraVnc

Cette petite note explique le plus implement possible commen demarre avec UltraVnc

  • INSTALLATION

  • sur le premier pc ( celui dont on veut prendre le controle a distance )

    Installer UltraVNC
    Lancer UltraVnc Server, cet écran apparait, il suffit de rentrer le mot de passe et laisser les options par défaut.

    sur le second pc ( celui qui prendra le pc )

    Installer UltraVNC
    Lancer UltraVnc en mode client.

    Choisir les reglages comme ici:


  • CONFIGURATION ET CONNEXION

  • Il faut enfin juste autoriser sur le pc dont on va prendre le controle, le pc client a se connecter.

    Dans votre firewall favori, rajouter en zone Trusted ou de confiance , l’ip du pc client et vous pouvez limiter la connexion au port 5901, par exemple.

    Vous êtes maintenant connecté au PC.


    Jan 22 2007

    mkCDrec

    Catégorie : LinuxCharles Collier @ 12:14 am

    mkCDrec est un puissant outil de sauvegarde bootable. Il permet de réaliser une sauvegarde bootable sur un CD si le volum le permet ou sinon permet de graver sur un CD l’essentiel necessaire au boot du serveur lors de la restauration et de recuperer la sauvegarde via le réseau.

    Le programme permet également de faire un clone d’un disque.

    MkCDrec supporte ext2 , ext3, minix, xfs , jfs, reiserfs file systems, LVM et les RAIDS logiciels. Chaque filesystem est sauvegardé dans un tar.gz

    Pour restaurer un system : inserer le CD booter dessus et executer /etc/recovery/start-restore.sh mkCDrec va restaurer tout seul le serveur en recuperant les fichiers data de sauvegarde à l’endroit ou ils ont ete sauvegardés.

    La plupart des configurations matérielles actuelles sont supportées.

    Essayer le , décompresser dans un répertoire puis lancer maketest
    La configuration requiert l’installation de quelques RPMs qui ne sont pas toujours installés (bientôt disponible)

    Pour plus d’informations reporter au site d’origine mkcdrec.org


    Jan 22 2007

    RPM: Gestion des packages et de la base de données RPMs

    Catégorie : LinuxCharles Collier @ 12:11 am

    Installation

    rpm -i

    Mise a jour

    rpm -U

    Test avant installation des dépendances

    rpm -i –test titi-x.x.rpm

    //exemple de résultat possible:

    error: Failed dependencies:
    toto>= y.y is needed by titi-x.x

    Trier par date d’installation:

    rpm -qa –last

    Trier par taille

    rpm -qa –queryformat ‘%{name} %{size}\n’ | sort -n +1 | column -t

    Réparer une base RPM corrompue:

    Cele peut arriver dans différentes situations, allant jusqu’à bloquer les processus rpm: installation, mise à jour, … dû à un problème avec up2date ou rhn-applet (appli dans Gnome ou KDE) ou hn_check ou le prog. rpm.

    => solution:

    .1. tuer tous les processus rpm* rhn*

    ps -aux | grep rhn
    ps -aux | grep up2date
    ps -aux | grep rpm

    // puis faire un kill -9 des processus

    kill -9 XXXXX

    .2. effacer tous les fichiers lockés de la base rpm

    rm -rf /var/lib/rpm/__db*

    .3. Reconstruire la base de données RPM

    rpm –rebuilddb

    Ca prend plusieurs minutes et tout doit revenir à la normale.


    « Page précédentePage suivante »