Skip to content

Instantly share code, notes, and snippets.

View Sacristan's full-sized avatar

Ģirts Ķesteris Sacristan

View GitHub Profile
@Sacristan
Sacristan / dev env setup
Last active August 8, 2016 18:20
Dev env setup
INSTRUCTIONS:
sudo apt-get install vim git curl
@Sacristan
Sacristan / gist:75d31c57e72c6f8b92d6
Last active August 29, 2015 14:17
return Rails all model classes alphabetically
(ActiveRecord::Base.connection.tables.map { |model| model.capitalize.singularize.camelize }).sort_by{|word| word.downcase}.reject {|r| r == "SchemaMigration" || r == "Session" }
openssl req -new -newkey rsa:2048 -nodes -keyout app.swisslanguages.com.key -out app.swisslanguages.com.csr
@Sacristan
Sacristan / gist:d06b1e2d8ebcbf29d159
Created January 29, 2015 09:12
replace with sed
for CHAR in (ls phrase/locales/phrase.* | cut -d "." -f2)
grep firstdata_lv phrase/locales/phrase.$CHAR.yml | grep code | sed -e 's/firstdata_lv/cps_lv/g' > ~/Documents/cps_translations/$CHAR.yml
end
@Sacristan
Sacristan / gist:1a65033309e13cd97b01
Last active August 29, 2015 14:03
check banklink transaction 1001 code
for TRANS in `cat ~/transactions`; do echo "__"$TRANS"__" && cat ~/apps/nordenhealth/shared/log/unicorn.log | grep '"VK_SERVICE"=>"1101"' | grep '"VK_STAMP"=>"'$TRANS'"' ; done
for TRANS in `echo 102344`; do echo "__"$TRANS"__" && cat ~/apps/nordenhealth/shared/log/unicorn.log | grep '"VK_SERVICE"=>"1101"' | grep '"VK_STAMP"=>"'$TRANS'"' ; done
@Sacristan
Sacristan / NEWdump
Last active February 1, 2016 09:30
new dump
ssh deployer@$ip
pg_dump --format=c -h localhost --username norden nordenhealth > latest.dump
scp deployer@$ip:/home/deployer/latest.dump ~/Desktop/
rake db:drop db:create;and pg_restore --verbose --clean --no-acl --no-owner -h localhost -U girts -d nordenhealth_development ~/Desktop/latest.dump
@Sacristan
Sacristan / config.fish
Created July 1, 2014 10:30
my fish config
# Path to your oh-my-fish.
set fish_path $HOME/.oh-my-fish
set fish_plugins git rails rvm
# Theme
set fish_theme robbyrussell
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-fish/plugins/*)
# Custom plugins may be added to ~/.oh-my-fish/custom/plugins/
# Example format: set fish_plugins autojump bundler
@Sacristan
Sacristan / gist:21c1129f1c470a97936c
Created June 26, 2014 17:04
Create Postgres superuser
sudo su postgres -c psql
ALTER USER myuser WITH SUPERUSER;
sudo apt-get install postgresql postgresql-contrib
sudo -u postgres createuser sac
@Sacristan
Sacristan / deploy ssh key remotely
Created June 12, 2014 18:43
deploy ssh key remotely
1. gem uninstall net-ssh
2. bundle install
3. sudo curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id
4. sudo chmod +x /usr/local/bin/ssh-copy-id
5. ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]