Skip to content

Instantly share code, notes, and snippets.

@sh4t
sh4t / cloudflare-update-record.sh
Created June 18, 2018 02:05 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@sh4t
sh4t / camel.py
Created March 1, 2016 07:20
for twitch.tv/goatador
#!/usr/bin/env python
#encoding: utf-8
# a modest attempt to not do the work, but to give you some insight.
somestring = "PrintShitOutandBeAllNiceAndSlow"
def fuq_camelcase(somestring):
final = ''
for item in somestring:
@sh4t
sh4t / ssh_bruteforce.list
Created December 31, 2015 00:55
The top brute forcing networks of the last 30 days!
AS36351 SoftLayer Technologies Inc.
AS9318 Hanaro Telecom Inc.
AS23650 AS Number for CHINANET jiangsu province backbone
AS4837 CNCGROUP China169 Backbone
AS23650 AS Number for CHINANET jiangsu province backbone
AS1267 Wind Telecomunicazioni SpA
AS16276 OVH SAS
AS9929 China Netcom Corp.
AS23650 AS Number for CHINANET jiangsu province backbone
AS12876 ONLINE S.A.S.
@sh4t
sh4t / es_zabbix.py
Last active December 1, 2015 06:09
elasticsearch-py zabbix play
#!/usr/bin/env python
import sys, os, pwd
import kaptan
import urllib3
from elasticsearch import *
urllib3.disable_warnings()
you = pwd.getpwuid(os.getuid()).pw_name
@sh4t
sh4t / regex.md
Created November 15, 2015 10:15
Useful Regular Expressions that I need to reference all the time

Regular Expressions

I end up needing to reference a bunch of useful expressions in my day to day work. In an effort to stop thinking about writing them, as I loathe writing regular expressions; I have started to maintain this list.

USA, Social Security Number(s) matching

No valid SSN begins with 666. Ignore them. ^((?!000)(?!666)([0-6]\d{2}|7[0-2][0-9]|73[0-3]|7[5-6][0-9]|77[0-1]))(\s|\-)((?!00)\d{2})(\s|\-)((?!0000)\d{4})$

@sh4t
sh4t / send_emails.sh
Last active May 12, 2017 18:53
Have a file of your users' name and email address laying around that you need to shoot an email to? I did and didn't want to leverage my server's SENDMAIL, etc so I just use mailgun..
#!/bin/bash
#
# Changed a few things up from my original version I am using
# but thought others might want to have an easy way to send
# emails to users using mailgun via bash..
#
# be sure to replace the FROM field, subject, content, etc
# just read the script and follow-along and modify accordingly.
#
# the contents of the file I am reading are email username:
@sh4t
sh4t / unassigned.sh
Created September 25, 2015 01:28
move replica, unassigned shards that match specific shard number to another node
#!/bin/bash
# danger! danger!
#
IFS=$'\n'
for line in $(curl -s 'localhost:9200/_cat/shards' | fgrep '0 r UNASSIGNED'); do
#for line in $(curl -s 'localhost:9200/_cat/shards' | fgrep 'UNASSIGNED'); do
INDEX=$(echo $line | (awk '{print $1}'))
SHARD=$(echo $line | (awk '{print $2}'))
SHARD_TYPE=$(echo $line | (awk '{print $3'}))
@sh4t
sh4t / steam.py
Created August 27, 2015 01:45
Parse GMAIL via IMAP, within steam (label/folder) for emails containing IPv4 address and write to a file. My attempt to deal with brute forcing.
#!/usr/bin/env python
#
#
import sys
import imaplib
import getpass
import email
import email.header
import datetime
@sh4t
sh4t / fetch_tor_exit_ips.sh
Created August 13, 2015 22:28
get the current exitnode exitaddress ips from T0R project
#!/bin/bash
curl -s https://check.torproject.org/exit-addresses | grep ExitAddress |awk '{print $2}'
@sh4t
sh4t / flush_chrome_dns.sh
Last active April 4, 2023 09:42
clearing chrome dns cache and sockets via js
#!/bin/bash
#
# The MIT License (MIT)
# Copyright (c) 2015 Justin Shattuck <shat@f5.com>, F5 Networks, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell