Skip to content

Instantly share code, notes, and snippets.

@whytheplatypus
whytheplatypus / .env
Last active August 8, 2019 01:16
local smh -> vmi
VMI_KEY="vmi key for use by smh"
VMI_SECRET="vmi secret fro use by smh"
SMH_KEY="smh key for use by smh_app"
SMH_SECRET="smh secret for use by smh_app"
APP_VMI_KEY="vmi key for use by smh_app"
APP_VMI_SECRET="vmi secret for use by smh_app"
@whytheplatypus
whytheplatypus / gist
Created December 7, 2018 14:01
local script to mimic gist
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Must supply a file name"
exit 1
fi
REPO_NAME=$(echo "$1" | base64)
LOCAL_REPO=$HOME/.gist/$REPO_NAME
FILE_PATH=$(pwd)/$1
### Keybase proof
I hereby claim:
* I am whytheplatypus on github.
* I am whytheplatypus (https://keybase.io/whytheplatypus) on keybase.
* I have a public key ASDyKeq5YK0NOmM0o1YRUg2tymYbsL4vrTT7kV_AVogsVgo
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am whytheplatypus on github.
  • I am whytheplatypus (https://keybase.io/whytheplatypus) on keybase.
  • I have a public key ASCCOjucpue7HhsA0kGuY066sT-X3RJhqP_sOn31y_VsJAo

To claim this, I am signing this object:

@whytheplatypus
whytheplatypus / webwork_ec2_ami.md
Last active November 8, 2023 23:23
Set up WeBWorK on Amazon ec2 with the AMI

#WeBWorK ec2 AMI

##Set up Amazon ec2

Sign up:

  1. Go to Amazon AWS and click sign up now.
  2. Follow the on screen instructions.

Launch you're instance:

  1. Sign into ec2 at https://console.aws.amazon.com/ec2/ Use the email address and password that you specified when signing up for AWS.
@whytheplatypus
whytheplatypus / createNode.sh
Created February 1, 2013 17:22
Create a new vm in smartos (I have the brand coded to joyent so it's really only for smartos builds I guess) first argument should be the UUID of the image second is the desired hostname for the new vm and the third is an alias for it.
#!/bin/bash
export GATEWAY=$(netstat -r | grep default | awk '{ print $2 }')
echo "{
\"brand\": \"joyent\",
\"dataset_uuid\": \"$1\",
\"hostname\": \"$2\",
\"alias\": \"$3\",
\"nics\": [
{
@whytheplatypus
whytheplatypus / enableMulticast.sh
Last active April 2, 2023 21:10
Quickly enable mdns on a smartos machine.
#!/bin/bash
mv /etc/nsswitch.conf /etc/nsswitch.conf_old
cp /etc/nsswitch.dns /etc/nsswitch.conf
svcadm enable multicast
svcs multicast
@whytheplatypus
whytheplatypus / updateNics.sh
Created January 2, 2013 21:20
update the gateway for all my smartOS machines to the global zones gateway.
# find gateway based on global zone gateway
export GATEWAY=$(netstat -r | grep default | awk '{ print $2 }')
for uuid in `vmadm list -H -o uuid`; do echo "{
\"update_nics\": [
{
`vmadm get $uuid | json nics | grep mac`
\"gateway\":\"${GATEWAY}\"
}
@whytheplatypus
whytheplatypus / gist:4264803
Created December 12, 2012 04:15
setup requirejs before it's script tag.. allows for a busted main.js
<script>
var require = {
waitSeconds: 15,
urlArgs : "bust=" + (new Date()).getTime(),
deps : ['main']
};
</script>
@whytheplatypus
whytheplatypus / paperclip.rb
Created December 16, 2011 22:30
neo4jrb_paperclip fix
#this goes in config/initializers
Paperclip.options[:log] = false