Skip to content

Instantly share code, notes, and snippets.

View tjeason's full-sized avatar

TJ Eason tjeason

View GitHub Profile
@tjeason
tjeason / fifo_hashmap.java
Last active September 19, 2018 14:15
FIFO hashmap structure in Java.
import java.util.*;
import java.lang.*;
import java.io.*;
public class FiFoHash {
private static List<Integer> accessLevelIdList = new ArrayList<>();
private static String employeeNumber = null;
private static HashMap<Integer, String> PruneHashMap(HashMap<Integer, String> hm) {
@tjeason
tjeason / server_monitor.py
Created February 3, 2015 21:27
Basic server monitoring in Python.
#!/usr/bin/env python
###########################################################################################
# File: server_monitor.py
# Name: Server Monitor
# Description: Performs healthcheck on a server, and notifies by e-mail if issue ocurrs.
# Version: 0.1
###########################################################################################
# Load modules for HTTP(S) and TCP connections, and I/O arguments.
from os import system
@tjeason
tjeason / web_crawler.py
Last active June 16, 2016 23:46
Python web crawler
import httplib
import re
import argparse
def searchURL(url="https://news.ycombinator.com/", depth=2, search="python"):
processed = []
# only do http links
if (url.startswith("https://") and (not url in processed)):
processed.append(url)
@tjeason
tjeason / cpu_usage.go
Created February 12, 2015 21:59
Getting Linux CPU usage in GO
package main
import (
"fmt"
"io/ioutil"
"strconv"
"strings"
"time"
)
@tjeason
tjeason / usbManager.ps1
Last active April 25, 2024 18:00
Enable, disable, and return status of USB Drive access on Windows 10
<#
.SYNOPSIS
Enable or Disable access to Removable Storage
.DESCRIPTION
Powershell script to enable or disable access to Removable Storage.
Requires `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned` before running.
.PARAMETER Status