Skip to content

Instantly share code, notes, and snippets.

@flxai
flxai / ffks-sort-nodes.sh
Created December 31, 2015 09:28
Sets file system modification time according to files certain contents
#!/bin/bash
grn='\e[0;32m'
red='\e[0;31m'
clr='\e[0m'
for f in $1/*; do
fn=$(basename $f)
# file system time stamp
fsts=$(stat -c%y $f | awk '{print $1}')
# key file time stamp
@flxai
flxai / ffks-fix-ugly-keys.sh
Last active December 31, 2015 09:27
Fixes some ugly fastd peers' keys
grn='\e[0;32m'
red='\e[0;31m'
clr='\e[0m'
for i in $1/*; do
fn=$(basename $i)
# comment keys
grep -qc '^# \?key' $i
ckeyworks=$?
@flxai
flxai / geizhals.sh
Created November 18, 2015 03:31
Get lowest price via Geizhals
#!/bin/bash
# Gets lowest price of an item listen on geizhals.de
item="$1"
url="https://geizhals.de/${item}.html"
price=$(curl -s "$url" | grep lowPrice | sed 's/.*gh_price\">\&euro\;\ \([0-9]\+\),\([0-9]\{2\}\).*/\1.\2€/')
echo $price