cd to target directory, run the following commands to start using git version control:
# start a local repository
git init
# add all files under directory to git repository
git add .
# commit the current version
update pg_database set datistemplate=false where datname='template1'; | |
drop database Template1; | |
-- if it complains the locale name -- run `locale -a` to list all locale names in terminal | |
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0; | |
update pg_database set datistemplate=true where datname='template1'; |
cd to target directory, run the following commands to start using git version control:
# start a local repository
git init
# add all files under directory to git repository
git add .
# commit the current version
sudo rm /etc/exports | |
sudo touch /etc/exports | |
vagrant reload |
pg_createcluster --start -e UTF-8 8.4 main
# 1. stop mysqld service
# after this command, remember to double check if /var/run/mysqld folder exists and its owner is mysql:mysql
sudo /etc/init.d/mysql stop
# might have to do this
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
# 2. start mysql without password
#!/bin/sh | |
set -e | |
if [ -e /.installed ]; then | |
echo 'Already installed.' | |
else | |
echo '' | |
echo 'INSTALLING' | |
echo '----------' |
"‐a".each_codepoint do |c| | |
if c & 0xff80 != 0 | |
puts "#{c} is non-ASCII char" | |
end | |
end |
# to add | |
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=127.0.0.1 connectport=3000 connectaddress=10.0.2.2 | |
# to remove | |
netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=127.0.0.1 |
#!/usr/bin/env bash | |
source $HOME/.rvm/scripts/rvm || source /etc/profile.d/rvm.sh | |
rvm use --default --install $1 | |
shift | |
if (( $# )) | |
then gem install $@ |
# Execute the following commands in terminal to see its output: | |
# $ curl -L -o resume.rb https://gist.github.com/tian-im/510644be3c5453f81bc86c8515d2d48b/raw && gem install rspec -N | |
# $ rspec resume.rb --format documentation --color | |
module Resume | |
puts <<~CONTACT | |
name: Tianwen "Tian" Chen | |
email: me at tian.im | |
github: https://github.com/tian-im | |
linkedin: http://www.linkedin.com/in/tian-im |