Skip to content

Instantly share code, notes, and snippets.

View oiojin831's full-sized avatar

Eung Jin Lee oiojin831

View GitHub Profile
@oiojin831
oiojin831 / docker.md
Created September 21, 2015 23:45
docker commands

Docker commands

Removing everything

#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)

Install nginx

move butterfly config from previous server to new server using scp

scp /etc/nginx/sites-enabled/butterfly [email protected]:~/ 
@oiojin831
oiojin831 / route53.md
Last active September 22, 2015 10:31
aws route53 change-resource-record-sets --hosted-zone-id ZXXTN8ME7HY7P --change-batch file:///home/oiojin831/aws-setting/sub.json
{
  "Changes": [
    {
      "Action": "CREATE",
 "ResourceRecordSet": {
@oiojin831
oiojin831 / s3.md
Last active September 10, 2015 04:25
s3 middleman setting
  • aws cli install

  • middleman build

  • aws configure credential setting

aws s3 mb s3://rollintiger.com 
aws s3 rm s3://rollintiger.com --recursive
aws s3 sync build s3://rollintiger.com --acl public-read --cache-control "public, max-age=86400"
aws s3 website s3://rollintiger.com --index-document index.html
@oiojin831
oiojin831 / mysql.md
Last active September 20, 2015 23:53
export and import

디비에서 파일려 가져오기

sudo mysqldump --user root --password=didwoehd33 mylodev > mylodev.sql

다른 서버로 전송

scp ~/mylodv.sql [email protected]:~/

내 서버에서 mysql에 저장하기

@oiojin831
oiojin831 / dotfiles.md
Last active September 20, 2015 23:53
From clean ubuntu to dot files
vim .zshrc
change theme to ys
ADD vimrc vimrc.local vimrc.bundles vimrc.bundles.local
upgrade tmux
add tmux.conf
@oiojin831
oiojin831 / rbenv.md
Last active September 20, 2015 23:54
rbenv document에서 모르는거 정리

rbenv document

###ruby-prefix가 머지? ruby가 gem들이 설치된 경로를 찾기위해서는 gem이 설치할떄 경로를 찾아야하니까

gem env

로 쳐보면 You should see an entry INSTALLATION DIRECTORY, but there is also GEM PATHS which is where it's loading all your gems from in your current environment.

ruby-prefix/lib/ruby/gems/1.9.1/gems/rspec-core-XX.YY/exe/rspec 여기에 있는게 오리지널인데 여기에는 같은 rspec이라도 버젼별로 저장됨

@oiojin831
oiojin831 / zsh.md
Last active September 20, 2015 23:54

#zsh

sudo apt-get update
sudo apt-get install zsh
chsh -s /bin/zsh oiojin831
echo $SHELL

#git

sudo apt-get install git
@oiojin831
oiojin831 / flask_env.md
Last active September 20, 2015 23:56
Flask 설정

APP_SETTINGS=config.DevelopmentConfig
config란는 모듈에서 DevelopmentConfig라는게 있는거임

app= Flask(name)
app.config 하면 Flask에서 제공하는 config변수임

$VIRTUAL_ENV/bin/postactivate
여기에 env변수 설정 가능
export APP_SETTINGS="config.DevelopmentConfig"
export DATABASE_URL="postgresql://localhost/이름"