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
#!/Users/dragonfox/vpython/bin/python | |
import gc | |
import sys | |
from greenlet import getcurrent, GreenletExit | |
from gevent import spawn, spawn_later | |
from gevent.hub import get_hub | |
from gevent.greenlet import Greenlet | |
def run(): | |
self = getcurrent() |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type Message struct { | |
Timestamp time.Time | |
Client *Client |
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
type Message struct { | |
Value string | |
} | |
func MakeElastic() (<-chan Message, chan<- Message) { | |
input := make(chan Message, 64) | |
output := make(chan Message, 64) | |
middle := make(chan []Message, 1) | |
go func(middle chan []Message, input <-chan Message) { | |
defer close(middle) |
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
For PostgreSQL you'd need to increase your kernel shared memory quotas. For Mac OS X to set it to 40MBs do: | |
sudo sysctl -w kern.sysv.shmmax=41943040 | |
sudo sysctl -w kern.sysv.shmall=10240 | |
Then in mydb/postgresql.conf change: | |
max_connections = 128 | |
More info here: |
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 escript | |
%% -*- erlang -*- | |
%%! -smp enable | |
-module(dnstest). | |
-mode(compile). | |
-record(dnsmsg, {id, qr, opcode, aa, tc, rd, ra, z, rcode, | |
questions, answers, authorities, extras, packet}). | |
-record(dnsquestion, {name, type, class}). |
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 sun.misc.*; | |
public class CrashSignal { | |
public static void main(String[] args) { | |
Signal signal = new Signal("INT"); | |
SignalHandler signalHandler = SignalHandler.SIG_IGN; | |
signalHandler.handle(signal); | |
} |
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/python | |
# -*- encoding: utf-8 -*- | |
from __future__ import print_function | |
import time | |
import threading | |
import multiprocessing | |
from Queue import Queue | |
from multiprocessing import Queue as MPQueue | |
messages = ( |
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
description "Configure Intel Rapid Start" | |
start on acpi-device-added DEVPATH=*/INT3392:00 | |
task | |
script | |
test -f "/sys$DEVPATH/wakeup_events" || { stop; exit 0; } | |
echo -n 2 >"/sys$DEVPATH/wakeup_events" | |
end script |
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 os | |
import shutil | |
from bsddb.db import * | |
DB_HOME = 'data' | |
DB_FILENAME = 'queue.db' | |
if os.path.isdir(DB_HOME): | |
shutil.rmtree(DB_HOME) | |
os.makedirs(DB_HOME) |
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
$ cat /proc/cpuinfo | |
Processor : Marvell PJ4Bv7 Processor rev 2 (v7l) | |
processor : 0 | |
BogoMIPS : 1332.01 | |
processor : 1 | |
BogoMIPS : 1332.01 | |
processor : 2 | |
BogoMIPS : 1332.01 |
OlderNewer