Skip to content

Instantly share code, notes, and snippets.

View xor-gate's full-sized avatar
👽

Jerry Jacobs xor-gate

👽
View GitHub Profile
@tsupo
tsupo / hmac_sha256.c
Created May 15, 2009 12:21
HMAC-SHA256 written in C with OpenSSL 0.9.8k
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/x509.h>
#include <openssl/hmac.h>
void
hmac_sha256(
const unsigned char *text, /* pointer to data stream */
@twslankard
twslankard / mountpoint.c
Created January 14, 2011 22:25
Using stat to determine programmatically whether a file is a mount point.
#include <assert.h>
#include <sys/stat.h>
#include <stdint.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char * argv[]) {
@bulljit
bulljit / transmissionUnRAR.sh
Created January 23, 2011 02:31
Transmission-Daemon Script: OnComplete unrar files and delete torrent
#!/bin/sh
DEST_DIR="/some/other/dir"
function linker() { # create simlink to downloaded files, rather than copy to final directory
if [ ! -d "$DEST_DIR/$1" ]; then mkdir "$DEST_DIR/$1"; fi
cd "$1"
for F in *; do
if [ -d "$F" ]; then linker "$1/$F"; fi
ln -s "$TR_TORRENT_DIR/$1/$F" "$DEST_DIR/$1"
@dataich
dataich / create_dmg.sh
Created May 1, 2011 13:50
create .dmg image after built on Xcode
set -ex
[ "$ACTION" = build ] || exit 0
[ "$BUILD_VARIANTS" = "normal" ] || exit 0
[ "$CONFIGURATION" = "Release" ] || exit 0
dir="$TEMP_FILES_DIR/disk"
dmg="$HOME/Desktop/$PROJECT_NAME.dmg"
rm -rf "$dir"
@nitrogenlogic
nitrogenlogic / 00_popen3_moved.md
Last active May 29, 2019 11:53
Two implementations of a popen3() function in POSIX/C providing stdin, stdout, and stderr
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@Jim-Holmstroem
Jim-Holmstroem / numpy_array_hash.py
Created February 21, 2012 10:51
Hash numpy.array
from hashlib import sha1
import numpy
arr=numpy.zeros((256,256,4))
sha1(arr)
@CocoaBeans
CocoaBeans / gdbinit
Created February 21, 2012 21:58
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@jordanorelli
jordanorelli / client.go
Created May 7, 2012 17:16
rpc server example in go
package main
import (
"bufio"
"log"
"net/rpc"
"os"
)
func main() {