Skip to content

Instantly share code, notes, and snippets.

View bryanveloso's full-sized avatar

Bryan Veloso bryanveloso

View GitHub Profile
start on runlevel [23]
stop on runlevel 1
stop on shutdown
respawn
script
cd /home/solr
java -jar start.jar
end script
@jcroft
jcroft / Cache settings
Created January 23, 2011 21:43
Using Django trunk with the python-memcache background, I can set the cache, but not get from it. But it's definitely setting, because you can see that the underlying memcache instance (cache._cache) is able to get -- it's just django's cache.get() method
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
'KEY_PREFIX': 'barstar_',
}
}
@jacobian
jacobian / replication_fabfile.py
Created January 27, 2011 18:05
A fab task to start pg9 hot standby.
def start_replication():
"""
Begin Postgresql standby
"""
# Stop pg on the slave machine.
with settings(host_string=env.db_slave):
run('service postgresql-9.0 stop')
# Create the backup on the master machine
with settings(host_string=env.db_master):
### Basic daemon config
ServerRoot "/etc/apache2"
PidFile ${APACHE_PID_FILE}
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
ServerTokens ProductOnly
ServerAdmin webmaster@djangoproject.com
### Listen on localhost:8000 (behind the proxy)
@tmm1
tmm1 / README.md
Created February 10, 2011 05:33
no longer requires any proxies! just replace your enhancers.js. also see https://gist.github.com/821736
@timblair
timblair / caveatPatchor.js
Created February 15, 2011 10:27 — forked from protocool/caveatPatchor.js
Sample caveatPatchor.js file for use in Propane 1.1.2 and above: pulls avatars from Gravatar
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@ericflo
ericflo / twitter_to_convore.py
Created February 20, 2011 10:02
A small script which takes keywords to track on Twitter and streams them live into a Convore topic.
import base64
import httplib
import threading
import urllib
import tweepy
CONVORE_BOT_USERNAME = ''
CONVORE_BOT_PASSWORD = ''
CONVORE_TOPIC_ID = '7612'
from tastypie.resources import ModelResource
from yourapp.api.cache import CustomCache
from yourapp.models import YourModel
class SampleResource(ModelResource):
class Meta:
queryset = YourModel.objects.all()
resource_name = 'sample'
# 2010-10-01
#
# Mac OS X 10.6.3
# Homebrew 0.7
# Xcode 3.2.4
# Git 1.7.3.1
# RVM 1.0.12
# Ruby 1.9.2, 1.8.7
# Rails 3.0.0
# Passenger 3.0.0.pre4
<!--
A quick fix for my friend Chris Bowler.
http://chrisbowler.com/journal/alternate-css-files
-->
<link rel="stylesheet" media="screen" id="time_style" href="/-/css/day.css" />
<script>