jeudi 28 juillet 2011

FTP Shell

ftp -v <<EOF
open <Nom_Machine_Distante>
lcd <local directory>
cd <remote directory>
put fichier
close
quit
EOF

mardi 5 juillet 2011

PHP - Zend Tutorial

Un lien vers z-f qui propose des modules Zend à mettre en oeuvre pour se faire la main. De nombreuses explications, des actuces pour mieux appréhender ce framework pas évident à cerner.

http://www.z-f.fr/page/comment_debuter

Enjoy !

PHP - Zend Process

http://www.kitpages.fr/cms/site/tutoriaux/sequence_globale.jpg

WINDOWS - Création d'un fichier taille voulue

Création d'un fichier de taille voulue

fsutil file createnew c:\fichier100Mo.txt 104857600

UNIX - Liste des librairies chargées par le système

Liste des shared lib chargée par le système

genkld | more

    Text address     Size File

        d521c100    3b379 /usr/lib/libptools.a[shr.o]
        d52e5080    299b6 /usr/lib/libtrace.a[shr.o]
        d51c4000    57a43 /usr/lib/security/ssha
        d4e74100     36d9 /usr/lib/liberrlog.a[shr.o]
        d5184100    3f781 /usr/lib/libpcap.a[shr.o]
        d517f000     4075 /appli/AppServer/bin/libibmaio.so
        d2491000      bc5 /appli//AppServer/bin/libgetClasses.so
        d4e72000     1b98 /appli//AppServer/bin/libSystemData.so
        d5174000     a640 /appli//AppServer/java/jre/bin/libnio.a
        d5153000    20e84 /appli//AppServer/java/jre/bin/libj9shr23.so
        d47c0000     9bd3 /appli/AppServer/bin/libWs60ProcessManagement.so
        d5135000    1d8fc /appli/AppServer/java/jre/bin/libnet.a
        d511f000    154da /appli/AppServer/java/jre/bin/libzip.a
        d50fe000    20edd /appli/AppServer/java/jre/bin/libj9ute23.so
        d50eb000    12357 /appli/AppServer/java/jre/bin/libiverel23.so
        d5088000    62a78 /appli/AppServer/java/jre/bin/libjclscar_23.so
        d5064000    23c53 /appli/AppServer/java/jre/bin/libj9vrb23.so
        d5034000    2ffa3 /appli/AppServer/java/jre/bin/libj9jvmti23.so
        d5007000    2cf32 /appli/AppServer/java/jre/bin/libj9dyn23.so
        d4f78000    8e349 /appli/AppServer/java/jre/bin/libj9gc23.so
        d4f61000    1641e /appli/AppServer/java/jre/bin/libj9bcv23.so
        d5563000   486ffc /appli/AppServer/java/jre/bin/libj9jit23.so
        d4f50000    10155 /appli/AppServer/java/jre/bin/libj9trc23.so
        d4f28000    278ca /appli/AppServer/java/jre/bin/libj9dmp23.so
        d4e62000     f118 /appli/AppServer/java/jre/bin/libj9zlib23.so
        d478b000    328f1 /appli/AppServer/java/jre/bin/libjava.a
        d47be000     1b6f /appli/AppServer/java/jre/bin/libwrappers.a
        d4e7e000    67a42 /appli//AppServer/java/jre/bin/libj9vm23.so

UNIX - Dump d'une librairie partagée

Dump d'une librarie Partagée

dump -Tv /HTTPServer/lib/libexpat.a

/HTTPServer/lib/libexpat.a[libexpat.so.0]:

                        ***Loader Section***

                        ***Loader Symbol Table Information***
[Index]      Value      Scn     IMEX Sclass   Type           IMPid Name

