sudo yum groupinstall "Development Tools"
sudo yum install openssl openssl-devel
sudo yum install git-core
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel \
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
# Load dynamic modules. See /usr/share/nginx/README.dynamic. |
Install nginx on MAC: | |
Docroot is: /usr/local/var/www | |
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that | |
nginx can run without sudo. | |
nginx will load all files in /usr/local/etc/nginx/servers/. |
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl |
#/bin/python | |
# sample of python regex with non-greedy(?) and back-reference(\1). | |
import re | |
pattern = re.compile(r'paymentContractId=(.*?)">\1'); | |
for i, line in enumerate(open('vbs-charged-backfill-orders.preprocessed')): | |
for match in re.finditer(pattern, line): | |
print match.group(1) |
# http part | |
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/hengwei.me/html; | |
index index.html index.htm; | |
# Make site accessible from http://localhost/ | |
server_name hengwei.me www.hengwei.me; |
command `sudo easy_install pygments` seems not work for me, use the following command got successfully. | |
sudo gem install pygments.rb |
https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps | |
1. set remote git repo | |
2. set local git branch: git remote add tech ssh://[email protected]:~/repos/t.hengwei.me.git | |
3. git push: git push live master |
http://www.liuxiao.org/2017/02/tensorflow-mac-os-%E4%B8%8A-tensorflow-%E5%AE%89%E8%A3%85%EF%BC%88%E6%94%AF%E6%8C%81-cuda%EF%BC%89/ | |
# remove end ^M character | |
perl -pe 's{\d+\.\d+%}{$&/100}eg' | |
# parse csv file, convert to tsv file. | |
perl -MText::ParseWords -lne' | |
print join "\t", map "$_", | |
parse_line(",",0, $_); # if you want to keep the double-quotes of the field, just use put '1' instead of 0 as the second parameter. | |
' infile.csv >infile.tsv |