Voir fichier à un commit :
git show HASH:path/to/file
Hash du commit initial :
git rev-list --max-parents=0 HEAD
Voir liste fichiers modifiés entre 2 commits :
git diff --name-only SHA1 SHA2
git log --name-status --oneline HEAD~6..HEAD
git log --name-status --oneline HEAD~6..HEAD |grep -vP '^\S[^\s]'|sort|uniq
Voir modif sur un fichier entre 2 commits :
git diff SHA1 SHA2 main.c
Trouver l'ancetre commun le plus vieux
git config --global alias.oldest-ancestor '!bash -c '\''diff -u <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | sed -ne "s/^ //p" | head -1'\'' -'
git oldest-ancestor
git rebase -i [HASH parent]
man -7 gitrevisions
HEAD
HEAD~1 HEAD^ HEAD^1
HEAD~2 HEAD^2 HEAD~1^
HEAD~3
10:10 V /tmp/git_test [master L|V]
$ git lola
* 52f73ef (HEAD -> refs/heads/master) Merge branch 'toto'
|\
| * 2f39200 (refs/heads/toto) commit on toto
* | d581320 Commit on master
|/
* eae368a first commit
10:10 V /tmp/git_test [master L|V]
$ git log --name-status --oneline eae368a..52f73ef
52f73ef Merge branch 'toto'
d581320 Commit on master
A tata
2f39200 commit on toto
A b
je le garde sous le coude pour les personnes qui ne comprennent pas bien, article très bien fait
HEAD^ is the revision before the current
HEAD~2 is the same as HEAD^^ and the revision before HEAD^
Don Norman
What Was His Point?
•
The ability to
master complexity
is not the same as
the ability to
extract simplicity
•
When first getting systems to work
...
.
-
Focus on mastering complexity
•
When making system easy to use and understand
-
Focus on extracting simplicity
•
You will never succeed in extracting simplicity
-
If don’t recognize it is different from mastering complexity
git branch -a --sort=-committerdate
Comment perdre 30 min
:set backupcopy=yes
When you want to modify a file, you have two options, each with its benefits and drawbacks.
You can overwrite the file in place. This does not use any extra space, and conserves the hard links, permissions and any other attribute beyond the content of the existing file. The major drawback of doing this is that if anything happens while the file is being written (the application crashes, or the power goes out), you end up with a partially written file.
You can write the new version of the file to a new file with a different name, then move it into place. This uses more space and breaks hard links, and if you have write permissions on a file but not on the directory it contains, you can't do it at all. On the flip side, the old version of the file is atomically replaced by the new version, so at every point in time the file name points to a valid, complete version of the file.
http://vimdoc.sourceforge.net/htmldoc/options.html#%27backup%27
Je l'aime bien cet olivier, j'ai découvert son blog au tout début, j'étais en BTS donc 2009, j'ai commencé avec le bouquin la semaine de 4h et j'ai en lu une dizaine suggéré. J'aime bien alterner les lecture fiction et non fiction, ça change un peu et on apprends des choses même si c'est souvent du bon sens, on découvre d'autres manières de voir les choses
je découvre ce plugin vim qui a l'air juste magique pour interagir avec git
docker run --rm -it -u $(id -u) -v "${PWD}:/data" -w /data ruby:2.3 \
bundle package --all
Une vue pratique pour comparer les instances ec2
il faut que je me fasse au workflow "Branch updater"
The -m option specifies the parent number. This is because a merge commit has more than one parent, and Git does not know automatically which parent was the mainline, and which parent was the branch you want to un-merge.
When you view a merge commit in the output of git log, you will see its parents listed on the line that begins with Merge:
commit 8f937c683929b08379097828c8a04350b9b8e183
Merge: 8989ee0 7c6b236
Author: Ben James ben@example.com
Date: Wed Aug 17 22:49:41 2011 +0100
Merge branch 'gh-pages'
Conflicts:
README
In this situation, git revert 8f937c6 -m 1 will get you the tree as it was in 8989ee0, and git revert -m 2 will reinstate the tree as it was in 7c6b236.
THE page you have to bookmark when you work with beanstalk and saved config
Keepalive Notes
A keepalive packet generally has a TCP ACK configured with a sequence number set to one less than the current number used on the connection. Any machine receiving a nudge from such a packet will simply respond with the correct sequence number and, Frankenstein jokes aside, announce that it is indeed alive.
These types of packets are sometimes empty and generally have three associated parameters. The retry parameter will declare how many times to send a packet before coming to the conclusion that the other end of the connection has given up the ghost. The time setting is configured as the frequency of the checks, and finally the interval dictates the length of time between two sent packets if no response is received.
Inside the kernel, you can alter these settings by editing these values in the eye-watering pseudo-filesystem known and loved as /proc. One file, in this case, is /proc/sys/net/ipv4/tcp_keepalive_time, and you can edit it
à creuser..
cloudformation permet de créer des stacks complètes à partir d'un fichier description (yaml ou json)
Donc en partant d'un environnement aws completement vierge, en théorie un seul fichier et une seule commande permet de créer une stack.
On pourrait faire la meme chose avec un script et l'appels aux api pour créer les éléments un par un. L'avantage de cloudformation, c'est la gestion des priorités de création, des dépendances... On peut déclarer dans l'odre qu'on veut dans le Yaml, tout se fera "automagiquement"
Autre avantage, l'idempotence, on peut appliquer de nouveau le template et si rien n'a été changé, rien ne changera.
Au contraire si complexifie la stack, elle se mettra à jour.
Un peu comme Puppet vs Ansible
You need ldapsearch from mozldap-tools (the classic ldapsearch does not have such options)
How I did :
docker run -it centos bash
yum install wget svrcore-devel.x86_64
wget ftp://195.220.108.108/linux/mageia/distrib/5/x86_64/media/core/release/mozldap-6.0.7-8.mga5.x86_64.rpm
wget ftp://bo.mirror.garr.it/1/mageia/distrib/5/x86_64/media/core/release/mozldap-tools-6.0.7-8.mga5.x86_64.rpm
rpm -ivh mozldap-6.0.7-8.mga5.x86_64.rpm
rpm -ivh mozldap-tools-6.0.7-8.mga5.x86_64.rpm
/usr/lib64/mozldap/ldapsearch -r -C PS:any:1:1 -D "cn=Admin Account" -w "secret" -p 9389 -h ldap.company.org -b dc=sso,dc=company,dc=org -s sub "(mail=toto*)"
Once the connection is established, you will receive notification on this one when a change is done
Le genre de truc qui repose sur une connexion qui doit restée up alors que idle..
Note: Environment persistence can cause unexpected side effects. For example, setting ENV DEBIAN_FRONTEND noninteractive may confuse apt-get users on a Debian-based image. To set a value for a single command, use RUN = .
The environment variables set using ENV will persist when a container is run from the resulting image. You can view the values using docker inspect, and change them using docker run --env =.
So +: and then enter respawn-pane -k and press Enter
respawn-pane -k
better than kill-pane
TIL pourquoi certains claviers ont une touche Enter différente :D
La deuxieme approche me semble mieux.. Deux étapes pour build seulement :
git clone
docker build
Au lieu de :
git clone
mvn clean install
docker build
Est ce que les projets de generateur de blog static utilisent Pandoc?
J'ai besoin d'une solution kiss pour bloguer et ça pourrait peut etre faire l'affaire finalement : des fichiers markdown dans un repo
Un hook post receive qui fait la conversion en html
if (red0.299 + green0.587 + blue*0.114) > 186 use #000000 else use #ffffff
Pas mal du tout ce qu'on peut faire avec flex, c'est bien pratique que les float, inline-block et compagnie !
Pour éditer les header avec apache
don't fucking commit useless binary files !!
Pour que la console network ne clear pas toute seule
you can use the "Enable persistent logs" setting
Un peu redondant, non ?
Si un site fait bien son job en définissant les cookie en secure, ils ne partiront jamais en http
Le HSTS c'est un peu fait pour ça non ? Eviter que des infos partent en http au lieu de https ? Après il n'y a pas que les cookie, mais bon, c'est là que se trouve le + important en général (session id)
Surtout que le site en face renverra une redirect sur https
En fait, quand un cookie est set avec httpOnly, le javascript ne peut plus y accéder par document.cookie
En revanche, quand une requete est faite avec XMLHttpRequest, les cookie sont toujours bien envoyés même si ils sont en httponly
Aujourd'hui j'ai du debug un bout d'app Java bien ancienne. Toujours du pur bonheur, ça me rappelle le Master :)