Skip to content

Instantly share code, notes, and snippets.

@iOS0x00
iOS0x00 / gist:8312332
Created January 8, 2014 05:39
简单的tmux配置,支持鼠标操作
set -g prefix C-a
set-window-option -g mode-keys vi
set-window-option -g utf8 on
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
@lithuak
lithuak / lj_spider.py
Last active January 6, 2018 21:20
Export cookies from Chrome db to Scrapy format
import sqlite3
def get_chrome_cookies():
conn = sqlite3.connect('/home/<username>/.config/chromium/Default/Cookies')
query = 'select name, value, path from cookies where host_key=".livejournal.com";'
return [{"name": r[0], "value": r[1], "path": r[2]} for r in conn.execute(query)]
@Kingson
Kingson / Douban_movie_query.py
Last active June 16, 2020 07:42
豆瓣电影查询助手V3.0 #增加给新关注的用户自动返回“欢迎关注豆瓣电影,输入电影名称即可快速查询电影讯息哦!”信息的功能 #大力丰富注释和docstring信息,以帮助后来者能快速上手。
#! /usr/bin/env python
# coding=utf-8
__author__ = 'jszhou'
from bottle import *
import hashlib
import xml.etree.ElementTree as ET
import urllib2
# import requests
import json
@lamengao
lamengao / gist:1560715
Created January 4, 2012 16:08
dl.cuoluo.me nginx config
server {
listen 80;
server_name dl.cuoluo.me;
location / {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://dl.dropbox.com/u/1812807/dl.cuoluo.me/index.html;
if ($request_method = POST) {
@santa4nt
santa4nt / patch_basehttpserver.py
Created April 21, 2010 23:57
A patch for slow BaseHTTPServer's default handler.
# This is a hack to patch slow socket.getfqdn calls that
# BaseHTTPServer (and its subclasses) make.
# See: http://bugs.python.org/issue6085
# See: http://www.answermysearches.com/xmlrpc-server-slow-in-python-how-to-fix/2140/
import BaseHTTPServer
def _bare_address_string(self):
host, port = self.client_address[:2]
return str(host)