Docker tips

Posted on 2015-05-24 in Trucs et astuces • Tagged with Docker

For my tips about docker compose, go here.

Create an image

docker build -t <name> .

Save and import

docker save <image> > file
docker load < <image>

Run

docker run --name …

Continue reading

AngularJS tips

Posted on 2015-04-26 in Programmation • Tagged with JavaScript, AngularJS

This page lists all the angularjs tips I have collected.

Disable HTTP request caching

This is mostly useful on Internet Explorer: every HTTP requests made with the $http service …


Continue reading

Git tips

Posted on 2015-04-26 in Programmation • Tagged with git

This pages provides all gitips I have collected.

Rebase

Split commit

After git rebase -i, run git reset HEAD~ to split …


Continue reading

Connect to a running docker container

Posted on 2015-03-25 in Trucs et astuces • Tagged with Docker

If you are running docker 1.3 or above, you should use: docker exec -it CONTAINER COMMAND to run COMMAND within the container. You can easily create a function to ease the thing and run bash by default:

dk-enter() {
    docker exec -it "$1" "${2:-/bin/bash}"
}

Otherwies, you can easily …


Continue reading

VirtualBox

Posted on 2015-03-01 in Trucs et astuces • Tagged with VirtualBox, Virtualisation

Transform img disk (qemu) to vdi (Virtual Box)

You need to convert img in raw with qemu-img …


Continue reading

Fusionner deux dépôts git

Posted on 2015-01-17 in Trucs et astuces • Tagged with git, Linux

Récemment, j'ai eu besoin de fusionner deux dépôts en un seul. Ça se fait plutôt bien. Voilà la procédure :

# On clone les dépots
git clone projet1
git clone projet2
cd projet1

# On ajoute le projet2 comme source dans le projet1
git remote add projet2 ../projet2
git fetch projet2

# On liste …

Continue reading

Importer périodiquement un flux ical dans owncloud

Posted on 2015-01-09 in Programmation • Tagged with Python, Calbdav, Owncloud

J'ai toujours trouvé dommage que owncloud ne soit pas capable d'importer périodiquement des calendriers que l'on trouve sur le web. Dans mon cas, mon emploi du temps est un flux ical régulièrement mis à jour et j'aimerais bien que owncloud soit capable de l'importer. Je me suis finalement résigné à …


Continue reading

Un shell pour pelican

Posted on 2015-01-09 in Programmation • Tagged with Bash/Shell, Linux, Pelican

Comme je l'ai déjà dit ici, mon blog est géré par Pelican. Il est également placé sous gestion de version. Pour régénérer automatiquement après chaque modification la version html des pages, il faut utiliser la commande make regenerate. Pour lancer le serveur de test pour voir les pages, on utilise …


Continue reading

Utiliser trap en bash pour pièger des signaux

Posted on 2015-01-09 in Trucs et astuces • Tagged with Linux, Bash/Shell

Bash est capable d'intercepter les signaux envoyés par certains raccourcis claviers (comme Ctrl-C) et de changer le comportement par défaut de ces raccourcis. Il suffit pour cela d'utiliser la commande trap. Elle prend en premier argument la commande à exécuter puis les signaux sur lesquels elle doit réagir.

Par exemple …


Continue reading

Utiliser un service webdav avec curl

Posted on 2015-01-07 in Trucs et astuces • Tagged with Linux, Bash/Shell, Webdav, curl

Il est tout à fait possible (et c'est même facile) d'utiliser curl pour communiquer avec un service webdav. Attention toute fois, tous les événements sont contenus dans des fichiers séparés qui doivent contenir les lignes BEGIN:VCALENDAR et END:VCALENDAR en plus des lignes décrivant l'évènement en lui même.

Pour …


Continue reading