1 min read

Unix Tips & Tricks

Unix Tips & Tricks

SWAP CONFIGURATION :
http://forum.sun.com/thread.jspa?threadID=25317&tstart=0
http://docs.sun.com/app/docs/doc/816-1048/6m7gaddij?a=view
/dev/dsk/c……….   –   –   swap   –   yes   – ds /etc/vfstab
swap -a /dev/dsk/c……
swap -l
swap -s
swap -d /dev/dsk/c0………

GESTION CENTRALISE PARC INFO LINUX/UNIX :
http://www.int-evry.fr/mci/user/doutrele/linux/
http://thierrylhomme.developpez.com/cfengine.html
http://www.int-evry.fr/mci/user/procacci/Doc/cfengine/cfengine.html
http://www.sysnav.com/index.php?id=49,85,0,0,1,0
http://www.sun.com/bigadmin/features/articles/cfengine_part1.html?feed=RSS
http://www.sun.com/bigadmin/features/articles/cfengine_part2.html?feed=RSS
www.cfengine.org
cfagent -qKv : reinstallation et check des conf sur le client

SSh A DISTANCE :
ssh Client " commande locale << cat /tmp/resultat "
ssh Client ls / > /tmp/1.test

RSYNC WEB :

http://www.delafond.org/traducmanfr/man/man1/rsync.1.html

ORACLE BASE DE DONNEES :
http://cyril-gruau.developpez.com/uml/tutoriel/ConceptionBD/
http://etudiant.univ-mlv.fr/~idernaul/projetbdd/index.html
http://www.ac-grenoble.fr/ecogest/pedago/administration/prodpeda/mcd.htm
http://osx.freshmeat.net/projects/tora/
http://gbriard.club.fr/technique/21.htm
http://www.puschitz.com/ : install fedora core 3 oracle 10
http://staff.in2.hr/denis/oracle/10g1install_fedora3_en.html
http://www.informatics.sussex.ac.uk/users/bernhard/db2003/datastudio.pdf
http://www.aquafold.com/downloads.html
http://download.oracle.com/otn/linux/oracle10g/ship.db.lnx32.cpio.gz
http://download.oracle.com/otn/nt/oracle10g/htmldb/htmldb_1.6.zip
http://www.oracletoolbox.org/
http://www.oracle-base.com/articles/9i/Oracle9iInstallationOnRedHatAS3.php
http://www.oracle-base.com/articles/10g/OracleDB10gInstallationOnFedora1.php
http://www.pagux.com/oracle9ionfedora3.html
http://www.oracle-base.com/articles/10g/OracleDB10gInstallationOnFedora3.php
http://www.aquafold.com/downloads.html

NMAP :
nmap IP_test -P0

 

EXPORT DISPLAY :
export DISPLAY="corail:0.0" : de la ou est lance le programme
bash-2.05$­­­­­­­­ xhost + :::: machine qui va initier le lancement

2 IPs ON ONE NETWORK :

http://www.adminschoice.com/discus/messages/1/172.html?1100850818
http://unix.ittoolbox.com/groups/groups.asp?v=SOLARIS-L&i=39259

LOGWATCH SWATCH :

http://home.gagme.com/greg/linux/protect-ssh.php#other

TRIPWIRE :

http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/ref-guide/ch-tripwire.html

MOUNT WINDOWS SHARE :

mount -F cifs //computername/share /mnt/somedirectory

TUNNEL SSH :

http://forum.hardware.fr/hardwarefr/OSAlternatifs/connecte-utilisant-connexion-httptunnel-sujet-41117-1.htm
ssh -R 10033:localhost:22 user@ip
10.5.216.84
ssh -X -p 10033 localhost

SIGNATURE ASCII, CADRES :

http://boxes.thomasjensen.com/
http://www.nog.net/~tony/warez/cowsay.shtml
figlet dag

HTACCESS EN URL :

parametre htaccess via url
oui index.htm vide : url via le site alo
http: //login:mdp@site/fichier

EQUIVALENCE : LINUX, WINDOWS :

http://bhami.com/rosetta.html
http://linuxshop.ru/linuxbegin/win-lin-soft-en/table.shtml

QUELQUES MOULINETTES :

for user in `ls`;do echo `ypcat passwd |grep $­­­­­­­­user |awk -F":" '{print $­­­­­­­­5}' |awk -F";" '{print $­­­­­­­­1}'`" – "`ypcat aliases |grep $­­­­­­­­user |uniq`;done

BITTORENT :

http://torrent.linux.duke.edu/

NAGIOS RRDTOOL MRTG :

