Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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