Skip to content

Instantly share code, notes, and snippets.

View braddevans's full-sized avatar
🐳
your average docker enjoyer

braddevans braddevans

🐳
your average docker enjoyer
View GitHub Profile
@braddevans
braddevans / index.js
Created March 28, 2023 01:42
get game hours by most played steam requires <apikey> and <steamid> changing
const request = require('request');
const Handlebars = require('handlebars');
// Replace with your Steam Web API key
const API_KEY = '<apikey>';
// Replace with the Steam profile URL of the user
const PROFILE_URL = 'https://steamcommunity.com/profiles/<steamid>';
// Retrieve the SteamID from the profile URL
@braddevans
braddevans / tlds.txt
Created November 5, 2022 22:50
Top Level Domains list originally pulled from https://tld-list.com/tlds-from-a-z
.5g.in
.6g.in
.2000.hu
.aaa
.aaa.pro
.aarp
.abarth
.abb
.abbott
.abbvie
@braddevans
braddevans / gen-ssh-keypair.sh
Created November 2, 2022 10:20
Generate SSH keypairs into a keys folder
#!/bin/bash
mkdir -p keys/{rsa,dsa,ecdsa,ed25519}
ssh-keygen -b 1024 -t dsa -f keys/dsa/id_dsa;
ssh-keygen -b 4096 -t rsa -f keys/rsa/id_rsa;
ssh-keygen -b 521 -t ecdsa -f keys/ecdsa/id_ecdsa;
ssh-keygen -b 4096 -t ed25519 -f keys/ed25519/id_ed25519;
@braddevans
braddevans / binary_to_dec.py
Last active October 19, 2022 08:41
binary to decimal in python
binaryStr = "101100101001" # binary: 2857
decnumber = 0
for index in range(0, len(binaryStr)):
# reverse string then process binary using calculation
# (binary_value * 2 ^ string_index)
decnumber += (int(binaryStr[::-1][index]) * (2 ** index))
print(f"dec: {decnumber}") # 2857
@braddevans
braddevans / BP_DICTStore.json
Created October 2, 2022 22:11
json_sot-item_names-dump
{
"BP_TradeRoute_bsp_outpost_1_to_wld_outpost_2_BACKWARD":{
"Name":"BP_TradeRoute_bsp_outpost_1_to_wld_outpost_2_BACKWARD"
},
"BP_TradeRoute_bsp_outpost_1_to_wld_outpost_2_FORWARD":{
"Name":"BP_TradeRoute_bsp_outpost_1_to_wld_outpost_2_FORWARD"
},
"BP_TradeRoute_bsp_outpost_1_to_wld_seapost_01_a_BACKWARD":{
"Name":"BP_TradeRoute_bsp_outpost_1_to_wld_seapost_01_a_BACKWARD"
},
@braddevans
braddevans / gpa-indir.ps1
Created February 3, 2021 12:56
Git pull All in Current Directory
Get-ChildItem */* |
where {$_.name -eq "README.md"} |
foreach {
cd $_.DirectoryName;
$folderName = pwd | Select-Object | %{$_.ProviderPath.Split("\")[-1]}
$BranchName = git rev-parse --abbrev-ref HEAD
$CurrentBranchRevision = git log -1 --pretty=format:%h
$NewestBranchRevision = git log -n 1 origin/$BranchName --pretty=format:%h
Write-Host "`n-===============================================-"
Write-Host "- -"
# Title: no more than 50 chars. #################
# [Task Ref]: INT-CS1
# Body: Wrap at 72 chars. ## Explain *what* and *why* # which is here: #
# Fixes:
# - Fix Invalid XML on line XXX in file:()
@braddevans
braddevans / hb_all_books_dl.js
Last active October 21, 2020 00:54 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
type “about:plugins” in the address bar and disable chrome's pdf viewer
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ|Download)$/i;
#!/bin/bash
# shellcheck disable=SC2140
# shellcheck disable=SC2034
# ## Variables ## #
input_file=$1
input_file_name=$(echo "$input_file" | cut -d'.' -f1)
input_file_name_test=$(echo "$input_file" | cut -d'-' -f2)
input_file_name_test_version=$(echo "$input_file" | cut -d'-' -f3 | rev | cut -c5- | rev)
@braddevans
braddevans / cf-ddns.sh
Last active April 23, 2020 16:34
update to the cloudflare dns updater
#!/bin/bash
while getopts z:e:a:t:n:p: option
do
case "${option}"
in
z) ZONEID=${OPTARG};;
a) APITOKEN=${OPTARG};;
t) ZONETYPE=${OPTARG};;
n) RECORD_NAME=${OPTARG};;