The Personal Website of Matthew Reeves

Welcome!

This is a random assortment of stuff from my University coursework and internship.

Code

C

Basic I/O in CDownload | View
File I/O in CDownload | View
Unix Cat Command Simulator in CDownload | View
Integer Sorter in CDownload | View
enigma.c - Simulates the Enigma MachineDownload | View
enigma.h - Header File for enigma.cDownload | View
sockets.c - Opens / Binds a socketDownload | View
sockets.h - Header File for sockets.cDownload | View
chat_server.c - Creates a simple chat session using sockets.cDownload | View
chat_server.h - Header File for chat_server.cDownload | View
Simple Shell in CDownload | View

Java

Basic Arithmetic in JavaDownload | View
Class to build a simple inventory of booksDownload | View
Program to test BookInventory.javaDownload | View
Class to 'build' books for BookInventory.java and UnsortedBookList.javaDownload | View
Converts octal numbers to decimal numbers in JavaDownload | View
Class for error handling of empty list exceptionsDownload | View
Converts characters to 'l3375P3@k' equivalentsDownload | View
Simulates Conway's Game of LifeDownload | View
Creates and updates a linked list in JavaDownload | View
Program to test LinkedList.javaDownload | View
Simple Mastermind game in JavaDownload | View
Examples of using Java's built-in Math classDownload | View
Generic Menu class in JavaDownload | View
Generates a numerology report based on birthdayDownload | View
Converts decimal numbers to octalDownload | View
Determines if a number is a Perfect numberDownload | View
Calculates postfix notation expressions in JavaDownload | View
Simple example of recursive functions in JavaDownload | View
Calculates a shipping cost in JavaDownload | View
Identifies "sexy primes" using JavaDownload | View
Program to demo the implementation of many basic Java functionsDownload | View
Program to test SimpleList.javaDownload | View
Implements an array based stack using JavaDownload | View
Program to test Stack.javaDownload | View
Very simple Sudoku checker in JavaDownload | View
Creates a search tree using JavaDownload | View
Program to test tree.javaDownload | View
Creates an unsorted list of booksDownload | View
Program to test UnsortedBookList.javaDownload | View
Program to identify Lucas numbers using JavaDownload | View

Perl

Basic Arithmetic in PerlDownload | View
Number Guessing Game in PerlDownload | View
Loop to read and add numbersDownload | View
Basic Output in PerlDownload | View
Basic Input in PerlDownload | View
Academy Awards Voting Simulator in PerlDownload | View
Binary to Decimel Converter in PerlDownload | View
Scrape Box Office Results from RottenTomatoesDownload | View
Run finger command with soundex to account for misspellingsDownload | View
Run the Unix 'last' command and summarize outputDownload | View
Lottery Numbers Generator in PerlDownload | View
Scanner / Interpreter for a simple fake language written in PerlDownload | View
Break apart a five digit number in PerlDownload | View
Identify a palindrome in PerlDownload | View
Identify a palindrome using a loop in PerlDownload | View
Send Email Using PerlDownload | View
Send Email Using a Perl CGI FileDownload | View
Analyze a Weblog Using PerlDownload | View
Build a fake shadow file Using PerlDownload | View
Simple dictionary attack against unsalted MD5 hashesDownload | View
Simple dictionary attack against salted MD5 hashesDownload | View

Python

Basic I/O in PythonDownload | View
Bubble Sort Using PythonDownload | View
Process Scheduler in PythonDownload | View
Test Scheduling Algorithm Performance using PythonDownload | View

Other

Example MakefileDownload | View
Example .vimrcDownload | View
Family Tree Program in the Lisp programming languageDownload | View
Coke Case Mastermind Simulator in the Prolog programming languageDownload | View

Documentation

Create a list of all mailboxes on a server, sorted by size on disk

Get-MailboxStatistics -Server '<server name>' | where {$_.ObjectClass -eq “Mailbox”} | Sort-Object TotalItemSize -Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}} -auto >> “c:\<output file name>.txt”

Enable RDP access via psexec

  1. Download the PsTools Suite from here.
  2. Open a command prompt Window, and open the PsTools directory.
  3. Run the following three commands
    • psexec \\<hostname> reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0
    • psexec \\<hostname> netsh firewall set service remoteadmin enable
    • psexec \\<hostname> netsh firewall set service remotedesktop enable
    where <hostname> is the name of the machine you are trying to enable RDP access to.

NOTE - These steps must be done a machine that is on the same domain and network as the target machine, using an account that will have admin rights on the target machine.

Miscellaneous SQL Queries

View the size on disk for all databases: SELECT table_schema AS "DATABASE NAME", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;

Check if logging of slow queries is enabled: mysqladmin var | grep log_slow_queries

Enable logging of slow queries:

  1. Open the MySQL config file: sudo vim /etc/mysql/my.cnf
  2. In the mysqld section add:
    1. long_query_time = <time variable>
    2. log-slow-queries = /var/log/mysql/mysql-slow.log
  3. Open the log file: sudo vim /var/log/mysql/mysql-slow.log

Optimize all tables in all databases: mysqlcheck -u USERNAME -p -o --all-databases