Ceci est une ancienne révision du document !
Tous mes tutoriels .pdf sont en français. Ils sont écrits et peaufinés au fur et à mesure de leur utilisation. Certains deviennent très denses (LaTeX, Linux, Fortran). Certains sont devenus des pavés sans jamais acquérir la clarté que j'aurais voulu leur donner (C, C++, Java). En espérant qu'ils vous soient utiles.
h1. Commandes terminal en vrac
h2. problème de terminal qui fait n'importe quoi
Parfois, une application laisse le terminal dans un état bizarre. par exemple, un appui sur entrée de crée pas de nouvelle ligne. Parfois aussi, comme j'ai eu tout à l'heure, les caractères d'input ne sont plus affichés. Bref, pour tout ça, la commande magique qui remet le terminal dans un état bien comme il faut :
reset
h2. Create folder recursively
To create several folder levels at once:
mkdir -p toto/tata/titi/subfolder
h2. Attach stdout of a given process to terminal
strace -ewrite -p 12575
(get the process ID through:
ps aux | grep “python”
h2. find login from UID (or inversely)
getent passwd|grep “537”
inversely :
getent passwd|grep “ccossou”
or simpler :
id ccossou
h2. Chercher un mot récursivement dans tous les fichiers d'un dossier
grep -rnw "ima_simulation.ini" .
h2. Create a tree of subdirectories of the pwd :
find . | sed 's/[^/]*\//| /g;s/| *\([^| ]\)/+— \1/' Change permissions for folders and files (folder need x to be read, file don't)
h2. Change directories to 755(-rwxr-xr-x) and files to 644 (-rw-r–r–) :
chmod -R u+rwX,go+rX,go-w /path
(“X” change x only to directories) Search for a word in all files of a directory :
grep -rnw “/etc” -e “romeovisu1” Trouver les fichiers de log relatif à un programme :
h2. Trouver le pid du programme en train de tourner :
[root@aero8 ~]# ps -ef | grep slurm root 2174 1 0 Feb05 ? 00:00:01 /usr/sbin/slurmd root 2588 1 0 Feb05 ? 00:00:06 slurmstepd: [697] lionel 2591 2588 0 Feb05 ? 00:00:00 /bin/bash /var/log/slurm/log_slurmd//job00697/slurm_script root 12033 12006 0 13:35 pts/1 00:00:00 grep slurm
regarder les fichiers ouverts par ce programme et qui contiennent “log” dans leur chemin :
[root@aero8 ~]# lsof -p 2174 | grep -i log slurmd 2174 root cwd DIR 8,1 4096 524342 /var/log/slurm slurmd 2174 root mem REG 8,1 10783 5509860 /usr/lib64/slurm/topology_none.so slurmd 2174 root 3w REG 8,1 9136 525731 /var/log/slurm/slurmd.log.aero8
h2. Trouver le PID parent
On peut créer l'alias suivant
# To retrieve the parent pid of a given process alias ppid='ps -o ppid= -p'
, et y faire appel de la façon suivante :
ppid 74015
h2. Informations sur un PID
Commandes correspondant à un PID donné :
glx-herschel3.ccossou:~$ ps -p 48736 -o args COMMAND python launch_supremePhoto.py object_obsids.txt 10 /data/glx-herschel/data1/herschel/
Informations générales
ps -p $PID
h2. Partager des fichiers (sticky bit, group)
Le sticky bit permet que le groupe d'un dossier soit répercuté sur les fichiers créé à l'intérieur de celui ci
Pour changer le groupe du dossier :
chgrp nom_du_groupe nom_du_dossier
Pour définir le sticky bit sur ce dossier :
chmod g+s nom_du_groupe
h1. Langages de programmation
h2. C
https://www.dropbox.com/s/u1s3p72lrlszklf/aide-memoire-C.pdf?dl=0
h2. C++
https://www.dropbox.com/s/u1s3p72lrlszklf/aide-memoire-C.pdf?dl=0
h2. Fortran
https://www.dropbox.com/s/d5k3qspx9s9e84t/aide-memoire-fortran.pdf?dl=0
h2. IDL
https://www.dropbox.com/s/65z26se87fhlz8r/aide-memoire-IDL.pdf?dl=0
h2. Java
https://www.dropbox.com/s/u1s3p72lrlszklf/aide-memoire-C.pdf?dl=0
h2. Python
https://www.dropbox.com/s/uvinfeaqo5ovgl5/python.pdf?dl=0
h2. Python/astro
Le tutoriel Python étant devenu énorme, j'ai fait un autre tutoriel spécifique à l'astro, avec des commandes spécifiques (pour lire des fichiers .fits notamment). Beaucoup d'infos restent cependant disponible dans le tuto Python générique.
https://www.dropbox.com/s/jtrs3sxh2lg9i9s/python_for_astrophysics.pdf?dl=0
h1. Logiciels
h2. Inkscape
Logiciel de dessin vectoriel que je vous encourage vivement à essayer (libre et gratuit).
https://www.dropbox.com/s/b0q0p6exunu805g/inkscape.pdf?dl=0
h2. LaTeX
https://www.dropbox.com/s/9uc3y47jua3sy8f/debuter%20avec%20TeX.pdf?dl=0
h2. Emacs
https://www.dropbox.com/s/yyuh4putftvomrk/aide-memoire-emacs.pdf?dl=0
h2. Vim
https://www.dropbox.com/s/naf3dff0dnqrgyz/aide-memoire-vim.pdf?dl=0
h1. Gestionnaires de version
h2. Git
https://www.dropbox.com/s/t5sqpc4po8mjzx7/aide-memoire-git.pdf?dl=0
h2. Subversion
https://www.dropbox.com/s/l2tr318w3b5ebkc/aide-memoire-subversion.pdf?dl=0
h1. Autres
h2. Gnuplot
https://www.dropbox.com/s/zmcsducn2juc0yj/aide-memoire-gnuplot.pdf?dl=0
h2. Linux
https://www.dropbox.com/s/80mb7jsmkauxap0/debuter%20avec%20Linux.pdf?dl=0