This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# PowerShell script to read out generic Windows Credentials | |
# this is kinda like macOS Keychain, but for Windows | |
# | |
# darell tan 2021.04.08 | |
# | |
[String] $CredNativeCode = @" | |
using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: permanently decrypts PDFs and places them into the parent directory | |
for %f in (C:\dir\encrypted\*.pdf) do ^ | |
qpdf.exe --decrypt --password=secretdoc "%f" "%~dpf..\%~nxf" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Normalizes a float32 little-endian raw file to the first few averaged values. | |
// The averaged values will be treated as the baseline and all values in the | |
// file will be relative to that. | |
// | |
// 2020.11.04 darell tan | |
// | |
package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! qrcode-svg v1.0.0 | https://github.com/papnkukn/qrcode-svg | MIT license */ | |
function QR8bitByte(t){this.mode=QRMode.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var o=[],n=this.data.charCodeAt(e);n>65536?(o[0]=240|(1835008&n)>>>18,o[1]=128|(258048&n)>>>12,o[2]=128|(4032&n)>>>6,o[3]=128|63&n):n>2048?(o[0]=224|(61440&n)>>>12,o[1]=128|(4032&n)>>>6,o[2]=128|63&n):n>128?(o[0]=192|(1984&n)>>>6,o[1]=128|63&n):o[0]=n,this.parsedData.push(o)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function QRCodeModel(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function QRPolynomial(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&0==t[r];)r++;this.num=new Array(t.length-r+e);for(var o=0;o<t.length-r;o++)this.num[o]=t[o+r]}functi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PREV= | |
while :; do | |
for a in led_blue net_blue led_ant led_yellow net_yellow led_ant; do | |
[ -n "$PREV" ] && echo 0 > /sys/class/leds/$PREV/brightness | |
echo 1 > /sys/class/leds/$a/brightness | |
PREV=$a | |
sleep 1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# rewrite blog posts front matter to fix date format and title | |
# 2020.05.26 darell tan | |
# | |
import re | |
import os | |
import sys | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* | |
* RPM File Dumper | |
* Adapted to run as a self-contained binary from Holo: | |
* https://github.com/holocm/holo-build | |
* | |
* 2020.05.30 darell tan | |
* | |
* Copyright 2015 Stefan Majewsky <[email protected]> | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ida-analysis.py | |
# a simple IDAPython binary analysis script | |
# 2020.05.24 darell tan | |
# | |
# invoke with: | |
# idat64 -c -A -S"ida-analysis.py $HOME/analysis.txt" <file.bin> | |
# | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# look for non-commented, non-empty lines | |
grep -v '^\s*\(#.*\)\?$' /etc/someconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# generate systemd .link files for "enpX" devices | |
# i don't like the "s0" suffix because it's useless | |
# | |
# 2020.04.25 darell tan | |
# | |
umask 022 |