Skip to content

Instantly share code, notes, and snippets.

@stasl
stasl / gist:5917465
Created July 3, 2013 12:22
rebase current branch
BRANCH=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
git co master;
git pull --rebase;
git co $BRANCH;
git rebase master;
git push --force origin $BRANCH;
@bradland
bradland / install_ruby.sh
Last active December 24, 2015 20:59
A reasonable Ruby install script. Includes "essential" deps.
# This build script will build Ruby 2.0.0-p247. You will need su to
# root or sudo as required.
# This build tested against Debian 7.0 64-bit arch, installed from net-inst image.
# These aren't specifically Ruby deps; more for building software in general
# (you probably already have them)
apt-get install -y build-essential autoconf
# These deps will support common libraries like yaml and give you the best irb experience.
@woglinde
woglinde / gist:0a7629a29e2228c4ac88
Created November 20, 2014 13:22
ssh force command demonstration
#!/bin/sh
logger "SSH COMMAND is $SSH_ORIGINAL_COMMAND"
if test -n "$SSH_ORIGINAL_COMMAND" -a parse_to_allow($SSH_ORIGINAL_COMMAND) ; then
/bin/bash -c "$SSH_ORIGINAL_COMMAND"
else
logger "shell access denied"
fi
@erichs
erichs / capfile.md
Last active November 22, 2017 14:42
Papers, Please
    set :application, `basename $(pwd)`.chomp
    set :commit_sha, `git rev-parse --short "HEAD"`.chomp
    set :default_environment, {
      "RATIONALE_CLIENT" => "capistrano",
      "RATIONALE" => "'Deploying #{application} #{commit_sha}'"
    }
@ewherrmann
ewherrmann / resque.rake
Last active July 2, 2020 00:36
Collection of Resque related custom rake tasks from around the web
require 'resque/tasks'
namespace :resque do
def del(key)
Resque.redis.keys(key).each { |k| Resque.redis.del(k) }
end
desc "Resque setup according to installation guide"
task :setup => :environment
@francois-blanchard
francois-blanchard / error_capistrano_deploy_could_not_parse_object.md
Last active January 13, 2021 10:05
Error Capistrano deploy - fatal: Could not parse object 'xx...xx'

Error Capistrano deploy - fatal: Could not parse object 'xx...xx'

  1. Connect you to your server $ ssh user@myserver
  2. Go to your deploy path and select the shared directorycd /your/directory/deploy/shared
  3. Remove the git cache rm -rf cached-copy
  4. Retry to deploy & have fun ;)
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
@eirikb
eirikb / clicktest.md
Last active April 9, 2021 16:49
Automated click testing in bash

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies

@karmi
karmi / nginx-elasticsearch-proxy.conf
Created May 23, 2011 08:16
Route requests to ElasticSearch to authenticated user's own index with an Nginx reverse-proxy
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost:8080/_search?q=*
#
# is rewritten to:
#
@JamesDullaghan
JamesDullaghan / digitalocean.md
Created July 6, 2013 20:54
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email