Skip to content

Instantly share code, notes, and snippets.

Avatar

Winston Hoy curiousercreative

View GitHub Profile
@curiousercreative
curiousercreative / main.sh
Created Aug 2, 2022
Make a 2011 MacBook Pro with failing AMD dGPU run Pop!_OS 22.04
View main.sh
#! /usr/bin/env bash
# If the Pop! installer won't boot due to dGPU failure, remove the SATA SSD/HDD from the MacBook and install Pop! to it using a computer that will boot the installer
# With Pop! installed and running as root
# disable AMD gpu drivers
cat << EOF > /etc/modprobe.d/blacklist-amd-dgpu.conf
blacklist radeon
blacklist amdgpu
EOF
@curiousercreative
curiousercreative / migrate-atom-deb-to-user-flatpak.sh
Created May 31, 2022
Rough script for migrating common settings from your .deb Atom to user-specific flatpak Atom (Pop!_OS 22.04 tested)
View migrate-atom-deb-to-user-flatpak.sh
#! /bin/bash
# global config
cp -f ~/.atom/config.cson ~/.var/app/io.atom.Atom/data/
# keybindings
cp -f ~/.atom/keymap.cson ~/.var/app/io.atom.Atom/data/
# init script (maybe you defined some custom function and then bound to a key combo?)
cp -f ~/.atom/init.coffee ~/.var/app/io.atom.Atom/data/
# packages
cp -rf ~/.atom/packages ~/.var/app/io.atom.Atom/data/
@curiousercreative
curiousercreative / system76-power-profile-default.sh
Last active Apr 28, 2022
Write a systemd service file to set profile after system76-power service starts and enable it
View system76-power-profile-default.sh
#!/usr/bin/env bash
# as superuser
sudo su
# write a systemd service file to set profile after system76-power service starts
cat <<EOF > /etc/systemd/system/system76-power-profile-default.service
[Unit]
Description=Set the profile profile at startup.
After=com.system76.PowerDaemon.service
View 01-wireguard.yml
network:
renderer: NetworkManager
version: 2
tunnels:
wg0:
mode: wireguard
addresses:
- 10.10.10.102/32
key: <private key>
peers:
View dmesg-i7-1165g7.txt
[ 0.000000] microcode: microcode updated early to revision 0x88, date = 2021-03-31
[ 0.000000] Linux version 5.15.15-76051515-generic (jenkins@warp.pop-os.org) (gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.37) #202201160435~1642693824~21.10~97db1bb SMP Thu Jan 20 17:35:05 U
[ 0.000000] Command line: initrd=\EFI\Pop_OS-5b30118c-3837-4895-9c60-70ea27dd36d9\initrd.img root=UUID=5b30118c-3837-4895-9c60-70ea27dd36d9 ro quiet systemd.show_status=false splash resume=UUID=f44f6cb9-8bab-4ab8-99fb-c409ad6e9668 loglevel=0
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Hygon HygonGenuine
[ 0.000000] Centaur CentaurHauls
[ 0.000000] zhaoxin Shanghai
[ 0.000000] x86/split lock detection: #AC: crashing the kernel on kernel split_locks and warning on user-space split_locks
View pcmify.sh
#! /bin/bash
askYesNo() {
local answer=
while [ "$answer" != "y" ] && [ "$answer" != "n" ]; do
read -e -n 1 -p "$1 (y/n) " answer
done
if [ "$answer" != "y" ]; then
return 1
fi
@curiousercreative
curiousercreative / carPriceNormalizer.mjs
Created Aug 19, 2021
normalize the cost of various used cards
View carPriceNormalizer.mjs
#!/usr/bin/env node
const currentYear = new Date().getFullYear();
const adjustments = {
exteriorColor: {
black: 1000,
blue: -500,
burgundy: 500,
charcoal: 500,
@curiousercreative
curiousercreative / dockify.sh
Last active May 2, 2021
Profiles for running System76 Galago Pro (galp5) docked vs undocked
View dockify.sh
#!/bin/bash
# restore default text size since our external display is already 200% scaled
gsettings set org.gnome.desktop.interface text-scaling-factor 1.0
# configure keys for Apple Wired keyboard
## Backup curent /usr/share/X11/xkb/symbols/pc
if [ ! -f /usr/share/X11/xkb/symbols/pc.bak ]; then
echo "Backing up /usr/share/X11/xkb/symbols/pc..."
sudo cp /usr/share/X11/xkb/symbols/pc /usr/share/X11/xkb/symbols/pc.bak
@curiousercreative
curiousercreative / darktable.log
Last active Mar 31, 2021
darktable macOS startup output
View darktable.log
$ rm -Rf ~/.config/darktable ~/.cache/darktable
$ /Applications/darktable.app/Contents/MacOS/darktable -d all
0.000898 application_directory: /Applications/darktable.app/Contents/MacOS
0.001040 darktable.datadir: /Applications/darktable.app/Contents/Resources/share/darktable
0.001123 darktable.plugindir: /Applications/darktable.app/Contents/Resources/lib/darktable
0.001196 darktable.localedir: /Applications/darktable.app/Contents/Resources/share/locale
0.001392 darktable.configdir: /Users/curiouser/.config/darktable
0.001539 darktable.cachedir: /Users/curiouser/.cache/darktable
0.001617 darktable.sharedir: /Applications/darktable.app/Contents/Resources/share
0.001709 darktable.tmpdir: /private/var/folders/jg/8sl7jff55y7dh77tfpztd4pr0000gn/T