[0]     0x00000000    undef      IMP     UA EXTref   libc.a(shr.o) _system_configuration
[1]     0x00000000    undef      IMP     DS EXTref   libc.a(shr.o) free
[2]     0x00000000    undef      IMP     DS EXTref   libc.a(shr.o) malloc
[3]     0x00000000    undef      IMP     DS EXTref   libc.a(shr.o) realloc
[4]     0x00000000    undef      IMP     DS EXTref   libc.a(shr.o) memcmp
[5]     0x20003ae8    .data      EXP     DS SECdef        [noIMid] XML_ExpatVersionInfo
[6]     0x20003e84    .data      EXP     DS SECdef        [noIMid] XmlInitEncodingNS
[7]     0x20003e90    .data      EXP     DS SECdef        [noIMid] XmlInitEncoding
[8]     0x20003e9c    .data      EXP     DS SECdef        [noIMid] XmlParseXmlDeclNS
[9]     0x20003ea8    .data      EXP     DS SECdef        [noIMid] XmlParseXmlDecl
[10]    0x2000416c    .data      EXP     DS SECdef        [noIMid] XmlInitUnknownEncodingNS
[11]    0x20004178    .data      EXP     DS SECdef        [noIMid] XmlInitUnknownEncoding
[12]    0x20004184    .data      EXP     DS SECdef        [noIMid] XML_ExpatVersion
[13]    0x20004190    .data      EXP     DS SECdef        [noIMid] XML_ErrorString
[14]    0x2000419c    .data      EXP     DS SECdef        [noIMid] XML_ParserFree
[15]    0x200041a8    .data      EXP     DS SECdef        [noIMid] XML_GetInputContext
[16]    0x200041b4    .data      EXP     DS SECdef        [noIMid] XML_GetCurrentByteCount
[17]    0x200041c0    .data      EXP     DS SECdef        [noIMid] XML_GetCurrentByteIndex
[18]    0x200041cc    .data      EXP     DS SECdef        [noIMid] XML_GetCurrentColumnNumber

UNIX - Liste des librairies chargées par un process

Liste des librairies chargées par un process

procmap 1138840
1138840 : /HTTPServer/bin/httpd -f /HTTPServer/conf/admin.c
10000000               359K  read/exec         httpd
3000052b                27K  read/write        httpd
d2860000                46K  read/exec        /HTTPServer/modules/mod_ibm_admin.so
30058000                 2K  read/write        /HTTPServer/modules/mod_ibm_admin.so
d2239000                21K  read/exec         /HTTPServer/modules/mod_log_config.so
f0f1dcf4                 1K  read/write        /HTTPServer/modules/mod_log_config.so
d2242000                 7K  read/exec         /HTTPServer/modules/mod_setenvif.so
f0f2165f                 0K  read/write        /HTTPServer/modules/mod_setenvif.so
d2258000                 4K  read/exec         /HTTPServer/modules/mod_dir.so
f0f25a71                 0K  read/write        /HTTPServer/modules/mod_dir.so
d222c000                 6K  read/exec         /HTTPServer/modules/mod_auth.so
f0f1b174                 0K  read/write        /HTTPServer/modules/mod_auth.so
d222a000                 5K  read/exec         /HTTPServer/modules/mod_access.so
f0f19fa6                 0K  read/write        /HTTPServer/modules/mod_access.so
d2244000                14K  read/exec         /HTTPServer/modules/mod_mime.so
f0f22b52                 0K  read/write        /HTTPServer/modules/mod_mime.so
d225d000                 7K  read/exec         /HTTPServer/modules/mod_alias.so
f0f28530                 0K  read/write       /HTTPServer/modules/mod_alias.so
d08a7500               161K  read/exec         /usr/lib/libC.a[shrcore.o]
../..
f035a3d0               608K  read/write        /usr/lib/libnsl.a[shr.o]
d2123000               191K  read/exec         /HTTPServer/lib/libapr-0.so
f0f0f911                10K  read/write        /HTTPServer/lib/libapr-0.so
d20f6000               106K  read/exec         /HTTPServer/lib/libaprutil-0.so

SHELL - Formatage colonnes avec awk

Formatage en colonne avec un awk

cat <file> | grep \~ | awk '{ printf ("%5s %10s %3s\n"),$2,$4,$5 }'

UNIX - Trouver les processes actifs sur un port précis

Trouver les processus actif sur un port

    lsof -i:<Port> -P

    -P : permet d'afficher le numéro de port et pas l'alias (/etc/services)

FTP - Envoi fichier avec Hash

Envoyer 100 blocs de 1024Ko -> 100 Mo en FTP

ftp <host>

activer le Hash pour suivre les trames réseaux (cela permet de suivre le débit et voir s'il n'y a pas de coupure réseau pendant le transfert)

Lancer la commande:

put "|dd if=/dev/zero bs=1024k count=100" /dev/null

SHELL - Remplacement d'une chaine dans un fichier

Remplacement d'une chaine dans un fichier

mkdir tempo
mv * ./tempo/
for i in `ls ./tempo/*`                             
do                                                                                                 
    cat ./tempo/${i} | sed -e 's/<chaine_ini>/<chaine_dest>/g' > ${i}
