Debian 7, Postgres 9.4
安装完后默认生成两个用户,一个系统用户postgres,一个数据库用户postgres,都没有密码,
系统用户postgres不要设置密码,修改数据库用户postgres密码
- $ sudo su postgres
- $ psql
- $ \password
Debian 7, Postgres 9.4
安装完后默认生成两个用户,一个系统用户postgres,一个数据库用户postgres,都没有密码,
系统用户postgres不要设置密码,修改数据库用户postgres密码
rails new project_name
修改Gemfile source https://ruby.taobao.org
#安装Gems bundle install
04d1b48b6bed24eaa1cf3ac13dc2ac34ae24509f8291857d76b6261692e7d698056f1a4a8db5f432e89132ed139bf8a1afe72b4c210b5dc4263bfc66fac3ce056f |
C-M-h mark-defun
C-x C-space pop-global-mark
modify-syntax-entry _ w
M-x find-name-dired: you will be prompted for a root directory and a filename pattern.
Press t to "toggle mark" for all files found.
Press Q for "Query-Replace in Files...": you will be prompted for query/substitution regexps.
Proceed as with query-replace-regexp: SPACE to replace and move to next match, n to skip a match, etc.
grep -rl {text} app | xargs sed -i"" -e 's/{text}/{replaced_text}/g'
# Rsa Demo | |
import math | |
import random | |
def to_binary(n): | |
if n / 2 == 0: | |
return str(n) | |
return to_binary(n/2) + str(n%2) | |
assert to_binary(4) == '100' |
Depends on http://github.com/bdauvergne/python-oath
pip install -e "git://github.com/bdauvergne/python-oath.git#egg=oath-dev"
Generate a secret key (and for fun, the QR code URL that can
be imported by the Google Authenticator scanner) with gen_google_code.py
.
See http://www.google.com/support/accounts/bin/answer.py?answer=1066447 for what to do with this.
(defun goto-template() | |
"Jump to correspondence Django template file" | |
(interactive) | |
(let (tmplName projectDir appName) | |
(setq projectDir "/home/shellfly/project/src") | |
(setq tmplName (thing-at-point 'filename)) | |
(setq appName (car (split-string tmplName "/"))) | |
(find-file (concat | |
(file-name-as-directory projectDir) | |
(file-name-as-directory appName) |
tcpdump -A -vvvv -s 9999 -i eth0 port 80 > /tmp/sample