Skip to content

Instantly share code, notes, and snippets.

View jordanwesthoff's full-sized avatar

Jordan Westhoff jordanwesthoff

View GitHub Profile
@jordanwesthoff
jordanwesthoff / batch_MKV_convert.sh
Created October 26, 2015 15:47
{AVCONV} Batch convert Matroska to MP4 video
for f in *.mkv;
do avconv -i "$f" -codec copy "${f%.mkv}.mp4";
done
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
@jordanwesthoff
jordanwesthoff / gist:db93d33f8ea3e96d12df
Last active August 29, 2015 14:22
Log of installing Zabbix Server on remote CentOS 6.5 server
### Bringing up ZABBIX Server Install ###
# 1. Add user for zabbix
sudo adduser jordan
sudo adduser jordan
### enter password
# 2. Install Zabbix, and all important dependencies
sudo yum -y install mysql-server php-xml mysql
@jordanwesthoff
jordanwesthoff / yum_install_test.sh
Created June 4, 2015 00:33
Yum installation test
pkg="wget"
if yum -qq install $pkg; then
echo "Successfully installed $pkg"
else
echo "Error installing $pkg"
fi
# Written like it was in shell, not sure what the right python calls are, just an FYI
mkdir -p /dev/shm/pdf_convert
cp /current_scantron_directory/pdf_image /dev/shm/pdf_convert
convert_function /dev/shm/pdf_convert/filename /dev/shm/pdf_convert/converted_filenames
cp /dev/shm/pdf_convert/* /current_scantron_directory
#So here, the script copies the image to a custom made (you can pick the name) directory in shared memory, better known as the temp #directory. Then it runs whatever convert function you have there and puts out the images based on whatever syntax you run the conversion #with. Then it copies all of the temp directories contents back into your scantron directory. All of the paths are made up, but they should #be easy to understand because they are just placeholders for your current working directories. Temp will always be in /dev/shm though
@jordanwesthoff
jordanwesthoff / harris_corner_detector.m
Created April 1, 2015 02:18
Implementation of the Harris Corner Detection Algorithm
function [ response, corners ] = harris_corner_detector( image, varargin )
% MATLAB FUNCTION DEFINITIONS
% function [ response, corners ] = harris_corner_detector( image, varargin )
% MATLAB CALLING SEQUENCE
% response = harris_corner_detector( image )
% response = harris_corner_detector( image, sigma )
% [ response, corners ] = harris_corner_detector( image )
% [ response, corners ] = harris_corner_detector( image, sigma)
@jordanwesthoff
jordanwesthoff / custom_saturation.m
Created March 18, 2015 18:25
MATLAB based saturation map function, REC.601 implementation
function custom_saturation(input_image, coefficient)
% USAGE
% Run the function with an input image as a string and with a coefficient
% for the level of saturation to apply to the image. Some common usages
% are:
%
% custom_saturation('panda.jpg', 0) -> This will entirely desaturate the
% image, panda.jpg
% custom_saturation('panda.jpg', 1) -> This will not modify the image sat.
@jordanwesthoff
jordanwesthoff / generate_10_bit_Scale.m
Last active August 29, 2015 14:17
MATLAB based Lift, Gamma, Gain LUT slope generator for 10-bit imaging
% Idiot proof snippet of code to generate a scale of 0-max 10 bit values in MATLAB.
col_1 = [0:1:1023];
Ten_bit_vals= [col_1 col_1];
display(Ten_bit_vals)
@jordanwesthoff
jordanwesthoff / OETF_cieplot_demo.m
Created March 17, 2015 20:29
MATLAB Script to generate CIEPlot of the REC.709 OETF Function
% Basic single use script to plot the correct CIE REC.709 OETF function
% Jordan Westhoff, RIT 2014
% Use exposure math to calculate the first portion of the OETF
G = 1.099;
B = 1 - G;
L = (G/10)^(20/11);
@jordanwesthoff
jordanwesthoff / wind_chill.py
Created March 11, 2015 13:22
NOAA RealFeel Temperature Python Script
```
Basic script to parse the current time and then use the official NOAA algorithm to return the current RealFeel temperature.
Jordan Westhoff, RIT 2015
```
import os
import sys
import time
T = input('Enter the current temperature (F): ')