Skip to content

Instantly share code, notes, and snippets.

@arturoherrero
arturoherrero / backup.sh
Last active August 29, 2015 14:10
Using rsync to backup my data
rsync -r --delete -h --progress --stats /Users/arturo/Documents /Volumes/Arthur/

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@arturoherrero
arturoherrero / gist:eba78d6f0df7b25304c4
Created June 26, 2014 11:09
Reject dangerous changes in Git repositories by default
https://secure.phabricator.com/D7689
+---------------------------------------------------------------+
| * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * |
+---------------------------------------------------------------+
\
\ ^ /^
\ / \ // \
\ |\___/| / \// .\
\ /V V \__ / // | \ \ *----*
@arturoherrero
arturoherrero / full_path_to_itself
Last active August 29, 2015 13:57
Bash script to get the full path to itself
#!/usr/bin/env bash -e
script_path=$( cd $(dirname $0) ; pwd -P )
@arturoherrero
arturoherrero / tree
Created March 16, 2014 22:41
Directory structure as tree
#!/usr/bin/env bash
shopt -s globstar
for file in **/*
do
slash=${file//[^\/]}
case "${#slash}" in
0) echo "|-- ${file}";;
1) echo "| |-- ${file}";;
@arturoherrero
arturoherrero / monitor-load.sh
Created January 20, 2014 20:37
Email notification for monitor load
#!/usr/bin/env bash
mail="[email protected]"
maxload="9"
hostname=`hostname`
load=`w | head -n1 | awk '{print $10}' | cut -d"," -f1`
if [ $load -gt $maxload ]
then
echo "$hostname - High load found" |
Any modern, innovative and worth learning framework or programming
language implements a subset of Smalltalk's features but lacks its
vision and design principles.
@arturoherrero
arturoherrero / update_git_repositories.sh
Created August 13, 2013 15:47
Update Git repositories
for d in *; do (cd $d && git pull); done

Command line tools every developer should know

Prior reading

  • The Unix philosophy, specially the "Make each program do one thing well" [1]

Basic

  • File and directory navigation/manipulation (ls, cd, mkdir, rm, rmdir, touch, cp, mv)
  • ln/unlink/readlink
@arturoherrero
arturoherrero / issuudownload.sh
Created February 19, 2013 23:31
Download issuu documents. Credits: http://www.kurtsik.org/blog/?p=1068
#! /bin/bash
# Script para descargar los documentos de issuu.com como imagenes JPG
# y convertirlos a PDF.
# kurtsik-2011
#
TMP_DIR="/tmp/issud/"
TMP_FILE="issuufile"
KONT=1
I_MAGICK=0