Skip to content

Instantly share code, notes, and snippets.

@hugodias
hugodias / sidekiq.config
Created April 17, 2017 22:24 — forked from ssaunier/sidekiq.config
Running Sidekiq on AWS Elastic Beanstalk (Put that file in `.ebextensions` folder)
# Sidekiq interaction and startup script
commands:
create_post_dir:
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
owner: root
group: root
@hugodias
hugodias / a.sh
Created April 13, 2017 12:21
Start postgres installed from homebrew
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
DIR=/var/app/current
if [ "$WORKER_MODE" = "1" ]
then
if [ -f /var/run/shoryuken.pid ]
then
su -l -c "kill -USR1 `cat /var/run/shoryuken.pid`" root || echo "no process"
su -l -c "rm -f /var/run/shoryuken.pid" root || echo "no file"
fi
commands:
nokogiri_config:
command: "bundle config build.nokogiri --use-system-libraries"
# Install Git needed for Git based gems
packages:
yum:
git: []
gitstalk() {
git log --author="$1" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
}
alias git-stalk=gitstalk
#!/bin/sh
if [[ $# -eq 0 ]] ; then
echo 'Usage: blog-checkup someblog.com'
exit 0
fi
# 1st get the bloddy IP address
#ip=`dig +short $1`
ip=`ping -c1 $1|head -n1|egrep --color="never" -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'`
.idea/
assets_debug_hack.rb
.pryrc
Guardfile
MyApp::Application.configure do
config.assets.debug = false
config.action_controller.perform_caching = true
end
[core]
excludesfile = /Users/your-username/.gitignore_global