Skip to content

Instantly share code, notes, and snippets.

View quentindecock's full-sized avatar

Quentin Decock quentindecock

  • Peers & Peers
  • Paris
View GitHub Profile
@quentindecock
quentindecock / migration
Created December 4, 2013 20:34
Migration script for Fiance / ES
#!/bin/zsh
RAILS_ENV=production bundle exec rake 'populate_index[clicks_share_link,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[comments_on_facebook_post,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[facebook_comment_plugin_update,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[favorites_tweet,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[likes_comment_on_facebook_post,1000]' \
RAILS_ENV=production bundle exec rake 'populate_index[takes_multiple_choice_action,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[likes_post_on_facebook,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[nexts_multiple_choice_action,1000]' && \
RAILS_ENV=production bundle exec rake 'populate_index[rates_challenge_response,1000]' && \
@quentindecock
quentindecock / reverse-proxy-nginx.conf
Created September 3, 2013 14:23
Simple Nginx reverse proxy configuration
# A Rails app living on unicorn
upstream unicorn {
server unix:/tmp/unicorn.admin_panel.sock fail_timeout=0;
}
server {
listen 80 deferred;
server_name myapp.mysite.com;
root /home/myuser/apps/my_app/current/public/;
#!/bin/bash
echo "REMEMBER: tmux -2 -S /tmp/tmux -attach; chmod aog+rwx /tmp/tmux"
ssh ci 'awk !/:1026/ ~/.ssh/known_hosts > ~/.ssh/known_hosts.new'
ssh ci 'mv ~/.ssh/known_hosts ~/.ssh/known_hosts.bak'
ssh ci 'mv ~/.ssh/known_hosts.new ~/.ssh/known_hosts'
ssh -v -N -R 1026:localhost:22 [email protected] >> /tmp/ssh_tunnel.out &
/usr/local/bin/tmux -2 -S /tmp/tmux
@quentindecock
quentindecock / reset_designer_environment.sh
Created March 14, 2012 15:37
Crowdtap clean db priming for designers
echo "-> Clear Sniper DB ..."
cd ../sniper/
bundle exec rake mongo:clear
echo "-> Clearing Crowdtap DB and priming the database ..."
cd ../crowdtap/
RAILS_ENV=staging bundle exec rake ct:dev:prime