git branch {tagname}-branch {tagname}
git checkout {tagname}-branch git add .
git ci -m "Fix included" # or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |
| #!/bin/bash | |
| rm /tmp/image-pull-secret.yaml | |
| login_cmd=$(aws ecr get-login) | |
| username=$(echo $login_cmd | cut -d " " -f 4) | |
| password=$(echo $login_cmd | cut -d " " -f 6) | |
| endpoint=$(echo $login_cmd | cut -d " " -f 9) | |
| auth=$(echo "$username:$password" | /usr/bin/base64) | |
| configjson="{ \"auths\": { \"${endpoint}\": { \"auth\": \"${auth}\" } } }" |
| rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name | awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" | "/bin/bash" }' |
| ## Useful Commands | |
| Get kubectl version | |
| kubectl version | |
| Get cluster info: |
Sidekiq jobs can be enqueued or scheduled. Enqueued means that they are gonna be picked up as soon as possible, scheduled jobs will be enqueued at some specific time.
When using ActiveJobs, Rails will return a job_id after sending the job to ActiveJobs
job = UserMailer.send_invite(params).deliver_later
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amendThis will open your $EDITOR and let you change the message. Continue with your usual git push origin master.
| v () { | |
| command="cd /vagrant; $@" | |
| vagrant ssh -c $command | |
| } | |
| vb () { | |
| command="cd /vagrant; bundle exec $@" | |
| vagrant ssh -c $command | |
| } |
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: tiller | |
| namespace: kube-system | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: tiller |
| set :rbenv, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"' | |
| job_type :rake, 'cd :path && PATH=:rbenv:"$PATH" :environment_variable=:environment bundle exec rake :task --silent :output' | |
| job_type :runner, 'cd :path && PATH=:rbenv:"$PATH" bin/rails runner -e :environment ":task" :output' | |
| set :output, 'log/whenever.log' |