Skip to content

Instantly share code, notes, and snippets.

@tonythere
tonythere / Linux Static IP
Last active August 4, 2016 07:51 — forked from fernandoaleman/Linux Static IP
Linux Static IP
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@tonythere
tonythere / genymotionwithplay.txt
Last active August 4, 2016 07:52 — forked from wbroek/genymotionwithplay.txt
genymotionwithgoogleplay
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 4.4 (http://goo.gl/TVcd93)
Google Apps for Android 4.3 (http://goo.im/gapps/gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (http://goo.im/gapps/gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (http://goo.im/gapps/gapps-jb-20121011-signed.zip)
@tonythere
tonythere / stuns
Last active August 29, 2015 14:10 — forked from yetithefoot/stuns
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@tonythere
tonythere / gtk3-pyenv.sh
Last active August 29, 2015 14:26 — forked from tarruda/gtk3-pyenv.sh
Install pygtk3 in pyenv
#!/bin/bash
# script for pyenv installation of pygtk3 in ubuntu 12.04
# Adapted from https://gist.github.com/mehcode/6172694
system_package_installed() {
if ! dpkg -l | grep -q $1; then
sudo apt-get install $1
fi
}
@tonythere
tonythere / gist:43003e650edcafeae180
Last active September 9, 2015 03:30 — forked from gobijan/gist:1568fb2b35c517f36369
Golang HTTP Handler to Upload Image => Resize => Convert to JPEG => Save to Disk.
func UploadHandler(w http.ResponseWriter, r *http.Request) {
file, _, err := r.FormFile("file")
if err != nil {
log.Println(err)
http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
return
}
img, _, err := image.Decode(file)
@tonythere
tonythere / tor_ip_renew.py
Created December 28, 2015 16:49 — forked from arulrajnet/tor_ip_renew.py
TOR ip renew script using pytorctl https://github.com/aaronsw/pytorctl which is a python based module to interact with the Tor Controller.
from TorCtl import TorCtl
import urllib2
user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
headers={'User-Agent':user_agent}
def request(url):
def _set_urlproxy():
proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:8118"})
opener = urllib2.build_opener(proxy_support)
@tonythere
tonythere / tmux.cheat
Created January 20, 2016 06:57 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@tonythere
tonythere / HLS_dvr.sh
Created January 23, 2016 10:30 — forked from John07/HLS_dvr.sh
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
@tonythere
tonythere / bump-version.sh
Created December 26, 2016 02:41 — forked from mareksuscak/bump-version.sh
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
@tonythere
tonythere / nginx.conf
Created March 6, 2017 04:05 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which