Skip to content

Instantly share code, notes, and snippets.

View leinardi's full-sized avatar

Roberto Leinardi leinardi

  • Munich
View GitHub Profile
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@oogali
oogali / root-disk-selection.ks
Created November 24, 2013 17:04
Kickstart snippet to avoid installing on wrong hard drive (or wiping your USB stick)
%pre
MIN_SIZE=100
MAX_SIZE=600
rootdisk=
for dev in sd vd xvd ; do
for drive in a b c d ; do
bdev="/sys/block/${dev}${drive}"
if [ -z "${rootdisk}" ]; then
if [ -d "${bdev}" ] && [ "$(cat ${bdev}/removable)" == "0" ]; then
@abiank
abiank / android_emu_start.sh
Created November 12, 2012 08:15 — forked from stackedsax/android_emu_start.sh
Script for starting up multiple android emulators per box
#!/bin/bash
#####
#
# This script creates android emulators on the fly.
#
# Please refer to the README for usage instructions.
#
####
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis