Skip to content

Instantly share code, notes, and snippets.

View hartsock's full-sized avatar

Shawn Hartsock hartsock

View GitHub Profile
@hartsock
hartsock / sync.sh
Last active August 10, 2017 17:54
A stupid bash script I wrote because I'm not clever enough to not have to write this.
#!/bin/bash
SRC=$1
DST=$2
if [[ -z ${SRC} ]]; then echo "No source dir"; exit 1; fi
if [[ -z ${DST} ]]; then echo "No destination dir"; exit 1; fi
for d in $(ls $SRC); do
if [ -d "$SRC/$d" ]; then
CMD="rsync -r $SRC/$d/ $DST/$SRC/$d"
@hartsock
hartsock / 2014.09.BioHacking.txt
Created July 3, 2017 15:41
List I made for myself when I started researching BioHacking in 2014. One question I had was... why at 6'2" and 240 lbs did I not look like a thing like Arnold?
1. Lift Weights
2. Sleep Well
3. Intermittent Fasting? Dietary Ketosis?
4. Cholesterol / Zinc / Magnesium / Vitamin D3
5. Lower Estrogen: Weight Loss, No BPA
6. Reduce Stress
7. Increase Androgen Receptors: L-Carnitine & L-Tartrate / Reduce over stimulation
@hartsock
hartsock / sketch_add_disk.py
Created April 17, 2017 19:28
adding a disk code sketch
from pyVmomi import vim
spec = vim.vm.device.VirtualDiskSpec()
spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add
spec.fileOperation = vim.vm.device.VirtualDeviceSpec.FileOperation.create
spec.device = vim.vm.device.VirtualDisk(
capacityInBytes=capacity_bytes,
capacityInKB = capacity_kb,
connectable = vim.vm.device.VirtualDevice.ConnectInfo(
startConnected = True,
@hartsock
hartsock / github_contributor_commands
Created February 2, 2017 17:06
Standard GitHub Practice
git clone git@github.com:[your fork of the upstream repo]
cd [repo name]
git remote add upstream https://github.com/[upstream repo]
git fetch --all
git pull upstream master
git push origin master
git checkout -b issue12345
# ... edit files ...
git commit -a -m 'fixed issue12345'
git push -u origin issue12345
# How to create an RPM repository
# This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages.
#
# See "How to create an RPM from source with spec file" for more information.
# https://gist.github.com/1376973
# Step: 1
# Install createrepo
@hartsock
hartsock / photon_developer_boxen_static_ip.txt
Created September 8, 2016 16:44
Static IP for the old Photon developer boxen
$ sudo gvim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf
host phodev {
hardware ethernet 00:0c:29:ab:9a:11;
fixed-address 192.168.218.10;
}
@hartsock
hartsock / yum_list.txt
Created September 1, 2016 15:50
My monster list of installed Photon OS packages
Installed Packages
Linux-PAM.x86_64 1.2.1-3.ph1 installed
Linux-PAM-lang.x86_64 1.2.1-3.ph1 installed
PyYAML.x86_64 3.11-2.ph1 installed
XML-Parser.x86_64 2.44-2.ph1 installed
acl.x86_64 2.2.52-2.ph1 installed
apache-maven.noarch 3.3.9-4.ph1 installed
apr.x86_64 1.5.2-6.ph1 installed
apr-devel.x86_64 1.5.2-6.ph1 installed
apr-util.x86_64 1.5.4-7.ph1 installed
@hartsock
hartsock / AbstractResource.java
Created February 18, 2016 15:32 — forked from knutwalker/AbstractResource.java
Jersey2 + Swagger with Resource inheritance
package com.example;
import com.wordnik.swagger.annotations.ApiParam;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@hartsock
hartsock / ding.sh
Last active August 29, 2015 14:24 — forked from benpickles/ding.sh
# .___.__
# __| _/|__| ____ ____
# / __ | | |/ \ / ___\
# / /_/ | | | | \/ /_/ >
# \____ | |__|___| /\___ /
# \/ \//_____/
#
# Make a "ding" sound on your Mac! Useful for notifying you when a command
# line script has finished.
#