http://martybugs.net/linux/hddtemp.cgi
http://dag.wieers.com/packages/nagios/
http://dag.wieers.com/packages/nagios/nagios-1.2-1.1.fc3.rf.i386.rpm
http://dag.wieers.com/packages/nagios/nagios-devel-1.2-1.1.fc3.rf.i386.rpm
http://www.supinfo-projects.com/fr/2004/monitoring_unix/2/
http://www.linagora.org/rubrique39.html
http://www.fedora-france.org/modules/newbb/viewtopic.php?topic_id=1023&forum=16
http://docs.guill.net/article.php3?id_article=2
http://www.linux-sottises.net/en_mrtg.php
http://www.joepverhaeg.nl/rrdtemp/
http://silverwraith.com/papers/freebsd-snmp.php
http://www.espace-groupware.com/supervision/nagios/
http://www-igm.univ-mlv.fr/~dr/XPOSE2004/nchaveron/Nagios.html
http://www.swelltech.com/support/webminguide/ch01.html
http://nagmin.sourceforge.net/
http://dag.wieers.com/packages/webmin/webmin-1.190-1.1.fc3.rf.noarch.rpm
http://nagiosplug.sourceforge.net/developer-guidelines.html
http://nagiosplug.sourceforge.net/
http://nagiosplug.sourceforge.net/projects/sourceforge.php
http://www.onlamp.com/pub/a/onlamp/2002/09/05/nagios.html
http://www.onlamp.com/pub/a/onlamp/2002/09/26/nagios.html PART 2
Nagios : ICMP, mailing list : NAGAT
http://www.nagios.org/download/extras.php
https://gna.org/projects/nagat/
livre nagios
http://docs.guill.net/article.php3?id_article=2
http://archil.nerim.net/nagios/index.html
http://archil.nerim.net/nagios/index.html
http://www.oreon.org/oreon.php?p=2
http://sf.gds.tuwien.ac.at/n/na/nagiostat/
http://linuxfr.org/~alenvers/13845.html
http://forums.cacti.net/about1843.html
http://www.nagiosexchange.org/Charts.42.0.html
http://www.hannes-schulz.de/?doc=proj&proj=nagios
http://apan.sourceforge.net/
http://sourceforge.net/projects/nagiosgraph/
http://www.nagiosexchange.org/Charts.42.0.html?&tx_netnagext_pi1[p_view]=195
http://nagios.sourceforge.net/docs/1_0/notifications.html
http://sourceforge.net/projects/nagiostat
http://people.via.ecp.fr/~alexis/formation-linux/centericq.html
http://www.int-evry.fr/mci/user/procacci/Doc/nagios/nagios.html
http://www.espace-groupware.com/supervision/nagios/
http://www-igm.univ-mlv.fr/~dr/XPOSE2004/nchaveron/Nagios.html
http://mathias-kettner.com/nagios_plugins.html : cacti et nagios
ttp://www.trustonme.net/didactels/191.html
http://www.cacti.net/downloads/docs/html/install_unix.html
http://esaracco.free.fr/Nagios/
création script nagios :
Ecrire des plugins
>> Nous avons vu qu’il était possible d’écrire ses propres plugins. Nous
>> avons tenté l’expérience, à partir de la commande nmap, pour détecter
>> le type d’OS tournant sur la machine testée.
>> Nous avons tout simplement repris un plugin de type
>> non-binaire,check_sensors, et nous l’avons adapté en changeant la
>> section spécifique au plugin. Nous l’avons remplacée par les quelques
>> lignes suivantes :
>> nmap -O $­­­­­­­­1>/usr/local/nagios/libexec/tmp
>> toto=`cat /usr/local/nagios/libexec/tmp|grep "linux"|wc -l`
>> if test "$­­­­­­­­toto" -ge 1; then
>>     $­­­­­­­­ECHO "OS=LINUXn"
>>     exitstatus=$­­­­­­­­STATE_OK
>> else
>>     toto=`cat /usr/local/nagios/libexec/tmp|grep "Windows"|wc -l`
>>     if test "$­­­­­­­­toto" -ge 1; then
>>         $­­­­­­­­ECHO "OS=WINDOWSn"
>>         exitstatus=$­­­­­­­­STATE_OK
>>     else
>>         $­­­­­­­­ECHO "OS INCONNUn"
>>         exitstatus=$­­­­­­­­STATE_OK
>>     fi
>> fi
>> rm /usr/local/nagios/libexec/tmp
>> Rem. En fait, la commande nmap -O IPaddress donne un certain nombre
>> d’informations concernant la machine, dont le type d’OS18. Comme vous
>> pouvez le constater, ce test simple, que nous avons appelé check_os ,
>> effectue un grep sur le résultat du nmap, de sorte à rechercher s’il
>> s’agit de Linux ou de Windows. Bien sûr, on pourrait l’étoffer pour
>> donner les versions d’OS, ou tester d’autres OS, mais là n’est pas
>> l’intérêt. Au final, nous disposons maintenant du plugin check_os, à
>> utiliser ainsi :
>> check_os IPaddress,
>> et qui va nous renvoyer dans la page des services de Nagios 3 valeurs
>> possibles : OS=LINUX, OS=WINDOWS ou OS INCONNU.
>> Cependant, cet exemple possède un inconvénient. En effet, la réponse
>> est loin d’être immédiate. En fait, dans le cas d’un OS Windows, on
>> observe un temps de réponse correct, de l’ordre de la seconde, mais
>> pour Linux, la commande nmap dure plusieurs secondes. Nous allons
>> maintenant voir un autre moyen, plus pratique et plus rapide de tester
>> l’OS. En outre, il va nous permettre de récupérer un certain nombre
>> d’informations complémentaires, notamment concernant le type de
>> machine (hardware).
check_load nagios : profile : export LANG=C

