Skip to content

Instantly share code, notes, and snippets.

@noxqsgit
noxqsgit / _nossl.conf
Created December 15, 2014 20:31
nginx redirect to ssl
server {
listen 80 default_server;
server_name _;
rewrite ^ https://$host$request_uri? permanent;
}
@noxqsgit
noxqsgit / update.sh
Last active August 29, 2015 14:04
update servers w/ ansible
LC_ALL=C ansible -i hosts -m shell -a 'aptitude update' all --sudo --ask-sudo-pass
LC_ALL=C ansible -i hosts -m shell -a 'aptitude safe-upgrade -y -s' all
LC_ALL=C ansible -i hosts -m shell -a 'DEBIAN_FRONTEND=noninteractive aptitude safe-upgrade -y' all --sudo --ask-sudo-pass
@noxqsgit
noxqsgit / nullmailer_1.11-2.1_amd64.deb
Last active August 29, 2015 14:03
backported nullmailer from trusty for precise (b/c precise nullmailer does not support tls)
@noxqsgit
noxqsgit / mail.rb
Created April 3, 2014 13:23
amazon SES + ruby (Net::SMTP)
#!/usr/bin/env ruby
require 'net/smtp'
unless (2..3).include? ARGV.length
puts 'Usage: mail.rb SUBJECT TO [FROM]'
exit 1
end
subject, to, from_ = ARGV
@noxqsgit
noxqsgit / bcrypt.sh
Created April 1, 2014 11:20
create bcrypt hash w/ ruby oneliner
ruby -rbcrypt -e 'print "password> "; puts BCrypt::Password.create(readline.chomp)'
@noxqsgit
noxqsgit / _ssl.conf
Last active January 3, 2016 03:19
nginx ssl proxy for all vhosts
ssl_certificate /etc/felix/ssl/foo.bundle.crt;
ssl_certificate_key /etc/felix/ssl/foo.key;
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
add_header Strict-Transport-Security 'max-age=31536000';
@noxqsgit
noxqsgit / .bash_profile
Created November 15, 2013 13:41
~nap dotfiles
# NAP {
umask 0022
export PATH="/__nap/nap/bin:$PATH" NAPRC=/__nap/cfg/naprc
# } NAP
# FELIX {
for _path in \
@noxqsgit
noxqsgit / README.md
Last active December 28, 2015 07:49
different Gemfile.lock files for different branches

Use different Gemfile.lock files for different branches:

  • Symlink Gemfile.branch1 and Gemfile.branch2 to Gemfile.all.
  • Use the branch-bundle script instead of bundle.
@noxqsgit
noxqsgit / cms_dump.rake
Last active December 28, 2015 03:09
DOES NOT WORK, USE https://github.com/obfusk/active-dump // seed_dump + comfortable-mexican-sofa
# seed_dump + comfortable-mexican-sofa
# $ cp .../cms_dump.rake lib/tasks/
# $ rake db:seed:dump:cms
models = %w{
Cms::Block Cms::Layout Cms::Page Cms::Revision Cms::Site
}
namespace :db do
namespace :seed do
@noxqsgit
noxqsgit / README.md
Last active December 27, 2015 18:39
nap switch branch

nap (remote)

nap stop APP

apps/APP (local)

git checkout stable
git push REMOTE stable
git branch -d master