Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / pdftk.sh
Created February 14, 2018 13:19
Rotate pdf on linux with pdftk
pdftk in.pdf cat 1north output out.pdf
@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 / .vimrc
Last active May 2, 2018 06:40
Google vimrc for python
"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 / gitTips.sh
Created January 25, 2018 09:05
git TIPS
#How to ignore a file locally in GIT
#Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user's workflow) should go into the $GIT_DIR/info/exclude file.
@gnthibault
gnthibault / InstallArmbianGuide.txt
Created January 23, 2018 09:54
Guide d'installation pour armbian sur une carte SD
D'abord, decompresser l'image:
cd chemin_vers_armbian_image
tar -xvf ./Armbian_5.27_S9xxx_Ubuntu_xenial_3.14.29_mate_KODI_20170702.img.xz
Cela decompresse l'archive, ensuite effectuer une copie "raw" de cette image sur la carte SD:
sudo dd if=/chemin_vers_/Armbian_5.27_S9xxx_Ubuntu_xenial_3.14.29_mate_KODI_20170702.img of=/dev/mmcblk0 status=progress bs=4M
Une fois l'operation terminee (plusieurs minutes), retirer et remettre la carte SD dans l'ordinateur, afin de pouvoir monter les deux partitions automatiquement (ou alors les monter manuellement)
Jeter un coup d'oeil dans BOOT:
eventuellement modifier le fichier armbian_first_run.txt (non obligatoire)
@gnthibault
gnthibault / astrobox_configuration_guidelines.sh
Last active January 9, 2022 21:52
Configuration of linux box for remote observatory with indi/indiwebmanager/vnc/webvnc, ...
# Instalation guide
### solve locale problem on computer
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
### Setup automatic time update toward UTC
sudo apt-get install ntp
@gnthibault
gnthibault / create-hotspot.md
Created January 10, 2018 14:20 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@gnthibault
gnthibault / dockerBirthAndDeath.sh
Created January 9, 2018 15:05
A few commands related to docker
#!/bin/bash
#Birth
mkdir dockerstuff
cd dockerstuff
echo "FROM ubuntu" Dockerfile
docker build -t testproj .
# Interactive run
#docker run -it ubuntu