Skip to content

Instantly share code, notes, and snippets.

View Sacristan's full-sized avatar

Ģirts Ķesteris Sacristan

View GitHub Profile
@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
openssl req -new -newkey rsa:2048 -nodes -keyout app.swisslanguages.com.key -out app.swisslanguages.com.csr
@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" }
@Sacristan
Sacristan / dev env setup
Last active August 8, 2016 18:20
Dev env setup
INSTRUCTIONS:
sudo apt-get install vim git curl
curl get.pow.cx/uninstall.sh | sh
curl get.pow.cx | sh
scutil --dns
sudo touch /etc/resolver/dev
sudo pfctl -f /etc/pf.conf
sudo pfctl -e
@Sacristan
Sacristan / gist:cf2c3b98c1403115e0b1
Last active July 22, 2016 09:48
Generate generic SSL certificate
openssl req -new -newkey rsa:2048 -nodes -keyout www.domain.com.key -out www.domain.com.com.csr
@Sacristan
Sacristan / fdl
Last active July 22, 2016 09:48
FDL cert gen
Staging:
1. $ openssl req -sha256 -newkey rsa:2048 -keyout <MerchantID>_key.pem -out <MerchantID>_req.pem -subj "/C=LV/O=www.stockholmhealth.com/OU=Everyday Content International/CN=<MerchantID>" -outform PEM
2. Ielogojamies IBIS un self-sign
3. Iemetam no šiem saņemtos failus (viņi atsūta sertifikātu pirms atbildes, ka atsūtīs sertifikātu) tai pašā mapē, kur key un:
4. $ openssl pkcs12 -export -in <MerchantID>.pem -out <MerchantID>.p12 -certfile ECOMM-test.pem -inkey <MerchantID>_key.pem
5. $ openssl pkcs12 -in <MerchantID>.p12 -out <MerchantID>_keystore.pem
Production:
@Sacristan
Sacristan / gist:e13e8f4e80b918be2747
Created January 11, 2016 16:44
Prune local branches that have been already merged into master
git branch --merged master | grep -v 'master$' | xargs git branch -d
Artist.where(id: Album.select(:artist_id))