Skip to content

Instantly share code, notes, and snippets.

@gnthibault
gnthibault / vimrc.txt
Last active April 17, 2018 11:39
vimrc for c++
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/home/gnthibault/.vim/bundle/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('/home/gnthibault/.vim/bundle')
@gnthibault
gnthibault / pdftk.sh
Created February 14, 2018 13:19
Rotate pdf on linux with pdftk
pdftk in.pdf cat 1north output out.pdf
@gnthibault
gnthibault / gist:5366255d455c763ebbd790ca32564ee4
Created February 15, 2018 10:15 — forked from wikimatze/gist:9790374
Github Two-Factor Authentication Failed For HTTPS

I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.

Two-Factor Authentication

"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.

Enabling Two-Factor Authentication

@gnthibault
gnthibault / mount-vg.sh
Created March 19, 2018 08:40
Mount encrypted partition from ubutun
# To be executed as root
# Check list of the volume group
pvs
# First, rename the vg you want if it has the same name as one other vg you are currently using, then set it active
vgdisplay
vgrename UUID-of-old-vg old_ubuntu_vg
vgchange -ay old_ubuntu_vg
@gnthibault
gnthibault / installGDAL.sh
Created March 27, 2018 11:52
Installing GDAL (c++ anf python) on ubuntu 16.04
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt upgrade
sudo apt-get install libgdal-dev libgdal1i
pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL
@gnthibault
gnthibault / get_ubuntu_window_back.txt
Created April 11, 2018 06:23
When ubuntu window is outside of the screen
Be sure to have the off-screen window selected (use Alt-Tab or Super-W for example). Then hold Alt+F7 and move the window with the cursor keys until it appears in the viewport.
@gnthibault
gnthibault / copywithstatusbar.sh
Created April 24, 2018 13:20
Copy with a status bar on linux with rsync
rsync --info=progress2 source dest
@gnthibault
gnthibault / dockerize_gui.sh
Created May 22, 2018 13:06
How to dockerize a gui application through ssh
python3 python3-pip python3-pyqt5 libgl1-mesa-glx libegl1-mesa libxcomposite1 libxcursor1 libxi6 libxtst6 libfontconfig1 libxrandr2 libasound2 python-tk
SOCK=/tmp/.X11-unix; XAUTH=/tmp/.docker.xauth; xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -it -e DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host ubuntu spyder3
@gnthibault
gnthibault / CondaPipTips.txt
Last active August 28, 2018 14:15
Run pip install inside anaconda environments
conda create --name my_name pip
source activate my_name
pip install -r ./requirements.txt
source deactivate my_name
conda env remove --name dash-app
@gnthibault
gnthibault / deletedocker.sh
Created May 31, 2018 07:30
delete docker images
#In order to delete all containers, use the given command
docker rm $(docker ps -a -q)
# In order to delete all images, use the given command
docker rmi $(docker images -q)