Skip to content

Instantly share code, notes, and snippets.

@therokh
therokh / monitor_mode.bash
Created June 29, 2023 14:03
Put all WLAN interfaces into monitor mode
#!/bin/bash
for interface in $(iw dev | grep wlan | grep -v mon | awk '{ print $2 }')
do
mon_interface="${interface}mon"
echo "Interface: $interface"
echo "Monitor interface: $mon_interface"
ip link set ${interface} down
iw dev ${interface} set type monitor
ip link set ${interface} name "${mon_interface}"
@therokh
therokh / download_minecraft_all.sh
Created March 11, 2018 10:19
Script to download all Minecraft client/server JAR versions
#!/bin/bash
## This script will download all URLs in the file provided as first arg
## ./download_minecraft_all.sh versions.txt
##
## Each URL on a newline, points to the .jar file on launcher.mojang.com
## ie. https://launcher.mojang.com/mc/game/1.12.2/client/.../client.jar
##
## Grab the URLs from https://mcversions.net/ and do some find/replace,
## or dump the source into a URL extractor
@therokh
therokh / new_site.sh
Last active March 11, 2018 09:46
Script to create a new config file for Nginx reverse proxy, and obtain a certificate via LetsEncrypt certbot
#!/bin/bash
## This script creates a new Nginx proxy configuration based on two inputs:
## 1. Server hostname for incoming requests
## 2. Proxy destination IP to redirect to
HOSTNAME=$1
PROXYDEST=$2
## Colours
RED='\e[0;31m'
@therokh
therokh / honeypot_dash.json
Created February 22, 2018 23:11
Honeypot dashboard for Grafana
{
"__inputs": [
{
"name": "DS_INFLUX-HONEYPOT",
"label": "Influx-Honeypot",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
@therokh
therokh / parse_pshitt.py
Created February 22, 2018 23:08
Script to parse Pshitt JSON output into InfluxDB
import requests
import geohash
import json
from datetime import datetime, timezone
from influxdb import InfluxDBClient
# noinspection PyUnresolvedReferences
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# noinspection PyUnresolvedReferences