Skip to content

Instantly share code, notes, and snippets.

View rbecheras's full-sized avatar
👋

Rémi Becheras rbecheras

👋
View GitHub Profile
@rbecheras
rbecheras / GnuPG-2.2.md
Created July 6, 2020 13:52 — forked from romen/GnuPG-2.2.md
Build/install instructions for GnuPG 2.2.x on Ubuntu and similar distros (formerly for 2.1.x)

GnuPG 2.2.1 Build Instructions

Below are my build instructions for GnuPG 2.2.1, released on September 19th, 2017. These instructions are built for a Ubuntu 16.04 LTS.

If you prefer, you may use the below install script to install GnuPG 2.2.1 by running the following commands:

curl -OL "https://gist.github.com/romen/b7bac24d679d91acabb27bfcdabbee01/raw/b93b7b00910db67c2c3332606792679802abbb32/install-gnupg22.sh" && bash ./install-gnupg22.sh

Install the needed dependencies

@rbecheras
rbecheras / docker-cleanup-resources.md
Created November 16, 2018 11:23 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@rbecheras
rbecheras / patch-init-generator.patch
Created August 30, 2018 09:00
generator init patch
This file has been truncated, but you can view the full file.
From f0cb48adb69a4c40c3ee47b9898b9ff945756f5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Becheras?= <remi.becheras@gmail.com>
Date: Wed, 22 Aug 2018 14:30:09 +0200
Subject: [PATCH 01/21] update readme
---
README.md | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
@rbecheras
rbecheras / mkcd-function.sh
Last active March 29, 2018 08:11
Include this function in your bashrc script to use mkcd anywhere in bash.
function mkcd () {
if [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage : mkcd [OPTIONS] [PATH]
Use 'mkdir -p' to create a directory then 'cd' into it
Options:
-h, --help Display help"
return 0
elif [[ -z $1 ]]; then
echo "Error: missing argument. mkcd takes exactly one argument"
@rbecheras
rbecheras / git-colored-prompt.bashrc.sh
Last active March 28, 2018 08:12
A bashrc snipet to set colored prompt with git branch
if [ "$color_prompt" = yes ]; then
prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]:\[\033[01;33m\]$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\[\033[00m\]\$ '
else
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
fi
unset color_prompt force_color_prompt
@rbecheras
rbecheras / beep.sh
Last active January 17, 2018 14:24
Ringtone Beep on Ubuntu Gnome
#!/bin/bash
BEEP=/usr/share/sounds/gnome/default/alerts/glass.ogg
VOL_MAX=35536
CENT=100
if [[ -z $1 ]]
then
CURSOR=100
else
@rbecheras
rbecheras / screencast.sh
Created January 11, 2018 13:25
Create a GIF screencast w/ Byzanz-Record
byzanz-record --delay=2 --duration=30 --x=0 --y=60 --width=700 --height=700 out.gif
@rbecheras
rbecheras / mass-rename-replace.sh
Last active January 4, 2018 15:14
A script to rename in mass replacing a string by an other
#!/usr/bin/env bash
# Bash colors
RED="\033[0;31m"
GREEN="\033[0;32m"
ORANGE="\033[0;33m"
YELLOW="\033[1;33m"
NC="\033[0m" # No Color
ERROR="${RED}ERREUR:"
SUCCESS="${GREEN}OK:"
@rbecheras
rbecheras / bash-getopts.sh
Last active December 12, 2017 16:47
Proof of concept of handling unix-like options in shell scripts
#!/usr/bin/env bash
optspec=":hv-:"
while getopts "$optspec" optchar; do
case "${optchar}" in
-)
case "${OPTARG}" in
loglevel)
val="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
echo "Parsing option: '--${OPTARG}', value: '${val}'" >&2
;;
@rbecheras
rbecheras / libecw-build.sh
Created December 12, 2017 09:36 — forked from fritzvd/build.sh
libecw building for gdal
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable # unstable packages
sudo apt-get install build-essential gdal-bin gdal-config libgdal-ecw-src
wget http://meuk.technokrat.nl/libecwj2-3.3-2006-09-06.zip
unzip ~/Downloads/libecwj2-3.3.2006-09-06.zip
cd ~/Downloadslibecwj2-3.3.2006-09-06
./configure
make # wait
make install # or sudo make install
sudo gdal-ecw-build /usr/local
sudo ldconfig