This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To download video/music files | |
# Put in ~/.aria2/aria2-inorder.conf | |
# Usage: aria2c --conf-path ~/.aria2/aria2-inorder.conf "$URL" | |
continue=true | |
split=8 | |
max-connection-per-server=8 | |
min-split-size=1M | |
stream-piece-selector=inorder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put in /etc/NetworkManager/conf.d/mac.conf | |
[device] | |
wifi.scan-rand-mac-address=yes | |
[connection] | |
wifi.cloned-mac-address=random | |
ethernet.cloned-mac-address=random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Newest version is in https://github.com/assafmo/ad7 | |
// Install: sudo npm install -g addic7ed-api | |
// Usage: node ad7.js "the flash" 4 8 | |
// Usage 2: chmod +x ad7.js; ./ad7.js "the flash" 4 8 | |
// Usage 3: chmod +x ad7.js; mv ad7.js /usr/local/bin/ad7; ad7 "the flash" 4 8 | |
// Usage 4: seq 1 4 | xargs -n 1 ad7 "the flash" 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
grep StartupWMClass /usr/share/applications/firefox-trunk.desktop || sudo sed -i 's/\[Desktop Entry\]/[Desktop Entry]\nStartupWMClass=Nightly/' /usr/share/applications/firefox-trunk.desktop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
nba_date=$( \ | |
curl 'https://data.nba.net/10s/prod/v3/today.json' --compressed -s | \ | |
jq .links.anchorDate \ | |
) | |
num_of_games=$( \ | |
curl 'https://data.nba.net/prod/v2/calendar.json' --compressed -s | \ | |
jq ".[$nba_date]" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sed -ri 's/\[.+\]:?|\(.+\):?|[a-zA-Z ]+://g' *srt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo npm install -g ad7 | |
file="$1" | |
( | |
cd $(dirname "${file}") | |
ad7 --show "$(basename "${file}" | grep -Pio '.+?S\d\dE\d\d' | sed -r 's/\.(s|S)[0-9]{2}(e|E)[0-9]{2}//')" \ | |
--s "$(basename "${file}" | grep -Pio 'S\d\dE\d\d' | awk -F '(S|s)|(E|e)' '{print $2}')" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# "low" = lower than 60 because my chinese battery dies at 51% | |
cat /sys/class/power_supply/BAT0/uevent | | |
awk -F = '/_FULL=/{full=$2} /_NOW=/{now=$2} END{if(now/full < 0.6){print "Bettery " 100*now/full "%"}}' | | |
xargs notify-send |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
place="$1" | |
curl "https://www.google.com/maps/place/${place}" -L -s --compressed | | |
grep -Po 'cacheResponse.+?\]' | | |
tr '[],()' ' ' | | |
awk '{print $4","$3}' |