3 ms·
Here are the updates with everyones changes: # Encrypt a file encrypt() { openssl enc -aes-256-cbc -salt -a -in $1 -out $2; } # Decrypt a file decrypt
by skanga 9y ago
Here are the updates with everyones changes:
# Encrypt a file
encrypt() { openssl enc -aes-256-cbc -salt -a -in $1 -out $2; }
# Decrypt a file
decrypt() { openssl enc -aes-256-cbc -d -a -in $1 -out $2; }
# Fetch weather forecast
weather() { curl "http://wttr.in/$1"; }
# Convert input text into a QR code
qrify() { curl "http://qrenco.de/$1"; }
# Fetch information about a stock
stock() { curl -s "https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=$1&apikey=KPCCCRJVMOGN9L6T" | awk '/\. / {$1=""; gsub("\"|,",""); print $0}'; }
# Conversion rate between currencies
currency() { curl -s "http://api.fixer.io/latest?base=${1^^}&symbols=${2^^}" | grep -Eo "[0-9]*[.][0-9]*"; }
# Fetch cheatsheet
cheat() { curl "http://cheat.sh/$1"; }
# Fetches DNS nameserver
dns_nameserver() { awk '/nameserver/ {print $2}' /etc/resolv.conf; }
# Fetches WAN ip address
wan_search() { dig +short myip.opendns.com @resolver1.opendns.com; }
# Show actual destination of a tinyurl. Eg: untiny "tinyurl.com/savepii"
untiny() { curl -s "http://x.datasig.io/short?url=http://$1" | awk -F '"' '/dest/ {print $4}'; }
# Get your remote IP addr
myip() { curl -s http://x.datasig.io/me | awk -F"\"" '/ip/ {print $4}'; }
# Fetch movie info
movie() { curl -s "http://www.omdbapi.com/?t=${1/ /+}&apikey=946f500a" | jq ". | {Ratings:[.Ratings[1].Source, .Ratings[1].Value ], Plot, Actors, Director, Genre, Rated, Year, Title}" | sed -e '/Ratings/{N;N;N;s/\n/ /g;s/"Ratings": \[ //;s/, /:/;s/ ]//}' | awk -F'"' '/: / {print $2 ": " $4}'; }