Skip to content

Instantly share code, notes, and snippets.

View pr1ntf's full-sized avatar

Trent pr1ntf

View GitHub Profile
@pr1ntf
pr1ntf / iohyve-0.2.12.sh
Created June 4, 2015 22:51
Before the fork.
#!/bin/sh
# iohyve v0.2.12 2015/05/18 "persist docs"
# Process command line
__parse_cmd () {
while [ $# -gt 0 ] ; do
case "$1" in
version) __version
exit
@pr1ntf
pr1ntf / bootin.sh
Last active August 29, 2015 14:23
bootin
#!/bin/sh
guestlist="$(zfs list | grep iohyve | grep -v ISO | grep -v .img | cut -d ' ' -f 1 | cut -d '/' -f 3 | sed 1d)"
#echo $guestlist
for i in $guestlist ; do
bootprop="$(zfs get -H -o value iohyve:boot neuralnet/iohyve/$i)"
if [ $bootprop = "1" ]; then
iohyve start $i -p &
@pr1ntf
pr1ntf / drillanswer.sh
Created July 2, 2015 19:21
human readable drill answer
drill TXT buttsbuttsbutts.xyz | grep -A1 ";; ANSWER" | sed 1d | cut -d '"' -f2
@pr1ntf
pr1ntf / plasma.py
Created September 17, 2015 14:11
PythonPlasma
# Python PIL (pillow) code to generate frame images out of a plasma algorithm
# Author: 2015 Thomas O. Robinson, cyranix@cyranix.net
# Open Source, no particular rights reserved. Would love to hear from anyone who reads, uses or improves it
# Certain research was done using http://www.bidouille.org/prog/plasma and http://lodev.org/cgtutor/plasma.html as references.
# I started this project because of a need to generate some random, psychedelicish grayscale animations for use in another project I am working on, and old school plasma screensavers seemed like a logical solution. Since there really wasn't any good tutorials on the net for implementing this, and literally nothing for python (which I am only using because the libraries for my other project only have bindings for C++ or python), which has some pretty poor documentation for working with images and graphics and pixel data and such, I set out on my own, and this is the result of about 3 days of inconsistent work. I've documented it the best I could
@pr1ntf
pr1ntf / winbhyvesawce.txt
Last active October 5, 2015 19:21
Secret sauce for Windows and bhyve
Existing Windows installation ISOs expect a GUI console. To get around that, you have to do an "unattended install". Windows people seem to know all about this but it was new to me It basically is dropping down an XML file into the ISO that answers all the questions, and sets parameters.
Sample XML unattend scripts can be downloaded from
https://github.com/nahanni/bhyve-windows-unattend-xml
These set up an IP address with DHCP, use "Test123" for the 'Administrator' password, enable remote RDP access, and install virtio drivers. You may want to customize these, but they will work fine out of the box. Note the license keys in these have been scrubbed - they're generally not needed for server installs, but if you're going for a desktop install you'll probably want to add them in.
Assuming w2k16, the steps are:
- Install the p7zip and cdrtools-devel packages on FreeBSD (the versions I used on CURRENT were v9.38 and 3.01a24,1 respectively)
@pr1ntf
pr1ntf / win2k16bhyve-err1.txt
Created October 5, 2015 20:47
win2k16bhyve-err1.txt
==AtaAtapiPassThru Start== Controller = 3EEC3D98
port [0] port mulitplier [0] has a [cdrom]
CalculateBestPioMode: AdvancedPioMode = 3
IdeInitCalculateMode: PioMode = 4
CalculateBestUdmaMode: DeviceUDmaMode = 407F
IdeInitCalculateMode: UdmaMode = 5
InstallProtocolInterface: 1D3DE7F0-0807-424F-AA69-11A54E19A46F 3EEB8A40
InstallProtocolInterface: 143B7632-B81B-4CB7-ABD3-B625A5B9BFFE 3EEB8A90
InstallProtocolInterface: 19DF145A-B1D4-453F-8507-38816676D7F6 3EDA7698
InstallProtocolInterface: 0167CCC4-D0F7-4F21-A3EF-9E64B7CDCE8B 3EDA7420
@pr1ntf
pr1ntf / iohyvereadme.txt
Created October 15, 2015 15:47
Old iohyve readme detailing vnet
### Welcome! ###
# If you are just setting up shared networking, just set the guest's IP to a valid IP address
# on the host's network. If you choose to use VNET, you'll need to set a few more things up.
### Quick Pre-flight checklist ###
# iohyve's network is meant to work either via VNET or Shared IP, both utilizing tap(4)
# The goal is to potentialy have bhyve guests and iocage jails living on the same VNET
# Things labeled as NEEDED are needed at the very least for shared IP guests.
@size = (1920,1080);
@center = (-.743653135,.131826563);
$zoom = .000014628;
$max_it = 700;
open U, "|convert -size $size[0]x$size[1] -depth 8 gray:- mandel.png";
for $py (0..$size[1]-1) {
$y0 = $center[1] + ($py/($size[0]-1) - .5) * $zoom;
for $px (0..$size[0]-1) {
$x0 = $center[0] + ($px/($size[0]-1) - .5) * $zoom;
@pr1ntf
pr1ntf / subtilevictories.txt
Last active November 15, 2015 00:56
subtilevictories.txt
Back in July, I posted a series of tweets to our main twitter account - @cryptostorm_is - of a fairly unusual nature. I include a link to the first (https://twitter.com/cryptostorm_is/status/624070397219180544) in the series, because they are public and piddling about by not doing so strikes me as disingenuous and, well... twee. Anything but twee, please. To say that tweet received a bit of notice would be an understatement: in addition to the eighty (80) retweets, it generated scores of DMs, emails, bitmessages, smoke signals... you get the point. Since then, I've been promising a follow-up blog post explaining wtf.
Nearly six months later, this is that post.
~ ~ ~
@pr1ntf
pr1ntf / iohyve8create.txt
Created October 27, 2015 21:54
Build iohyve man page
cat iohyve.8.txt | txt2man -t iohyve -s 8 -v "FreeBSD System Manager's Manual" > iohyve.8