Skip to content

Instantly share code, notes, and snippets.

View liluo's full-sized avatar
:octocat:
Hey, there ~

liluo liluo

:octocat:
Hey, there ~
View GitHub Profile
@liluo
liluo / ghfmd.rb
Created December 18, 2012 07:51 — forked from capnslipp/ghfmd.rb
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
#!/usr/bin/env ruby
# ^ 1.8.x or 1.9, folks!
require 'rubygems'
require File.expand_path('./md_izer', File.dirname(__FILE__))
render_options = {
:fenced_code_blocks => true,
:autolink => true,
:space_after_headers => true
@liluo
liluo / clients.md
Created February 14, 2013 11:53 — forked from defunkt/clients.md

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ]
@liluo
liluo / graph.rb
Last active December 17, 2015 12:29 — forked from SaitoWu/graph.rb
require 'date'
author = "fenbi"
email = "[email protected]"
date = Date.new(2012, 7, 30)
l = %w{
. . . . . . .
. . o . . . .
. . o . . . .
@liluo
liluo / singleapp.py
Last active August 29, 2015 14:21 — forked from jinuljt/singleapp.py
import fcntl
import time
import sys
lock = file('singleapp.lock', "w+")
try:
fcntl.lockf(lock, fcntl.LOCK_EX|fcntl.LOCK_NB)
except Exception, e:
print "kill me before start again"

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@liluo
liluo / intercept-https-with-python-mitmproxy.md
Created April 14, 2016 05:38 — forked from dannvix/intercept-https-with-python-mitmproxy.md
Intercept and manipulate HTTPs traffic with Python and mitmproxy

Intercepts HTTPs Traffic with Python & mitmproxy

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

This manual helps you create your own proxy with Python and mitmproxy/libmproxy. Mitmproxy ships with both a standalone command-line tool (mitmproxy) and a Python library (libmproxy).

@liluo
liluo / redis_key_sizes.sh
Created August 29, 2016 12:25 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
Thread-9jnxc
looping.rb:17:in `block (2 levels) in <main>'
\_ looping.rb:15:in `each'
\_ looping.rb:15:in `block in <main>'
\_ looping.rb:22:in `call'
\_ looping.rb:22:in `condition'
\_ looping.rb:26:in `looping'
\_ looping.rb:31:in `<main>'
@liluo
liluo / spacemacs-keybindings
Created March 28, 2018 05:28 — forked from adham90/spacemacs-keybindings
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |