Skip to content

Instantly share code, notes, and snippets.

View pwlin's full-sized avatar
🎧
Listening to Africa by Toto

pwlin pwlin

🎧
Listening to Africa by Toto
View GitHub Profile
@pwlin
pwlin / tunneling.md
Created October 15, 2023 17:20 — forked from tombowditch/tunneling.md
Tunneling a whole process through wireguard

Tunneling a whole process through wireguard

Certain company blocking a certain hosting provider? No problem, just tunnel the process through a small VPS with wireguard.

Consider server A your blocked server and server B your VPS.

Step 1: Generate a keypair on server A and server B

Server A:

// FFmpeg settings for vimeo.com
// =============================
// Trying to find the best settings for encoding videos as described here: http://vimeo.com/help/compression
//
// Input file: MTS
// Video: H264, 1920x1080, 50fps
// Audio: A52 Audio (aka AC3), Stereo, 48kHz, 256kbps
ffmpeg -i input.mts -vcodec libx264 -acodec aac -strict experimental -vpre hq -s hd720 -b 5000k -ab 320k -r 25 -g 25 -threads 0 output.mp4
@pwlin
pwlin / encoder.js
Created December 11, 2013 13:45 — forked from iron9light/encoder.js
var fsDoOverwrite = true // Overwrite file with base64 code
var fsAsASCII = false // Create base64 code file as ASCII file
var adTypeBinary = 1 // Binary file is encoded
function encode(from, to) {
var inputStream = WScript.CreateObject("ADODB.Stream");
inputStream.Type = adTypeBinary
inputStream.Open();
inputStream.LoadFromFile(from);
@pwlin
pwlin / decoder.js
Created December 11, 2013 13:46 — forked from iron9light/decoder.js
foForReading = 1 // Open base 64 code file for reading
foAsASCII = 0 // Open base 64 code file as ASCII file
adSaveCreateOverWrite = 2 // Mode for ADODB.Stream
adTypeBinary = 1 // Binary file is encoded
function decode(from, to) {
var fileSystemObj = WScript.CreateObject("Scripting.FileSystemObject");
var file = fileSystemObj.GetFile(from)
var inputStream = file.OpenAsTextStream(foForReading, foAsASCII);