Skip to content

Instantly share code, notes, and snippets.

Revoltech plugnburn

Block or report user

Report or block plugnburn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@plugnburn
plugnburn / unlockgen.py
Created Mar 28, 2019
Huawei modem unlock/flash code generator for algos v1/v2/v201 (Python 2 version)
View unlockgen.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import hashlib
import argparse
import binascii
import struct
def encrypt_v1(imei, key):
@plugnburn
plugnburn / paschenometer.js
Last active Jun 21, 2018
Paschenometer - visual image to text ratio meter for helpix.ru reviews
View paschenometer.js
//copy the following into browser console and run
(()=>{
let root=document.querySelector('div[itemprop="reviewBody"]'),
selCalc = sel => [].slice.call(root.querySelectorAll(sel)).reduce((v,el)=> v + (parseFloat(getComputedStyle(el).height) || 0), 0),
totalImageHeight = selCalc('div[align="center"] img'), totalTextHeight = selCalc('p'),
totalHeight = totalImageHeight + totalTextHeight;
console.log('Percentage: images - ' + (100*totalImageHeight/totalHeight).toFixed(2) + '%, text - ' + (100*totalTextHeight/totalHeight).toFixed(2) + '%')
console.log('Paschenism ratio:', (totalImageHeight/totalTextHeight).toFixed(2))
})()
@plugnburn
plugnburn / totp.red
Last active Aug 16, 2017
TOTP in Red: One-time password generation library compatible with Google Authenticator
View totp.red
Red [
Title: "TOTP library compatible with Google Authenticator"
Author: "@plugnburn"
notes {
Implements Google Authenticator-compatible TOTP algorithm.
Usage:
totp-b32 KEY ; generate a one-time password for string! key in Base32
totp-bin KEY ; generate a one-time password for binary! key
totp-genkey ; generate a random key and return it in the Base32 format
totp-genkey/pass PASSWORD ; generate a key from a password and return it in the Base32 format
@plugnburn
plugnburn / README.md
Last active Jun 29, 2019
JJY.js: Web Audio API based JJY transmitter
View README.md

JJY.js: JJY time signal emulation/transmission library

Usage

  1. Make sure that the watch/clock is configured to receive JJY 40 KHz signal (for most Casio Waveceptor/G-Shock watches, the easiest way is to enter the engineer menu by pressing Mode+Light+Receive and select J 40 reception mode, for all other watches you need to set the home city to Tokyo)
  2. Make sure your device clock is in sync before running the emulator.
  3. From the page, run:
@plugnburn
plugnburn / fibsynth.sh
Last active Jun 23, 2017
FibSynth - experimental Fibonacci based synth/sequencer based on Bash and SoX
View fibsynth.sh
#!/bin/bash
# Fibonacci Synth
# Usage: ./fibsynth.sh [a] [b] [modulo base] [scale] [interval] [tone shift]
# Example: fibsynth.sh 1 1 10 mixlyd 0.2 0
i=$1
j=$2
base=$3
interval=$5
@plugnburn
plugnburn / sociopunk.js
Created May 8, 2017
Sociopunk: text-based steganography
View sociopunk.js
// Sociopunk plaintext steganography module aimed at social network posting
// Encoding: Sociopunk.enc(secretText, coverText) when cover text is in Latin
// or Sociopunk.enc(secretText, coverText, true) when cover text is in Cyrillic
// Decoding: Sociopunk.dec(coverText) or Socipunk.dec(coverText, true) respectively
Sociopunk = (function(){
var msg2bin = m => unescape(encodeURIComponent(m)).split('').map(c=>('00000000'+c.charCodeAt(0).toString(2)).substr(-8)).join('').split('').map(Number),
bin2msg = b => decodeURIComponent(escape(b.join('').match(/\d{8}/g).map(c => String.fromCharCode(Number('0b'+c))).join(''))),
latinPattern = 'aeiocxAEIOCX', cyrPattern = 'аеіосхАЕІОСХ';
@plugnburn
plugnburn / soxharp.sh
Last active Mar 3, 2018
SoX harp - simplest cross-platform musical instrument in a few lines of Bash (depends on SoX)
View soxharp.sh
#!/bin/bash
function idx() {
local t=${1%%$2*}
[[ "$1" == "$t" ]] && echo "-1" || echo ${#t}
}
oct=0
while IFS= read -r -s -n1 i; do
@plugnburn
plugnburn / mon.sh
Created Oct 6, 2016
Simplest possible monitoring solution using public etcd service and Instapush API
View mon.sh
#!/bin/bash
# Usage
# Monitoring server: mon.sh [etcd_chan_id] [instapush_app_id] [instapush_app_secret]
# Monitoring client: echo '[event_name]#[vars_json]' | mon.sh [etcd_chan_id]
ETCD_CHANID="$1" # etcd channel id on discovery.etcd.io
INSTAPUSH_APP="$2" # instapush app id
INSTAPUSH_SECRET="$3" # instapush secret key
MSGKEY="notifikey"
@plugnburn
plugnburn / fm2toavi.sh
Created Jun 30, 2016
FM2toAVI: convert FCEUX emulator recordings into real videos
View fm2toavi.sh
#!/bin/bash
# Usage: fm2toavi.sh rom.nes movie.fm2 output.avi
fceux --subtitles 0 --slstart 0 --slend 239 --xscale 1 --yscale 1 --special 0 --pal 0 \
--sound 1 --soundq 1 --soundrate 48000 --volume 150 --trianglevol 256 --square1vol 256 \
--square2vol 256 --noisevol 256 --pcmvol 256 --mute 1 --nospritelim 1 --no-config 1 \
--videolog "ffmpeg -f s16le -ar 48000 -channels 1 -i s.log -f rawvideo -r 60.0998 -s 256x224 -pix_fmt bgr24 -i - -c:a pcm_s16le -c:v libx264rgb -qp 0 -pix_fmt rgb24 $3"\
--playmov "$2" "$1"
@plugnburn
plugnburn / game.js
Last active Jun 14, 2016
Arc Escape: Super Hexagon for the very poor, see complete compressed game at http://arc-escape.surge.sh
View game.js
function T() {
var track = 'w=t>>9,k=32,m=2048,a=1-((t/m)%1),d=(((14*t*t)^t)%m)*a,y=([3,3,4.7,2][p=w/k&3])*(t/4),h=((("IQNNNN!!]]!Q!IW]WQNN??!!W]WQNNN?".charCodeAt(w/2&15|p/3<<4))/33)*t)-t,s=y*.98%80+y%80+(w>>7&&a*((5*t%m*a&128)*(0x53232323>>w/4&1)+(d&127)*(0xa444c444>>w/4&1)*1.5+(d*w&1)+(h%k+h*1.99%k+h*.49%k+h*.97%k-64)*(4-(2*a)))),(s*s>>14?127:s)+128',
duration = 120,
beat=function(b,e,a,t){return(a="data")+":audio/wav;base64,UklGRl9fX19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgA"+btoa(eval("for(t=0;++t<e*8e3;)a+=String.fromCharCode(255&("+b+"))"))}
return beat(track, duration)
}
!function() {
var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame,
aud, screenHeight = 0, screenWidth = 0, minSide = 0, maxSide = 0, centerX = 0, centerY = 0, realLoop = null, score = 0, baseSpeed = 0, speed = 0,
You can’t perform that action at this time.