Skip to content

Instantly share code, notes, and snippets.

View apsun's full-sized avatar

Andrew Sun apsun

View GitHub Profile
# Set brightness
bright() {
dbus-send \
--dest=com.ddcutil.DdcutilService \
--type=method_call \
/com/ddcutil/DdcutilObject \
com.ddcutil.DdcutilInterface.SetVcp \
int32:1 string: byte:0x10 uint16:"$1" uint32:0
}
<html>
<body>
<svg width="1024" height="1024" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="shadow">
<feDropShadow result="drop-shadow-0" in="SourceGraphic" style="flood-opacity: 0.3;" stdDeviation="10" dx="0" dy="10"/>
</filter>
<clipPath id="clip-0">
<path style="stroke-width: 3px; fill: rgb(255, 255, 255);" d="M 100 724 L 100 300 C 100 185.001 170 99.995 300.026 100 L 724 99.995 C 854 100 924 185.001 924 300 L 924 724 C 924 839.001 854 923.995 724 924 L 300.026 924 C 170 924 100 839.001 100 724 Z"/>
</clipPath>
@apsun
apsun / clean_firefox.sh
Created March 25, 2025 07:54
Clear Firefox history recommendations and cache
sqlite3 ~/.mozilla/firefox/*.default-release/places.sqlite 'delete from moz_origins;'
rm -rf ~/.mozilla/firefox/*.default-release/storage/default/**/cache
@apsun
apsun / nfc_normalize.sh
Last active March 25, 2025 07:55
NFC-normalize all filenames in the current directory
find . | grep -P '\p{M}' | xargs -d'\n' -L1 convmv -f utf-8 -t utf-8 --nfc --notest
#!/bin/bash
# add furigana to japanese text and output html
# manual edits to output will be preserved
# dependency: https://github.com/encody/autoruby
# cargo install [email protected]
set -euo pipefail
if [ "$#" -ne 2 ]; then
echo >&2 "usage: $0 in.txt out.html"
exit 1
#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <pty.h>
#include <sys/ttydefaults.h>
#include <sys/epoll.h>
#include <sys/wait.h>
#!/bin/bash
#
# generates a database containing all amateur radio entities from the FCC
# documentation: https://www.fcc.gov/wireless/data/public-access-files-database-downloads
#
# example usage:
# find all 1x3 callsigns with suffix ABC
# select call_sign, license_status from HD where call_sign like '__ABC';
#
# find all callsigns registered in zip code 98005
#!/bin/bash
set -euo pipefail
GPG_KEY_ID='<[email protected]>'
DEVICE_NAME='yourhostname'
# mount
d=$(mktemp -d)
ifuse --documents me.mssun.passforios "$d"
#!/bin/sh
set -euo pipefail
if [ $# -ne 2 ]; then
echo >&1 "usage: $0 <index> <hostname>"
exit 1
fi
index="$1"
hostname="$2"

I recently purchased a Framework 13 and a ThinkPad P14s Gen 5 AMD. I thought I would write down my impressions after using them for a week and see how they stack up against a modern MacBook. (No performance comparisons, as I got the 7640U in the Framework vs. the 8840HS in the ThinkPad, so it wouldn't be a fair fight)

Framework 13 AMD ($845 laptop + $80 RAM + $80 SSD)

Build quality

  • expansion cards have significant gaps, one port misaligned slightly
  • shell feels like plastic, not very premium (very thin aluminum)
  • screen flex is quite significant when bent from a corner
  • hinge is stiff but very wobbly, can open with one hand
  • bezel not very secure, peels up when opening screen all the way