This file contains 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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<style> | |
* { font-family: sans-serif; font-size: 16px; } | |
input { font-family: monospace; } | |
input[readonly] { border: 1px solid #eee; } | |
div.row { padding: .8em 0; } |
This file contains 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 | |
# run as root | |
apt remove cloud-init unattended-upgrades popularity-contest landscape-common update-manager-core | |
apt autoremove | |
# disable upgrade units & timers | |
systemctl disable --now apt-daily{,-upgrade}.{timer,service} |
This file contains 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
data:text/html,<script>setInterval("d = new Date(); document.body.innerHTML = `<h1>${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`", 500);</script><body> |
This file contains 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
<!-- PIN entry animation --> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<style> | |
.h { | |
position: relative; |
This file contains 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
// | |
// 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, |
This file contains 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
#!/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 |
This file contains 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
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 | |
This file contains 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
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); | |
} | |
}); |
This file contains 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
# 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 |
This file contains 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
# moves up file data at current pos to specified to_offset | |
def moveup(f, to_offset, block_size=4096): | |
assert f.tell() > to_offset | |
while True: | |
data = f.read(block_size) | |
newpos = f.tell() | |
f.seek(to_offset) | |
to_offset += len(data) |