Skip to content

Instantly share code, notes, and snippets.

View tojo17's full-sized avatar

とじょ17 tojo17

View GitHub Profile
@tojo17
tojo17 / readme.md
Last active March 30, 2017 17:33
build PCL for VS2015 on Win10 x64
@tojo17
tojo17 / login.sh
Created July 17, 2017 06:50
BJUT gateway CLI login
curl -d "DDDDD=UserName&upass=Password&v46s=1&0MKKey=" "http://lgn.bjut.edu.cn/"

On making a docker

config ip address

Modify C:\Users\<Username>\.docker\machine\machines\default\config.json docker-machine restart

  • Note that the ip address is still managed by Virtual Box DHCP, which is set in VBox->File->Preferences->Network.

config environment vars

eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)

Use mirror

@tojo17
tojo17 / #opt#ss-redir#iptables.sh
Created August 2, 2018 15:06
make switch great again
#!/bin/bash
# SS-REDIR TCP
iptables -t nat -N SSREDIR_TCP
# Bypass ssserver and LAN
iptables -t nat -A SSREDIR_TCP -d ===server ip=== -j RETURN
iptables -t nat -A SSREDIR_TCP -d 0.0.0.0/8 -j RETURN
iptables -t nat -A SSREDIR_TCP -d 10.0.0.0/8 -j RETURN
iptables -t nat -A SSREDIR_TCP -d 127.0.0.0/8 -j RETURN
iptables -t nat -A SSREDIR_TCP -d 169.254.0.0/16 -j RETURN
iptables -t nat -A SSREDIR_TCP -d 172.16.0.0/12 -j RETURN
@tojo17
tojo17 / functional.py
Created March 25, 2019 12:57
Fuck TorchView
from __future__ import division
import torch
import sys
import math
from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
try:
import accimage
except ImportError:
accimage = None
import numpy as np