Skip to content

Instantly share code, notes, and snippets.

View Thithip's full-sized avatar
🦙

Thibaut Pierret Thithip

🦙
View GitHub Profile
@Thithip
Thithip / force_git_using_ssh_instead_of_https.md
Created November 8, 2019 08:33
Git: Using SSH indentification instead of HTTPS by default

Sometimes with package manager you can have some troubles to download private Git dependencies (I had trouble with go get in Go with a private repository). If it's an authentication issue, you can force Git to use SSH indentification instead of HTTPS (or opposite) with the following lines:

Add to .gitconfig file:

[url "ssh://git@github.com"]
        insteadOf = https://github.com

Keybase proof

I hereby claim:

  • I am thithip on github.
  • I am thithip (https://keybase.io/thithip) on keybase.
  • I have a public key ASB1y2NBxjoot-V3dJn3Wp1JelSR5sSJuOvKxQA30QMYzAo

To claim this, I am signing this object:

@Thithip
Thithip / callgrind2png.sh
Created August 9, 2015 14:10
Callgrind file to PNG with gprof2dot
# link to gprof2dot GitHub : https://github.com/jrfonseca/gprof2dot
gprof2dot --format=callgrind --output=out.dot callgrind.out
dot -Tpng out.dot -o graph.png
@Thithip
Thithip / generate_md5.py
Created August 9, 2015 08:47
Generate file MD5 in Python
import hashlib
print hashlib.md5(open(file_path, 'rb').read()).hexdigest()
@Thithip
Thithip / exemple_commit
Created June 24, 2015 08:28
Commit exemple
feat: reset password on demand
send an email with unique reset url
display a form to define a new password
Closes #1234
@Thithip
Thithip / docker_mint.md
Last active August 29, 2015 14:20
Install Docker under Linux Mint

Docker installation with specifics packages missing in Linux Mint :

sudo apt-get install apparmor lxc cgroup-lite
wget -qO- https://get.docker.com/ | sh

Add <user> to Docker's group to autorise the user use Docker without sudo permissions :

sudo usermod -aG docker <user>
@Thithip
Thithip / problem_git_ignore.md
Last active January 16, 2024 10:27
Git : problème de .gitignore non pris en compte

Si au fur et à mesure des commits, ou après un git clone, le .gitignore peut ne plus fonctionner, Git indexe alors des fichiers qui ne le devrait pas l'être. Il faut donc tout réinitialiser.

  • archivage de tout le code modifié non versionné ;
  • suppression de l'index
git rm -r --cached .
  • réimportation de tout l'index (le .gitignore est maintenant pris en compte) :
git add .
@Thithip
Thithip / generate_pwd.py
Last active August 29, 2015 14:13
Python : Génération d'un mot de passe aléatoire
import random
import string
pwd = ''.join([string.ascii_letters.__add__(string.digits) [random.randint(0,len(string.ascii_letters+string.digits) -1) ] for i in range(10)])
@Thithip
Thithip / git_editor.md
Last active August 12, 2021 02:34
Git : Changer l'éditeur de message par défaut

Git : Changer l'éditeur de message par défaut

Pour changer d'éditeur de message pour les commit dans Git, il suffit d'entrer la commande suivante :

git config --global core.editor "vim"

L'option --global permet d'enregistrer la configuration pour tous les dépôts Git, et non seulement le dépôt courant.

@Thithip
Thithip / live_usb.md
Last active August 29, 2015 14:13
Création d'un live USB sous Linux

Création d'un live USB sous Linux

Pour créer un live USB sous Linux, pas besoin d'installer logiciel ! Un simple bash permet de faire le travail très simplement et rapidement.

Dans un éditeur, lancer la commande suivante :

dd if=/chemin/de/la/source.iso of=/dev/sdx oflag=direct bs=1048576

avec :