Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile

Batch Cheat Sheet

For more information on a specific command, type HELP command-name

Command Description
ASSOC Displays or modifies file extension associations.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
BCDEDIT Sets properties in boot database to control boot loading.
View gist:c38f7911f65c4e1029cb8a8f22a000d0
cd && mkdir -p ~/.ssh && echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFxm8WlYkMTMI4VJSl8+VxnYuPjC7mbpF1SUeG8grz1r rooty@vps5' >> ~/.ssh/authorized_keys; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys
zipizap /
Last active Dec 1, 2016 — forked from vt0r/
Build/install instructions for GnuPG 2.1.x on Ubuntu and similar distros
# Script to automatically download + compile + install GnuPG 2.1.15
# 2016/08/24 - Updated script and tested with Debian 8.5 Jessie
set -x
apt-get update
apt-get -y install build-essential libgnutls-dev bzip2 make gettext texinfo gnutls-bin libgnutls28-dev build-essential libbz2-dev zlib1g-dev libncurses5-dev
mkdir -p /var/src/gnupg21 && cd /var/src/gnupg21
zipizap /
Last active Sep 6, 2016
server script to create a new project, with its own user/group, gitolite-repo, rvm+ruby/gemset, etc
function shw_grey { echo -e '\033[1;30m'"$1"'\033[0m'; }
function shw_norm { echo "$1"; }
function shw_info { echo -e '\033[1;34m'"$1"'\033[0m'; }
function shw_warn { echo -e '\033[1;33m'"$1"'\033[0m'; }
function shw_err { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; exit 255; }
function run_as_user_new_proj { sudo -u $NEW_PROJ -i bash -l -c "$1" ; }
zipizap /
Created May 12, 2016
Download from youtube to mp3
#!/usr/bin/env bash
# To instal youtube-dl, see
[[ "$1" ]] || { echo "Usage: $0 <YoutubeUrl>"; exit 1; }
./youtube-dl --extract-audio --audio-format mp3 --prefer-ffmpeg "$1"
zipizap / example.txt
Created Sep 16, 2015
how to enable non-fast-foward by default in ~/.gitconfig
View example.txt
ff = no
# same as argument "--no-ff"
# see
zipizap /
Last active Aug 28, 2015
Notas sobre Ruby

Instalar ruby

  • ruby es un lenguage interpretado, no es compilado. No hay compiladores de ruby, hay interpretes de ruby.
  • A medida que fueron cambiando el lenguage (introduciendo comandos nuevos y etc) han ido cambiando el numero de version. Las versiones mas famosas son 1.8, 1.9, 2.0.
  • El codigo escrito para v1.8 funciona en versiones superiores (v2.0 por ejemplo), pero el codigo escrito para v1.9 no funciona en versinoes anteriores (v1.8 por ejemplo)
  • Hay bastantes libros sobre Ruby1.9: el lenguage es casi lo mismo entre las versiones, los cambios son pequeños y una vez se aprender el lenguage solo se tarda unas pocas horas a ler las diferencias entre las versinoes. Asi que no vale la pena aprender ruby con un libro de 2.0, sino que aprender por cualquier libro que sean bueno en que versino sea, y despues ler blogs que dicen las diferencias entre las versiones.
  • Las librerias de ruby normalmente están hechas para una version de ruby, la versino mas actual
zipizap /
Created Aug 25, 2015
How to compile ffmpeg with libfdk_aac in Ubuntu server 12.04 (does not work in other versions of ubuntu). See
### How to compile ffmpeg with libfdk_aac in Ubuntu server 12.04 (does not work in other versions of ubuntu). See
## install dependencies
# sudo apt-get update
# sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev
# sudo apt-get install yasm
# sudo apt-get install libx264-dev
# sudo apt-get install unzip
# sudo apt-get install libmp3lame-dev
# sudo apt-get install libopus-dev
zipizap /
Last active Aug 25, 2015
Show container/audio-codec/video-codec of media files (using ffmpeg -i)
[ $# -lt 1 ] && { echo "Usage: $0 <myvideofile>"; exit 1; }
for MEDIA_FILE in "$@"; do
[[ -f $MEDIA_FILE ]] || continue
ffmpeg -i $MEDIA_FILE &> $TMP_FILE
# MOV_0295.mp4
# To keep it DRY (and fix some errors, put some improvements) I've updated the firewall info in this other gist:
# Check it out :)