Skip to content

Instantly share code, notes, and snippets.

View wynemo's full-sized avatar
:octocat:
吃土中

Nemo.Zhang wynemo

:octocat:
吃土中
View GitHub Profile
@wynemo
wynemo / django learning.txt
Last active March 3, 2017 04:43
django learning
cd somedir
wget -c https://pypi.python.org/packages/d4/0c/9840c08189e030873387a73b90ada981885010dd9aea134d6de30cd24cb8/virtualenv-15.1.0.tar.gz
wget -c https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
cd Python-2.7.13
mkdir $PWD/../python2.7
./configure --prefix=$PWD/../python2.7
#sudo aptitude install libbz2-dev
#libreadline6-dev
https://docs.docker.com/engine/installation/linux/centos/
sudo systemctl restart docker
/home/nemo.zhang/mysqldata
chcon -Rt svirt_sandbox_file_t /home/nemo.zhang/mysqldata
sudo docker run --name test-mysql -v /home/nemo.zhang/mysqldata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=mypassword -d mysql/mysql-server
@wynemo
wynemo / PIL on centos7.txt
Last active March 8, 2017 14:35
install PIL 1.1.7 on centos 7
do this in dev instance `rm /home/propus/.download/PIL-1.1.7-cp27-none-linux_x86_64.whl`
and do this `yum install libjpeg-turbo-devel`
and remove `PIL` and `python-pillow`. we dont need a system package.
we just need install PIL in python virtualenv environment.
the reason of this issue is that centos 7 use `libjpeg-turbo-devel` instead of `libjpeg-devel`.
zdb@dabin:~$ cat /etc/fail2ban/filter.d/sslproxy.local
[Definition]
failregex = read error remote error: tls: unknown certificate authority <HOST>:\d+
zdb@dabin:~$ cat /etc/fail2ban/jail.local
[sslproxy]
enabled = true
port = 443
# http://docs.ansible.com/ansible/intro.html
####################################################
# create env
cd somedir
export PATH=$PATH:$PWD/env/bin
wget -c https://pypi.python.org/packages/d4/0c/9840c08189e030873387a73b90ada981885010dd9aea134d6de30cd24cb8/virtualenv-15.1.0.tar.gz
wget -c https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
cd Python-2.7.13
import sys
from twisted.internet import reactor, defer
from twisted.python import log
log.startLogging(sys.stdout)
@defer.inlineCallbacks
def foo():
reactor.stop()
@wynemo
wynemo / nodejs learning.txt
Last active May 9, 2017 08:51
nodejs learning
request lib set http proxy
process.env.https_proxy='​http://192.168.196.71:7000'
process.env.http_proxy='​http://192.168.196.71:7000'
webkit set http proxy
nw.App.setProxyConfig("http=192.168.196.71:7000;https=192.168.196.71:7000")
https://www.postgresql.org/docs/current/static/app-psql.html
\d+ tablename
\list or \l: list all databases
\dt: list all tables in the current database
\connect database_name
@wynemo
wynemo / conda.sh
Last active October 12, 2016 14:39
conda
wget -c https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh
sh Anaconda2-4.2.0-Linux-x86_64.sh
./conda --version
export http_proxys=127.0.0.1:7000
./conda create -vv -n mystock python=2.7 numpy pandas matplotlib ipython scipy
source activate mystock
(mystock) [nemo.zhang@cws71 bin]$ ipython --pylab
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40)
Type "copyright", "credits" or "license" for more information.
@wynemo
wynemo / recent_used_command.sh
Created October 11, 2016 02:47
实用命令
grep -irnI 'foo' * # find text foo in current folder
find . -iname '*bar* # find file that matches bar
du --max-depth=1 -h # list size of each in current folder
df -h # disk size
rsync -avzp -e 'ssh -i /tmp/ttt' /path1 user@server:/path2/