Skip to content

Instantly share code, notes, and snippets.

# If cached file exists, serve it and stop processing
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [L]
# other redirection (imgs, js, css, ...)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.*/mephisto/.*
RewriteCond %{REQUEST_URI} !.*html
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1 -f
installing rails...
ruby-1.8.6-p383: ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux]
/home/worker/.rvm/ruby-1.8.6-p383/bin/ruby: No such file or directory -- gem (LoadError)
worker@railsdev:~/.rvm/ruby-1.8.7-p174/bin$ rvm --shebang --env inspect gem
<i> /home/worker/.rvm/ruby-1.8.7-p174/bin/gem: </i>
#!/home/worker/.rvm/ruby-1.8.7-p174/bin/ruby
ENV['GEM_HOME']=ENV['GEM_HOME'] || '/home/worker/.rvm/gems/ruby/1.8.7'
ENV['GEM_PATH']=ENV['GEM_PATH'] || '/home/worker/.rvm/gems/ruby/1.8.7'
ENV['PATH']='/home/worker/.rvm/ruby-1.8.7-p174/bin:/home/worker/.rvm/gems/ruby/1.8.7/bin:' + ENV['PATH']
This is a script to take a debian box from ground zero to Rails Testing Machine.
You will end up with MySQL, Postgres, Sqlite, Memcached and many rubies.
As well as automated testing scripts.
install instructions:
1) untar the installer to your home directory
2) Setup password-less sudo for your work account (not mandatory, but nice)
3) There really needs to be a step three - don't you think?
4) run the installer
Let's make a list of Sinatra-based apps!
Apps:
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com"
- http://github.com/rtomayko/wink "minimalist blogging engine"
- http://github.com/foca/integrity "The easy and fun Continuous Integration server"
- http://github.com/sr/git-wiki "git-powered wiki"
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits."
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>."
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!"
#!/usr/bin/env bash
#
# Supported Operating Systems:
#
# - Arch Linux
# - RedHat Based (CentOS, ...)
# - Debian Based (Ubuntu, ...)
#
<?xml version="1.0" standalone='no'?>
<!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# Modified slightly by Greg AT Nokes DOT Name
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]
@tsykoduk
tsykoduk / gist:897781
Created April 1, 2011 05:17
Growl mail replacement
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
set maxlen to 200
set the notificationList to {"new Mail"}
tell application "GrowlHelperApp"
register as application ¬
"myGrowlMail" all notifications notificationList ¬
default notifications notificationList ¬
icon of application "Mail"
[app;tomcats]
update no
contacts no
tomcat_jvm.update no
tomcat_jvm.graph_category Tomcat
tomcat_jvm.graph_title Tomcat JVM
tomcat_jvm.stack \
app;server0:tomcat_jvm.tomcat_jvm \
app;server1:tomcat_jvm.tomcat_jvm \
app;server2:tomcat_jvm.tomcat_jvm \