Skip to content

Instantly share code, notes, and snippets.

@ppoffice
ppoffice / build.sh
Last active March 14, 2023 23:44
Minimal Linux Build Script
#!/bin/sh
# Modified from ivandavidov/minimal-linux-script
# https://github.com/ivandavidov/minimal-linux-script
# This script includes a dynamic linked busybox, openssl, python and
# network support
set -ex
KERNEL_VERSION=4.17.2
BUSYBOX_VERSION=1.28.4
@ppoffice
ppoffice / Unicode_Garbled_Text_Decoder.js
Created April 25, 2016 14:56
Unicode Garbled Text Decoder
x = '\xE7\xBB\xBF\xE8\x89\xB2\xE5\x81\xA5\xE5\xBA\xB7\xE5\xB0\x8F\xE6\xB8\x85\xE6\x96\xB0';
x.split('').map(i => (j = i.charCodeAt(0).toString(2), i.charCodeAt(0) > 127 ? j : new Array((4 - (j.length % 4)) % 4).fill('0').join('') + j)).map((i, j, k) => (l = i.match(/^0|^1{2,4}0/), l ? m = new Array(l[0] === '0' ? 1 : l[0].length - 1).fill(0) : m = [], m.map((o, r) => r === 0 ? i.slice(l[0].length, i.length) : k[j + r].slice(2, k[j + r].length)))).filter(i => i.length).map(i => String.fromCharCode(parseInt(i.join(''), 2))).join('');