done                                                                                               

lundi 4 juillet 2011

WAS - Document Reference

http://www-01.ibm.com/software/webservers/appserv/was/library/

AIX - Runqueue

La runQueue est la pile d'attente des threads destinés à être traités pas la CPU.
Le dispatcher se charge d'envoyer les threads vers les processeurs.

On considère que le niveau de runqueue toléré est à peu près égal à 2 fois le nombre de CPU disponible.
En deuxième lieu nous triendrons compte des temps de réponse applicatifs.

Une extension de CPU peut permettre de réduire ce taux si le nombre moyen est trop élevé.

AIX - Réinitialiser les LED panneau avant

Réinitialisation du code LED sur la panneau frontal serveur

# /usr/lpp/diagnostics/bin/usysfault -s normal

SAN - Réduction timeOut on controller

Lorsqu'un contrôleur de fibre channel se fige, il peut rester en l'état assez longtemps.

On peut réduire le temps de bascule sur une archi redondée:

chdev -l fscsix -a fc_err_recov=fast_fail -P

AIX - Prise en compte modification réseau

Prise en compte modification réseaux

Pour qu'une modification réseaux soit prise en compte (sans reboot) il faut raffraîchir le process inetd.

Deux solution:

kill -1 <pid_inetd>             --> rechargement des fichiers de conf

refresh -s inetd                --> arrêt/relance du service (sans interruption)

AIX - Bascule 32 vers 64 bits

Modification séquence de boot AIX pour passage 32 ou 64 bits

ln -sf /usr/lib/boot/unix_mp /unix
ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
lslv -m hd5
bosboot -ad /dev/ipldevice
shutdown -Fr
bootinfo -K (should now be 32)


Pour info

unix_mp : multi processor (32bits)
unix_64 : 64 bits

AIX - Mémoire Système

Mémoire réellement occupée

vmstat|tail -1|awk '{print $3/256}'

Dump de l'occupation de la mémoire et des différents pool

Before reducing memory using DLPAR, use 'vmstat -v | grep pools' to determine the number of AIX memory pools. If the number of memory pools is greater than 1, use the mempool subcommand of the AIX kdb command (with echo "mempool *" | kdb) to display memory pools and the free pages within each pool:

telstar:/ # echo "mempool *" | kdb
[Some lines snipped.]
(0)> mempool *
                 VMP MEMP  NB_PAGES  FRAMESETS        NUMFRB           
F100080009740000  00  000   00795980  000 001 002 003 000379E4         
F100080009740380  00  001   007928E6  004 005 006 007 00024EF9         
F100080009740700  01  002   0023FD00  008 009 00A 00B 0000127A         
F100080009740A80  02  003   00201900  00C 00D 00E 00F 000010E5
(0)> quit
telstar:/ #

Occupation mémoire d'un process

root@echange_wbi:/etc >svmon -P 2756648

-------------------------------------------------------------------------------
     Pid Command          Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
 2756648 java             92269    65560        0    90123      N     Y     N

    Vsid      Esid Type Description              PSize  Inuse   Pin Pgsp Virtual
       0         0 work kernel segment (lgpg_vsid=0) L     16    16    0    16
   eb09d         d work text or shared-lib code seg  s   8839     0    0  8839
  319ee1         5 work working storage              s   8170     0    0  8170
  1c8e3b         3 work working storage              s   7384     0    0  7384
  1c09ba         - clnt /dev/icscp3iflv:12612        s    430     0    -     -
  3289e7         - clnt /dev/icscp3iflv:12802        s    284     0    -     -
  1209a6         - clnt /dev/icscp3iflv:12744        s    200     0    -     -
   7098c         - clnt /dev/icscp3iflv:12711        s    181     0    -     -
  3c88fb         - clnt /dev/hd2:103532              s    180     0    -     -
  2309c4         - clnt /dev/icscp3iflv:12718        s    168     0    -     -
   81612         f work working storage              s     81     0    0    81
  2209c6         - clnt /dev/icscp3iflv:12720        s     81     0    -     -
  351ce8         - work                              s     72    21    0    72
  3d88f9         - clnt /dev/hd2:103952              s     71     0    -     -
   89713         4 work working storage              s      0     0    0     0

AIX - Affichage long des processes actifs

Liste des processus sur 256 caractères

    ps -auxwww

AIX - Iptrace

startsrc -s iptrace -a "-a /tmp/iptrace.log"

