$ uname -r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install dependencies | |
apt-get update && apt-get upgrade | |
apt-get install 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 | |
# install RVM | |
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
### as per RVM instructions (both files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_registry_keys(data) | |
require 'win32/registry' | |
data.each do |key, value| | |
path = key.split("\\").delete_at(-1).delete_at(0).join("\\") | |
root = key.split("\\").first | |
key = key.split("\\").last | |
if root == "HKEY_CURRENT_USER" | |
hive = Win32::Registry::HKEY_CURRENT_USER.new | |
else | |
hive = Win32::Registry::HKEY_LOCAL_MACHINE.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProfilesController < AuthorizedController | |
before_filter :extract_location, :only => :search | |
def search | |
search_terms = params[:profile].keep_if {|key, val| !val.blank? && val != '0'} | |
search_terms.each{|key, val| search_terms[key] = true if val == '1'} | |
if @location_params[:name] | |
@locations = Location.near(@location_params[:name], @location_params[:within], {:select => "locations.*, profiles.*", :units => :km}).joins(:profile).has_user_role.where(:profiles => search_terms) | |
current_hometown_filter_for_search(@locations) | |
profile_ids = @locations.map{|loc| loc.profile_id}.compact.uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = Factory(:user, :role => "admin") | |
visit new_user_session_path | |
fill_in "user_email", :with => user.email | |
fill_in "user_password", :with => "foobar" | |
click_button "Sign" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Theirs: | |
class UsersController < ApplicationController | |
def follow | |
@user = User.find(params[:id]) | |
if current_user.follow(@user) | |
redirect_to root_url | |
else | |
redirect_to @user | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#encrypt files with aes-256-cbc cipher using openssl | |
#install: | |
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc | |
# sudo chmod +x /usr/bin/enc | |
# enc --help | |
#encrypt files | |
if [ $1 == "-e" ]; | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Textmate essential bundles | |
cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles | |
# mkdir -p cd /Applications/TextMate.app/Contents/SharedSupport/Bundles | |
git clone git://github.com/protocool/ack-tmbundle.git Ack.tmbundle | |
git clone git://github.com/textmate/ruby-haml.tmbundle.git | |
git clone git://github.com/seaofclouds/sass-textmate-bundle.git "Ruby Saas.tmbundle" | |
git clone https://github.com/aslakhellesoy/cucumber-tmbundle.git Cucumber.tmbundle | |
git clone git://github.com/karnowski/blue-ridge-tmbundle.git JavaScript\ Blue\ Ridge.tmbundle | |
git clone git://github.com/johnmuhl/nginx-tmbundle.git nginx.tmbundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PROXY_USER=user | |
PROXY_PASS=password | |
PROXY_PORT=3128 | |
# Clear the repository index caches | |
yum clean all | |
# Update the operating system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p /opt/bin | |
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |
OlderNewer