Skip to content

Instantly share code, notes, and snippets.

View jordanwesthoff's full-sized avatar

Jordan Westhoff jordanwesthoff

View GitHub Profile
@jordanwesthoff
jordanwesthoff / 0_reuse_code.js
Created June 4, 2014 15:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jordanwesthoff
jordanwesthoff / cp_progress.sh
Last active August 29, 2015 14:02
{linux} cp with progress bar operation
#!/bin/sh
cp_p()
{
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)
@jordanwesthoff
jordanwesthoff / disk_speed.sh
Created July 14, 2014 15:32
This is a basic gist for testing the disk speed of your system. It writes a pre-specified quantity of MB to the drive and measures the time. Following that, it then reads the same bytes to see how long it takes as well. I got this off of a random forum a long, long time ago and have modified it a bit as the time has passed; it's pretty handy.
#!/bin/bash
# Jordan Westhoff, RIT 2014
read -p "Batch size for test (enter in MB) {1024MB in a GB}" sze
echo "Testing Disk Speed"
echo "$sze MB sample size"
dd if=/dev/zero of=test bs=1048576 count=$sze
@jordanwesthoff
jordanwesthoff / CUDA_path_change.sh
Created October 8, 2014 19:24
Fixing UltraGrid libcudart.so.6: Cannot open shared directory problem.
#!/bin/bash
#
# This is a quick and simple way to bind to the correct version of CUDA to the operating libraries in Linux.
# Very common issue [last tested, Ubuntu 14.04 LTS] after installing CUDA and STITOLA UltraGrid - also hard to google.
echo 'MODIFYING PATH TO MAKE CUDA WORK'
sudo ldconfig /usr/local/cuda/lib64
@jordanwesthoff
jordanwesthoff / gist:010a4562ba10a0de0178
Created October 20, 2014 19:44
Network Stack Settings for UltraGrid on OSX
# Extending network buffers for UltraGrid on OSX
# Edit: /etc/sysctl.conf
# Extended network buffers for UltraGrid
kern.ipc.maxsockbuf=33554432
net.inet.udp.recvspace=5944320
sudo nvram boot-args="ncl=131072" # for OS X 10.6
@jordanwesthoff
jordanwesthoff / doxconver_init.sh
Last active August 29, 2015 14:07
Dpxconvert
#!/bin/bash
# Simplistic steps to install dpxconvert
# Make sure you are in the directory 'Sweenet Arriraw_1_0'
# example /Users/user/Downloads/Sweeney\ Arriraw_1_0
# Make sure to install the dpxconvert dependency, libTiff, before dpxconvert
cd src
cd tiff-3.8.0
make
@jordanwesthoff
jordanwesthoff / geekbenchfix.sh
Created October 21, 2014 19:28
Fix Geekbench on Ubuntu 14.04 LTS
# Run as root if you get the error
# error while loading shared libraries: libstdc++6: cannot open shared object file: No such file or directory
# Geekbench on Ubuntu 14.04 LTS
sudo apt-get install lib32stdc++6
apt-get update
apt-get install -y -q vim slurm-llnl
echo "10.10.10.3 controller" >> /etc/hosts
echo "10.10.10.4 server" >> /etc/hosts
wget https://raw.github.com/guillermo-carrasco/mussolblog/master/setting_up_a_testing_SLURM_cluster/slurm.conf
mv slurm.conf /etc/slurm-llnl/
SCRIPT
@jordanwesthoff
jordanwesthoff / Method 1?
Last active August 29, 2015 14:10
Intelligent sorter
YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
OTHER_CMD=$(which <other installer>
if [[ ! -z $YUM_CMD ]]; then
yum install $YUM_PACKAGE_NAME
elif [[ ! -z $APT_GET_CMD ]]; then
apt-get $DEB_PACKAGE_NAME
elif [[ ! -z $OTHER_CMD ]]; then
@jordanwesthoff
jordanwesthoff / Darktable Install CentOS6
Last active August 29, 2015 14:13
Darktable RAW Viewer dependencies
cd /etc/yum.repos.d/
wget http://pkgrepo.linuxtech.net/el6/release/linuxtech.repo
install darktable:
yum --enablerepo=linuxtech-testing install darktable