Skip to content

Instantly share code, notes, and snippets.

View IntegersOfK's full-sized avatar

Adam James West IntegersOfK

View GitHub Profile
@IntegersOfK
IntegersOfK / update_and_run_satisfactory_dedicated_server.bat
Created October 28, 2021 15:09
Satisfactory Dedicated Server on Windows keep alive batch script
REM This script will check for SatisfactoryDedicatedServer game updates (and install them)
REM Then it'll turn on the server.
REM If the server closes for any reason (like a crash/game update) it'll restart.
REM Note, depending on where dedicated server is installed, you may need to run as Admin.
REM TODO: Add a parameter for where the steamcmd folder lives.
REM TODO: The game does a good job at auto-saving, but maybe we can add a backup with each loop in-case?
REM Bypass "Terminate Batch Job" prompt so it'll continue looping without user prompt
if "%~1"=="-FIXED_CTRL_C" (
REM Remove the -FIXED_CTRL_C parameter
@IntegersOfK
IntegersOfK / combos.py
Created July 21, 2016 14:03
A python sample snippet for reordering bip39 mnemonic seed words into a valid bip39 seed (corrects word order to fix checksum/compliance with bip39)
#This snippet takes words intended for a bip39 mnemonic seed as a list and reorders them into a seed where the checksum validates.
#Often people want to choose their own seed words but the resulting order doesn't adhere to the bip39 specification,
#This is a way to force your favourite words into a valid hd bip39 seed. Disclaimer: Use true random entropy to select your words!
#All possible combinations are written to a text file, but that's probably going to be a lot of choice so you should probably
#Limit the number of itterations or cancel it a ways into processing
import itertools
import os
import binascii
import mnemonic
@IntegersOfK
IntegersOfK / list_filenames.py
Created July 8, 2016 14:32
Simple python script to make a list of all the filenames in a particular folder tree.
import os
with open('output.txt', 'w') as a:
for path, subdirs, files in os.walk('/folder/with/files'):
for filename in files:
filestr = str(filename)
if filestr.endswith('.htm') or filestr.endswith('.html'):
print(filename)
a.write(str(filename) + ',') #separate by comma
else:
@IntegersOfK
IntegersOfK / azimuth_to_bearing.py
Last active May 9, 2023 09:51
A python function which takes compass azimuth in degrees and returns the bearing N/E/S/W.
def convert_az_to_bearing(a):
"""Takes the azimuth, which should be 0-360 degrees, and returns a string N/E/S/W.
North is 0 degrees."""
if a > 360 or a < 0 or not a:
return ""
elif a >= 348.75 or a < 11.25:
return "N"
elif a >= 11.25 and a < 33.75:
return "NNE"
@IntegersOfK
IntegersOfK / jQuery-footer-year.js
Created June 21, 2016 02:29
A jQuery snippet for updating a copyright footer date with the current year. That way at the end of the year you won't have to update all your sites.