Skip to content

Instantly share code, notes, and snippets.

View arter97's full-sized avatar
💭
Code responsibly.

Juhyung Park arter97

💭
Code responsibly.
View GitHub Profile
@arter97
arter97 / mkfs.sh
Created January 9, 2024 04:51
Tesla DashCam/Sentry ext4 formatting
TARGET=/dev/sda1
TMP=/tmp/$(uuidgen)
mkdir $TMP
mkdir $TMP/TeslaCam
chown 1984:1999 $TMP $TMP/TeslaCam
mkfs.ext4 -b 4096 -O ^flex_bg -E lazy_itable_init=0,lazy_journal_init=0,root_owner=1984:1999 -L TESLADRIVE -d $TMP $TARGET
(
curl -s https://pkg.hamonikr.org/hamonikr-pkg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/hamonikr.gpg
echo "deb [arch=amd64] https://repo.hamonikr.org jammy main" | sudo tee /etc/apt/sources.list.d/hamonikr-pkg.list
echo "#deb-src [arch=amd64] https://repo.hamonikr.org jammy main" | sudo tee -a /etc/apt/sources.list.d/hamonikr-pkg.list
sudo apt update
sudo apt install -y nimf nimf-libhangul
im-config -n nimf
sudo mkdir -p /opt/zoom/platforminputcontexts
sudo ln -s /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libqt5im-nimf.so /opt/zoom/platforminputcontexts
ls -al /opt/zoom/platforminputcontexts
@arter97
arter97 / reboot
Last active November 29, 2022 22:29
kexec reboot helper for Ubuntu
#!/bin/bash
# Store at /usr/local/sbin/reboot with 755 permission
echo ""
echo "Using kexec for faster reboot."
echo ""
echo "If you want to perform a full reboot,"
echo "use 'systemctl reboot' instead."
echo ""
@arter97
arter97 / firewall.sh
Last active May 16, 2021 20:16
ipset firewall for crontab
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
exec > /dev/kmsg 2>&1
TMP=/tmp/ipsum.txt
until wget --spider https://raw.githubusercontent.com/stamparm/ipsum/master/ipsum.txt > /dev/null 2>&1; do
echo "Waiting for GitHub to be accessible"
# FIVRVoltage00
wrmsr -a 0x150 0x80000011f1e00000
# FIVRVoltage10
wrmsr -a 0x150 0x80000111f6600000
# FIVRVoltage20
wrmsr -a 0x150 0x80000211f1e00000
# FIVRVoltage30
wrmsr -a 0x150 0x80000311f6600000
# FIVRVoltage40
wrmsr -a 0x150 0x80000411fec00000
@arter97
arter97 / gist:47c70e6092f6c66f90d7b051ec425d92
Created June 8, 2020 09:37
dconf batch backup & restore (w/ meld)
dconf dump / | grep '^\[' | tr -d '\[' | tr -d '\]' |
while read a; do
(
dconf dump /$a/ |
sed -e 's@\[/\]@DUMMYPLACEHOLDER@g' |
sed -e '/DUMMYPLACEHOLDER/,$!d' |
tail -n+2 |
sed -e 's@^\[@DUMMYPLACEHOLDER@g' |
sed '/DUMMYPLACEHOLDER/,$d'; echo
) |