Skip to content

Instantly share code, notes, and snippets.

View bortels's full-sized avatar

Tom Bortels bortels

  • Simi Valley, CA, USA
View GitHub Profile
@bortels
bortels / gist:7311859
Created November 5, 2013 00:31
powercli example
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vmhost
= Get-VMHost -Name vortex10a.wlvdev.diginsite.com
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $s.Creat
eVM.VM | foreach { New-VM -VMHost $vmhost -Name $_.Name -DiskGB $_.HDDCapacity }
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
MyVM1 PoweredOff 1 0.250
New-VM : 11/4/2013 4:08:36 PM New-VM The operation for the entity
@bortels
bortels / bootstrap apache
Last active December 17, 2015 18:39
Install Apache with mod_ssl on RHEL for AWS (AMI6 baseline)
sudo yum -y install httpd httpd-tools mod_ssl
sudo cat <<MODSSL >>/etc/httpd/conf/httpd.conf
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
<Directory /var/www/html>
AllowOverride All
</Directory>
DocumentRoot /var/www/html
@bortels
bortels / install mitmproxy on AMI6
Last active December 17, 2015 18:39
Set up virtualenv on AMI6 RHEL for mitmproxy
# AWS AMI6 base setup for dev
cd
sudo yum -y update
# Prereqa for ruby/python
sudo yum -y groupinstall "Development Tools"
sudo yum -y install libxml2-devel zlib-devel openssl-devel libxslt libxslt-devel
sudo yum -y install readline-devel gdbm-devel bzip2-devel ncurses-devel sqlite-devel tk-devel
# mitmproxy requires Python 2.7+, but AMI6 only has 2.6.6, yay.
yum -y install wget
wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
@bortels
bortels / route53examples.rb
Created March 6, 2013 00:48
Experiments with aws ruby sdk for route53
#!/usr/bin/ruby
# Update route 53 DNS entry
require 'rubygems'
require 'aws-sdk'
AWS.config(YAML.load(File.read('credentials-file')))
zoneid = "unknown"
@bortels
bortels / launchinstance
Created March 6, 2013 00:44
example script to create AWS ec2 instance using ruby sdk
#!/usr/bin/ruby
require 'rubygems'
require 'aws-sdk'
require 'erb'
aws_email="email address here"
aws_name="My Test Instance"
# below is IAM credentials for my account
@bortels
bortels / turtle_startup.lua
Created February 18, 2013 00:18
Startup Script for Computercraft Turtles
-- startup script for melee turtle
-- grabs a fresh copy of melee script on startup, then executes it
-- install with "pastebin get YBWf4qsN startup"
pastebinid = "UYwardhQ"
payload = "melee"
backup = payload .. ".bak"
print("Fetching " .. payload .. " program from pastebin")
if (fs.exists(backup)) then
@bortels
bortels / gist:4653149
Created January 28, 2013 04:50
testing encoding
Abc > Def & Yow
@bortels
bortels / ply
Created November 2, 2012 04:05
PLY loading class for Codea
-- minor modifications from https://dl.dropbox.com/u/80475380/CodeaForumPictures/Main.lua
--
-- call with m = PLY:parsePLY(string)
PLY = class()
function PLY:readLine()
-- Read one line of ply string. Return without \n. Return nil, if end is reached.
local endLine = false
@bortels
bortels / mvc
Created October 2, 2012 17:02
minecraft control script using screen
#! /bin/sh
### BEGIN INIT INFO
# Provides: minecraft_server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Minecraft Server control script.
# Description: Minecraft Server control script.
# Options
@bortels
bortels / sphere.lua
Created May 3, 2012 20:36
Sphere in Codea
-- Use this function to perform your initial setup
function setup()
    local vertex = {}
vertex[1] = vec3(0.382683, 0.923880, 0.00000e+0)
vertex[2] = vec3(0.353553, 0.923880, 0.146447)
vertex[3] = vec3(0.270598, 0.923880, 0.270598)
vertex[4] = vec3(0.146447, 0.923880, 0.353553)
vertex[5] = vec3(2.34318e-17, 0.923880, 0.382683)
vertex[6] = vec3(-0.146447, 0.923880, 0.353553)