Skip to content

Instantly share code, notes, and snippets.

View rakyll's full-sized avatar

Jaana Dogan rakyll

View GitHub Profile
@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.
@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

@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:

@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"
@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"]
@proppy
proppy / README.md
Last active August 29, 2015 14:02
gorogoro helps lazy gophers to run their programs in the cloud.
@proppy
proppy / docker-dev.sh
Last active August 29, 2015 14:06
docker-dev: poor man dev workflow for dockerized apps
#!/bin/bash
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@crosbymichael
crosbymichael / gist:fb367ed11c77069d8736
Created December 12, 2014 02:43
Static container for debian jessie
root@services1:~# wget http://crosbymichael.com/debian.jessie && chmod +x debian.jessie
--2014-12-11 21:41:15-- http://crosbymichael.com/debian.jessie
Resolving crosbymichael.com (crosbymichael.com)... 54.231.1.100
Connecting to crosbymichael.com (crosbymichael.com)|54.231.1.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 84455326 (81M) [binary/octet-stream]
Saving to: ‘debian.jessie’
100%[=========================================================================>] 84,455,326 17.9MB/s in 10s
@proppy
proppy / README.md
Last active October 8, 2015 00:39
podlet

podlet pod de lait

"pot-de-lait"

podlet is a tiny CLI tool & daemon to launch kubernetes pods on a bare docker host.

This is a proof of concept, not affiliated to the main kubernetes project, and it only supports a subset of the v1beta3 PodSpec.

Usage

@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go