stopsrc -s iptrace

AIX - Information Segment mémoire

Obtenir des infos sur un segment mémoire

On liste les segments mémoire avec la commande suivante :

root@machine:/home/root$ ipcs -mP|awk '/m/ {ligne=$0} /SID/ {print ligne" " $1}'
m   1179648 0x76003809 --rw-rw-rw-     root   system SID:0x2561
m    131073 0x76003810 --rw-rw-rw-     root   system SID:0x19007
m         2 0x0d097858 --rw-rw----     root   system SID:0x25a1
m         3 0xffffffff D-rw-------  suiveur    suivi SID:0x3865c
m    393220 0x0052e2c1 --rw-------  suiveur    suivi SID:0x2fc97
m         5 0xffffffff --rw-rw----     root   system SID:0x8c0
m   3145734 0x0000cace --rw-rw-rw-     root   system SID:0xd808
m   8126471 0xffffffff --rw-rw----     root   system SID:0x6ab

Soit la ligne suivante :

m         2 0x0d097858 --rw-rw----     root   system SID:0x25a1

On récupère le SID, ici 0x25a1, ensuite un svmon nous donnera plus d'infos :

root@machine:/home/root$ svmon -lS 0x25a1

    Vsid      Esid Type Description              PSize  Inuse   Pin Pgsp Virtual
    25a1         3 work shared memory segment        s      1     0    0     1
                   pid(s)=80434, 78606, 73892, 72518, 70314, 68498, 62240,
                   pid(s)=61728, 57886, 54110, 50450, 48752, 34464, 31384,
                   pid(s)=27290, 22746

AIX - Consommation mémoire

(echo $(vmstat|tail -1|awk '{print $3}')*4/1024)|bc

AIX - Configuration ntp

Déclarer un nouveau serveur NTP

dans le fichier /etc/ntp.conf

broadcastclient
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
server 158.156.35.20 # serveur ntp

Configuration du TimeZone

dans le fichier /etc/environment

TZ=NFT-1DFT,M3.5.0/02:00,M10.5.0/03:00
LANG=fr_FR

dlpar (TechnicalUser)     
25 May 04 11:28
I try to transform an AIX 5.1 64bits as my xntp server for all my AIXs but it's not working if i try to connect it on the Internet.

/etc/ntp.conf:
server  134.214.100.6 version 3 prefer
server  193.51.24.1  version 3
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace

firewall:
PORT 123 is open for my server

lssrc -ls xntpd
 Program name:    /usr/sbin/xntpd
 Version:         3
 Leap indicator:  11 (Leap indicator is insane.)
 Sys peer:        no peer, system is insane
 Sys stratum:     16
 Sys precision:   -18
 Debug/Tracing:   DISABLED
 Root distance:   0.000000
 Root dispersion: 0.000000
 Reference ID:    no refid, system is insane
 Reference time:  no reftime, system is insane
 Broadcast delay: 0.003906 (sec)
 Auth delay:      0.000122 (sec)
 System flags:    pll monitor filegen 
 System uptime:   1178 (sec)
 Clock stability: 0.000000 (sec)
 Clock frequency: 0.000000 (sec)
 Peer: 134.214.100.6
      flags: (configured)(preferred)
      stratum: 16, version: 3
      our mode: client, his mode: unspecified
 Peer: 193.54.82.20
      flags: (configured)
      stratum: 16, version: 3
      our mode: client, his mode: unspecified
 Peer: 193.51.24.1
      flags: (configured)
      stratum: 16, version: 3
      our mode: client, his mode: unspecified
Subsystem         Group            PID     Status
 xntpd            tcpip            1441892   active


ntpq -p                                                                   
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
 134.214.100.6   0.0.0.0         16 -    -   64    0     0.00    0.000 16000.0
 193.51.24.1     0.0.0.0         16 -    -   64    0     0.00    0.000 16000.0
 193.54.82.20    0.0.0.0         16 -    -   64    0     0.00    0.000 16000.0

ntpdate -d  193.51.24.1  
                                                     
