Skip to content

Instantly share code, notes, and snippets.

View liubin's full-sized avatar

Bin Liu liubin

View GitHub Profile
@liubin
liubin / squash-commits.md
Last active January 19, 2018 08:11 — forked from jbub/squash-commits.sh
git squash last two commits into one

1

git rebase --interactive HEAD~2

#  we are going to squash c into b 
pick b76d157 b
pick a931ac7 c

# squash c into b
@liubin
liubin / gist:7db1f942753f40e510674c0b997e950f
Last active January 15, 2021 16:51 — forked from jordelver/gist:3073101
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Get devices list

networksetup -listnetworkserviceorder

Set the SOCKS proxy to local SSH tunnel

@liubin
liubin / kubecon_curl.sh
Created December 11, 2017 04:52 — forked from superbrothers/kubecon_curl.sh
Download Kubecon Austin 2017 presentations from Sched
#!/bin/bash
mkdir -p kubecon_files
DAYS=("2017-12-06" "2017-12-07" "2017-12-08")
for DAY in "${DAYS[@]}"; do
#Super shitty pipefest because of grep matched groups sadness
LINKS=($(curl https://kccncna17.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do
echo "Requesting https://kccncna17.sched.com/${LINK}"
@liubin
liubin / ssh-d4m
Created November 6, 2017 11:40
SSH into Docker for Mac xhyve VM
1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
2. when done use CTRL-A CTRL-\ and then y (for yes) to exit
Alternative method:
1. docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
@liubin
liubin / out_forward.conf
Created September 30, 2017 06:52 — forked from sonots/out_forward.conf
ログの欠損をできるだけ避ける Fluentd の out_forward 設定サンプル cf. http://blog.livedoor.jp/sonots/archives/44690980.html
<source>
type in_tail
# ...
tag raw.eventlog
</source>
<match raw.**>
type forward
log_level "#{ENV['DEBUG'] ? 'debug' : 'info'}"
@liubin
liubin / golang_job_queue.md
Created August 11, 2017 10:06 — forked from harlow/golang_job_queue.md
Job queues in Golang
@liubin
liubin / main.go
Created August 10, 2017 05:19 — forked from kevburnsjr/main.go
Easy Middleware in Go
package main
import (
"net/http"
"time"
"log"
)
func main() {
dh := DispatchHandler{}
@liubin
liubin / opentsdb.conf
Created March 29, 2017 09:22 — forked from kylebrandt/opentsdb.conf
OpenTSDB Configuration
tsd.core.auto_create_metrics=true
tsd.core.meta.enable_realtime_ts=false
tsd.core.meta.enable_realtime_uid=false
tsd.core.meta.enable_tsuid_incrementing=false
tsd.core.meta.enable_tracking=false
tsd.core.plugin_path=
tsd.core.tree.enable_processing=false
tsd.http.cachedir=/tmp/tsd
tsd.http.request.cors_domains=*
tsd.http.request.enable_chunked=true
@liubin
liubin / shiguredo_tech.rst
Created March 14, 2017 04:57 — forked from voluntas/shiguredo_tech.rst
時雨堂を支える技術

時雨堂を支える技術

日時

2017-03-14

時雨堂

バージョン

2.4.2

URL

http://shiguredo.jp/

言語