Skip to content

Instantly share code, notes, and snippets.

@robjshaw
robjshaw / gist:30db8ebc9ddc8daf3d07
Last active August 29, 2015 14:10
setting up hackfest box
# ubuntu 14.10 server
sudo apt-get update
#sudo apt-get install node
#sudo apt-get install nodejs
#sudo apt-get install npm
# set up rest http://www.getrailo.org/index.cfm/whats-up/railo-40-beta-released/features/rest-services/
# set up ngrok on mac https://www.twilio.com/blog/2013/10/test-your-webhooks-locally-with-ngrok.html
// aws cloudformation describe-stacks --region ap-southeast-2 | jq '.Stacks[] | select( .Parameters[0].ParameterValue == "s3://" ) | { StackId }'
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:xxxxxxx",
"Description": "Cache Cluster",
"Parameters": [
{
"ParameterValue": "SecurityGroupWebCacheCluster",
"ParameterKey": "SecurityGroup"
},
@robjshaw
robjshaw / gist:845bbee579aa09db666d
Last active August 29, 2015 14:02
simple backup script for webroot -> s3 backup
#!/bin/bash
NOW=$(date +"%m-%d-%Y")
file="$NOW.appname.tar.gz"
sourcedir='/var/www/appname/public_html'
bucketname="s3://bucketname/$file"
echo "backing up $sourcedir to /tmp/$file & then to s3 bucket $bucketname"
tar -zcvf /tmp/$file $sourcedir
echo 'all backed up now s3 move'
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:GetObjectAcl",
"s3:PutObjectAcl",
"s3:ListBucket",
<cfscript>
QueueName = "QTransactions";
durable = true;
loadPaths = arrayNew(1);
loadPaths[1] = expandPath("lib/rabbitmq-java-client-bin-2.8.4/rabbitmq-client.jar");
// load jars
javaLoader = createObject("component", "lib.javaloader.JavaLoader").init(loadPaths);
@robjshaw
robjshaw / gist:7205580
Created October 28, 2013 22:01 — forked from justincarter/gist:1306983
mac friendly :)
[
// cf tags
//
// cfabort
{ "keys": ["command+shift+a"], "command": "insert_snippet", "args": {"contents": "<cfabort>" } },
// cfdump
{ "keys": ["command+shift+d"], "command": "insert_snippet", "args": {"contents": "<cfdump var=\"#${0:$SELECTION}#\">" } },
// cfoutput
{ "keys": ["command+shift+o"], "command": "insert_snippet", "args": {"contents": "<cfoutput>${0:$SELECTION}</cfoutput>" } },
<cfcomponent output="false">
<cffunction name="get" access="remote">
<cfargument name="type" required="true" />
<cfargument name="stArguments" required="true" />
<cfscript>
//var listToArray(arguments.type, '_');
var qGet = "";
var aColumns = arrayNew(1);
@robjshaw
robjshaw / gist:5625543
Last active December 17, 2015 14:38
dealing with Scientific notation in deserializeJson() in Coldfusion - DRAFT
<cfset stArgumentStructure = deserializeJSON(arguments.jsonStructure) />
<cfloop collection="#stArgumentStructure#" item="argumentItem">
<cfif (isStruct(stArgumentStructure[argumentItem]))>
<!--- structure we'll loop down one level... --->
<cfloop collection="#stArgumentStructure[argumentItem]#" item="argumentItemChildren">
<cfif isNumeric(stArgumentStructure[argumentItem][argumentItemChildren])>
<cfset stArgumentStructure[argumentItem][argumentItemChildren] = trim(numberformat(stArgumentStructure[argumentItem][argumentItemChildren], '__________________________________________________________')) />
</cfif>
</cfloop>
@robjshaw
robjshaw / gist:5219039
Last active December 15, 2015 06:49
keytool coldfusion built in webserver
keytool -genkey -dname "cn=127.0.0.1, ou=CF, o=robjshaw, L=Sydney, ST=NSW, C=AU" -keyalg rsa -keystore mykey
keytool -importkeystore -srckeystore mykey -destkeystore mykeyout.p12 -deststoretype PKCS12
@robjshaw
robjshaw / gist:5209216
Created March 20, 2013 22:41
coldfusion dev environment virtualbox - ubuntu server 12.10
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openssh-server
sudo reboot
## shared folders