ICQ LIGNE DE COMMANDE ET ENVOI MESSAGE LIGNE DE COMMANDE :

http://konst.org.ua/centericq/

NFS :

http://ernest.cheska.net/index.php?fichier=nfs&status=loaddocumentation

MYSQL :

/usr/bin/mysqldump -u root -ppasswd -x -e -A > /data2/mysql_lookit.sql
mysql -u root -pmypwd < /tmp/backup/base1_table1.sql
http://www.debianworld.org/index.php?page=doc_backing_up_mysql
Changer le mot de passe d'un utilisateur
Se connecter en tant que root :
mysql -u root -p password
Puis exécuter les requêtes SQL suivantes :
USE mysql;
UPDATE user SET password=PASSWORD('toto') WHERE user='root';
FLUSH PRIVILEGES;

CRYPTAGE FICHIER :

http://www.ze-linux.org/howto.html?id_docs=19&version=mono
crypt pour XXX : gpg –batch –output 1.gpg -a -e -r Name
pub  1024D/8BCECB05 2005-04-22 Emmanuel (nsl3.dyndns.org) <nsl@free.fr>
>  Empreinte de la clé = XXXX XXXX XXXX XXXX XXXX XXXX ….
> sub  2048g/XDDKDKD 2005-04-22

GRAVER LIGNE DE COMMANDE :

http://www.gcolpart.com/howto/grav.php4
http://people.via.ecp.fr/~alexis/formation-linux/graver.html
http://callendor.zongo.be/wiki/GraverSousGnuLinux
effacer : cdrecord blank=fast dev=ATA:1,0,0
chercher graveur : cdrecord -scanbus
graver iso : cdrecord dev=ATAPI:1,0,0 -sao -v windows.iso
creer iso : mkisofs -LlrR -o windows.iso ./graver/
cdrecord blank=fast dev=ATA:1,0,0
mkisofs -R -r -J –hide-rr-moved -V "MyDisc" -o windows.iso ./graver/
pour windows !!!!
cdrecord dev=ATAPI:1,0,0 speed=4 -dao -force driveropts=burnproof -data > gracetime=0 -v windows.iso

PORTSENTRY SECURITE NMAP NETSTAT :

http://cyrille.balland.free.fr/site-esmith/securite/portsenty.htm
http://www.linux-france.org/prj/inetdoc/securite/tutoriel/tutoriel.securite.dissimulation.backdoor.html
netstat -apn
nmap -P0 192.168.0.8

SNMP :

http://www.little-pinguin.net/tutos/2
http://christian.caleca.free.fr/snmp/la_mib.htm

SENDMAIL :
http://www.linux-sec.net/Mail/sendmail.gwif.html

TCP/IP :

http://home.student.uu.se/j/jolo4453/projekt/tcpip1/ip_rout.htm
Ipforwarding : http://www.leonine.com/sunlib/security/ipf/solaris-x86-fw-ipf.html

MIRROR WEB SITE :

http://www.openca.org/openca/mirrors.shtml : doing rsync with ftp or http

APACHE SSL SERVER CLIENT HTTPS IDENTIFICATION :

http://ws.apache.org/soap/docs/install/FAQ_Tomcat_SOAP_SSL.html
http://www.garex.net/apache/
https://ssl247.com/buy_starter_ssl.php
https://products.freessl.com/ssl/chainedssl.do?ref=freessl
http://www.rapidssl.com/chainedssl/chainedssl-csr.html
http://www.faure.de/Apache+SSL+PHP+fp-howto-1p.html
http://www.ssl.com/support/multipleCAApache.jsp
http://marc.boget.free.fr/stage-html2/Memoire%20de%20stage-8_2_6.html
http://www.cru.fr/securite/crypto-jres99.pdf