25 May 17:18:44 ntpdate[745486]: 3.4y
transmit(193.51.24.1)
receive(193.51.24.1)
transmit(193.51.24.1)
receive(193.51.24.1)
transmit(193.51.24.1)
receive(193.51.24.1)
transmit(193.51.24.1)
receive(193.51.24.1)
transmit(193.51.24.1)
server 193.51.24.1, port 123
stratum 2, precision -20, leap 00, trust 000
refid [195.83.222.27], delay 0.03731, dispersion 0.00056
transmitted 4, in filter 4
reference time:      c45de27f.b1cf4623  Tue, May 25 2004 17:19:27.694
originate timestamp: c45de281.a13a604e  Tue, May 25 2004 17:19:29.629
transmit timestamp:  c45de254.c96a2000  Tue, May 25 2004 17:18:44.786
filter delay:  0.03888  0.03731  0.03775  0.03894
               0.00000  0.00000  0.00000  0.00000
filter offset: 44.83734 44.83692 44.83611 44.83633
               0.000000 0.000000 0.000000 0.000000
delay 0.03731, dispersion 0.00056
offset 44.836925

25 May 17:18:44 ntpdate[745486]: step time server 193.51.24.1 offset 44.836925 sec

ntpdate 193.51.24.1  
25 May 17:19:11 ntpdate[745488]: the NTP socket is in use, exiting

stopsrc -s xntpd + ntpdate 193.51.24.1  
ntpdate  193.51.24.1
25 May 17:20:59 ntpdate[1073200]: no server suitable for synchronization found

AIX - Changer la vitesse de Média

Contrôler la vitesse

lsattr -Rl ent0 -a media_speed

Modifier la vitesse

/usr/sbin/ifconfig en0 down detach
/usr/sbin/ifconfig et0 down detach 


/usr/sbin/chdev -l ent0 -a media_speed=Auto_Negotiation 
/usr/sbin/chdev -l en0 -a state=up
/usr/sbin/mkdev -l inet0

AIX - Affichage du bit mode

Affichage du Bit Mode

getconf -a | grep KERN

AIX - Compte système locké

chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s <user>
chuser "account_locked=false" <user>

AIX - Accéder console Partition Virtuelle (on VIO)

Accéder à une console d'une partition virtuelle
se logguer sur le VIO server
Récupérer le numéro de la partition virtuelle sur la console VIO

mkvt -id <id_partition>

SAN - Aix commandes

lscfg -vl fcsx (pour chaque carte fibre du serveur )             
=> récupérer le WWN des cartes

lscfg -pv | grep fcs0 . Fcs1
lsdev -C | grep 1742 (ou 1722 ou 3542 ou 3552 )              

=> liste les devices venant de la baie

fget_config -l darx (pour chaque dar detecté)                       
=> donne la relation entre les dars, dacs et hdisks

fget_config -Av                                                           
=> liste tous les DAR + numéro de LUN et LUN name....

lsattr -El dacx (pour chaque dac detecté )                       
=> permet de récupurer le S/N des contrôleur et donc la relation dac / ctrl

lsattr -El hdiskx (pour chaque hdisk venant de la baie)           
=> permet de récupérer le LUN id et IEEE Vol  de chaque hdisk donc la relation hdisks / logical drive

lsdev -Cc adapter | grep fcs                                        
=> permet de récupérer l'adresse PCI des cartes fibres

lsdev -C | grep <adresse PCI d'une carte FC>                     
=> permet de voir quel device est detecté par quelle carte

lslpp -l                                                                   
=> récupérer les filesets installés et leur niveau

PHP Shell

#!/usr/local/bin/php -q
<?php
    print("Hello, world!\n");
?>

NB : Le "-q" supprime les header http.

on recupere donc les paramètres dans $argv et $argc si register_argc_argv=on et dans
$_SERVER['argv'] et $_SERVER['argc']

PHP - Définir le niveau d'erreur

Positionner le niveau d'erreur au niveau de PHP

ini_set("error_reporting", E_ALL);
ini_set("display_errors","1"); // masque ou afficahe les  erreurs
ini_set("ignore_repeated_errors","0"); // evite la repetition des mm erreurs dans les logs
ini_set("log_errors", "0" ); // inscrit les erreurs dans un fichier log
ini_set("error_log",  "/php/lic/log/errors.log" ); // le chemin de ce fichier

PHP - Gestion des Exceptions

Gestion des exeptions

try {
    if(!@include('/path/to/file.php')) {
        throw new Exception('Failed to load blabla');
    }
}
catch(Exception $e) {
    print $e->getMessage();
}

DEV - TinyMCE exemple

<html>
<head>
<title>TinyMCE Test</title>
<script language="javascript" type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
</head>
<body>
<form method="post" action="response.php">
<textarea name="content" cols="50" rows="15">TinyMCE</textarea>
<input type="submit" value="Save" />
</form>
</body>
</html>

