Skip to content

Instantly share code, notes, and snippets.

View adamcooke's full-sized avatar

Adam Cooke adamcooke

View GitHub Profile
{
"priority":"Normal",
"description":"They are all over the place!",
"status":"new",
"milestone":"Priority Updates",
"summary":"Change all help links to point to tender and the tender KB",
"assignee":"John Smith",
"category":"Documentation",
"id":4,
"reporter":"Adam Cooke"
crunchie ~ # wget --user=adam --password=aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d https://account.codebasehq.com/cb/app/archive/tgz/39184c99733042019c681056a6e6551382aada12
--18:27:45-- https://account.codebasehq.com/project/repository/archive/tgz/39184c99733042019c681056a6e6551382aada12
=> `39184c99733042019c681056a6e6551382aada12'
Resolving account.codebasehq.com... 94.76.230.38
Connecting to account.codebasehq.com|94.76.230.38|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://account.codebasehq.com/project/repository/downloadqueue/42019c6/ui9kjzbg96fjha4k8qzmi22ffjrxdgzvw8gr33k8/cb-app-39184c.tgz [following]
--18:27:51-- https://account.codebasehq.com/downloadqueue/42019c6/ui9kjzbg96fjha4k8qzmi22ffjrxdgzvw8gr33k8/cb-app-39184c.tgz
=> `project-repository-39184c.tgz'
Reusing existing connection to account.codebasehq.com:443.
@adamcooke
adamcooke / gist:207720
Created October 11, 2009 15:22
Ubuntu/Debian Ruby & Passenger Install Script
#!/bin/bash
cd /tmp
apt-get update
apt-get upgrade
aptitude -yq install build-essential --without-recommends
aptitude -yq install zlib1g-dev ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby
EDITOR="mate -w"
export GIT_EDITOR="mate -w"
# Put git branch in my prompt.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\[\1\]/'
}
export PS1='\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[0;31m\]\w\[\033[00m\]\[\033[37m\]$(parse_git_branch)\[\033[00m\]\$ '
export PATH="/usr/local/mysql/bin/:/opt/local/bin:/opt/local/sbin:/Users/adam/.gem/ruby/1.8/bin:$PATH"
@adamcooke
adamcooke / gist:213628
Created October 19, 2009 18:59 — forked from wmoxam/gist:41713
Passenger worker monitor to kill workers which use too much RAM. Needs to sudo otherwise RSS figures aren't available. Daemonized with Daemons gem for easy of use.
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
Daemons.run_proc('PassengerMonitor') do
command = 'sudo passenger-memory-stats'
memory_limit = 250
class SomeJob
include Resque::Mixin::Status
def self.perform(*args)
resque_status :being_awesome
end
end
@adamcooke
adamcooke / small_revenue_with_signups.rb
Created November 8, 2009 19:59
An example of 'charty' - a rails plugin for amcharts
chart :small_revenue_with_signups do |c|
c.type = :line
## Defines the font size & actual font to use. The size & background colours are used in the
## the XML settings and in the HTML which is generated for this chart (unless overriden in the
## render).
c.font = 'Arial'
c.font_size = 11
c.width = 400
c.height = 180
83.170.74.96/27 [codebase network]
87.117.197.109/32 [pluto]
78.129.239.38/32 [neptune]
10.0.1.0/24 [atech workgroup]
10.0.0.0/24 [atech servers]
10.0.70.0/24 [codebase staging network]
The Appli Gem allows you to easily access your Appli account functions from the
command line. The functions below outline the options which are currently
available.
Global Commands
--------------------------------------------------------------------------------
create Create a new application with the provided identifier
help Displays this help message
keys:add Upload your local public key to your appli user account
@adamcooke
adamcooke / cloudapp-export.rb
Created January 11, 2013 15:45
Export all your drops from CloudApp using this quick Ruby script
#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
#
# gem install cloudapp_api
# ruby cloudapp-export.rb adam@atechmedia.com mypassword
#