Welcome!
This is a random assortment of stuff from my University coursework and internship.
Code
C
Basic I/O in C | Download | View |
File I/O in C | Download | View |
Unix Cat Command Simulator in C | Download | View |
Integer Sorter in C | Download | View |
enigma.c - Simulates the Enigma Machine | Download | View |
enigma.h - Header File for enigma.c | Download | View |
sockets.c - Opens / Binds a socket | Download | View |
sockets.h - Header File for sockets.c | Download | View |
chat_server.c - Creates a simple chat session using sockets.c | Download | View |
chat_server.h - Header File for chat_server.c | Download | View |
Simple Shell in C | Download | View |
Java
Basic Arithmetic in Java | Download | View |
Class to build a simple inventory of books | Download | View |
Program to test BookInventory.java | Download | View |
Class to 'build' books for BookInventory.java and UnsortedBookList.java | Download | View |
Converts octal numbers to decimal numbers in Java | Download | View |
Class for error handling of empty list exceptions | Download | View |
Converts characters to 'l3375P3@k' equivalents | Download | View |
Simulates Conway's Game of Life | Download | View |
Creates and updates a linked list in Java | Download | View |
Program to test LinkedList.java | Download | View |
Simple Mastermind game in Java | Download | View |
Examples of using Java's built-in Math class | Download | View |
Generic Menu class in Java | Download | View |
Generates a numerology report based on birthday | Download | View |
Converts decimal numbers to octal | Download | View |
Determines if a number is a Perfect number | Download | View |
Calculates postfix notation expressions in Java | Download | View |
Simple example of recursive functions in Java | Download | View |
Calculates a shipping cost in Java | Download | View |
Identifies "sexy primes" using Java | Download | View |
Program to demo the implementation of many basic Java functions | Download | View |
Program to test SimpleList.java | Download | View |
Implements an array based stack using Java | Download | View |
Program to test Stack.java | Download | View |
Very simple Sudoku checker in Java | Download | View |
Creates a search tree using Java | Download | View |
Program to test tree.java | Download | View |
Creates an unsorted list of books | Download | View |
Program to test UnsortedBookList.java | Download | View |
Program to identify Lucas numbers using Java | Download | View |
Perl
Basic Arithmetic in Perl | Download | View |
Number Guessing Game in Perl | Download | View |
Loop to read and add numbers | Download | View |
Basic Output in Perl | Download | View |
Basic Input in Perl | Download | View |
Academy Awards Voting Simulator in Perl | Download | View |
Binary to Decimel Converter in Perl | Download | View |
Scrape Box Office Results from RottenTomatoes | Download | View |
Run finger command with soundex to account for misspellings | Download | View |
Run the Unix 'last' command and summarize output | Download | View |
Lottery Numbers Generator in Perl | Download | View |
Scanner / Interpreter for a simple fake language written in Perl | Download | View |
Break apart a five digit number in Perl | Download | View |
Identify a palindrome in Perl | Download | View |
Identify a palindrome using a loop in Perl | Download | View |
Send Email Using Perl | Download | View |
Send Email Using a Perl CGI File | Download | View |
Analyze a Weblog Using Perl | Download | View |
Build a fake shadow file Using Perl | Download | View |
Simple dictionary attack against unsalted MD5 hashes | Download | View |
Simple dictionary attack against salted MD5 hashes | Download | View |
Python
Basic I/O in Python | Download | View |
Bubble Sort Using Python | Download | View |
Process Scheduler in Python | Download | View |
Test Scheduling Algorithm Performance using Python | Download | View |
Other
Example Makefile | Download | View |
Example .vimrc | Download | View |
Family Tree Program in the Lisp programming language | Download | View |
Coke Case Mastermind Simulator in the Prolog programming language | Download | 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
- Download the PsTools Suite from here.
- Open a command prompt Window, and open the PsTools directory.
- 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
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:
- Open the MySQL config file: sudo vim /etc/mysql/my.cnf
- In the mysqld section add:
- long_query_time = <time variable>
- log-slow-queries = /var/log/mysql/mysql-slow.log
- 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