Skip to content

Instantly share code, notes, and snippets.

View tommyready's full-sized avatar
🎯
Focusing

Tommy Ready tommyready

🎯
Focusing
  • Charleston, SC
View GitHub Profile
@tommyready
tommyready / Hosts.py
Created July 19, 2017 17:46
Use Python to Automate Host File Edits
import os
import datetime
import re
import socket
import struct
import uuid
def normalize_ipv4(ip):
try:
@tommyready
tommyready / CloudFlareApiClient.cs
Last active January 4, 2024 17:52
Update Cloud Flare DNS Record via Cloud Flare API v4 using C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace CloudFlareApiClient
{
class Program
{
@tommyready
tommyready / config\config.php
Last active December 28, 2023 11:58
Using PHP to read MINECRAFT PlayerData JSON files for Player Stats
<?php
DEFINE('_MINECRAFT_SERVER_DIRECTORY_','C:\Minecraft Server Files');
@tommyready
tommyready / test.cfm
Last active December 9, 2016 16:14
Coldfusion Test Range Script
<cfscript>
writeDump( getCurrentFboRates() );
LOCAL.aircraftTypeId = 1440;
LOCAL.startRange = 1;
LOCAL.endRange = 99;
@tommyready
tommyready / application.cfc
Last active April 13, 2017 17:15
Getting Application Scope Settings from INI File in CFSCRIPT
component {
this.name = 'MyApp' & hash(getCurrentTemplatePath());
this.applicationTimeout = createTimeSpan(1,0,0,0);
this.sessionTimeout = createTimeSpan(1,0,0,0);
this.sessionManagement = true;
this.setClientCookies = false;
public boolean function onApplicationStart() {
@tommyready
tommyready / tLogger.dll
Last active November 14, 2016 15:38
Using C# to Create a Log Writer .DLL
using System;
using System.IO;
namespace tLogger
{
public class Log
{
private static Int32 maxFileSize = 10240000; // 10 MB
@tommyready
tommyready / combinePaths.cfm
Last active October 26, 2016 15:02
Coldfusion CFSCRIPT Function to Combine Array of Paths (Strings) into a Path (String)
<cfscript>
public string function combinePaths(required array paths) {
var fullPath = "";
for(var p=1; p <= ArrayLen(paths); p++) {
fullPath &= paths[p];
if(Right(paths[p],1) == "\") continue; // Continue to Next iteration if \ is already there
if(len((trim(GetFileFromPath(paths[p]) == 0)))) break; // Exit Loop on File Found // File should be last element in array
fullPath &= "\";
}
return fullPath;
@tommyready
tommyready / RestartService.cs
Last active March 18, 2022 21:29
Using C# to Restart a Windows Service.
using System;
using System.ServiceProcess;
using System.Diagnostics;
namespace RestartService
{
class Program
{
static void Main(string[] args)
@tommyready
tommyready / NetworkAdaptersUtility.cs
Last active August 29, 2023 11:49
Using C# to Disable and Enable a Network Adapter
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace NetworkAdaptersUtility
{
class Program
{
static void Main(string[] args)
{