Skip to content

Instantly share code, notes, and snippets.

View liubin's full-sized avatar

Bin Liu liubin

View GitHub Profile
@liubin
liubin / nc-tcp-forward.sh
Created February 9, 2023 07:06 — forked from holly/nc-tcp-forward.sh
easy tcp port forwarding by netcat
#!/usr/bin/env bash
set -e
if [ $# != 3 ]; then
echo 'Usage: nc-tcp-forward.sh $FRONTPORT $BACKHOST $BACKPORT' >&2
exit 1
fi
@liubin
liubin / qemu-networking.md
Created December 6, 2022 08:32 — forked from extremecoders-re/qemu-networking.md
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@liubin
liubin / mecab_cabocha.ipynb
Created October 24, 2022 03:18 — forked from tomowarkar/mecab_cabocha.ipynb
How to use MeCab and CaboCha in Google Colaboratory! you can also see here: https://tomowarkar.github.io/blog/posts/colab_mecab/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@liubin
liubin / cookie.go
Created June 4, 2013 12:44
display cookie in go lang
@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 / latest-protobuf-ubuntu-18-04.md
Created April 26, 2020 12:39 — forked from diegopacheco/latest-protobuf-ubuntu-18-04.md
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
@liubin
liubin / PV_PVC.yaml
Last active February 28, 2020 10:38
CKA
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-001
spec:
capacity:
storage: 100Mi
accessModes:
- ReadWriteOnce
- ReadWriteMany
@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 / gist:92545beded509864af824022bc948d7c
Created August 2, 2018 10:11 — forked from tsuri/gist:ddcffce68e7737ce506172cd823bd5af
mixed normal and preemtible kubernetes cluster
# Kubernetes clusters using preemtible instances
## Motivation
People experimenting with kubernetes clusters on the GKE not
necessarily have money to keep a full cluster on at all time. GKE
clusters can be easily resized, but this still incurs in the full
instance cost when the cluster is up.
Google has added preemptible instances that are ideal for many