# Update Installed Packages
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install tmux htop git vim wget curl -y
# change default editor
sudo update-alternatives --config editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
sed -n 224380,224571p filename.log > piece.log |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >>/etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
# inspect
packer inspect example.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
md5 ~/Download/file.iso | |
shasum -a 1 ~/Download/file.iso | |
shasum -a 256 ~/Download/file.iso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import env, local, run | |
def vagrant(): | |
env.user = 'vagrant' | |
env.hosts = ['127.0.0.1:2222'] | |
result = local('vagrant ssh-config | grep IdentityFile', capture=True) | |
env.key_filename = result.split()[1] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import psycopg2 | |
from datetime import datetime | |
# ISOLATION_LEVEL_AUTOCOMMIT | |
# ISOLATION_LEVEL_READ_COMMITTED | |
# ISOLATION_LEVEL_REPEATABLE_READ | |
# ISOLATION_LEVEL_SERIALIZABLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from os import path | |
import geoip2.database | |
ips = """ | |
223.143.56.227 | |
101.8.221.38 | |
1.34.73.244 | |
42.70.123.135 | |
14.0.209.138 |