Skip to content

Instantly share code, notes, and snippets.

View jatkins's full-sized avatar

Jess Atkins jatkins

View GitHub Profile
@jatkins
jatkins / create.h
Created May 2, 2011 21:25
Fake Filesystem
#ifndef create
#define create
#define SIZE 255
#define TRUE 1
void newFile(char *filename, char *data){
int i = 0;
printf("Enter the file name: ");
@jatkins
jatkins / simulation.rb
Created May 2, 2011 22:02
system simulation
#!/usr/bin/ruby
#
# Author: Jacob Atkins
# Email: jta4j@mcs.uvawise.edu
# Class: CSC 4300 - Computer Architecture
#
apps = Dir["./apps/*.hack"].sort
@@memory = Array.new(100)
@jatkins
jatkins / base.php
Created May 5, 2011 02:46
Simple base converter
Decimal: <input type="text" name="decimal"/>
Converting to base:
<select name="base">
<option value="2">2 - Binary</option>
<option value="8">8 - Octal</option>
<option value="16">16 - Hexadecimal</option>
</select>
<input type="submit" />
</form>
</p>
require 'rubygems'
require 'net/ftp'
require 'peach'
PROTO = 'ftp'
URL = 'ladsweb.nascom.nasa.gov'
PATH = 'allData/5/'
DATASET = 'MOD03'
YEARS = 2000..2011
WORKPATH = "#{PATH}#{DATASET}"
@jatkins
jatkins / setup.sh
Created May 29, 2011 14:47
Script for setting up a new ADRIENNE server
#!/bin/bash
# Add non-free repos to apt so we can install java
sed -i -e 's/main/main non-free/' /etc/apt/sources.list
# Apt section
apt-get update
apt-get upgrade -y
apt-get install -y build-essential vim sun-java6-jre mysql-client curl libcurl3
@jatkins
jatkins / mac.rb
Last active September 27, 2015 18:37
Script for getting the MAC adreess of a large set of network computers.
#!/usr/bin/ruby
ipconfig = `ifconfig`
interface = /(eth\d)/.match(ipconfig)
mac = /([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})/.match(ipconfig)
host = `hostname`
f = File.open("Macaddresses.txt", 'a') # This file should be on a share that all machines can access.
f << "#{host.chomp("\n")}"
@jatkins
jatkins / iptables.rules.up
Created December 11, 2011 05:57
Firewall Rules
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
@jatkins
jatkins / cook.sh
Created December 11, 2011 06:14
A simple way to setup servers
#!/bin/bash
apt-get install -y sudo build-essential vim zlib1g-dev
/usr/sbin/groupadd wheel
/usr/sbin/usermod -a -G wheel jacob
chmod +w /etc/sudoers
echo "%wheel All=(ALL) ALL" >> /etc
chmod -w /etc/sudoers
@jatkins
jatkins / rfid_reader.ino
Created March 22, 2012 20:49
RFID Reader
#include <SoftwareSerial.h>
SoftwareSerial rfid(9,11);
SoftwareSerial wire(2,3);
int SerialResetPIN = 6;
int SerialSleepPIN = 7;
int RFIDResetPin = 10;
void setup() {
#include <LiquidCrystal.h>
#include <SD.h>
#include <Keypad.h>
#include <Servo.h>
const int chipSelect = 53; // SD pin
const char gpsTag[] = "$GPRMC"; // Start of GPS command
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);