SENDMAIL - Envoi Mail

echo "test" | /usr/lib/sendmail -bm -t -v tester@domain.com

tester@domain.fr... Connecting to messagerie-domain.com via relay...
220 BSVX400076.re.cdc.fr Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at  Thu, 29 Jan 2009 17:03:20 +0100
>>> EHLO hostname.com
250-hostname.com  Hello [10.2.87.11]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
>>> MAIL From:<root@hostname.com> SIZE=5
250 2.1.0 root@hostname.com....Sender OK
>>> RCPT To:<tester@domain.com>
>>> DATA
250 2.1.5 tester@domain.com
354 Start mail input; end with <CRLF>.<CRLF>
>>> .
250 2.6.0  <200901291603.n0TG3KEM5156902@hostname.com> Queued mail for delivery
tester@domain.com... Sent ( <200901291603.n0TG3KEM5156902@hostname.com> Queued mail for delivery)
Closing connection to messagerie-domain.fr
>>> QUIT
221 2.0.0 messagerie-domain.fr Service closing transmission channel

Linux - LVM Structure

Un diagramme qui résume complètement la logique LVM


CRYPTO - Commandes de base OpenSSL

http://www.frpki.org/index.php?/openssl_base.html

CRYPTO - Afficher les informations d'un certificats #PKCS12

Afficher les informations d'un certificats PKCS12

openssl pkcs12 -in <ddr.p12> -info

Linux - Prob fstab au boot

En mode Single User, le / est monté en ReadOnly et ne permet pas de modification de la configuration sous /etc ... notamment dans fstab qui peut contenir une ligne bloquante lors de la phase de boot. Pour débloquer la situation, démonter et remonter le "/" en rw et permettre la mise à jour

mount -o remount,rw /

Linux - Definir un mot de passe One Shot

echo <passwd>   | passwd --stdin <username>

vendredi 1 juillet 2011

MOOTOOLS - AJax

var req=null;

window.addEvent('domready', function(){
   
    req = new Request.HTML({
        url: 'http://localhost/class/modules/resp.php',
        method:'get',
        evalScripts: true,
        evalResponse:true,
        onSuccess: function(html){ $('result').set('text', ''); $('result').adopt(html); },
        onFailure: function()     { $('result').set('text', 'The request failed.'); }
    });

    $('list').addEvent('click', function()    { req.send('action=list'); });
    $('update').addEvent('click', function(){ req.send('action=update'); });
    $('delete').addEvent('click', function(){ req.send('action=delete'); });
    $('detail').addEvent('click', function(){ req.send('action=detail'); });
});

MOOTOOLS - AJax

var req=null;

window.addEvent('domready', function(){
   
    req = new Request.HTML({
        url: 'http://localhost/class/modules/resp.php',
        method:'get',
        evalScripts: true,
        evalResponse:true,
        onSuccess: function(html){ $('result').set('text', ''); $('result').adopt(html); },
        onFailure: function()     { $('result').set('text', 'The request failed.'); }
    });

    $('list').addEvent('click', function()    { req.send('action=list'); });
    $('update').addEvent('click', function(){ req.send('action=update'); });
    $('delete').addEvent('click', function(){ req.send('action=delete'); });
    $('detail').addEvent('click', function(){ req.send('action=detail'); });
});

IBM - WebSphere license Public

https://www-112.ibm.com/software/howtobuy/buyingtools/paexpress/Express?P0=E1&part_number=D55W8LL,D55WJLL,D51JXLL,D55WQLL,D55WELL&catalogLocale=fr_FR&Locale=fr_FR&country=FRA&PT=html&S_TACT=none&S_CMP=none&brand=ws

IBM - WebSphere Support LifeCycle

http://www-01.ibm.com/software/websphere/support/lifecycle/

WebSphere Application Server    7.0.x    E    5724-J08    17 Oct 2008   
WebSphere Application Server    6.1.x    E    5724-J08    30 Jun 2006   
WebSphere Application Server    6.0.x    E    5724-J08    31 Dec 2004    30 Sep 2010
WebSphere Application Server    5.1.x    S    5630-A36    16 Jan 2004    26 Sep 2008
WebSphere Application Server    5.0.x    S    5630-A36    03 Jan 2003    30 Sep 2006

IBM - Service Pack

http://www-03.ibm.com/services/ca/fr/its/spacs.html

