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
all: clean build | |
build: | |
gcc student_a64_template.s a64_testbench.o -o ac_lab -g -lm | |
run: build | |
qemu-aarch64 ./ac_lab ${ARGS} | |
run-and-wait-for-debug: | |
while true; do make build && qemu-aarch64 -g 25540 ./ac_lab ${ARGS}; sleep 1; done |
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
# NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix build --impure .#opi | |
{ | |
description = "NixOS Orange Pi Zero configuration flake"; | |
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; | |
outputs = { self, nixpkgs }: rec { | |
pkgsIntel = import nixpkgs { | |
system = "x86_64-linux"; # or something else | |
config = { allowUnfree = true; allowUnsupportedSystem = true;}; |
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
# Minimum index is 1, the IHDR block MUST be first for a valid PNG | |
# this assumes the skipped blocks aren't very large, so it reads the whole block into memory at once, beware of setting index to more than 1 | |
# The script is also read into memory so don't make it too large | |
def insert_text_chunk(filein, fileout, text, index = 1): | |
from binascii import crc32 | |
from struct import pack, unpack | |
with open(filein, 'rb') as fin, open(fileout, 'wb') as fout: | |
fout.write(fin.read(8)) # PNG Header | |
# skip blocks |
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
javascript:(() => { w = window.open("https://ntfy.sh/mytopic/publish?message="+encodeURIComponent(document.getSelection().toString().replace(/(<br>)|(<br\/>)/, "\n"))); setTimeout(() => {w.close()}, 1500); })(); |
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
If your MXID server alias is different from the server host, ie domain.tld and matrix.domain.tld, apprise could work with this | |
matrixs://%40localpart%3Aexample.org:[email protected]/#room-name | |
just wanted to publish this |
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
{ | |
auto_https disable_redirects | |
} | |
(upgrade) { | |
@upgradable { | |
header Upgrade-Insecure-Requests 1 | |
protocol http | |
} |
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
cat access.log access.log.1 | grep '/t.json' | awk '{print $1}' | sort | uniq | xargs -L1 -I % curl "https://freegeoip.app/json/%" | tee -a ~/log.log |
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/bash | |
# Note: an empty json file at old_ver.json should exist before running this | |
cd "$(dirname "$0")" | |
nvchecker -l error -c nvchecker.toml | |
VAR="`nvcmp -c nvchecker.toml`" | |
url="https://gotify.example.com" | |
token="A123ABC.DEF" |
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/bash | |
SERVER_NAME="STATUS" | |
URL="https://status.malhotra.cc" | |
TIMEOUT=10 | |
GOTIFYURL="https://gotify.example.com" | |
GOTIFY_TOKEN="token" | |
PRIORITY=9 | |
STATUS=$(curl -m $TIMEOUT "$URL" -w "%{http_code}\\n" -I -o /dev/null 2>/dev/null) |
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
Traceback (most recent call last): | |
File "/home/karmanyaahm/Documents/code/other/server/google_classroom/.venv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__ | |
return self.wsgi_app(environ, start_response) | |
File "/home/karmanyaahm/Documents/code/other/server/google_classroom/.venv/lib/python3.8/site-packages/flask_behind_proxy.py", line 25, in __call__ | |
return self.app(environ, start_response) | |
File "/home/karmanyaahm/Documents/code/other/server/google_classroom/.venv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app | |
response = self.handle_exception(e) | |
File "/home/karmanyaahm/Documents/code/other/server/google_classroom/.venv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception | |
reraise(exc_type, exc_value, tb) | |
File "/home/karmanyaahm/Documents/code/other/server/google_classroom/.venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise |
NewerOlder