Skip to content

Instantly share code, notes, and snippets.

@illuzian
illuzian / name.lua
Created October 22, 2023 00:11
Add Town and Industry Prefixes in Transport Fever 2
-- run in console with debug enabled or make it a mod or whatevs
exists = {}
towns = game.interface.getEntities( {radius = 999999}, {type = "TOWN", includeData=true} )
buildings = game.interface.getEntities( {radius = 999999}, {type = "SIM_BUILDING", includeData=true} )
buildings_prefixes = {}
for town_id,town in pairs(towns) do
print(town.name)
print(town_id)
town_full_name = town.name
@illuzian
illuzian / logging.py
Created October 5, 2023 22:18
Using Loguru With Django (or anything else really)
import logging
from loguru import logger as loguru_logger
import sys
# You can register this handler with Python's standard logging library.
@illuzian
illuzian / rev.sh
Last active July 26, 2022 00:28
Revshell
‎‎​
@illuzian
illuzian / quick_reference.kql
Created September 29, 2021 02:53
Kusto (KQL) Quick Reference
// The _IsBillable property specifies whether ingested data is billable.
union *
| where _IsBillable = true
// The _BilledSize property specifies the size in bytes of data that will be billed to your Azure account if _IsBillable is true.
union *
| where _IsBillable = true
| summarize bytes=sum(_BilledSize) by Computer
// The TimeGenerated (Log Analytics workspace) and timestamp (Application Insights application) properties contain the date and time that the record was created by the data source. See Log data ingestion time in Azure Monitor for more details.
@illuzian
illuzian / Microsoft.PowerShell_profile.ps1
Created September 16, 2021 04:25
PowerShell profile with Linux aliases and Proxy Conf Functions
$ExecutionPolicy = Get-ExecutionPolicy
$DesiredPolicies = @('Bypass', 'Unrestricted')
# Becase I always accidently type ip addr on Windows.
function ip {
if ($args[0] -eq 'addr') {
ipconfig /all
} if ($args[0] -eq 'route') {
@illuzian
illuzian / lookup_org_ip.py
Created July 21, 2021 05:03
Moderately Efficient ASN/Org Lookup by IP
import csv
import ipaddress
database = {}
with open('GeoLite2-ASN-Blocks-IPv4.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
ip_net = ipaddress.IPv4Interface(row['network'])
database[ip_net] = {}
database[ip_net]['autonomous_system_organization'] = row['autonomous_system_organization']
@illuzian
illuzian / id_ecdsa.pub
Created June 25, 2021 08:29
id_ecdsa.pub
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAH/u1jJ6vbNFRYtwcfeCD4aDvY2tvBipSUyV4ZM/rFdVCxXV7Rb5HGwlv8lhzLQ0M9BAGlrCz5otDcnpZoLSw3X1AAqBPyBfJcqBf1ufWTmpKyr1ftXX8fHibkgYiSwuRZVCfejzozyW4En2wfmJQL94pmclQf/I/G77wrYN5wcTDjdqw== main-ecdsa
@illuzian
illuzian / manage_kav_network.zsh
Last active March 13, 2023 18:41
Disable Kaspersky Network Filter for on MacOS for VMware Networking
KAV_NETWORK_SERVICES=('HomeNetworkMonitoring' 'httpscan' 'ids' 'SafeBanking')
ACTION='NONE'
ACTION_OUTCOME='OK'
case $@ in
start) ACTION='START';;
stop) ACTION='STOP';;
status) ACTION='STATUS';;
@illuzian
illuzian / ip_list_with_excludes.py
Last active April 4, 2021 23:09
Generates a list of IPs with optional address excludes and file output (for autorecon etc)
import ipaddress
import argparse
arg_parser = argparse.ArgumentParser(add_help=True)
arg_parser.add_argument('--subnet','-s', help='The subnet to generate a list for.', required=True, dest='subnet')
arg_parser.add_argument('--exclude', '-e', help='Any IPs that should be excluded from the list. ', nargs='+', dest='exclusions')
arg_parser.add_argument('--out-file', '-o', help='A file to output to', dest='out_file')
args = arg_parser.parse_args()
arg_vars = vars(args)
@illuzian
illuzian / check_website_online.sh
Created November 9, 2020 00:35
One liner to check online status of websites
# Check status of a list of websites in the file check_hosts.txt. Increase --max-time if sites are slow to respond
cat check_hosts.txt | while read host; do echo $host $(curl --ssl -Is "$host" -K HEAD --max-time 3 | head -1); done