Skip to content

Instantly share code, notes, and snippets.

View akarzim's full-sized avatar

François VANTOMME akarzim

View GitHub Profile
@akarzim
akarzim / do_backup
Created August 26, 2013 07:46
Just a simple way do perform a daily backup on my external disk.
#!/bin/sh
# Source du backup
SRC="/home/akarzim/Documents"
# Destination du backup
DST="/media/SDBackup"
UUID="/dev/disk/by-uuid/02e610cf-1cda-4891-b6f5-486d216a4d39"
# Date de la forme année-mois-jour-timestamp
# (le timestamp %s sert si on veut faire plusieurs sauvegardes dans la même journée)
DATE=`date +%Y-%m-%d-%s`
@akarzim
akarzim / Logging::Logger.rb
Last active February 2, 2016 08:14
Logging::Logger #with_backtrace
# https://github.com/TwP/logging/
# Temporarily log with or without backtrace
#
# Usage:
# require 'logging'
# logger = Logging.logger(STDOUT)
# logger.with_backtrace do
# logger.error StandardError.new('oups!')
# end
#
@akarzim
akarzim / keybase.md
Created February 13, 2016 15:04
keybase.io verification code

Keybase proof

I hereby claim:

  • I am akarzim on github.
  • I am akarzim (https://keybase.io/akarzim) on keybase.
  • I have a public key ASD_kvOPf8DwAJ3kMZ2viboTc9bqLfdB6gVMqXtsX_aY6wo

To claim this, I am signing this object:

@akarzim
akarzim / README.md
Last active December 18, 2016 11:36
ZSH Docker precmd prompt for Pure theme

Docker precmd prompt for [Pure][1] ZSH theme

How to use

With [zplug][2]

zplug "akarzim/2bd1012f3047585b19cdfad4937895b3", \
    from:gist, \
    on:"sindresorhus/pure", \
 if:"(( $+commands[docker] ))"
@akarzim
akarzim / globalias.zsh
Last active November 1, 2017 17:03
Expand aliases with CTRL+SPACE
#
# Set key binding to extend aliases.
#
# Authors:
# François Vantomme <akarzim@gmail.com>
#
# Return if requirements are not found.
if [[ "$TERM" == 'dumb' ]]; then
return 1
@akarzim
akarzim / README.md
Last active November 20, 2019 10:42
Git additional aliases to Prezto module using ZPlug

Git additional aliases to [Prezto][1] ZSH manager

How to use

With [zplug][2]

zplug "akarzim/7b2f24c7f0dee222b662f35f5bba497a", \
    from:gist, \
    use:git-aliases.zsh, \
 if:"(( $+commands[git] ))"
@akarzim
akarzim / exa-aliases.zsh
Created March 20, 2018 16:07
Exa ZSH aliases
alias l='exa -1a' # Lists in one column, hidden files.
alias ll='exa -l' # Lists human readable sizes.
alias lr='ll -R' # Lists human readable sizes, recursively.
alias la='ll -a' # Lists human readable sizes, hidden files.
alias lm='la | "$PAGER"' # Lists human readable sizes, hidden files through pager.
alias lx='ll --sort=Extension' # Lists sorted by extension (GNU only).
alias lk='ll --sort=size -r' # Lists sorted by size, largest last.
alias lt='ll --sort=modified -r' # Lists sorted by date, most recent last.
alias lc='lt -m' # Lists sorted by date, most recent last, shows change time.
alias lu='lt -u' # Lists sorted by date, most recent last, shows access time.
@akarzim
akarzim / ncdu-aliases.zsh
Created August 30, 2018 16:26
NCurses Disk Usage ZSH aliases
# The options are:
# --color dark - use a colour scheme
# -rr - read-only mode (prevents delete and spawn shell)
# --exclude ignore directories I won't do anything about
alias du='ncdu --color dark -rr -x --exclude .git --exclude node_modules'
@akarzim
akarzim / README.md
Last active February 17, 2021 19:18
Docker commands over container partial name

ZSH Docker Aliases

Defines [Docker][1] aliases and functions.

Aliases

Docker

  • dka! Attach to a running container by name
  • dkE! Run an interactive command in a running container by name
function brip {
sudo /sbin/route -n add -net 192.168.0.0/16 -gateway $(docker-machine ip)
sudo /sbin/route -n add -net 172.19.0.0/12 -gateway $(docker-machine ip)
interface=$(ifconfig bridge100 | grep member | cut -d ' ' -f 2)
sudo ifconfig bridge100 -hostfilter "$interface"
}