Skip to content

Instantly share code, notes, and snippets.

@musghost
musghost / Procfile
Created July 21, 2017 20:30 — forked from andrius/Procfile
How to dockerize rails app with puma. Edit config/application.rb and config/puma.rb
api: bundle exec puma -C config/puma.rb
@musghost
musghost / gist:26c02abbc9369463e666198c7610889e
Created December 12, 2016 21:47 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@musghost
musghost / redis.markdown
Created October 31, 2016 16:24 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@musghost
musghost / etchosts.sh
Last active August 29, 2015 14:24 — forked from mikeflynn/etchosts.sh
#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{