Skip to content

Instantly share code, notes, and snippets.

View rakyll's full-sized avatar

Jaana Dogan rakyll

View GitHub Profile
@proppy
proppy / README.md
Last active August 29, 2015 14:02
gorogoro helps lazy gophers to run their programs in the cloud.
@proppy
proppy / Dockerfile
Last active August 29, 2015 13:57
gce2docker: bootstrap a GCE vm with docker
FROM google/cloud-sdk
RUN apt-get update && apt-get install -y --no-install-recommends curl sshpass netcat-traditional
RUN curl https://get.docker.io/builds/Linux/x86_64/docker-latest -o /bin/docker && chmod +x /bin/docker
RUN curl http://stedolan.github.io/jq/download/linux64/jq -o /bin/jq && chmod +x /bin/jq
ADD gce2docker-fork.sh /
EXPOSE 44243
ENV DOCKER_HOST :44243
ENTRYPOINT ["/gce2docker-fork.sh"]
@rcrowley
rcrowley / grace.go
Last active March 1, 2023 16:06
Graceful stop in Go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jordelver
jordelver / gist:3139365
Created July 18, 2012 22:29
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0

1: EFI 209.7 MB disk0s1

@willb
willb / ptr_inspect.c
Created October 3, 2008 01:57
This is some example code showing how to use the ptrace system call under Linux to trace the system calls of a child process.
/*
ptr_inspect.c
Demonstration code; shows how to trace the system calls in a child
process with ptrace. Only works on 64-bit x86 Linux for now, I'm
afraid. (Even worse, it's only tested on Linux 2.6....)
The callname() function looks clunky and machine-generated because it
*is* clunky and machine-generated.