134 liens privés
J'ai commencé à utiliser jrnl ( http://links.simonlefort.be/?5Nprkg ) mais je n'ai pas forcément envie que toutes les commandes que je tape soit gardées dans l'historique. Heureusement, il y a des options pour ça dans Bash et Zsh :
Dans Bash, il faut modifier "~/.bashrc" :
| ========
export HISTCONTROL=ignorespace
alias jrnl=' jrnl'
| ========
Dans Zsh, on rajoute ces deux lignes dans le fichier "~/.zshrc" :
| ========
HIST_IGNORE_SPACE="true"
alias jrnl=' jrnl'
| ========
C'est évidemment adaptable à bien d'autres commandes. L'alias est juste une commodité supplémentaire mais toutes les commandes commençant par un espace ne seront pas historisées.
Installation de Zsh :
| ========
$ sudo aptitude install zsh
| ========
Vérifier la version :
| ========
$ zsh --version
zsh 5.0.7 (x86_64-pc-linux-gnu)
| ========
Mettre Zsh comme shell par défaut :
| ========
$ chsh -s /usr/bin/zsh
ou mieux :
$ chsh -s $(which zsh)
| ========
Télécharger et installer Oh-my-zsh :
| ========
$ sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
--2015-07-24 12:13:28-- https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh
Résolution de raw.github.com (raw.github.com)… 23.235.43.133
Connexion à raw.github.com (raw.github.com)|23.235.43.133|:443… connecté.
requête HTTP transmise, en attente de la réponse… 301 Moved Permanently
Emplacement : https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh [suivant]
--2015-07-24 12:13:29-- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
Résolution de raw.githubusercontent.com (raw.githubusercontent.com)… 23.235.43.133
Connexion à raw.githubusercontent.com (raw.githubusercontent.com)|23.235.43.133|:443… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 2033 (2,0K) [text/plain]
Sauvegarde en : « STDOUT »
- 100%[==================================================================>] 1,99K --.-KB/s ds 0s
2015-07-24 12:13:29 (67,7 MB/s) — envoi vers sortie standard [2033/2033]
Cloning Oh My Zsh...
Clonage dans '/home/simon/.oh-my-zsh'...
remote: Counting objects: 660, done.
remote: Compressing objects: 100% (531/531), done.
remote: Total 660 (delta 15), reused 508 (delta 4), pack-reused 0
Réception d'objets: 100% (660/660), 372.32 KiB | 0 bytes/s, fait.
Résolution des deltas: 100% (15/15), fait.
Vérification de la connectivité... fait.
Looking for an existing zsh config...
Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to ~/.zshrc
Copying your current PATH and adding it to the end of ~/.zshrc for you.
_ / / ___ _ ____/ /_
/ \/ \ / ` \/ / / / / / / / \
/ // / / / / / / / / / / // / / /_( ) / / /
___// // // // //\, / /_/// //
// ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at http://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
| ========
Une liste d'outil pour la ligne de commande. Il y a plein de trucs à prendre là-dedans, à lire attentivement !
Tout un tas de commandes bash.
(Et la suite : http://matutine.cmoi.cc/posts/festival-de-commandes-bash-en-une-ligne-suite.html )
Cet alias permet de relancer la dernière commande avec "sudo" devant. Génial. :-)
Le thème Solarized est un thème pour être efficace. Les différences sont bien marquées entre les "o" minuscule, "O" majuscule et "0" (zéro) ainsi qu'entre les "l" minuscule, "L" majuscule, "i" minuscule, "I" majuscule" et "1" (un). En plus, la colaration syntaxique en mode "dark" est très agréable.
Je l'ai mis sur bash et vim.
Explications pour bash : https://github.com/Anthony25/gnome-terminal-colors-solarized
Explications pour vim : https://github.com/altercation/vim-colors-solarized
J'ai testé chez moi :
| ========
| simon@ordi:~$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
| vulnerable
| this is a test
| ========
J'ai ensuite fait un "$ sudo aptitude update" , suivi d'un "$ sudo aptitude upgrade" et c'est apparemment corrigé. Ouf!
| ========
| simon@ordi:~$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
| bash: warning: x: ignoring function definition attempt
| bash: error importing function definition for `x'
| this is a test
| ========
Un petit script bash qui permet de récupérer son adresse publique. Je l'ai modifié pour récupérer juste l'adresse IP, sans l'envoyer par mail ni la tester avec l'ancienne adresse IP. La partie principale, c'est évidemment la deuxième ligne. | ======== | #!/bin/bash |
---|---|---|
ip=$(dig +short myip.opendns.com @resolver1.opendns.com) | ||
echo $ip | ||
======== |
(via Sebsauvage : http://sebsauvage.net/links/?xVPvdw )
Un outil pour manager ses password sous la forme d'un script bash de 600 lignes utilisant GPG et des outils standards de GNU/Linux. Intéressant, faut que je jette un œil dessus.