This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface=eth0 | |
dhcp-range=10.5.0.50,10.5.0.150,12h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
submenu "Ubuntu" { | |
submenu "10.04 LTS Lucid Lynx" { | |
submenu amd64 { | |
menuentry live { | |
loopback loop /boot/iso/ubuntu-10.04-desktop-amd64.iso | |
linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash iso-scan/filename=/boot/iso/ubuntu-10.04-desktop-amd64.iso noeject noprompt -- | |
initrd (loop)/casper/initrd.lz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc -Wall -lrt -std=c99 -o foo foo.c | |
#define _POSIX_C_SOURCE 199309L | |
#include <time.h> | |
int main() { | |
struct timespec ts; | |
clock_gettime(CLOCK_MONOTONIC, &ts); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
git fetch keithw | |
was_master= | |
if out=$(git symbolic-ref HEAD); then | |
if [ "$out" = "refs/heads/master" ]; then | |
git checkout HEAD@{0} | |
was_master=yes | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _XOPEN_SOURCE | |
#include <wchar.h> | |
#include <locale.h> | |
#include <stdio.h> | |
int main() { | |
setlocale(LC_ALL, ""); | |
printf("%d\n", wcwidth(0xE6)); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
class Foo(object): | |
def __init__(self, name): | |
self.name = name | |
def add(self, x, y): | |
print '%s: %d + %d = %d' % (self.name, x, y, x+y) | |
obj = Foo('bar') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from ctypes import * | |
for ln in open('/proc/self/maps'): | |
if "[vdso]" in ln: | |
start, end = [int(x,16) for x in ln.split()[0].split('-')] | |
CDLL("libc.so.6").write(1, c_void_p(start), end-start) | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int x[] = {-1}; | |
#include <stdio.h> | |
int main() { | |
printf("Hello, world!\n"); | |
return 0; | |
} | |
//-}(); main = putStrLn "Hello, world!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; $ nasm -fbin print.asm -o print.com | |
; $ cat print.com | |
; h<|XP- {P_X(%GGG(%GGWZ- sh LI!XI!Hello, DOS!$ | |
; | |
; C:\>PRINT.COM | |
; Hello, DOS! | |
org 100h | |
; di <- replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from BeautifulSoup import BeautifulSoup | |
for a in BeautifulSoup(sys.stdin).findAll('a'): | |
print a['href'] |
OlderNewer