Skip to content

Instantly share code, notes, and snippets.

@alanstevens
alanstevens / install-packages.sh
Created December 19, 2011 22:29
A script to install/uninstall my default packages on a fresh Linux Mint system.
#! /usr/bin/env bash
#
# execute this script with:
# curl https://raw.github.com/gist/1499222/install-packages.sh | sudo bash -s <username> <public_key_url>
# curl https://raw.github.com/gist/1499222/install-packages.sh | sudo bash -s 'alan' 'https://dl.dropbox.com/s/qfo16yktbn23q9j/id_rsa.pub?dl=1'
#
user_name=$1
public_key=$2
@alanstevens
alanstevens / newgemset.sh
Last active September 28, 2015 21:39
A shell script for creating a new gemset. The default gemset name is the current working directory but there is an optional parameter for creating a custom gemset name
#!/usr/bin/env bash
readonly rubyversion="1.9.3"
# Source RVM as a function into local environment.
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
@alanstevens
alanstevens / install-rvm.sh
Last active September 28, 2015 21:58
Shell script to install rvm and rails
#!/bin/bash
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile
rvm autolibs enable
rvm install 1.9.3
rvm use 1.9.3 --default
rvm use 1.9.3@global
echo "install: --no-rdoc --no-ri" >> ~/.gemrc
echo "update: --no-rdoc --no-ri" >> ~/.gemrc
@alanstevens
alanstevens / OSX_Lion_NTFS_support
Created January 2, 2012 00:05 — forked from zwned/OSX_Lion_NTFS_support
NTFS Support Mac OSX Lion
brew install fuse4x
brew install ntfs-3g
sudo kextunload -b org.fuse4x.kext.fuse4x
sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.0/Library/Extensions/fuse4x.kext /Library/Extensions
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
sudo touch /sbin/mount_ntfs
@alanstevens
alanstevens / Install-Mac-Ctags.sh
Last active September 30, 2015 14:18
Script to install exuberant ctags so I don't have to Google it next time.
#!/bin/bash
curl -O http://superb-dca3.dl.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz
tar xzvf ctags-5.8.tar.gz
cd ctags-5.8
./configure
make
sudo make install
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
@alanstevens
alanstevens / lock_down_ubuntu.sh
Created February 21, 2012 16:28
Script to lock down a new Ubuntu server
#!/bin/sh
#
# execute this script as root with:
# curl https://raw.github.com/gist/1877257/lock_down_ubuntu.sh | bash -s MyAwesomeHostName
#
if [[ ! "root" = "$(whoami)" ]] ; then
echo -e "****\nThis script must be run as root.\n****" && exit 1
fi
@alanstevens
alanstevens / gist:1909640
Created February 25, 2012 17:29
Script to setup the web server for Rails on an Ubuntu server
#!/bin/bash
#
# Install nginx & passenger build dependencies
#
apt-get install libcurl4-openssl-dev --yes
apt-get install libpcre3 libpcre3-dev --yes
#
# source rvm in the current shell session
@alanstevens
alanstevens / install_system_rvm.sh
Last active October 1, 2015 03:18 — forked from tsykoduk/rvm_systemizer_setup.sh
Shell script to install rvm at the system level.
#!/usr/bin/env bash
#
# execute with:
# curl https://gist.github.com/alanstevens/1909971/raw/install_system_rvm.sh|bash
#
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
@alanstevens
alanstevens / mvim
Last active July 2, 2017 23:06
mvim script to open a new tab in MacVim
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
@alanstevens
alanstevens / install_all.sh
Created March 19, 2012 18:29
Server Setup
#!/usr/bin/env bash
#
# execute this script as root with:
# curl https://raw.github.com/gist/2123030/install_all.sh | bash -s MyAwesomeHostName
#
if [[ ! "root" = "$(whoami)" ]] ; then
echo -e "****\nThis script must be run as root.\n****" && exit 1
fi