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 | |
sudo yum install -y wget gcc | |
wget http://download.redis.io/redis-stable.tar.gz | |
tar xvzf redis-stable.tar.gz | |
cd redis-stable/src | |
make redis-cli | |
sudo cp redis-stable/src/redis-cli /usr/local/bin/ |
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
# copy/import data from heroku postgres to localhost pg database | |
# useful for copying admin's work on live site into local database to reproduce errors | |
# https://devcenter.heroku.com/articles/heroku-postgres-import-export | |
# take heroku pg snapshot and download | |
heroku pg:backups:capture | |
heroku pg:backups:download | |
# load the dump into local postgres database, assuming $DATABASE_URL set locally |
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
div | |
= @safe JST["templates/carrier_reference_number"]({order: @order, user_id: @user_id, edit: true}) |
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
echo `ifconfig | grep '192.168' | awk '{ print $2 }' | sed 's/addr://g'` |
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
sudo du -k / | sort -n | tail -10 |
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
RAILS_ENV=production rake db:migrate; echo "Done" | mail -s "Interrupted `date`" [email protected] | |
this requires mail server to be set up in /etc/ssmtp/ssmtp.conf |
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
find /path/to/files -type f -exec sed -i '' 's/oldstring/new string/g' {} \; |
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
# ~/.bashrc | |
alias rails="bundle exec rails" | |
alias rake="bundle exec rake" | |
alias rspec="bundle exec rspec" | |
alias cap="bundle exec cap" |
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
C:\Windows\SysWOW64\odbcad32.exe | |
Useful when you can't find ODBC connections that you KNOW are there.... |
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
-- Backup Database to .bak File | |
-- Need to pass in FILENAME and DB arguments | |
DECLARE @fileName VARCHAR(90); | |
DECLARE @db_name VARCHAR(20); | |
DECLARE @fileDate VARCHAR(20); | |
SET @fileName = FILENAME; | |
SET @db_name = DB; | |
SET @fileDate = CONVERT(VARCHAR(20), GETDATE(),112); | |
SET @fileName = @fileName + @db_name + '_' + RTRIM(@fileDate) + '.bak'; |
NewerOlder