Skip to content

Instantly share code, notes, and snippets.

View kaspergrubbe's full-sized avatar

Kasper Grubbe kaspergrubbe

View GitHub Profile
function prompt
{
local WHITE="\[\033[1;37m\]"
local GREEN="\[\033[0;32m\]"
local CYAN="\[\033[0;36m\]"
local GRAY="\[\033[0;37m\]"
local BLUE="\[\033[0;34m\]"
export PS1="${GREEN}[git]${WHITE}=> "
}
prompt
document.getElementById('stdbox').outerHTML ='<span id="itemtools" style="z-index:99;"><table cellspacing=0 width=60><tr><td><img src="'+picaddr+'chat/gfx/box/minibox_top_left.gif"></td><td background="'+picaddr+'chat/gfx/box/minibox_top_bg.gif"><table width="100%" cellspacing=0><tr><td width=1><img onclick="deleteitemtools();" src="'+picaddr+'chat/gfx/diverse/arrow_up.gif"></td><td><img src="'+picaddr+'chat/gfx/diverse/spacer.gif"><br><img src="'+picaddr+'chat/gfx/box/titles/ting.gif"></td></td></tr></table></td><td><img src="'+picaddr+'chat/gfx/box/minibox_top_right.gif"></td></tr><tr><td background="'+picaddr+'chat/gfx/box/minibox_left_bg.gif"><img src="'+picaddr+'chat/gfx/diverse/spacer.gif"></td><td bgcolor="white" width="100%" align="center" style="padding-top:2"><a onclick="pickupitem('+id+')"><img src="'+picaddr+'chat/gfx/diverse/hand.gif" style="border-width:1;border-style:solid;border-color:white;" onmouseover="this.style.borderColor=\'black\'" onmouseout="this.style.borderColor=\'white\'"></a> <a o
@kaspergrubbe
kaspergrubbe / gist:5040161
Created February 26, 2013 17:07
Stackscript
#!/bin/bash
# <UDF name="HOSTNAME" Label="server hostname" default="linode"/>
###########################################################
# System
###########################################################
function system_update {
apt-get update
apt-get -y install aptitude
@kaspergrubbe
kaspergrubbe / Deploy.rb
Created February 26, 2013 17:11
Deploy script
set :application, "self"
set :repository, "[email protected]:kaspergrubbe/self.git"
set :branch, "master"
set :deploy_via, :copy
set :migrate_target, :current
set :rails_env, "production"
set :deploy_to, "/home/deployer/apps/#{application}"
# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
#!/usr/bin/env ruby
tagname = ARGV.pop
def prompt(*args)
print(*args)
gets.chomp
end
if tagname.nil?
(function(a,b){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(n
#!/bin/bash
# <UDF name="HOSTNAME" Label="server hostname" default="linode"/>
# Update system
apt-get update
apt-get -y install aptitude
aptitude -y full-upgrade
# Setup needed packages for building Ruby
apt-get -y install gcc make git zlib1g-dev build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
# Net / encoding
require 'net/http'
require 'net/https'
require 'base64'
# Imgur:
$client_id = 'xxx'
$client_secret = 'xxx'
# Imgur user tokens:
location ~ /uploads/ {
root /home/deployer/apps/appname;
gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
}
@kaspergrubbe
kaspergrubbe / install-graphite-ubuntu-13.04.sh
Last active October 4, 2020 11:53 — forked from jgeurts/install-graphite-ubuntu-12.04.sh
Don't overwrite the local_settings.py
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 16. June 2013
####################################
# This is apparantly needed for python when running manage.py
# described here: http://stackoverflow.com/questions/11593556/django-createsuperuser-not-working
export LANG=en_US.UTF-8