Skip to content

Instantly share code, notes, and snippets.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jancuk
jancuk / bash-rails
Created October 29, 2014 02:32
bash-rails
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
then
@jancuk
jancuk / gist:ae7818845d49822c6319
Created May 22, 2015 17:56
unicorn localhost rails
upstream app_rails {
server unix:/path/rails_app.sock;
}
server {
listen *:80;
client_max_body_size 50M;
root path/rails_app;
access_log /var/log/nginx/access_log.log;
error_log /var/log/nginx/error_log.log;
#!/usr/bin/env puma
basedir = '/Users/azhar/code/fighting/puma_s'
directory "#{basedir}"
environment 'development'
daemonize true
bind "unix://#{basedir}/tmp/sockets/api_indomaret.sock"
pidfile "#{basedir}/tmp/pid"
state_path "#{basedir}/tmp/state"
stdout_redirect 'log/puma.log', 'log/puma_err.log'
upstream api {
server unix:/Users/azhar/code/fighting/puma_s/tmp/sockets/api.sock fail_timeout=0;
}
server{
listen 80;
server_name pumaa.com;
error_log /var/log/nginx/nginx_error.log;
# location /doc {
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.1.7
rvm use 2.1.7 --default
ruby -v
#!/bin/bash
declare -r TRUE=0
declare -r FALSE=1
# takes a string and returns true if it seems to represent "yes"
function isYes() {
local x=$1
[ $x = "y" ] && echo $TRUE; return
[ $x = "Y" ] && echo $TRUE; return
@jancuk
jancuk / slim.conf
Created December 2, 2015 07:21
nginx for slim framework
server {
listen 80;
server_name apites.com;
root /home/azhar/Learning/OSS/test_layout/slim-boilerplate/public;
index index.html index.htm index.php;
access_log /var/log/nginx/dynamite_log.log;
error_log /var/log/nginx/dynamite_error_log.log;
@jancuk
jancuk / install
Created January 18, 2016 10:37
install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 2.2.3
git config --global color.ui true
git config --global user.name "YOUR NAME"
"python from powerline.vim import setup as powerline_setup
"python powerline_setup()
"python del powerline_setup
filetype on
" bring in the bundles for mac and windows
set rtp+=~/vimfiles/vundle.git/
set rtp+=~/.vim/vundle.git/
" au BufNewFile,BufRead *.rs set filetype=rust
autocmd FileType * set tabstop=2|set shiftwidth=2|set expandtab