AUTO-MOUNT MONTAGE :

http://wiki.9hells.org/USB_Storage

AWSTATS :

[root@nsl3 awstats]# /var/www/awstats/awstats.pl -config=website
Update for config "/etc/awstats/awstats.website.conf"
With data in log file "/var/log/httpd/access_log"…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 2079
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 2079 new qualified records.

PROTFTP :
"500 FTP server shut down (Maintanance in progress) — please try again later."
# rm -f /etc/shutmsg
# /etc/rc.d/init.d/proftpd resume
——
CHROOT
<Global>
DefaultRoot /data/servers/ftp/
DefaultTransferMode binary
RootLogin off
#DefaultChdir /data/servers/ftp/
</Global>
——
http://lea-linux.org/reseau/partfic/proftpd.html

REDIRECTION SHELL :

http://www.nerdlabs.org/documents/shell_redirection.php

SAMBA :

http://ubuntustartguide.online.fr/dev/sambaserver.html

CHROOT bash -R :

http://www.miscmag.com/articles/full-page.php3?page=113
http://www.cgsecurity.org/Articles/proftpd.html
http://www.linuxfocus.org/Francais/January2002/article225.shtml
http://www.pariscyber.com/security/chroot.php
http://www.hsc.fr/ressources/breves/chroot-openssh.html.fr

POSTFIX :

http://christian.caleca.free.fr/smtp/installation_de_postfix.htm
http://www.linux-france.org/article/mail/postfix-jaco/
http://www.miscmag.com/articles/full-page.php3?page=113

VPN :

http://sylvestre.ledru.info/linux.php

SHELL UNIX :

http://www.shellunix.com/
http://www.e-atlantide.com/securite/sun.htm

CALCUL SHELL :

NB_RES_100=`expr 100 * $­­­­­­­­NB_RESUMES`
POURCENTAGE=`expr $­­­­­­­­NB_RES_100 / $­­­­­­­­NB_LIGNES`

COULEUR HEXA WEB HTML :

http://membres.lycos.fr/ninouslechat/couleurhexa.html

Lister les tailles des ss répértoires en triant par taille :
du -k | sort -nr

ANTI-VIRUS MESSAGERIE SYSTEM :

http://www.math.cnrs.fr/mathrice/mars.2004/migration_sendmail_postfix.pdf
spam assassin
clam AV
postfix
amavisd-new
maildir
http://math.univ-lille1.fr/lmsp/
http://www.linux-france.org/article/mail/postfix-jaco/
http://lea-linux.org/reseau/postfix.html :
Postfix <http://www.postfix.org/> (serveur smtp)
SpamAssassin <http://www.spamassassin.org/> (filtrage spam)
Anomy Sanitizer <http://mailtools.anomy.net/> (filtrage mails erronés et douteux)
ClamAV <http://www.clamav.net/> (antivirus)
UW-IMAP <http://www.washington.edu/imap/> (serveur pop3 et imap)
http://lists.ze-linux.org/2004-03/msg00025.html
http://www.system-linux.net/config/index1.html
http://www.system-linux.net/index.php
http://poivron.org/blog/index.php/2004/08/31/6-spam_n_virus_filtering3
http://www.ijs.si/software/amavisd/
http://eric.gerbier.free.fr/email.html
http://www.gcolpart.com/howto/mail.php4
http://www.linux-sec.net/Mail/AntiVirus/
http://www.amavis.org/ : intégrer ds thunderbird
http://www.sophos.fr/products/sav/ : anti virus
http://people.via.ecp.fr/~alexis/formation-linux/apt.html
http://www.linux-france.org/article/mail/postfix-jaco/
http://lists.alphanet.ch/pipermail/gull/2003-September/001089.html
http://www.software-facilities.com/mail-software/messagewall.php
http://p3scan.sourceforge.net/
http://www.clamav.net/

ROUTE :

netstat -rn
route add default IP
/etc/defaultrouter
netstat -rn -I qfe0 -i 5 : check + resume des logs reseaux sur l'interface
netstat -rn : routes actuelles
netstat -antu : ports ouverts
route add/delete default ip

SYSLOG :

tabulations entre les parametres
http://www.freebsddiary.org/syslog.php

SED :

>sed "s//usr/sbin/tcpd//opt/alct/sbin/tcpd/g" /var/tmp/inetd.conf > /var/tmp/inetd.conf_final

Laisser un commentaire