Skip to content

Instantly share code, notes, and snippets.

View pandada8's full-sized avatar
🐟
摸鱼

pandada8 pandada8

🐟
摸鱼
View GitHub Profile
@pandada8
pandada8 / tmux.conf
Created April 24, 2016 16:24
Tmux Configuration
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
@pandada8
pandada8 / iwillneverfail.py
Last active June 3, 2016 18:03
I will never fail
import traceback
import sys
import functools
def retry(times):
def retry_wrapper(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
for i in range(times):
try:
@pandada8
pandada8 / keybase.md
Created May 7, 2016 17:15
keybase.md

Keybase proof

I hereby claim:

  • I am pandada8 on github.
  • I am pandada8 (https://keybase.io/pandada8) on keybase.
  • I have a public key ASBCjiDpQWgi-KOTqNlGNVi06PKiUb5_7pt24pn0mUKM9Ao

To claim this, I am signing this object:

@pandada8
pandada8 / v6tun
Created May 9, 2016 13:46 — forked from jackyyf/v6tun
#! /bin/bash
### BEGIN INIT INFO
# Provides: ipv6
# Required-Start: $local_fs $all
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the ipv6 tunnel
# Description: ipv6 tunnel start-stop-daemon
@pandada8
pandada8 / create.py
Created May 16, 2016 10:18
setup zerotier
import requests
requests.post("http://127.0.0.1:9993/controller/network/##########000001", json={
"name": "test",
"private": True,
"enableBroadcast": False,
"allowPassiveBridging": False,
"v4AssignMode": "zt",
"v6AssignMode": "none",
"multicastLimit": 24,
@pandada8
pandada8 / config.yml
Created May 24, 2016 06:20
Build A Docker Registry Mirror
version: 0.1
log:
level: debug
fields:
service: registry
storage:
cache:
layerinfo: inmemory
filesystem:
rootdirectory: /var/lib/registry
@pandada8
pandada8 / clone.py
Last active May 27, 2016 17:02
git clone helper
#!/bin/env python
import os
import sys
from urllib.parse import urlsplit
import subprocess
os.chdir(os.path.expanduser("~/repo/"))
def clone(url, folder):
os.makedirs(folder, exist_ok=True)
@pandada8
pandada8 / install
Last active October 20, 2016 02:15
sudo apt install build-essential libncurses5-dev libreadline-dev zlib1g-dev liblzo2-dev libssl-dev -y
wget https://www.tinc-vpn.org/packages/tinc-1.1pre14.tar.gz && tar xvf tinc-1.1pre14.tar.gz && cd tinc-1.1pre14
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/sbin --with-systemd=/etc/systemd/system
make
make install
sudo tinc -n panda init
sudo tinc -n panda edit tinc-up
sudo tinc -n panda add subnet 192.168.25.0
@pandada8
pandada8 / hepan.py
Last active September 18, 2016 01:19
import requests
import json
import time
import datetime
class MobCent():
def __init__(self):
@pandada8
pandada8 / main.md
Created September 24, 2016 01:48
preload in mac
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main() {
	srand(time(NULL));
	int i = 10;
	while (i --) {
 printf("%d\n", rand() * 100);