Skip to content

Instantly share code, notes, and snippets.

@mutahirqureshi
mutahirqureshi / push_hosts.sh
Created April 10, 2017 18:27
copy local hosts file to Genymotion emulator
#!/bin/sh
# usage: ./push_hosts.sh [<genymotion_emulator_serial>]
# IP that genymotion assigns to host machine
IP="10.0.3.2"
[ -z "$1" ] && ADB="adb" || ADB="adb -s $1"
cat /etc/hosts | grep '127.0.0.1' | grep -v 'localhost' | sed 's/127.0.0.1/'$IP'/' > /tmp/hosts-adb
. ~/.profile
. ~/.bashrc
export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:$PATH
#export GIT=/usr/local/bin/git
export JAVA_HOME=$(/usr/libexec/java_home)
# Add Android paths
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
@mutahirqureshi
mutahirqureshi / sort.c
Created April 8, 2014 00:25
Sorting puzzle
#include <stdio.h>
/**
* Compile: gcc -o sort sort.c
*
* Usage: ./sort integer1, integer2 ...
*/
int main (int argc, char *argv[]) {
// array that will store sorted input
int copy[argc - 1];