Skip to content

Instantly share code, notes, and snippets.

View fuzzy's full-sized avatar

Mike 'Fuzzy' Partin fuzzy

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
package main
import (
"fmt"
"net"
"time"
)
func main() {
ts := time.Now().Unix()
#!/usr/bin/env python2
import time
import socket
if __name__ == '__main__':
st = int(time.time())
while 1:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('relay-vip.phl.corp.theplatform.com', 2003))
@fuzzy
fuzzy / golang.sh
Last active October 27, 2016 17:49
Added this to my ~/.profile.d/ which is helpful as I nfs mount my home directory across several machines, not all running Linux, and not all on the same architecture. under $GOPATH src and pkg are shared dirs with each bin dir being arch/platform specific.
# Uncomment this for debugging output
set -x
GOOS=$(uname -s)
GOARCH=$(uname -m)
GOBASE=${HOME}/.goroot/${GOOS}/${GOARCH}
GOVERS_BSTRAP=1.4.3
GOFILE_BSTRAP=${HOME}/.goroot/go${GOVERS_BSTRAP}.src.tar.gz
GOURL_BSTRAP=https://storage.googleapis.com/golang/go${GOVERS_BSTRAP}.src.tar.gz
GOVERS_ACTIVE=1.7.3
package main
import (
"bytes"
"fmt"
"time"
)
func Strappend(p string, a string) string {
b := bytes.NewBufferString(p)
package main
import (
"bytes"
"fmt"
"math"
"time"
)
func Strappend(p string, a string) string {
import urllib2
from multiprocessing.dummy import Pool as ThreadPool
urls = [
'http://www.python.org',
'http://www.python.org/about/',
'http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html',
'http://www.python.org/doc/',
'http://www.python.org/download/',
'http://www.python.org/getit/',
---
# This file of course builds nothing, but is here to show you how a specfile
# is written. It's pretty standard fare, nothing crazy or wildly different from
# things like a rpm specfiles, or homebrew recipes (altho not in ruby).
#
# Some rules to keep in mind:
#
# 1) All options are required.
# 2) Any value you have defined below, is available as a macro, there are other
# macros available by default, they will documented elsewhere, and are referenced
{
/*
This file of course builds nothing, but is here to show you how a specfile
is written. It's pretty standard fare, nothing crazy or wildly different from
things like a rpm specfiles, or homebrew recipes (altho not in ruby).
Some rules to keep in mind:
1) All options are required.
2) Any value you have defined below, is available as a macro, there are other
@fuzzy
fuzzy / bash_prompt.sh
Created May 22, 2016 17:36
Color coding by platform: Supports Linux(Arch, Gentoo, Debian, Redhat, and derived systems), (Free|Net|Open)BSD, and OSX.
# Light shades
L_black="$(echo -e "\033[0;30m")"
L_red="$(echo -e "\033[0;31m")"
L_green="$(echo -e "\033[0;32m")"
L_brown="$(echo -e "\033[0;33m")"
L_blue="$(echo -e "\033[0;34m")"
L_purple="$(echo -e "\033[0;35m")"
L_cyan="$(echo -e "\033[0;36m")"
L_white="$(echo -e "\033[0;37m")"