View place_to_gps.sh
#!/bin/bash
place="$1"
curl "https://www.google.com/maps/place/${place}" -L -s --compressed |
grep -Po 'cacheResponse.+?\]' |
tr '[],()' ' ' |
awk '{print $4","$3}'
View battery_low.sh
#!/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
View addic7ed.sh
#!/bin/bash
file="$1"
(
cd $(dirname "${file}")
ad7 --show "$(basename "${file}" | grep -Pio '.+?S\d\dE\d\d' | awk -F '.(S|s)[0-9]{2}(E|e)[0-9]{2}' '{print $1}')" \
--s "$(basename "${file}" | grep -Pio 'S\d\dE\d\d' | awk -F '(S|s)|(E|e)' '{print $2}')" \
--e "$(basename "${file}" | grep -Pio 'S\d\dE\d\d' | awk -F '(S|s)|(E|e)' '{print $3}')"
)
View hi.sh
#!/bin/bash
sed -ri 's/\[.+\]:?|\(.+\):?|[a-zA-Z ]+://g' *srt
View nba_com_gamerecaps_to_mp4.sh
#!/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]" \
View fix_firefox_double_icon.sh
#!/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
View ad7.js
#!/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
View scaling_governor_performance.sh
#!/bin/sh
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
View mac.conf
# 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
View aria2-inorder.conf
# 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