Skip to content

Instantly share code, notes, and snippets.

View parasquid's full-sized avatar

Tristan parasquid

View GitHub Profile
# config/environments/development.rb
Hello::Application.configure do
# ...
# https://rails.lighthouseapp.com/projects/8994/tickets/4676-reload-routes-on-each-request-in-dev-mode
service_reloader = ActiveSupport::FileUpdateChecker.new(Dir["app/services/**"]) { Rails.application.reload_routes! }
config.to_prepare do
service_reloader.execute_if_updated
# Seek&Destroy: Sample Bot
#
# Enjoys following and target and firing many shots
class SeekAndDestroy < RTanque::Bot::Brain
NAME = 'Jimmy'
include RTanque::Bot::BrainHelper
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 5.0
def tick!
set :max_asset_age, 2 ## Set asset age in minutes to test modified date against.
after "deploy:finalize_update", "deploy:assets:determine_modified_assets", "deploy:assets:conditionally_precompile"
namespace :deploy do
namespace :assets do
desc "Figure out modified assets."
task :determine_modified_assets, :roles => assets_role, :except => { :no_release => true } do
set :updated_assets, capture("find #{latest_release}/app/assets -type d -name .git -prune -o -mmin -#{max_asset_age} -type f -print", :except => { :no_release => true }).split
@parasquid
parasquid / README.md
Last active December 17, 2015 14:29 — forked from sfate/README.md
Install ruby-2.0.0-p195 on a Ubuntu 12.04 production server using checkinstall

Installs ruby-2.0.0-p247 on ubuntu via checkinstall so it's in your package manager and you can remove it.

Quick install:

curl -Lo- https://gist.github.com/parasquid/5624732/raw/install-ruby-2-ubuntu.sh | bash
@parasquid
parasquid / setup.sh
Last active January 19, 2024 12:03
Linode Server Setup Script
# security measures:
# - change ssh port to 20022
sed -i 's/#Port 22/Port 20022/' /etc/ssh/sshd_config
# - disallow root login
sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
# - disallow password auth
cat >> /etc/ssh/sshd_config << EOF
PasswordAuthentication no
AllowUsers deploy
EOF
@parasquid
parasquid / console_output
Last active August 29, 2015 14:04
Sync the production branch with the master branch before deployment
tristan@tristan-vbox ~/Sites/lightbringer $ cap production deploy
INFO [8ec98abf] Running /usr/bin/env git checkout master on
DEBUG [8ec98abf] Command: ( RAILS_ENV=production /usr/bin/env git checkout master )
DEBUG [8ec98abf] Already on 'master'
INFO [8ec98abf] Finished in 0.168 seconds with exit status 0 (successful).
INFO [61300fdb] Running /usr/bin/env git pull origin master on
DEBUG [61300fdb] Command: ( RAILS_ENV=production /usr/bin/env git pull origin master )
DEBUG [61300fdb] Already up-to-date.
DEBUG [61300fdb] From github.com:mindvalley/lightbringer
DEBUG [61300fdb] * branch master -> FETCH_HEAD
@parasquid
parasquid / gist:7aaa1c365f1f11b001b6
Last active August 29, 2015 14:06
trust local postgres connections
sed -i 's/local all postgres peer/local all all peer/' /etc/postgresql/9.3/main/pg_hba.conf
sed -i 's/host all all 127.0.0.1\/32 md5/host all all 127.0.0.1\/32 trust/' /etc/postgresql/9.3/main/pg_hba.conf
/etc/init.d/postgresql restart
@parasquid
parasquid / gist:9d246193bfdf87a935b4
Last active December 3, 2015 04:29
Sublime Text 2 User Settings
{
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 2,
"color_scheme": "Packages/Color Scheme - Default/Dawn.tmTheme",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"drag_text": false,
"font_face": "Consolas",
"font_size": 12,
@parasquid
parasquid / .bashrc
Last active November 7, 2020 12:17
.bashrc
. /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
export PATH="$PATH:$HOME/bin"
[ -f /home/linuxbrew/.linuxbrew/etc/bash_completion ] && . /home/linuxbrew/.linuxbrew/etc/bash_completion
source /home/linuxbrew/.linuxbrew/etc/bash_completion.d/git-prompt.sh
PS1="\[\033[32m\][\[\033[1;32m\]\w]\[\033[0m\]\$(__git_ps1) \n\[\033[1;36m\]\u\[\033[32m\]$ \[\033[0m\]"
@parasquid
parasquid / gist:49d889f43abdfab3f78f
Last active August 29, 2015 14:09
Go Pro indefinite video recording
# locks exposure
t ia2 -exp lock 1
# enable USB Mass Storage Device
sleep 1
t app usb msc
# records video
sleep 4
t app button shutter PR