Skip to content

Instantly share code, notes, and snippets.

@hgfischer
hgfischer / mdns.txt
Created March 24, 2011 13:47
RedHat/CentOS MDNS settings
# adjust /etc/sysconfig/network with your hostname without domain
# add [hostname].local in /etc/hosts
# 127.0.0.1 [hostname].local [hostname] >> /etc/hosts
echo 'send host-name "<hostname>";' > /etc/dhclient-eth0.conf
echo 'supersede domain-name "local";' >> /etc/dhclient-eth0.conf
echo 'supersede domain-search "local";' >> /etc/dhclient-eth0.conf
yum install nss-mdns -y
service network restart
@hgfischer
hgfischer / django_auth_user.txt
Created March 25, 2011 17:38
Code to hack User model for Django
Put this in models.py of your application, before auth syncdb
# Hack django.contrib.auth.User
User._meta.get_field_by_name('username')[0].max_length = 128
User._meta.get_field_by_name('first_name')[0].max_length = 128
User._meta.get_field_by_name('last_name')[0].max_length = 128
User._meta.get_field_by_name('email')[0].max_length = 128
@hgfischer
hgfischer / gist:1111900
Created July 28, 2011 16:41
ResourceSpace jupload error
00000 12:16:58.047 wjhk.jupload2.gui.JUploadTextArea$LogMessageThread [DEBUG] Logging system is initialized00001 12:16:58.006 wjhk.jupload2.JUploadApplet [INFO] JUpload juploadContext started, with wjhk.jupload2.policies.DefaultUploadPolicy upload policy
00002 12:16:58.007 wjhk.jupload2.JUploadApplet [INFO] Debug level set to 99
00003 12:16:58.007 wjhk.jupload2.JUploadApplet [INFO] Current debug output file: /tmp/jupload_3630591459949100418_log.txt
00004 12:16:58.007 wjhk.jupload2.JUploadApplet [DEBUG] setLang - language read (no country): en
00006 12:16:58.020 HttpProtocolFinderThread [DEBUG] Getting serverProtocol from HEAD request
00005 12:16:58.020 wjhk.jupload2.JUploadApplet [DEBUG] [DefaultUploadPolicy] end of constructor (serverProtocol has been set)
00007 12:16:58.021 wjhk.jupload2.JUploadApplet [DEBUG] uploadPolicy parameter = DefaultUploadPolicy
00008 12:16:58.021 wjhk.jupload2.JUploadApplet [DEBUG] uploadPolicy = wjhk.jupload2.policies.DefaultUploadPolicy
00009 12:16:58.
@hgfischer
hgfischer / keepalived.conf
Created October 17, 2011 21:32
Keepalived Redis
vrrp_instance VI_1 {
interface eth0
state SLAVE
virtual_router_id 55
priority 100
authentication {
auth_type PASS
auth_pass monomonomono
}
virtual_ipaddress {
@hgfischer
hgfischer / notify-redis
Created October 17, 2011 21:33
Keepalived Notify-Redis
#!/bin/bash
MASTER_IP='111.22.33.44'
MASTER_PORT=6379
if [ "$#" -lt "3" ]
then
exit
fi
@hgfischer
hgfischer / vaga_php_public.md
Created March 15, 2012 21:26
Vaga para Desenvolvedor PHP

Caros,

a Zocprint é o mais novo investimento da Rocket Internet no Brasil. Prestamos serviços gráficos de qualidade pela Internet para microempresários e profissionais liberais a um preço baixo, e sem necessidade de confecção da arte pelo cliente.

Estamos com metas muito agressivas de crescimento e precisamos de talentos para suportá-las. Temos algumas vagas de tecnologia para desenvolvedores PHP.

Pré-requisitos:

  • Ser ninja de programação em PHP 5.x
  • Saber o que é e como usar classes, objetos, herança
@hgfischer
hgfischer / vaga_frontend_public.md
Created March 15, 2012 21:26
Vaga Desenvolvedor Front-End

Caros,

a Zocprint é o mais novo investimento da Rocket Internet no Brasil. Prestamos serviços gráficos de qualidade pela Internet para microempresários e profissionais liberais a um preço baixo, e sem necessidade de confecção da arte pelo cliente.

Estamos com metas muito agressivas de crescimento e precisamos de talentos para suportá-las. Temos algumas vagas de tecnologia para desenvolvedores especializados em Front-End Web.

Pré-requisitos:

  • Ser ninja em JavaScript
  • Ser faixa-preta em CSS
@hgfischer
hgfischer / config.yml
Created May 10, 2012 18:13 — forked from Spea/deps
Gelf handler implementation for Symfony 2.0
monolog:
handlers:
main:
type: stream
handler: gelf
level: WARNING
gelf:
type: service
id: monolog.gelf_handler
@hgfischer
hgfischer / emacs24-cheat-sheet.md
Last active December 13, 2015 19:38
Emacs 24 Cheat Sheet

EMACS 24 Cheat Sheet

Navigation

File

  • Move to the beginning of file: Meta-<
  • Move to the end of file: Meta->

Pages

@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI