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 | |
# | |
# yesterday.sh | |
# a simple way to substract one day from today | |
YESTERDAY=$(date -d "$date - 1 days" +"%Y-%m-%d") | |
echo $YESTERDAY |
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 | |
# | |
# timestamp.sh | |
# a simple timestamp function, to use in scripts | |
function timestamp(){ | |
date +"%Y-%m-%d %H:%M:%S" | |
} | |
timestamp |
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 | |
# | |
# from site: ipinfo.io | |
# gets info on given IP adress | |
if [ -z $1 ]; then | |
echo "$(basename $0) [ip address]""" | |
exit | |
fi |
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 | |
# | |
# trim-yesterday-pcaps.sh | |
# trim pcap files for the previous day | |
# ksaver, May 2019 | |
SENSOR_NAME=$(hostname) | |
IFACE=eth1 | |
PCAP_SIZE=102400 | |
YESTERDAY=$(date -d "$date - 1 days" +"%Y-%m-%d") |
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 | |
# spinner.sh | |
# A simple spinner in your terminal. | |
SPINS=( | |
"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgKiUlJSUlJSUlIyAgICAgICAgICAgICAgICAgICAgKCUlJSUlJSUlJSggICAgICAgICAgICAgICAKICAgICAgICAgICAgKiUlICAgLCgoKiAgICMlIyAgICAgICAgICAgICAgLiUlICAgKCUlJSguICAlJSwgICAgICAgICAgICAKICAgICAgICAgICAlJSAuJSUlJSUlJSUlJS8gLyUsICAgICAgICAgICAlJSAgJSUlJSUlJSUlJSUgICUlICAgICAgICAgICAKICAgICAgICAgICUoICUlJSMgLyUlKCAvJSUlIC4lJS8gICAgICAgIyUlICglJSUgIyUlJSggJSUlKCAlJSAg |
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 | |
# geolocate an IP address | |
if [ -z $1 ]; then | |
echo "Missing argument: IP address." | |
else | |
IP=$1 | |
curl http://api.db-ip.com/v2/free/$IP | |
fi |
NewerOlder