Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Tommy Ready tommyready

View GitHub Profile
@tommyready
tommyready / iis-create-sites.ps1
Created Mar 19, 2019
Windows Powershell Script to Create IIS Sites for Current User
View iis-create-sites.ps1
# 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"
@tommyready
tommyready / ImapService.php
Last active Jun 18, 2018
Laravel IMAP Service
View ImapService.php
<?php
namespace App\Services;
class ImapService {
protected $imapHost;
protected $imapEmail;
protected $imapPassword;
protected $searchCriteria;
@tommyready
tommyready / dbcopier.py
Created Oct 16, 2017
Using Python to dump a Mysql database and import into another Mysql database
View dbcopier.py
#!/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 / pydump.py
Created Oct 16, 2017 — forked from sagar-webonise/pydump.py
Python script for taking mysqldump
View pydump.py
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def get_dump():
print "Enter user:"
user = raw_input()
@tommyready
tommyready / backeruper.py
Last active Oct 6, 2017
Using Python to Zip a Directory then Upload to AWS S3
View backeruper.py
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 / deployer5000.py
Last active Jan 10, 2018
Python Laravel Deployment Script
View deployer5000.py
import git
import string
import os
from os import path
from git import *
from subprocess import call
class gitConnect():
def deploy(self):
@tommyready
tommyready / PDOService.php
Last active Jul 2, 2018
Laravel 5 Service that Wraps PDO to call StoredProcedure with Multiple ResultSets and Return Arrays of Data
View PDOService.php
<?php
namespace App\Services;
class PDOService {
private $connection;
public function __construct($connection) {
$this->connection = $connection;
@tommyready
tommyready / imageColor.js
Created Aug 5, 2017
Use pure JavaScript to get the color of a pixel on click
View imageColor.js
<script type="text/javascript" language="javascript">
var img = document.getElementById("myImage");
img.addEventListener("click", function(event) {
var canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
var p = canvas.getContext('2d').getImageData(event.offsetX, event.offsetY, 1, 1).data;
var hex = "#" + ("000000" + rgbToHex(p[0], p[1], p[2])).slice(-6);
@tommyready
tommyready / Hosts.py
Created Jul 19, 2017
Use Python to Automate Host File Edits
View Hosts.py
import os
import datetime
import re
import socket
import struct
import uuid
def normalize_ipv4(ip):
try:
@tommyready
tommyready / CloudFlareApiClient.cs
Last active Feb 28, 2018
Update Cloud Flare DNS Record via Cloud Flare API v4 using C#
View CloudFlareApiClient.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace CloudFlareApiClient
{
class Program
{
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.