Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'm currently busy from my primary work. Some delays are expected.

Daun Jeong Mnkai

💭
I'm currently busy from my primary work. Some delays are expected.
View GitHub Profile
@Mnkai
Mnkai / rename_episode_by_tag.sh
Created Mar 4, 2018
Rename video file name to include episode number information
View rename_episode_by_tag.sh
#!/bin/zsh
1=$(basename $1)
EPINUM=$(ffmpeg -i "$1" 2>&1 > /dev/null | grep episode_sort | cut -d ":" -f 2)
mv $1 $(printf %02d $EPINUM)" "$1
@Mnkai
Mnkai / README.md
Last active Feb 18, 2021
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)
View README.md

TDP and turbo parameter modification with MSR on non-overclockable CPU

Disclaimer

  • MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
  • MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
  • Only tested on Intel i7-8550U (Kaby Lake R).
  • This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.

Start

@Mnkai
Mnkai / ctl-472-672-support.patch
Created Jan 14, 2018
Git patch for input-wacom to support CTL-472/672 graphic tablets
View ctl-472-672-support.patch
diff --git a/4.5/wacom_wac.c b/4.5/wacom_wac.c
index 1ab33cc..b74bbf8 100644
--- a/4.5/wacom_wac.c
+++ b/4.5/wacom_wac.c
@@ -4424,6 +4424,12 @@ static const struct wacom_features wacom_features_0x360 =
static const struct wacom_features wacom_features_0x361 =
{ "Wacom Intuos Pro L", 62200, 43200, 8191, 63,
INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
+static const struct wacom_features wacom_features_0x37A =
+ { "Wacom One by Wacom S", 15200, 9500, 2047, 63,
@Mnkai
Mnkai / block_bluetooth.sh
Created Nov 28, 2017
Example scripts to disable and enable bluetooth when sleeping
View block_bluetooth.sh
#!/bin/bash
ID="-1"
ID=$(echo $(rfkill | grep bluetooth) | cut -f1 -d " ")
if [ "$ID" == "-1" ]; then
exit -1
else
rfkill block $ID
rmmod btusb -f
@Mnkai
Mnkai / undervolt-sleep.service
Last active Aug 30, 2018
Example undervolt script for i7-8550U processor, Dell XPS 13 9360
View undervolt-sleep.service
[Unit]
Description=Undervolting preset resume after sleep
After=suspend.target
[Service]
Type=oneshot
ExecStart=/bin/bash /opt/undervolt_check_and_apply.sh
[Install]
WantedBy=suspend.target
@Mnkai
Mnkai / dell_sound_workaround.sh
Created Nov 17, 2017
Rough example of sound subsystem restart for Dell XPS static noise issue
View dell_sound_workaround.sh
#!/bin/bash
rmmod snd_hda_intel --force
modprobe snd_hda_intel
alsactl restore
pkill pulseaudio
@Mnkai
Mnkai / updateBundle.sh
Created Nov 12, 2017
Bash script file for updating mastodon bundle
View updateBundle.sh
#!/bin/bash
# Delete current bundles
sudo -u mastodon rm -rf /var/lib/mastodon/live/vendor/bundle
# Build new bundles
cd /var/lib/mastodon/live
sudo -u mastodon bundle install --deployment --without development test
# Start mastodon services
@Mnkai
Mnkai / mastodon-bundle.hook
Created Nov 12, 2017
Pacman compatible libalpm hook for updating mastodon bundle (*scripts not included*)
View mastodon-bundle.hook
[Trigger]
Operation = Upgrade
Type = Package
Target = imagemagick
Target = ffmpeg
Target = protobuf
Target = nginx
Target = redis
Target = postgresql
Target = nodejs
@Mnkai
Mnkai / mastodon-stop.hook
Created Nov 12, 2017
Pacman compatible libalpm hook for stopping mastodon service before transaction
View mastodon-stop.hook
[Trigger]
Operation = Upgrade
Type = Package
Target = imagemagick
Target = ffmpeg
Target = protobuf
Target = nginx
Target = redis
Target = postgresql
Target = nodejs
@Mnkai
Mnkai / thermalPrint.sh
Last active Oct 25, 2017
Printing markdown document to thermal printer by command line - depends on pandoc and wkhtmltopdf
View thermalPrint.sh
#!/usr/bin/zsh
pandoc "$1" -o "/tmp/print_temp_out.html" --wrap=preserve -f markdown -t html -s
wkhtmltopdf --encoding utf-8 --margin-top 1mm --margin-bottom 7mm --margin-left 0mm --margin-right 0mm --page-height 210mm --page-width 47mm --grayscale "/tmp/print_temp_out.html" "/tmp/print_temp_out.pdf"
lp -d Zjiang-58 "/tmp/print_temp_out.pdf"
rm "/tmp/print_temp_out.pdf"
rm "/tmp/print_temp_out.html"