Skip to content

Instantly share code, notes, and snippets.

@dadatuputi
dadatuputi / tm_diff.py
Last active Oct 21, 2020
Talent Marketplace diff output
View tm_diff.py
#!/usr/bin/env python3
import xlrd, argparse, openpyxl
import pandas as pd
SUFFIX_OLD = '_old'
SUFFIX_NEW = '_new'
def diff(f1, f2, o):
df1 = pd.read_excel(f1, sheet_name=0, header=0, index_col=0)
@dadatuputi
dadatuputi / podman-svc-gen.sh
Created Aug 18, 2020
Generate podman service files from existing containers
View podman-svc-gen.sh
#!/bin/bash
podman container list -a --format "{{.Names}}" | while read i; do podman generate systemd -fn --new $i; done
@dadatuputi
dadatuputi / countryblock.py
Created Jun 17, 2020
Python countryblock with threshold
View countryblock.py
import requests, argparse, pathlib
from itertools import accumulate
from operator import itemgetter
def build_subnet_list(country, threshold):
"""
Return a list of the largest subnets from the designated
country that provide coverage at least up to the threshold amount
"""
View ancestornames.py
from gedcom.element.individual import IndividualElement
from gedcom.parser import Parser
file_path = 'temp.ged'
gedcom_parser = Parser()
gedcom_parser.parse_file(file_path)
root_child_elements = gedcom_parser.get_root_child_elements()
first_names = {}
@dadatuputi
dadatuputi / ddns.sh
Created May 27, 2020
Cloudflare DDNS update script
View ddns.sh
#!/usr/bin/env bash
########################################################################################################
# This script is designed to be run within a gcr.io/google.com/cloudsdktool/cloud-sdk container but
# can be run anywhere BASH, curl and jq are available.
# The GCLOUD* and CLOUDFLARE* variables are environment variables and should be set in
# docker-compose.yml but can be set here as well.
#
# DOMAIN=<>
#
@dadatuputi
dadatuputi / rot64.py
Created May 25, 2020
Encryption: Encrypt an any data with a base64-based Caesar Cipher
View rot64.py
import argparse
import sys
import base64
# Author: Bradford Law
# Author Website: https://bradford.la
# Description: A Caesar Cipher implementation for Python 3.x that accepts any binary data,
# get args with argparse library:
# https://docs.python.org/3/library/argparse.html
@dadatuputi
dadatuputi / rot13.py
Last active May 25, 2020
Encryption: Encrypt an ASCII [a-zA-Z0-9] string with a Caeser Cipher (ROT-N) encryption
View rot13.py
import argparse
import sys
# Author: Bradford Law
# Author Website: https://bradford.la
# Description: A simple rot13 implementation for Python 3.x
# get args with argparse library:
# https://docs.python.org/3/library/argparse.html
parser = argparse.ArgumentParser(description='A simple rot13 implementation in Python.', prog='rot13')
@dadatuputi
dadatuputi / derbycon2016crypto.py
Created May 25, 2020
CTF: Derbycon 2016 Hilary E-Mail Buster
View derbycon2016crypto.py
## ## ##
### ### # # # ##### # # #####
# # # # # # # # # #
# # ## # # ### ## # ## ## # #### ## ### ## # # # ## ## ## ### ## ## #
##### # # # # # ## # # ### # # # # # # # #### # # # # # # ##
# # # # # ### # # # # # # # ### # # # # # # # # #### #
# # # # # # # # # # # # # # # # # # # # # # # # # #
### ### ### ### ### #### ### # ##### ### ## ## #### ### ### ##### #### ## ## ### ###
# #
@dadatuputi
dadatuputi / chanhop.sh
Created May 25, 2020
Wi-Fi Channel Hoping BASH Script
View chanhop.sh
#!/bin/bash
# From http://www.willhackforsushi.com/books/377_eth_2e_06.pdf and referenced by https://wiki.wireshark.org/CaptureSetup/WLAN#Channel_Hopping (dead/spam link)
# Hop channels every second
IFACE=ath0
IEEE80211bg="1 2 3 4 5 6 7 8 9 10 11"
IEEE80211bg_intl="$IEEE80211b 12 13 14"
IEEE80211a="36 40 44 48 52 56 60 64 149 153 157 161"
IEEE80211bga="$IEEE80211bg $IEEE80211a"
@dadatuputi
dadatuputi / HalloweenSlugOLantern.ino
Created May 25, 2020
Halloween Arduino Slug: Arduino code for a motion-activated screaming pumpkin slug
View HalloweenSlugOLantern.ino
#include <RBD_Timer.h>
#include <RBD_Light.h>
#include "SD.h"
#include "TMRpcm.h"
#include "SPI.h"
#define SD_ChipSelectPin 4
TMRpcm tmrpcm;
You can’t perform that action at this time.