Skip to content

Instantly share code, notes, and snippets.

@qianbinbin
qianbinbin / unmount.md
Last active February 21, 2023 13:22
Android shell script to unmount all external SD card(s)

The script may not work for Android < 6.0.

Simply run unmount.sh in Android terminal to unmount all external SD card(s), partitions formated as internal will be ignored.

To unmount when system starting up, put the script in /data/adb/service.d/ (Magisk root required) and execute chmod +x /data/adb/service.d/unmount.sh. This will be useful if Linux Deploy installs in a SD card partition.

To turn on logs, change LOG_ON=false to LOG_ON=true, the log file will be /data/local/tmp/unmount.log.

@qianbinbin
qianbinbin / reset_jetbrains_trial.sh
Created October 16, 2020 08:53
Reset Jetbrains trial for macOS
#!/bin/sh
JB_PATH=~/"Library/Application Support/JetBrains"
KEY=com.apple.java.util.prefs
echo "Deleting defaults for $KEY"
defaults delete "$KEY"
echo