Skip to content

Instantly share code, notes, and snippets.

View samyranavela's full-sized avatar

Samy RANAVELA samyranavela

  • Soustons, France
View GitHub Profile
@samyranavela
samyranavela / traefik.sh
Created November 9, 2016 13:47
Start a traefik container & connect to all network
#!/bin/sh
#set -ex
# The daemon's name (to ensure uniqueness and for stop, restart and status)
name="traefik"
# The path of the client executable
command="$HOME/traefik/traefik.sh"
# Any command line arguments for the client executable
command_args=""
# The path of the daemon executable
@samyranavela
samyranavela / gist:d0e70c2c3c603603edc11e54735beddb
Created June 10, 2016 07:33 — forked from archgrove/gist:6766129
Replays a git history, passing the repository at each state to a given script
#!/bin/bash
# Takes a repository and script from the command line
# and executes the script for each git log entry in reverse chronological order
# Use temporary files of the following format
TMP_TEMPLATE="/tmp/gitreplay-XXXXXXXX"
# Validate command line parameters
if [ -z $1 -o -z $2 ]; then
@samyranavela
samyranavela / start-stop-daemon-template
Created April 25, 2016 09:35 — forked from bcap/start-stop-daemon-template
Template file for creating linux services out of executables using the start-stop-daemon
#!/bin/bash
### BEGIN INIT INFO
# Provides: <service name>
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: <service description>
### END INIT INFO
@samyranavela
samyranavela / psg.sh
Created December 31, 2014 23:46
Shortcut to search a process by name
#!/bin/sh
# http://www.commandlinefu.com/commands/view/13947/shortcut-to-search-a-process-by-name
psg(){ ps aux | grep -v grep | egrep -e "$1|USER"; }
@samyranavela
samyranavela / findame.sh
Created December 31, 2014 23:45
Shortcut to find files with ease.
#!/bin/sh
# http://www.commandlinefu.com/commands/view/13949/shortcut-to-find-files-with-ease.
findame(){ find . -iname "*$1*"; }
@samyranavela
samyranavela / file_size.sh
Created December 29, 2014 18:06
Taille total des fichiers > 5MB
#!/bin/sh
find ./ -type f -size +5120 -exec du -shc {} +