Edito
Voila voila, je refais mon infra…
Et j'ai donc envie de participer a une oeuvre commune :
Antoine.
Pub
Désolé de vous incommoder avec cela, c'est un mal aujourd'hui nécessaire. Je le souhaite juste utile, on verra.
Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.
docs:linuxeries:scripts_divers [2013/05/22 11:46] adlp PAGE VALIDE |
docs:linuxeries:scripts_divers [2015/06/15 16:42] (version actuelle) |
||
---|---|---|---|
Ligne 84: | Ligne 84: | ||
en gros aller jetter un oeuil par [[http://monblog.system-linux.net/blog/2011/09/03/connaitre-processus-swap-linux/|là]] est une bonne idée a mon sens. | en gros aller jetter un oeuil par [[http://monblog.system-linux.net/blog/2011/09/03/connaitre-processus-swap-linux/|là]] est une bonne idée a mon sens. | ||
+ | |||
+ | |||
+ | <code perl> | ||
+ | #!/usr/bin/perl | ||
+ | ### Porcios Code by Antoine Delaporte | ||
+ | ### License GPL 2 | ||
+ | |||
+ | open(PS,"ls -d /proc/[0-9]* |"); | ||
+ | |||
+ | foreach my $proc (<PS>) { | ||
+ | chomp($proc); | ||
+ | my $swap=0; | ||
+ | if(open (SW,$proc."/smaps")) { | ||
+ | while(<SW>) { | ||
+ | if(/^Swap:/) { | ||
+ | s/.*\s(.*)\s.*\s/$1/g; | ||
+ | $swap+=$_; | ||
+ | } | ||
+ | } | ||
+ | close(SW) | ||
+ | } | ||
+ | if($swap) { | ||
+ | my $lnk=readlink($proc."/exe"); | ||
+ | $proc=~ s/^\/proc\///g; | ||
+ | print "$swap $proc $lnk\n"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | close(PS); | ||
+ | </code> | ||
====== Stdout 2 SysLog ====== | ====== Stdout 2 SysLog ====== | ||
Ligne 102: | Ligne 132: | ||
Et quand on est un grand garcon on utilise la fonction systeme **logger** | Et quand on est un grand garcon on utilise la fonction systeme **logger** | ||
+ | Et si on est joueur: | ||
+ | <xtermrtf> | ||
+ | echo netcat:"Host test log" | nc -u -w 1 127.0.0.1 514 | ||
+ | </xtermrtf> | ||
====== Réaction a presence d'un nouveau fichier dans un repertoire ====== | ====== Réaction a presence d'un nouveau fichier dans un repertoire ====== | ||
Ligne 145: | Ligne 179: | ||
<xtermrtf> | <xtermrtf> | ||
%admin ALL = NOPASSWD: /usr/sbin/vpnc | %admin ALL = NOPASSWD: /usr/sbin/vpnc | ||
+ | </xtermrtf> | ||
+ | |||
+ | ====== FtpS en LDC ====== | ||
+ | |||
+ | <xtermrtf> | ||
+ | adlp@wurzel:~$ lftp ServeurFTP -u User,Password -e "set ssl:verify-certificate no" | ||
</xtermrtf> | </xtermrtf> |