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 / NetworkAdaptersUtility.cs
Last active April 18, 2024 15:01
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)
{
@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 / csv-to-mysql.py
Created April 6, 2022 07:34 — forked from rasyadhs/csv-to-mysql.py
Python CSV to MySQL
#!/usr/bin/env python
# Run with no args for usage instructions
#
# Notes:
# - will probably insert duplicate records if you load the same file twice
# - assumes that the number of fields in the header row is the same
# as the number of columns in the rest of the file and in the database
# - assumes the column order is the same in the file and in the database
#
@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 / dbcopier.py
Created October 16, 2017 17:49
Using Python to dump a Mysql database and import into another Mysql database
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def combine_files(self,file1,file2):
with open('file1', 'w') as outfile:
with open(file2) as infile:
@tommyready
tommyready / WebsiteAndStoreCreator.php
Created April 24, 2021 03:44 — forked from 0-Sony/WebsiteAndStoreCreator.php
Magento 2 : Create Programmatically Website/Store/StoreGroup
<?php
/**
* This file is part of Namespace for Magento.
*
* @license All rights reserved
* @author Phuong LE <phuong.le@agence-soon.fr> <@>
* @category Namespace
* @package Namespace_Core
* @copyright Copyright (c) 2016 Agence Soon (http://www.agence-soon.fr)
*/
@tommyready
tommyready / PDOService.php
Last active June 7, 2020 21:57
Laravel 5 Service that Wraps PDO to call StoredProcedure with Multiple ResultSets and Return Arrays of Data
<?php
namespace App\Services;
class PDOService {
private $connection;
public function __construct($connection) {
$this->connection = $connection;
@tommyready
tommyready / backerupper.py
Last active November 21, 2019 00:38
Using Python to Zip a Directory then Upload to AWS S3
import os, sys
import math
import boto
import string
import shutil
from os import path
from os import stat
from array import *
from time import gmtime, strftime
from boto.s3.key import Key
@tommyready
tommyready / iis-create-sites.ps1
Created March 19, 2019 03:42
Windows Powershell Script to Create IIS Sites for Current User
# IIS Site Creation Tool
# Verion: 0.0.1
# Author: Tommy Ready <tommy.r.ready@gmail.com>
# Description: Powershell Tool for auto creation of IIS sites per the user logged in.
# Run Command: C:\> .\iis-site-creator.ps1
$current_user = $env:UserName
$user_iis_folder = "C:\sites\$current_user"
$shared_directory = "C:\sites\shared"
$shared_media_direectory = $shared_directory + "\Data"