IBM - PVU Licensing

http://www-01.ibm.com/software/lotus/passportadvantage/pvu_licensing_for_customers.html

IBM - Configuration Tool

http://www-03.ibm.com/systems/x/hardware/configtools.html

JAVA - Afficher le header d'un exécutable Java

Afficher le header de l'exécutable Java

dump -X64 -H /usr/java5_64/jre/bin/java

/usr/java5_64/jre/bin/java:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x0000004d       0x000000c2       0x00000065

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000005       0x00001390       0x00000338       0x000013f5


                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER
0      /usr/lib:/lib
1                                    libc.a                      shr_64.o
2                                    libC.a                  shr_64.o
3                                    libpthreads.a          shr_xpg5_64.o
4                                    libiconv.a              shr4_64.o

CVS - Commandes

CVS commands are:
        add          Add a new file/directory to the repository
        admin        Administration front end for rcs
        annotate     Show last revision where each line was modified
        checkout     Checkout sources for editing
        commit       Check files into the repository
        diff         Show differences between revisions
        edit         Get ready to edit a watched file
        editors      See who is editing a watched file
        export       Export sources from CVS, similar to checkout
        history      Show repository access history
        import       Import sources into CVS, using vendor branches
        init         Create a CVS repository if it doesn't exist
        log          Print out history information for files
        login        Prompt for password for authenticating server
        logout       Removes entry in .cvspass for remote repository
        pserver      Password server mode
        rannotate    Show last revision where each line of module was modified
        rdiff        Create 'patch' format diffs between releases
        release      Indicate that a Module is no longer in use
        remove       Remove an entry from the repository
        rlog         Print out history information for a module
        rtag         Add a symbolic tag to a module
        server       Server mode
        status       Display status information on checked out files
        tag          Add a symbolic tag to checked out version of files
        unedit       Undo an edit command
        update       Bring work tree in sync with repository
        version      Show current CVS version(s)
        watch        Set watches
        watchers     See who is watching a file


cvs --help-options
CVS global options (specified before the command name) are:
    -H           Displays usage information for command.
    -Q           Cause CVS to be really quiet.
    -q           Cause CVS to be somewhat quiet.
    -r           Make checked-out files read-only.
    -w           Make checked-out files read-write (default).
    -n           Do not execute anything that will change the disk.
    -t           Show trace of program execution -- try with -n.
    -v           CVS version and copyright.
    -T tmpdir    Use 'tmpdir' for temporary files.
    -e editor    Use 'editor' for editing log information.
    -d CVS_root  Overrides $CVSROOT as the root of the CVS tree.
    -f           Do not use the ~/.cvsrc file.
    -z #         Use compression level '#' for net traffic.
    -a           Authenticate all net traffic.
    -s VAR=VAL   Set CVS user variable.
(Specify the --help option for a list of other help options)

CVS - Nouveau Projet

Création du module dans le référentiel

Création sous /users/cvs/cvsdata

cvs -d $repository init

Attention : $repository doit être le chemin complet (ex : /users/cvs/cvsdata/PROJECT)

Mise à jour du fichier password

lorsque le module est ajouté, un répertoire est /users/cvs/cvsdata/PROJECT et contient un répertoire CVSROOT.
Dans ce répertoire, récupérer un fichier passwd d'un autre module et le copie dans ce répertoire, il contient les users autorisé à
utiliser ce module.

testcvs::cvs
test1::cvs

Ajout d'un utilisateur avec lecture seule

Créer un fichier readers sous  /users/cvs/cvsdata/<PROJET>/CVSROOT et indiquer dans ce fichier les utilisateurs ayant ce privilège.

Mise à jour du fichier /etc/services

cvsPROJECT     60034/tcp      #serveur CVS /users/cvs/cvsdata/PROJECT

Mise à jour du fichier /etc/inetd.conf

cvsPROJECT stream tcp nowait root /usr/bin/cvs cvs --allow-root=/users/cvs/cvsdata/PROJECT pserver

CVS - Commandes Base

Ajouter les nouveaux fichiers

    cvs add *.sql

Ajouter les nouveaux fichiers dans le référentiel

    cvs commit -m 'comment' *.sql

Tagguer les nouveaux fichiers ajoutés

    cvs tag v00-00-00 *.sql


Contrôler la version d'un fichier

    cvs status -v <file_name>

