Skip to content

Instantly share code, notes, and snippets.

View vvoody's full-sized avatar

vvoody vvoody

  • Shanghai, China
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Rolando Espinoza La fuente
from scrapy.conf import settings
from scrapy.core import signals
from scrapy.core.manager import scrapymanager
from scrapy.item import Item, Field
from scrapy.selector import HtmlXPathSelector
from scrapy.spider import BaseSpider
@weakish
weakish / renews.sh
Created August 25, 2010 08:53
Upload #photos to renren.com and fetch news #python #sh
#!/bin/sh
### get news from your friends at renren.com
# Copyright: (c) 2009,2010 Jakukyo Friel <weakish@gmail.com>
# License: GPL v2
# Config area
# We put everything in an hg repo. You should set it up already.
renrepo=$HOME/repo/renren
#!/usr/bin/env python
# Usage:
# This script will generate two files(vpnup and vpndown) after executing.
# Do chmod a+x on the two newly created files, and then move them to the
# openvpn config folder. then add the following two lines to the vpn config file:
# up vpnup
# down vpndown
# you might also need 'redirect-gateway' in the config file, if you don't use vpn
# as the default gateway.
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
@hugs
hugs / selenium-examples.py
Created February 16, 2011 19:40
Example code for using the Selenium 2 Python bindings.
# To install the Python client library:
# pip install -U selenium
# Import the Selenium 2 namespace (aka "webdriver")
from selenium import webdriver
# iPhone
driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub')
# Android
anonymous
anonymous / adhoc
Created July 31, 2011 17:38
Linux Ad-hoc shell script
#!/bin/bash
#####################################
#Author: Leon Lee #
#email: lendylongli@gmail.com #
#QQ: 730395591 #
#Version: 1.0 #
#Note: If you have some good ideas #
# or advice, please mail me^^ #
#####################################
@gwarser
gwarser / readcookies.py
Created October 29, 2011 14:21
Opera cookies4.dat reader
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function
import os, sys
import struct as st
import time as tm
uint32 = '>I'
int32 = '>i'
@xream
xream / ssh.c
Created December 30, 2011 05:12
Multiple SSH Tunnels
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <signal.h>
@yegle
yegle / bash-invocation.md
Created January 5, 2012 11:44
Bash Shell启动方式与RC脚本

Bash Shell启动方式与rc脚本

Shell的不同分类

根据启动Bash Shell的方式不同,对Shell有两种分类方式

登录Shell与非登录Shell

根据Shell的启动方式不同,可以将Shell分为

@vol4ok
vol4ok / gist:2587886
Created May 3, 2012 18:21
Split .ape and .flac and convert to .m4a (ALAC) or .mp3 on MacOS X
brew install flac ffmpeg cuetools # ставим нужные пакеты
# скачиваем cuetag.sh скрипт, например отсюда https://github.com/gumayunov/split-cue/blob/master/cuetag
ffmpeg -i 1.ape 1.flac # конвертируем во flac, так как libmac для APE не ставится на osx
cuebreakpoints 1.cue | shnsplit -o flac 1.flac #нарезаем на треки
cuetag 1.cue split-track*.flac #прописываем тэги (cuetag.sh ставится отдельно отдельно)
#конвертируем в ALAC
for f in split-track*.flac
do