Skip to content

Instantly share code, notes, and snippets.

View kyoheiyazawa's full-sized avatar

Kyohei Yazawa kyoheiyazawa

  • Minneapolis, MN, USA
View GitHub Profile
@kyoheiyazawa
kyoheiyazawa / protonstuff.sh
Created April 6, 2020 23:03
Running Winetricks for Steam Proton
WINEPREFIX=/home/<username>/.local/share/Steam/steamapps/compatdata/<game id>/pfx winetricks <command>
@kyoheiyazawa
kyoheiyazawa / copy_iso.md
Created February 17, 2020 01:40
.iso to USB drive Linux
  • Find USB drive
sudo fdisk -l

USB is /dev/sda

  • Unmount partition
umount /dev/sda1
  • Copy image
@kyoheiyazawa
kyoheiyazawa / touchpadfix.sh
Last active November 12, 2020 00:50
Fix Thinkpad X1 Carbon trackpad dropout (place at /lib/systemd/system-sleep/)
#!/bin/bash
# chmod 755, chown root:root
sleep 1s
if [ "${1}" == "post" ]; then
echo "Executing custom touchpad fix at /usr/lib/systemd/system-sleep/touchpad-fix.sh"
echo -n "none" | sudo tee /sys/bus/serio/devices/serio1/drvctl
echo -n "reconnect" | sudo tee /sys/bus/serio/devices/serio1/drvctl
fi
@kyoheiyazawa
kyoheiyazawa / eww-json.md
Last active June 14, 2019 16:50
Emacs—Format JSON within eww

Open a JSON URL.
Disable read only in eww buffer:

M-x read-only-mode

Select the JSON body.
Pretty print:

M-x json-pretty-print
@kyoheiyazawa
kyoheiyazawa / grep.md
Created December 11, 2018 15:03
Grep - exclude comments
$ grep --color=always -rn 'stuff/stuff' | grep -v "#"
@kyoheiyazawa
kyoheiyazawa / ab.md
Created November 14, 2018 17:39
ab load testing

ab -k -c 200 -n 1200 <url>
-k = keep open
-c = concurrent requests
-n = number of requests to complete

By default, the max. number of concurrent requests seems to be 256 on Mac:
ulimit -a
This can likely be changed.