Skip to content

Instantly share code, notes, and snippets.

@danfaizer
danfaizer / OfterForgottenHelpfulCommands.sh
Last active June 9, 2016 15:16
Often Forgotten Helpful Commands
# DD with progress bar (pv package required)
pv -tpreb myimage.img | sudo dd of=/dev/diskX bs=1m
# SSH port forwarding/tunneling
ssh -f -L local_port:destination_server:destination_port user@intermediate_server -N
# MySQL - Size per DB query
SELECT table_schema "DB name", sum( data_length + index_length ) / 1024 / 1024 "DB size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
# MySQL - Size per Table query
@obfusk
obfusk / break.py
Last active July 16, 2024 11:26
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@enricruiz
enricruiz / api.md
Created December 15, 2011 15:54
VSM API cheatsheet ( < v2.2)

VSM Rest API ( < v2.2)

Take care to build the hypervisor address as follows (last '/' is mandatory):

http://#{ip}:#{port}/

Hypervisor types are:

  • VMX_04