cd /run/media/weet
su
mkdir dvd
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
import glob | |
import logging | |
import logging.handlers | |
LOG_FILENAME = 'logging_rotatingfile_example.out' | |
# Set up a specific logger with our desired output level | |
my_logger = logging.getLogger('MyLogger') | |
my_logger.setLevel(logging.DEBUG) |
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
\#* | |
*~ | |
*.swp | |
*.py[oc] | |
*.bin | |
flymake_* |
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
#!/usr/bin/env python | |
#coding: utf-8 | |
import os | |
import sys | |
import time | |
msg = "Well done, take a break!" | |
def start(min, msg): | |
time.sleep(min * 60) |
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
#### Easy way >> http://nginx.org/en/linux_packages.html | |
wget http://nginx.org/keys/nginx_signing.key | |
sudo apt-key add nginx_signing.key | |
## Code names: squeeze, wheezy | |
# deb http://nginx.org/packages/debian/ [codename] nginx | |
# deb-src http://nginx.org/packages/debian/ [codename] nginx | |
sudo apt-get update | |
sudo apt-get install nginx |
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
import urllib | |
def build_url(url, params): | |
query_string = '&'.join(['='.join([k, urllib.quote(v)]) for k, v in params.iteritems()]) | |
return '{}?{}'.format(url, query_string) | |
params = { | |
'abc':'some#def', | |
'integer': '234123' | |
} |
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 centos:centos7 | |
MAINTAINER weet <[email protected]> | |
RUN rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/7/x86_64/e/epel-release-7-1.noarch.rpm | |
RUN yum install -y redis | |
EXPOSE 6379 | |
ENTRYPOINT ["/usr/bin/redis-server"] | |
# sudo docker run -p 6379:6379 -d centos-redis |
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 centos:centos7 | |
MAINTAINER weet <[email protected]> | |
RUN yum install -y http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm | |
RUN yum install -y postgresql93-server postgresql93-contrib | |
RUN /usr/pgsql-9.3/bin/postgresql93-setup initdb | |
RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/9.3/data/pg_hba.conf | |
RUN echo "listen_addresses='*'" >> /var/lib/pgsql/9.3/data/postgresql.conf |
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
# Link: http://linuxg.net/improve-the-font-rendering-of-your-ubuntu-debian-or-derivative-system-via-infinality/ | |
echo "deb http://ppa.launchpad.net/no1wantdthisname/ppa/ubuntu precise main" | sudo tee /etc/apt/sources.list.d/infinality.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E985B27B | |
sudo apt-get update | |
sudo apt-get install fontconfig-infinality |
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
#!/usr/bin/env python | |
#coding: utf-8 | |
from gevent import monkey | |
monkey.patch_all() | |
import gevent | |
from gevent.queue import Queue |