This guide helps you to setup a minimal stateless and diskless Debian initramfs with debootstrap. It is suitable for running from QEMU or network booting with (e.g. with iPXE).
This guide is for amd64 architecture.
#!/bin/sh -eu | |
export ydin=`uname -r` | |
export os=`uname` | |
lspci | jq -Rs '{os: env.os, ver: env.ydin, laitteet: split("\n") | map(capture("^[^ ]* (?<key>[^:]*): (?<value>.*)$") ) | from_entries}' |
This useful little tool checks for changes in GPIO state without periodic polling by using the interrupt interface provided by Linux. It's useful in scripts to wait for a state change with Raspberry Pi, but works with any hardware with GPIOs.
Public domain.
To make this work, you need to export the pin and then enable interrupts. For example:
# Write all addresses containing 0.1 BTC to file | |
with open('/tmp/addresses.txt', 'w') as f: | |
f.write("\n".join([addr for addr in listaddresses() if wallet.get_addr_balance(addr)[0] == 10000000])) | |
# List all coins having balance of 0.1, with label starting with letter L containing transactions between blocks 395000 and 400350, inclusive. | |
[addr for addr in listaddresses() if wallet.get_addr_balance(addr)[0] == 10000000 and wallet.get_label(addr)[0] == 'L' and any([tx[1] >= 395000 and tx[1] <= 400350 for tx in wallet.get_address_history(addr)])] |
This is a script which listens to DTMF tones and collects 6-digit PIN code and passes it to given SSH server for processing. The server is also responsible of doing the action if it's correct. So, the correct codes are never stored on the PBX but on a remote system accessible via SSH key pair. The PIN code is passed as an argument to the command.
Caller IDs are so easy to fake, not only by phone phreaks but anyone with a plain web browser and some cryptocurrencies when you know where to go. So you should NEVER use caller phone number as an identification method. A better option is to
#!/bin/sh -eu | |
curl -o vaccines.json https://dynamic.hs.fi/2020/corona-embed-grid/vaccinesGlobalLatest.json | |
curl -o overview.json https://dynamic.hs.fi/2020/corona-embed-grid/overviewData.json | |
jq -r --slurpfile overview overview.json -f vaccines_to_cases_ratio.jq vaccines.json >ratios.csv |
bottom_hole_dist = 120; | |
bottom_rise = 10; | |
width = 205; | |
height = 115; | |
rounding_w = 200; | |
rounding_h = 110; | |
rounding_r = 10; | |
max_depth = 80; | |
plateau_depth = 5; | |
hole_d = 3; |
This tool helps you with many absolutely proprietary software which doesn't include proper push-to-talk key. I wrote this with Google Meet in mind but is also useful for many other browser based apps as well.
It works so that when Caps Lock is held down, the microphone is unmuted. If you want to toggle it (for example during a demonstration), just press Ctrl + Caps Lock.
#!/bin/sh -eu | |
# | |
# Change your IRC nickname and Matrix ID here | |
nick=Zouppeni | |
mxid='@zouppen:jkl.hacklab.fi' | |
if test $# -ne 2; then | |
echo Usage $0 IRC_CHANNEL ROOM_ID >&2 | |
exit 1 | |
fi |
#!/bin/sh -eu | |
# | |
# Usage: merge-helper base_branch branches_to_merge... | |
# Example: merge-helper lamassu/dev dockerify ui-fixes | |
git diff-index --quiet HEAD && stash= || stash=1 | |
test $stash && git stash | |
git checkout -B wip-`whoami` "$1" | |
tgt="$1" | |
shift |