Skip to content

Instantly share code, notes, and snippets.

View rapind's full-sized avatar

Dave Rapin rapind

View GitHub Profile
@rapind
rapind / delayed_job@.service
Created December 1, 2020 17:42 — forked from stevensona/delayed_job@.service
systemd unit file for running ruby/rails delayed_job as service
# Keep delayed job workers running using systemd on ubuntu
# Usage
# Start "sudo systemctl start delayed_job@{0..3}" to start 4 worker instances
# Enable "sudo systemctl enable delayed_job@{0..3}" to enable 4 worker instances
# Restart "sudo systemctl restart delayed_job@{0..3}" to restart 4 worker instances
# Disable "sudo systemctl disable delayed_job@{0..3}" to disable 4 worker instances
# Stop "sudo systemctl stop delayed_job@{0..3}" to stop 4 worker instances
[Unit]
Description=Delayed Job Worker %i
App = Component.create
displayName: 'App'
@rapind
rapind / github-print-bookmarklet
Last active August 29, 2015 14:25 — forked from s0lst1c3/github-print-bookmarklet
Github Print Bookmarklet
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('%23header,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push,%20.wiki-actions,%20%23last-edit,%20.actions,%20.header,.site-footer,.repository-sidebar,.file-navigation,.gh-header-meta,.gh-header-actions,#wiki-rightbar,#wiki-footer,#toc,#all_commit_comments,.thread-subscription-status').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D);%20$('link').removeAttr('media');%7D); var removeMe = document.getElementsByClassName("file-header
### Keybase proof
I hereby claim:
* I am rapind on github.
* I am rapind (https://keybase.io/rapind) on keybase.
* I have a public key whose fingerprint is DB5B 10B5 4359 91BD BAD4 2A2C 4AAC 1621 D2BD 84CB
To claim this, I am signing this object:
@rapind
rapind / mithril-view.coffee
Created January 21, 2015 17:09
Coffeescript version of the Mithril Tutorial's Todo View.
# See: http://lhorie.github.io/mithril/getting-started.html
todo.view = () ->
vm = todo.vm
m "html",
m "body",
m "input",
onchange: m.withAttr "value", vm.description
value: vm.description()
m "button",
onclick: vm.add.bind vm, vm.description
@rapind
rapind / base-backup.sh
Created December 26, 2014 13:33
Make a base PostgreSQL backup
sudo -u postgres bash -c "envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-push /var/lib/postgresql/9.3/main"
@rapind
rapind / restart-postgresql.sh
Created December 26, 2014 13:32
Restart PostgreSQL
sudo service postgresql restart
@rapind
rapind / edit_postgresql.sh
Last active August 29, 2015 14:12
Edit postgresql.conf
sudo vi /etc/postgresql/9.3/main/postgresql.conf
@rapind
rapind / postgresql.conf
Last active August 29, 2015 14:12
Update PostgreSQL archiving / WAL for WAL-E backups
# WAL-E Backups
# Goes in the bottom of your postgresql.conf
wal_level = archive
archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env /usr/local/bin/wal-e wal-push %p'
archive_timeout = 60