Skip to content

Instantly share code, notes, and snippets.

@fsouza
fsouza / t9.c
Last active December 10, 2015 09:48
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define readline(buf) do { \
int j, c; \
for(j = 0; (c = getchar()) != '\n' && c != EOF; j++) { \
buf[j] = c; \
} \
package main
import (
"bytes"
"encoding/gob"
"github.com/kr/beanstalk"
"fmt"
)
type Message struct {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __cilk
#include <cilk/cilk.h>
#else
#define cilk_spawn
#endif
package main
import (
"github.com/kr/beanstalk"
)
func main() {
var id uint64
c, err := beanstalk.Dial("tcp", "127.0.0.1:11300")
if err != nil {
limit nofile 20000 20000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
pre-start script
mkdir -p /var/lib/mongodb/
mkdir -p /var/log/mongodb/
end script
start on runlevel [2345]
@fsouza
fsouza / gist:4722172
Created February 6, 2013 12:02
fsnotify data races
==================
WARNING: DATA RACE
Read by goroutine 8:
runtime.mapaccess1()
/Users/f/lib/go/src/pkg/runtime/hashmap.c:839 +0x0
github.com/howeyc/fsnotify.(*Watcher).readEvents()
/Users/f/gocode/src/github.com/howeyc/fsnotify/fsnotify_bsd.go:255 +0x650
Previous write by goroutine 7:
runtime.mapassign1()
% setenv HOMEBREW_MAKE_JOBS 1
% setenv VERBOSE 1
% brew install irssi
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://irssi.org/files/irssi-0.8.15.tar.bz2
Already downloaded: /Library/Caches/Homebrew/irssi-0.8.15.tar.bz2
/usr/bin/tar xf /Library/Caches/Homebrew/irssi-0.8.15.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file configure
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by irssi configure 0.8.15, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --prefix=/usr/local/Cellar/irssi/0.8.15 --sysconfdir=/usr/local/etc --with-bot --with-proxy --enable-ssl --enable-ipv6 --with-socks --with-perl=yes --with-perl-lib=/usr/local/Cellar/irssi/0.8.15/lib/perl5/site_perl
## --------- ##
## Platform. ##
% setenv HOMEBREW_MAKE_JOBS 1
% setenv VERBOSE 1
% brew install irssi
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://irssi.org/files/irssi-0.8.15.tar.bz2
Already downloaded: /Library/Caches/Homebrew/irssi-0.8.15.tar.bz2
/usr/bin/tar xf /Library/Caches/Homebrew/irssi-0.8.15.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file configure
% brew doctor
Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.