Skip to content

Instantly share code, notes, and snippets.

View dacodekid's full-sized avatar
😜

Da CodeKid dacodekid

😜
View GitHub Profile
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@dacodekid
dacodekid / mongo-autostart-osx.md
Last active September 23, 2015 13:30 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@dacodekid
dacodekid / rethinkdb_setup_osx.md
Created November 23, 2015 16:55 — forked from mafrosis/rethinkdb_setup_osx.md
RethinkDB Setup on OSX

RethinkDB Setup on OSX

This guide will get RethinkDB setup and running with a default configuration on OSX. There is also an option for setting RethinkDB to start at boot time on OSX, and a note on upgrading to a more recent RethinkDB version.

First Installation

Install Homebrew if you don't already have it:

@dacodekid
dacodekid / dokku+django.md
Created March 13, 2017 03:21
Starting up with Dokku, Django, Let's Encrypt and PostgreSQL on Python 3.5.2

Steps to set up a Django+PostgreSQL app using Dokku on Python 3.5.2

  1. Verify needed files & settings

    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi
    
    #PROJ_ROOT/requirements.txt
    dj-database-url==0.4.1
    
@dacodekid
dacodekid / Vagrant
Created September 25, 2017 17:50
Vagrant Root Login On Provision
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
# --- IF private_key FILE EXISTS, THEN LOGIN AS root
if File.exist?(Dir.getwd + "/.vagrant/machines/default/virtualbox/private_key")
config.ssh.username = "root"
config.ssh.private_key_path = "~/.ssh/id_rsa"
end
# --- COPY PUBLIC KEY INTO MACHINE ---
@dacodekid
dacodekid / index.html
Last active August 29, 2022 02:27
Hugo with Webpack Integration
<!-- refer generated css/js file -->
<link rel="stylesheet" href="{{$.Site.BaseURL}}/{{ if eq (getenv "APP_ENV") "dev" }}main.css{{ else }}{{ index .Site.Data.manifest "main.css" | relURL }}{{ end }}">
<script type="text/javascript" src="{{$.Site.BaseURL}}/{{ if eq (getenv "APP_ENV") "dev" }}main.js{{ else }}{{ index .Site.Data.manifest "main.js" | relURL }}{{ end }}"></script>