Set mysql in python34 virtualenv
Normally if you install mysql in ubuntu python34 virtualenv, use
sudo apt-get install mysqlclient
so it’s better use the follow install
sudo a...
Command List for View Linux System Information
系统
# uname -a #查看内核/操作系统/CPU信息
# head -n 1 /etc/issue #查看操作系统版本
# cat /proc/cpuinfo #查看cpu信息...
vim commands cheatsheet
##Cursor movement
h - move left
j - move down
k - move up
l - move right
w - jump by start of words (punctuation considered words)
W - jump by words (spa...
Introduction to South Migrations
Install SOUTH:
pip install South
vim settings.py
In "INSTALLED_APP"
Add
'south',
python manage.py syncdb
Create a new app.
python man...
Create and apply filters to lists of file paths (Python recipe)
An experiment with filtering lists of files, documentation is written directly into the code.
"""
This is a bit ...
Deploying Django to Heroku
ls blog
vim requirements.txt
Django <=1.*.*
South
psycopg2=2.4.2
pip install -r requirements.txt
gir commit -am "change requirements"...
RSS With the Syndication Framework
Create feed.py
vim post/feed.py
from django.contrib.syndication.views import Feed
from post.models import *
class LastestPostFeed(Feed):
...
How to use Pyhton to generate source file of 2 ways
利用Python的字符串处理模块,开发人员可以编写脚本用来生成那些格式相同的C、C++、JAVA源程序、头文件和测试文件,从而避免大量的重复工作。本文概述两种利用Python string类生成java源代码的方法。
String Template
...
Remote control with telnetlib (Python recipe)
# auto_telnet.py - remote control via telnet
import os, sys, string, telnetlib
from getpass import getpass
class AutoTelnet:
...
How to set lightness in Ubuntu14.04
Open the folder.
sudo vim /etc/default/grub
Change the following code
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
To
...