Skip to content

Instantly share code, notes, and snippets.

View justmao945's full-sized avatar
🌴
On vacation

justmao945

🌴
On vacation
View GitHub Profile
On receiving end:
nc -l 1234 > file.tar.gz
On sending end:
cat file.tar.gz | nc <reciever's ip or hostname> 1234
That should work. Depending on the speed, it may take a while but both processes will finish when the transfer is done.
@justmao945
justmao945 / golang-tls.md
Created October 20, 2017 08:14 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@justmao945
justmao945 / unzip-gbk.py
Created February 21, 2016 14:08 — forked from yinyanghu/unzip-gbk.py
Extracting file from ZIP format for GBK coding
import os
import sys
import zipfile
print "Processing File " + sys.argv[1]
file=zipfile.ZipFile(sys.argv[1],"r");
for name in file.namelist():
utf8name=name.decode('gbk')
print "Extracting " + utf8name
@justmao945
justmao945 / vpn
Last active December 14, 2015 17:29
#!/bin/bash
####################
# Variables
####################
## How many seconds to wait for the ppp to come up each try
TIMEOUT=120
## How many seconds to wait for l2tpd to restart
L2TPD_TIMEOUT=10
## LAC name in config file
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
nvidiaInspector.exe -setGPUClock:0,0,275 -setMemoryClock:0,0,250 -setShaderClock:0,0,550