start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Original project: https://github.com/fxn/tkn | |
Encoding.default_internal = "UTF-8" | |
require 'io/console' | |
require 'active_support/core_ext/string/strip' | |
require 'pygments' |
rails new <app-name> -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb |
#!/bin/sh | |
echo "" | |
echo "-----" | |
echo "Transfering ..." | |
GIT_DIR=/home/<username>/repo/<app>.git | |
WWW_DIR=/var/www/<app>/current | |
git --work-tree=$WWW_DIR --git-dir=$GIT_DIR checkout -f |
server { | |
listen 80; | |
server_name <fqdn>; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
error_log /var/log/nginx/<app>-error.log; | |
access_log /var/log/nginx/<app>-access.log; | |
} |
Note to self, after fiddling with the same errors again and again while setting this up, I'm writing down what I repeat every time I setup a new droplet @ digitalocean.
Create a new droplet @ cloud.digitalocean.com and, when created, copy the IP address to setup a domain name pointing to it right away.
I go at https://www.hover.com/domains and add an A record, I'll assume dev.domain.com
in this guide.
export GOROOT=$HOME/go | |
export GOPATH=$HOME/code/go | |
export PATH=$PATH:$GOROOT/bin | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$HOME/goae:$PATH | |
export wd=$GOPATH/src/github.com/kiasaki |
C-f Move forward a character | |
C-b Move backward a character | |
M-f Move forward a word | |
M-b Move backward a word | |
C-n Move to next line | |
C-p Move to previous line | |
C-a Move to beginning of line |
self.slug.gsub(/[ "'*@#$%^&()+=;:.,?>|\\<~_!]/,'-').gsub(/-{2,}/,'-') |
# How to generate a secret key with Python | |
# via http://flask.pocoo.org/docs/quickstart/ | |
import os | |
os.urandom(24) |