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 | |
| # https://wiki.freebsd.org/Wii | |
| # https://wiki.freebsd.org/BuildingOnNonFreeBSD | |
| # https://github.com/freebsd/freebsd-src/blob/main/.github/workflows/cross-bootstrap-tools.yml | |
| # https://github.com/freebsd/freebsd-ci/tree/master/jobs/FreeBSD-main-powerpc-build | |
| # https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-world-kernel-head.sh | |
| # Support for the wii was removed in 29d0137a8d2b31771eee2172f4f73e7d4fe48373 . | |
| # Reverting it causes merge conflicts. |
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
| from pathlib import Path | |
| OLD = b"/old/downloads/dir/" | |
| NEW = b"/new/downloads/dir/" | |
| for fname in Path(".").glob("*.resume"): | |
| print(fname) | |
| with fname.open("rb") as f: | |
| data = f.read() |
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
| # mobile data be expensive | |
| # https://twitter.com/MishaalRahman/status/1452868924152983552 | |
| adb shell settings put secure sysui_qs_tiles "wifi,cell,custom(com.android.settings/.development.qstile.DevelopmentTiles\$SensorsOff),$(adb shell settings get secure sysui_qs_tiles)" | |
| # no google | |
| adb shell settings put secure assist_touch_gesture_enabled 0 | |
| # gotta go fast | |
| adb shell settings put global animator_duration_scale 0.5 | |
| adb shell settings put global transition_animation_scale 0.5 |
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
| $fn = 100; | |
| rotate([0, 0, 180]) { | |
| color("brown"){ | |
| translate([-2.5, -2.5, 0]) cube([5, 5, 70]); | |
| translate([0, 2.5, 50]) cube([40, 5, 5], center=true); | |
| } | |
| translate([0, 5, 50]) |
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
| #!/usr/bin/env python | |
| import re | |
| import os | |
| import sys | |
| from pathlib import Path | |
| import subprocess | |
| import shutil | |
| import concurrent.futures as futures | |
| import requests | |
| import json |
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
| import numpy as n,pygame as p | |
| q=(999,)*2 | |
| b=n.random.rand(*q)>.3 | |
| t=p.display | |
| r=n.roll | |
| o=p.surfarray.pixels2d(t.set_mode(q)) | |
| while 1: | |
| w=sum(r(r(b,a,0),c,1)for a in[-1,0,1]for c in[-1,0,1]) | |
| b=b&((w==3)|(w==4))|((~b)*(w==3)) | |
| o[:,:]=0-b |
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
| #!/usr/bin/env python | |
| import requests | |
| from requests.utils import parse_url | |
| from functools import lru_cache | |
| from pathlib import Path | |
| import shlex | |
| from tqdm.auto import tqdm | |
| import re | |
| import typer | |
| import os |
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
| NIX_CONFIG="extra-experimental-features = nix-command flakes" use flake |
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
| porcelain2jsonl() { | |
| uniq | ( | |
| printf "[" | |
| while read key data; do | |
| if test -z "$key"; then | |
| printf "]\n[" | |
| else | |
| printf '{"%s": "%s"}, ' "$key" "$data" | |
| fi | |
| 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
| ssh idun-login1.hpc.ntnu.no sinfo -N -o %all --json | jq ' | |
| [.sinfo[]|select(.partition.name == "CPUQ")] as $CPUQ_nodes | | |
| [.sinfo[]|select(.partition.name == "GPUQ")] as $GPUQ_nodes | | |
| def gpus_maximum: | |
| .gres.total | |
| | match("gpu:[^:]*:([0-9]+)").captures[0].string | |
| | tonumber; | |
| def gpus_used: | |
| .gres.used |