Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@border
border / gochan.go
Created October 14, 2014 15:20
Golang chan test
package main
import (
"runtime"
"sync"
"time"
)
func Generate(ch chan<- int, quit chan bool) {
for i := 2; i < 1000; i++ {
# Last Change: 2008-06-24 02:28:36
"""
Enumerates active processes as seen under windows Task Manager on Win NT/2k/XP using PSAPI.dll
(new api for processes) and using ctypes.Use it as you please.
Based on information from http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q175030&ID=KB;EN-US;Q175030
By Eric Koome
email ekoome@yahoo.com
license GPL
@border
border / Makefile
Created January 12, 2011 08:56
Go Programming Language Package Test
include $(GOROOT)/src/Make.inc
all:
$(GC) numbers.go
$(GC) filestuts.go
$(GC) test.go
$(LD) -o test.out test.$O
clean:
rm -rf *.6 *.8 *.o *.out
@border
border / httpGet.go
Created January 29, 2011 13:30
Http Get Example
package main
import (
"log"
"io/ioutil"
"http"
)
func main() {
res, _, err := http.Get("http://bbs.golang-china.org/")
@border
border / go_client.go
Created March 31, 2011 01:45
A Server By Go
package main
import (
"log"
"net"
)
func main() {
@border
border / gist:897651
Created April 1, 2011 02:45
Logging in Reverse, Nice use of the reader interface in logging From: https://rogpeppe.wordpress.com/2011/03/31/logging-in-reverse/
package main
import (
"io"
"os"
"log"
)
type msg struct {
data []byte
#include <stdio.h>
#include <stdlib.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
struct ov7725_reg {
unsigned char addr;
unsigned char val;
};
@border
border / mongoIndexTest.py
Created June 18, 2011 15:21
How to save 200% RAM by selecting the right key data type for #MongoDB
Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz
Mem 2G
bvcom@ubuntu:~/work/db/test$ time python mongoIndexTest.py
ObjectID
int
Base64 BSON
string
real 4m59.993s
user 2m30.729s
@border
border / libxslt.sh
Created October 26, 2011 02:10
android 2.3.4_r1 building error
border@b0rder:~$ cat /etc/issue
Ubuntu 11.04 \n \l
border@b0rder:~$ uname -a
Linux b0rder 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=generic