Skip to content

Instantly share code, notes, and snippets.

@smoufa
smoufa / eip_associate.sh
Last active August 29, 2015 14:05
Associate current ec2 instance with an elastic ip address
#!/bin/bash
#
# This will associate an available elastic ip with the instance
# User needs these rights:
# "ec2:AssociateAddress",
# "ec2:DescribeAddresses",
# "ec2:DescribeInstances"
AWS_ACCESS_KEY=foo
@smoufa
smoufa / bamboo-agent
Last active October 20, 2021 08:34
Install Bamboo remote agent as a service on CentOS
root@remote:
$ cat << EOF > /etc/init.d/bamboo-agent
#!/bin/sh
#
# bamboo-agent Starts the Bamboo Remote Agent Service
#
# chkconfig: 345 05 95
# description: Starts and stops Bamboo remote build agent service
# runs as root which is probably a bad idea
<cfscript>
xml = '<?xml version="1.0" encoding="UTF-8"?><ProductAvailRateRetrievalRQ xmlns="http://www.expediaconnect.com/EQC/PAR/2011/06"><Authentication username="EQC187155HW" password="mj26qf68"/><Hotel id="522467" /><ParamSet><AvailRateRetrieval from="2016-03-18" to="2016-03-18" inventory="true" roomAvailStatus="true" rateAvailStatus="true" rates="true" restrictions="true"><RoomType id="359607"/></AvailRateRetrieval></ParamSet></ProductAvailRateRetrievalRQ>';
xmlObj = xmlParse(xml);
myNode = searchNode(xml, "Hotel");
dump(myNode);
dump(getAttribute(myNode[1], 'id'));