A light branching strategy with mercurial and bookmarks

Posted on 2015-07-22 in Programmation • Tagged with git, mercurial

I am a contributor to nbpython the netbeans plugin for python. Since the DCVS used is mercurial and I have almost exclusively used git before I add to adapt my workflow to work properly.

What I want to do:

  • create a branch from …

Continue reading

Déplacer des lignes correspondant à une regexp en bash

Posted on 2015-07-22 in Trucs et astuces • Tagged with Bash/Shell

Récemment sur un projet j'ai dû mettre à jour closure compiler. Afin de faire cette mise à jour, j'ai dû déplacer certaines lignes de code utilisées par closure : le compilateur utilise des goog.require et des goog.provide pour trouver les dépendances entre les fichiers. Dans la version utilisée par …


Continue reading

Supprimer la ligne encoding de fichiers python

Posted on 2015-07-22 in Trucs et astuces • Tagged with python, Bash/Shell

Lors du passage à python 3 sur un projet, j'ai décidé de supprimer les lignes qui donnent l'encodage du fichier. En effet, ils étaient tous en UTF-8 et c'est l'encodage par défaut sous python 3.

J'ai écrit ce petit script pour automatiser tout ça :

for file in $(find chsdi/ -name …

Continue reading

CORS and HTTP authentication

Posted on 2015-06-27 in Auto-hébergement • Tagged with nginx, apache, webdav, owncloud

Before doing a request (POST, GET, PUT, …) on another domain with Javascript, web browsers will perform an OPTIONS request to verify that the request is likely to be accepted by the server. They mostly check for CORS headers.

This doesn't cause any troubles if …


Continue reading

Use udev to setfacl when mounting a usb drive

Posted on 2015-05-31 in Trucs et astuces

Write the line below (and adapt it) in /etc/udev/rules.d/:

SUBSYSTEMS=="block",ACTION=="add",KERNEL=="sd?1",RUN+="/usr/bin/setfacl -m    u:apache:r-x /run/media/jenselme"

Attention: if the path of the command is not absolute, udev will search of it in /usr/lib/udev.


Use docker to deploy a Glassfish application

Posted on 2015-05-24 in Programmation • Tagged with Java, Glassfish, Docker

Recently I had to deploy an application on Glassfish. Since Glassfish is not packaged on the distribution I have on my server (Fedora Server) and I wanted to avoid to pollute my system I decided to use Docker.

In order to deploy my application correctly, I based my Dockerfile on …


Continue reading

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