As configured in my dotfiles.
start new:
tmux
start new with session name:
| # 0 is too far from ` ;) | |
| set -g base-index 1 | |
| # Automatically set window title | |
| set-window-option -g automatic-rename on | |
| set-option -g set-titles on | |
| #set -g default-terminal screen-256color | |
| set -g status-keys vi | |
| set -g history-limit 10000 |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/bash | |
| #脚本文件名: tc2 | |
| ######################################################################################### | |
| #用TC(Traffic Control)解决ADSL宽带速度技术 Ver. 1.0 by KindGeorge 2004.12.27 # | |
| ######################################################################################### | |
| #此脚本经过实验通过,更多的信息请参阅http://lartc.org | |
| #tc+iptables+HTB+SFQ | |
| # | |
| #一.什么是ADSL? ADSL(Asymmetric Digital Subscriber Loop,非对称数字用户环路) | |
| #用最简单的话的讲,就是采用上行和下行不对等带宽的基于ATM的技术. |
| -- This script... | |
| -- It assumes when you ssh into the vagrant box you automatically cd into | |
| -- the project's directory (by having a `cd /vagrant` within your | |
| -- `~/.bashrc` for example) | |
| using terms from application "Terminal" | |
| tell application "Terminal" | |
| activate | |
| -- open the terminal's window, set its dimensions |
| # -*- coding: utf-8 -*- | |
| import urllib | |
| from pyquery import PyQuery as pq | |
| import sys | |
| import re | |
| keyword="黑魔女学园 720P TSDM" | |
| s_utf=keyword#.decode(sys.stdin.encoding).encode("utf-8") | |
| url_str='http://bt.ktxp.com/search.php?keyword=%s'%urllib.quote(s_utf) | |
| d = pq(url=url_str) |
Create an empty git repo or reinitialize an existing one
git init| :%s/r//g 删除DOS方式的回车^M | |
| :%s= *$== 删除行尾空白 | |
| :%s/^(.*)n1/1$/ 删除重复行 | |
| :%s/^.{-}pdf/new.pdf/ 只是删除第一个pdf | |
| :%s/<!--_.{-}-->// 又是删除多行注释(咦?为什么要说「又」呢?) | |
| :g/s*^$/d 删除所有空行 :这个好用有没有人用过还有其他的方法吗? |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network :private_network, ip: "192.168.33.10" | |
| config.ssh.forward_agent = true |
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
| # -*- coding: utf-8 -*- | |
| ''' | |
| 1. Construct the url with num_iid, eg: http://a.m.tmall.com/i15110720150.htm, 15110720150 is the num_iid. | |
| 2. Get the html text. | |
| 3. Parse the img urls and insert the num_iid and img urls into sqlite. | |
| ''' | |
| import requests | |
| from pyquery import PyQuery as pq |