Skip to content

Instantly share code, notes, and snippets.

View Wildcarde's full-sized avatar

Garrett Mc. Wildcarde

View GitHub Profile
@Wildcarde
Wildcarde / drawfigure.m
Last active August 29, 2015 14:19
Demo Scripts for Vxfb on Rondo
%this script will simply create a simple 3D graph with a spike in the middle of the display.
dir = '~/'; %change this to wherever you want the figure drawn to.
h=figure('visible','off')
t = -10:0.01:10;
f = -100:2:100;
sg = 0.5;
[T,F] = meshgrid(t,f);
Z = exp(-(T.^2 + F.^2)/(2*sg^2)) ;
mesh(T,F,Z);axis tight;
set(gcf, 'paperpositionmode', 'auto');
@Wildcarde
Wildcarde / roboclone.bat
Created April 22, 2015 20:10
A basic robocopy command that can be scheduled via Windows Event Scheduler
REM SERVICEUNC is the name of the server you wish to connect to
REM Replace password with the service account password
REM Replace domain with site domain name
net use Z: \\<SERVERUNC>\<LAB\TARGET> <PASSWORD> /USER:<DOMAIN>\<ServiceAccount>
REM this is the robocopy location for windows XP installed via 'windows resource kits', the location will
REM be different for Vista/7/8 as robocopy is included as part of the OS packages.
"C:\Program Files\Windows Resource Kits\Tools\robocopy.exe" E:/ Z:/Raw/ /LOG+:Z:/Logs/transfer.log /E /Z /B /TS /NP
REM Remove the previously mounted link so it doesn't leave trailing links or open connections
@Wildcarde
Wildcarde / Dockerfile
Last active December 16, 2020 12:00
Jedi Knight: Jedi Academy Dockerized Server
## Docker file to build a jedi academy server and mount the apk files from a source folder
FROM centos
MAINTAINER Garrett McGrath <gmcgrath815 at gmail.com>
RUN yum install -y wget unzip
RUN wget https://www.dropbox.com/s/mbdmpim04krl1o2/jalinuxded_1.011.zip?dl=0 -O /tmp/temp.zip; unzip /tmp/temp.zip -d /opt/jaserv; \
wget https://www.dropbox.com/s/ig82qlsohlbwzye/dedicated_ja_server_unofficialpatch.zip?dl=0 -O /tmp/patch.zip; unzip /tmp/patch.zip -d /tmp/patch; \
cp /tmp/patch/DEDICATED_JA_server_UnofficialPATCH/linuxjampded /opt/jaserv/linuxjampded; \
rm /tmp/temp.zip /tmp/patch.zip; rm -fr /tmp/patch; \
@Wildcarde
Wildcarde / mapdrivedomainautomount.bat
Last active September 8, 2015 15:10
This is a simple batch script I put together for automatically mounting a users shared drive when they log into one of our domain auth'd lab machines. We didn't have direct control over the OU behavior of these machines so we couldn't add a group policy rule, this is an effective workaround for that problem.
@echo off
net use * /delete /yes
cls
set i=0
set group="Domain Users"
for /f %%f in ('"gpresult /user %USERNAME% /R | findstr /i %group%"') do set /a i=%i%+1
if %i% gtr 0 (goto :member)
:nomember
goto :end
@Wildcarde
Wildcarde / Dockerfile
Last active November 30, 2019 17:34
Unreal Tournament Docker Container Files - Currently this makes a free standing server, a future update will be enable handling launching hubs
FROM centos:6
MAINTAINER Garrett McGrath <gmcgrath815+docker at gmail.com>
RUN yum install -y wget unzip; /usr/bin/wget "<unreal linux source link here>" -O temp.zip; /usr/bin/unzip temp.zip; rm temp.zip
RUN yum install -y Xvfb xorg-X11-server-Xvfb which
RUN chmod +x /LinuxServer/Engine/Binaries/Linux/*
#this is where you SHOULD be able to mount the confs file and have it 'just work' that's not the case however.
@Wildcarde
Wildcarde / CreateEnv.sh
Last active February 13, 2017 16:24
Python PyStone Slurm Demo
#!/bin/bash
#This file will create the environment we will be using on spock. A similar environment can be constructed on rondo.
#First we need to load the module we will be using for this demo, running this command
#will add a new version of python to your command line. Unfortunately the 3.4 version doesn't have the tools
#we need, so we will actually be using it to make a custom environment for this demonstration.
module load anacondapy/3.4
#Running this will display a list of available python environments you've made with conda
#we include two stock environments via the module load command and you can make any number
@Wildcarde
Wildcarde / 01_BasicIntro.md
Last active November 13, 2018 06:22
Git Hands on Demo for the PNI

Basic git intro

A few notes, all commands in this tutorial will assume you are working in a linux shell. The same commands should work for OSX but have not been tested. This primer is not intended to give you a full breadth of coverage of the git toolset but show you the basics of making a repository, recording changes, reviewing differences over time, and pushing and pulling from a remote repository. We won't be working with any of the graphical tools for the time being as they are all very different, but the underlying tech to all of them is the same commands we will be doing on the command line.

To get started we'll need a place to work, so lets create that and populate it with some files. I'll be using the files from https://gist.github.com/Wildcarde/9079ead23d5651d871e0 for this demo but feel free to use other files if you would like to.

mkdir gitclass
cd gitclass
wget https://gist.github.com/Wildcarde/9079ead23d5651d871e0/raw/e68a6db01c3e9786d1a49a1b14064dc30f1e18ac/drawfigure.m
wget htt
@Wildcarde
Wildcarde / matlabparscript.m
Last active October 11, 2020 02:01
Parallel Matlab Spock Demo
function [] = parbench()
%main function for building pool and running benchmark
% this is adapted from the mathworks parallel benchmark demo
% to occupy only one file instead of several
% original article here: https://www.mathworks.com/help/distcomp/examples/simple-benchmarking-of-parfor-using-blackjack.html
%% Setup
%If you want more than 12 core you MUST create the pool by hand
% Below that it will detect the number of cores requested by and
% create a pool of the appropriate size. If this pool size is too
@Wildcarde
Wildcarde / Intro.md
Last active October 26, 2020 20:33
Spock Basics Talk

Spock Crash Course

Basic Architecture Info:

  • ~60 nodes
  • mixture of: ** 24 cores X 250GB memory / node ** 32 cores x 252GB memory / node
  • No Swap
  • Dedicated 10Gbps connection to Bucket / node
  • IB Backend for MPI - not available on 'redshirt' machines
@Wildcarde
Wildcarde / unravel.py
Created May 10, 2016 21:09
Quick hack to reverse a list of IPs to their hostnames from firewall logs, this assumes python 2.7/3 and pandas are available
#!/bin/env python
import pandas as pd
import socket
df = pd.read_csv('<sourcecsv>.csv')
ips=df["Source address"]
for ip in ips:
print (socket.gethostbyaddr(str(ip)))