Skip to content

Instantly share code, notes, and snippets.

View slmingol's full-sized avatar
:octocat:
codz

Sam Mingo slmingol

:octocat:
codz
View GitHub Profile
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork [email protected]
@rednaxelafx
rednaxelafx / PrintThreadIds.java
Created February 25, 2011 10:31
find out the correspondence between the tid/nid of Java threads as shown from jstack/JMX, on HotSpot/Linux
package fx.jvm.hotspot.tools;
import java.util.List;
import sun.jvm.hotspot.tools.Tool;
public class PrintThreadIds extends Tool {
public static void main(String[] args) {
PrintThreadIds tool = new PrintThreadIds();
tool.start(args);
#! /bin/bash
(($#)) || (echo "Usage: mack PATTERN PATTERN [PATTERN...]"; exit 1)
if (($# == 1)); then
ack -l "$1"
else
grep -Ffx <(ack -l "$1") <(shift; mack "$@")
fi
@gms8994
gms8994 / cdn_tester.sh
Created May 17, 2011 14:17
curl timer fetch stackexchange CDNs
#!/bin/bash
REPEAT=20
TIMER=0
function fetchTimer {
URL=$1
CURRENT_TIME=`curl --compressed -w '%{time_total}' -o /dev/null -s $URL`;
TIMER=`echo "$CURRENT_TIME + $TIMER" | bc`
@RafeKettler
RafeKettler / request_test.py
Created May 17, 2011 15:07
Stack overflow CDN request test in Python
#!/usr/bin/env python
"""
CDN tester for SO. Designed to make lives easier.
Usage:
python request_test.py # for default number of tries, 20
python request_test.py 100 # for a specific number of tries
Rafe Kettler, public domain.
"""
@krams915
krams915 / haproxy.cfg
Created October 7, 2011 00:20
haproxy.cfg - Notes
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#Adds a global syslog server. Up to two global servers can be defined. They
#will receive logs for startups and exits, as well as all logs from proxies
#configured with "log global". An optional level can be specified to filter
#outgoing messages. By default, all messages are sent.
#An IPv4 address optionally followed by a colon and a UDP port. If
#no port is specified, 514 is used by default (the standard syslog port).
@mynameisrufus
mynameisrufus / .gitignore
Created November 17, 2011 06:09
Double-forking Unix daemon
tmp
log
doc
daemon
*.swp
@bryanjswift
bryanjswift / .rtorrent.rc
Created December 28, 2011 02:42
rtorrent configuration file with description
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
@wgzhao
wgzhao / heredoc-argoff-2.sh
Created December 29, 2011 14:36
shell here document usage sample
#!/bin/bash
# generate-script.sh
# Based on an idea by Albert Reiner.
OUTFILE=generated.sh # Name of the file to generate.
# -----------------------------------------------------------
# 'Here document containing the body of the generated script.
(
@flores
flores / gist:1623381
Created January 16, 2012 22:28
sample haproxy.cfg
global
log 127.0.0.1 local0 notice
maxconn 50000
daemon
stats socket /tmp/proxystats level admin
defaults
log global
mode http
option httplog
option dontlognull