Ajouter une nouvelle arborescence (Création module)

    cd /repository
    mkdir <new_module>
    cd <new_module>
    cvs import -m 'comment' <new_module> init start
    cd ..
    cvs co <new_module>
    cd <new_module>
    mkdir -p oracle/schema
    cvs add oracle
    cvs add oracle/schema

Restauration d'un schéma à une version donnée

    cvs update -r v00-00-00

Suppression d'une version ou d'un fichier

    cvs tag -d v00-00-00 <fichier>
   
Modifier la révision d'un fichier

    cvs update -j <after revision> -j <before revision> <file>
    cvs commit -m 'comment' <file>

TOMCAT - mod_jk & Serveur HTTP

Fichier de configuration qui mappe le serveur http vers les jvm

Ce fichier doit être contenu dans le HTTPD/conf et déclaré dans le fichier httpd.conf

Extrait httpd.conf

Ne pas oublier de compiler déposer ou compiler le module dynamique Tomcat sous ~/modules
../..
# LoadModule foo_module modules/mod_foo.so
LoadModule php5_module        modules/libphp5.so
LoadModule jk_module          modules/mod_jk-1.2.27-httpd-2.2.6.so

#
# Mod_jk settings
#
JkWorkersFile "/usr/product/apache/httpd-2.2.11/conf/workers.properties"
JkLogFile "/usr/product/apache/httpd-2.2.11/logs/mod_jk.log"
JkLogLevel debug
JkOptions +FlushPackets

Dans ce fichier on récupère le port ajp13 qui sera déclaré dans le fichier virtualhost ...

Extrait fichier Worker.properties

# workers.properties -
#
# This file provides jk derived plugins with the needed information to
# connect to the different tomcat workers.  Note that the distributed
# version of this file requires modification before it is usable by a
# plugin.
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something
#
# Normally all you will need to do is un-comment and modify the first three
# properties, i.e. workers.tomcat_home, workers.java_home and ps.
# Most of the configuration is derived from these.
#
# When you are done updating workers.tomcat_home, workers.java_home and ps
# you should have 5 workers configured:
#
# - An ajp12 worker that connects to localhost:8007
# - An ajp13 worker that connects to localhost:8009
# - An ajp13 worker that connects to localhost:8809
# - A jni inprocess worker.
# - A load balancer worker
#
# However by default the plugins will only use the ajp12 worker. To have
# the plugins use other workers you should modify the worker.list property.
#
#

# OPTIONS ( very important for jni mode )

#
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
workers.tomcat_home=/users/tomcat/apache-tomcat-5.5.25

#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/usr/java/jdk1.5.0_17

#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ DEFAULT worker list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
# Add 'inprocess' if you want JNI connector
worker.list=rjal,sjal,sjaladmin


#
#------ DEFAULT ajp13 WORKER DEFINITIONS -----------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.list=sjaladmin
worker.sjaladmin.port=8209
worker.sjaladmin.host=localhost
worker.sjaladmin.type=ajp13

worker.list=rjal
worker.rjal.port=8109
worker.rjal.host=localhost
worker.rjal.type=ajp13

worker.list=sjal
worker.sjal.port=8009
worker.sjal.host=localhost
worker.sjal.type=ajp13

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
# worker.itomcat.lbfactor=1

# worker.jtomcat.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.itomcat.cachesize

VI - Quelques commandes

Pas de retour chariot sur copier/coller

set nonoautoindent

Afficher les lignes

set nu

Supprimer toutes les lignes vides

g/^$/d

Supprimer le dernier caractère

1,$ s/.\{1\}$//g

WINDOWS - Générer un fichier de taille voulue

fsutil file createnew c:\fichier100Mo.txt 104857600

Firmware SAN

Dates de support IBM

Téléchargement des Firmware par modèle

Fix Level Recommandation Tool

Liste des derniers Releases AIX

JYTHON - Lister les modules d'une application

Lister les modules d'une application

print AdminApp.listModules('TraitementLog_V01R01C06');
TraitementLog_V01R01C06#TraitementLog_EJB.jar+META-INF/ejb-jar.xml

CFT - S_TCP already in use

Aller dans le répertoire ~/fildat et supprimer le fichier S_TCP (fichier socket)

HTTPD - Sécurisation IHM

Mise en place d'un fichier .htpasswd pour sécuriser l'accès à l'IHM

htpasswd -c <file_name> <login>



Définir dans le fichier .htaccess


AuthUserFile /HTTPServer/conf/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Required"
AuthType Basic
Require valid-user