Skip to content

Instantly share code, notes, and snippets.

geekman

Block or report user

Report or block geekman

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
@geekman
geekman / clock.html
Created Apr 2, 2019
clock display HTML snippet. encode onto a QR for quick & dirty time display
View clock.html
data:text/html,<script>setInterval("d = new Date(); document.body.innerHTML = `<h1>${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`", 500);</script><body>
@geekman
geekman / strip-style-tags.lua
Created Mar 2, 2019
Aegisub plugin to remove font, size & color styling
View strip-style-tags.lua
-- modified from strip-tags.lua by Thomas Goyne <plorkyeran@aegisub.org>
--
-- Permission to use, copy, modify, and distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@geekman
geekman / pin-entry-anim.html
Last active Mar 13, 2019
PIN entry animation
View pin-entry-anim.html
<!-- PIN entry animation -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<style>
.h {
position: relative;
@geekman
geekman / uboot-image.bt
Created Dec 8, 2018
010 editor template for U-Boot images that i hacked up
View uboot-image.bt
//
// quick 010 Editor template for u-boot images
// darell tan 2018.12.08
//
enum <uchar> IH_TYPES {
TYPE_INVALID,
TYPE_STANDALONE,
TYPE_KERNEL,
TYPE_RAMDISK,
@geekman
geekman / ren_dated_file.py
Created Sep 16, 2018
renames a dated file into another date format
View ren_dated_file.py
#!/usr/bin/env python
#
# renames files with date JAN_18 to "<prefix> 2018-01"
# darell tan 2018.09.14
#
from __future__ import print_function
import sys
import os
import re
@geekman
geekman / boot.cmd
Created Jul 21, 2018
boot-time device tree overlays with U-Boot
View boot.cmd
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
fdt addr ${fdt_addr_r}
fdt resize
setexpr fdtovaddr ${fdt_addr_r} + F000
@geekman
geekman / fixer.js
Created May 12, 2018
JS to "fixup" ASCII art on old Apple docs, e.g https://support.apple.com/kb/TA40730
View fixer.js
document.querySelector('.SUMMARY').childNodes.forEach(function(e) {
if (e.nodeType == Node.TEXT_NODE && (e.textContent.match(/[+|-]/g) || []).length > 2) {
var n = document.createElement('code');
n.textContent = e.textContent.replace(/^[\r\n]*(.*)[\r\n]*$/, '$1');
n.style = 'white-space:pre-wrap';
e.parentNode.replaceChild(n, e);
}
});
@geekman
geekman / script.ps1
Created Mar 29, 2018
making sure your USB network adapter doesn't take over your default gateway & Internet connection
View script.ps1
# to verify, use `route print` and check the order in which the interfaces are listed
Get-NetAdapter | Where-Object {$_.InterfaceDescription -like '*USB*'} | Set-NetIPInterface -InterfaceMetric 9999
@geekman
geekman / moveup.py
Created Jan 19, 2018
removes a block within a file and shifts its following contents "upwards"
View moveup.py
# moves up file data at current pos to specified to_offset
def moveup(f, to_offset, block_size=4096):
while True:
data = f.read(block_size)
newpos = f.tell()
f.seek(to_offset)
to_offset += len(data)
if len(data) == 0: break
@geekman
geekman / GetProfileOwner.ps1
Created Jan 2, 2018
retrieves owner of a Windows profile directory
View GetProfileOwner.ps1
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string] $Path
)
# Usually the profile owner has full control, but is not a well-known SID
# References:
# https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems
# https://technet.microsoft.com/en-us/library/ff730940.aspx
You can’t perform that action at this time.