Skip to content

Instantly share code, notes, and snippets.

@fsouza
fsouza / runserver_quiet.py
Created October 28, 2011 21:01
Quiet version of runserver (only for continuous integration!)
# -*- coding: utf-8 -*-
import sys
from django.core.management.commands.runserver import Command as BaseCommand
class Command(BaseCommand):
def handle(self, addrport='', *args, **options):
sys.stdout = open('/dev/null', 'w')
sys.stderr = open('/dev/null', 'w')
user nginx;
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
% brew upgrade
==> Upgrading 2 outdated packages, with result:
git 1.7.8.2, readline 6.2.2
==> Upgrading git
==> Downloading http://git-core.googlecode.com/files/git-1.7.8.2.tar.gz
File already downloaded in /Users/francisco.souza/Library/Caches/Homebrew
==> make prefix=/usr/local/Cellar/git/1.7.8.2 install
GIT_VERSION = 1.7.8.2
* new build flags or prefix
* new link flags
brew doctor
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libcharset.1.dylib
/usr/local/lib/libgmp.3.5.2.dylib
/usr/local/lib/libiconv.2.dylib
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(void)
#!/bin/csh
setenv CLASSPATH "`pwd`/bin"
java br.com.andressa.main.Main
package lxc
import (
"bytes"
"os/exec"
)
func LxcCreate(containerName, config string) error {
if err := exec.Command("sudo", "lxc-start", "--daemon", "-n", containerName).Start(); err != nil {
return err
type Person struct {
Name string
Age int
}
p := Person{Name: "andrews", Age: 1000}
Update(p, {"age": 27})
#!/bin/csh
foreach a (`ls | grep -E 'aula_[0-9]$'`)
set new_a=`echo $a | sed 's/aula_\([0-9]\)/aula_0\1/'`
mv $a $new_a
end
@fsouza
fsouza / sorteio.py
Created May 9, 2012 15:03
Script de sorteio do dev in cachu
# -*- coding: utf-8 -*-
import random
import sys
limpa_nl = lambda arq: [l.strip('\n') for l in arq.readlines()]
def main():
if len(sys.argv) != 2:
print "Você deve informar o arquivo com inscritos!"