Skip to content

Instantly share code, notes, and snippets.

View sepastian's full-sized avatar
💭
\_ . |‾‾‾| o-`o

Sebastian Gassner sepastian

💭
\_ . |‾‾‾| o-`o
View GitHub Profile
@sepastian
sepastian / reset_pwd_os_x_10_4.sh
Created February 13, 2014 07:45
Reset the password of any user in Mac OS X 10.4.
# Reset the password of any user in Mac OS X 10.4.
# Boot into single user mode pressing and holding Ctrl + S after pressing the power button.
# When the root prompt appeats, do:
sh /etc/rc
passwd admin
reboot
@sepastian
sepastian / locomotive_cms_install.sh
Last active August 29, 2015 14:00
LocomotiveCMS install
# Install Locomotive CMS's wagon and engine
# Ruby version used: ruby-2.1.1 [ i686 ] RVM
# Depends: mongo, imagemagick
# Wagon
# See http://doc.locomotivecms.com/get-started/install-wagon#linux
gem install locomotivecms_wagon
# Engine
@sepastian
sepastian / gist:3519bc30689fb8650686
Created September 12, 2014 13:32
Upgrading PostgreSQL 9.1 to 9.3 on Debian 7 (wheezy) using pg_upgrade
# https://no0p.github.io/postgresql/2014/03/29/upgrading-pg-ubuntu.html
@sepastian
sepastian / crontab.sh
Created March 17, 2015 09:02
rbenv and cron
# Run a Ruby script every minute.
# Use the Ruby provided by rbenv.
#
# Edit with crontab -e.
*/1 * * * * /bin/bash -c 'export PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:"$PATH"; eval "$(rbenv init -)"; cd $HOME/path/to/script/; ruby ./graph.rb > /output/path/index.html'
### Keybase proof
I hereby claim:
* I am sepastian on github.
* I am sepastian (https://keybase.io/sepastian) on keybase.
* I have a public key whose fingerprint is 214D 35E9 65E8 6DDF AFE4 F388 03AB E849 A825 7946
To claim this, I am signing this object:
@sepastian
sepastian / rbenv_ruby-build_debian.sh
Last active August 29, 2015 14:22
Install rbenv + ruby-build with dependencies in Debian
# Install rbenv.
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
mkdir ~/.rbenv/cache
# Install ruby-build.
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# Install Debian dependencies.
sudo apt-get update
sudo apt-get --assume-yes install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
@sepastian
sepastian / record_screen.sh
Created June 30, 2015 09:23
Record the screen using avconv
# Record the screen using avconv.
avconv -f x11grab -r 25 -s 1920x1080 -i :0.0 -vcodec libx264 -threads 4 output.avi
@sepastian
sepastian / archive_photos
Created July 13, 2015 14:07
Sort JPEG files into folders named YYYY/MM/DD
#!/bin/bash
set -o nounset
set -o errexit
set -o pipefail
PHOTO_DIR="$1"
ARCHIVE_DIR="$2"
if [ $# != 2 ]
then
@sepastian
sepastian / rails_4.2_default.rb
Last active September 25, 2015 05:40
Rails 4.2 template with active admin, devise, pundit, bootstrap, slim, unicorn, pg (optional), git
# Use with `rails new -m https://gist.githubusercontent.com/sepastian/8d9bf523d3950d4c8a4d/raw/88fd29455af48f5d99569063a6239b5dcdac3d96/rails_4.2_default.rb -d postgresql`
require 'fileutils'
if Rails.version !~ /\A4\.2/
puts "Required: Rails 4.2.x; found: Rails #{Rails.version}."
puts "$ bundle update rails"
exit 2
end
@sepastian
sepastian / gist:5695396
Last active December 18, 2015 00:18
Compiling Ruby 1.8.4 with Tcl/tk support and Rubygems-0.9.0 (plus several ancient gems) under Ubuntu 13.04
# Compiling Ruby 1.8.4 with Tk from source under Ubuntu 13.04
# Install Rubygems 0.9.0 from source and various gems
# Download sources
~$ cd build
~/build$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz
~/build$ wget http://prdownloads.sourceforge.net/tcl/tcl8.5.14-src.tar.gz
~/build$ wget http://prdownloads.sourceforge.net/tcl/tk8.5.14-src.tar.gz
~/build$ wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
~/build$ tar xf ruby-1.8.4.tar.gz