Skip to content

Instantly share code, notes, and snippets.

@fumin
fumin / tcpdump
Created August 31, 2013 00:36
command for filtering only packets with length > 0
# Command for filtering only packets with length > 0
# Copied from http://www.wains.be/pub/networking/tcpdump_advanced_filters.txt
#
sudo tcpdump -i lo0 -A -q '(((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) && port 55976'
@fumin
fumin / english_club_self_intro.md
Last active December 14, 2015 00:59
self intro for english club

Awaw self intro for English Club

Basic info

I am fumin (awaw in most places on the web) who is mainly a developer focusing on web, iOS, and Android apps. I work at cardinalblue.com. You can find more about me at github/fumin, previous homepage, and future graphics.

Motivation

To practice the English language orally, and to get to know new friends

Expectations

I hope everyone participating find the gathering interesting, helpful, and rewarding. I believe I will feel the same if everyone feels so.

@fumin
fumin / futures.rb
Created December 12, 2012 02:13
futures implementation
require 'fiber'
require 'eventmachine'
require 'rest-core'
class BlockingClient
def initialize *args
@client = RC::Universal.new(*args)
end
def get path, params={}, opts={}
@client.get(path, params, opts).tap{}
@fumin
fumin / findcode
Last active October 13, 2015 02:18
find code for use with vim
#!/bin/bash
cd `pwd`
find . ! \( -name ".git" -prune -o -name tmp -prune -o -name log -prune \) -type f -exec grep "$@" {} \;
@fumin
fumin / use_rc_tumblr.rb
Created October 23, 2012 21:40
how to use RC::Tumblr
c = RC::Tumblr.new
c.authorize_url! # https://api.tumblr.com/oauth/authorize?oauth_token=I8QcLz0oqCTS47D9cHqjn9QfHkcmZzeMJNZEwkpCEwOdIctD2Y
# throw the above link into browser and login
# Eventually you'll end up in http://pic-collage.com/?oauth_token=I8QcLz0oqCTS47D9cHqjn9QfHkcmZzeMJNZEwkpCEwOdIctD2Y&oauth_verifier=nSAGgIsnwFoNChxIWAjYmFWKjMDWTG0UmOOr4VGpRcYsSDY7Z3
c.authorize! :oauth_verifier => 'nSAGgIsnwFoNChxIWAjYmFWKjMDWTG0UmOOr4VGpRcYsSDY7Z3'
# You are ready now :)
pp c.user_info