Skip to content

Instantly share code, notes, and snippets.

@sebatyler
sebatyler / cleanup_docker.sh
Last active February 1, 2019 10:07
cleanup_docker.sh
docker ps -a|grep Exited|awk '{print $1}'|xargs docker rm
docker images -a|grep none|awk '{print $3}'|xargs docker rmi
import os
file_path = '/tmp/zz/test.csv'
path_dir = os.path.dirname(file_path)
os.makedirs(path_dir, exist_ok=True)
@sebatyler
sebatyler / resolve.sh
Last active October 23, 2017 13:44
pip problem
# ssl
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
# pip
pip install -I https://github.com/pypa/pip/archive/master.zip#egg=pip
[user]
name = sebatyler
email = [email protected]
[alias]
ci = commit
co = checkout
s = status
t = stash
b = branch
cp = cherry-pick
@sebatyler
sebatyler / deploy.rb
Created February 17, 2015 02:02
puma ruby on rails deployment
set :puma_conf, "#{fetch(:deploy_to)}/current/config/puma.rb"
# default hook 끄고 항상 phased-restart (zero downtime)
namespace :puma do
Rake::Task['check'].clear_actions
Rake::Task['smart_restart'].clear_actions
end
after 'deploy:finished', 'puma:phased-restart'
@sebatyler
sebatyler / Vagrantfile
Last active August 29, 2015 14:13
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@sebatyler
sebatyler / rails.md
Last active August 29, 2015 14:09
Ruby on Rails

리눅스 설치

virtualbox 깔고 linux 배포판 중 ubuntu 나 centos 를 깔면 된다. 모든 작업은 ssh 로 linux 에 접근해서 하면 된다.

rvm, ruby 설치

참고 링크

ruby는 2.1을 설치하자

#export LC_ALL=ko_KR.UTF-8
export LC_ALL=en_US.UTF-8
export TZ='Asia/Seoul'
set -o vi
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
@sebatyler
sebatyler / .vimrc
Last active August 29, 2015 14:08
"set nu
"set tenc=cp949
"set tenc=utf-8
"set enc=cp949
"set enc=utf-8
set shell=bash
set nocompatible
set nobackup
set cindent
set autoindent
unsetenv DISPLAY
autodetach on # default: on
crlf off # default: off
deflogin off # default: on
hardcopy_append on # default: off
startup_message off # default: on
vbell off # default: ???
term xterm
termcapinfo xterm ti@:te@
termcapinfo linux "ve=\E[?25h\E[?17;0;64c"