Skip to content

Instantly share code, notes, and snippets.

View andrewwatson's full-sized avatar
🤡
Cranking Out The Code

Andrew Watson andrewwatson

🤡
Cranking Out The Code
View GitHub Profile
@andrewwatson
andrewwatson / gist:deb53c5367533e3dfe6b
Created July 15, 2015 20:08
running docker machine and docker from terraform local-exec
provisioner "local-exec" {
command = "docker-machine create -d generic --generic-ssh-user=ubuntu --generic-ip-address=${self.public_ip} --generic-ssh-key ${var.key_path} --engine-opt dns=172.17.42.1 --engine-opt dns-search=service.consul discovery-${count.index}"
}
provisioner "local-exec" {
command = "docker --tlsverify --tlscacert=\"$HOME/.docker/machine/machines/discovery-${count.index}/ca.pem\" --tlscert=\"$HOME/.docker/machine/machines/discovery-${count.index}/cert.pem\" --tlskey=\"$HOME/.docker/machine/machines/discovery-${count.index}/key.pem\" -H=tcp://${self.public_ip}:2376 ps"
}
[root@upsilon ~]# cat /etc/yum.repos.d/remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority
@andrewwatson
andrewwatson / gist:977589
Created May 17, 2011 22:43
Patch to Dial Applet so that the Dial verb can have a configurable timeout
twiml.php changes
33a34,35
> $ring_timeout = AppletInstance::getValue('ring_timeout', 20);
>
126c128
< $dial = $response->addDial(array('action' => current_url(), 'timeout' => 5));
---
> $dial = $response->addDial(array('action' => current_url(), 'timeout' => $ring_timeout));
@andrewwatson
andrewwatson / moderator.xml
Created May 26, 2011 00:50
This is an example of a moderated, recorded conference call
<Response>
<Dial action="recording_hook.php">
<Conference startConferenceOnEnter="true" endConferenceOnExit="true" record="true">DrPepper</Conference>
</Dial>
</Response>
@andrewwatson
andrewwatson / fetch poll takers
Created May 27, 2011 17:27
A snippet to illustrate
Replace this code:
/* Create an Array of people to be called */
$people = array(
0 => "415-555-1234",
1 => "415-555-2345",
2 => "415-555-3456"
);
With this:
@andrewwatson
andrewwatson / index.php
Created June 2, 2011 05:05
An idea for fixing OpenVBX index.php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('log_errors', true);
if (version_compare(PHP_VERSION, '5.2.4') >= 0) {
// running 5.2.4 or newer
ini_set('display_errors', 'stderr');
} else {
ini_set('display_errors', false);
}
@andrewwatson
andrewwatson / upgrade.php
Created June 8, 2011 21:46
Upgrade Phone Number
<?php
$sn = $argv[1];
$asid = $argv[2];
$sid = "ACxxxxx";
$token = "xxxxx";
$url = "https://api.twilio.com/2010-04-01/Accounts/${asid}/IncomingPhoneNumbers/${sn}";
printf("%s\n",$url);
<?php
$sn = $argv[1];
$asid = $argv[2];
$vurl = $argv[3];
$sid = "ACxxxxxxxxxxxxxxxxxxxx";
$token = "xxxxxxxxxxxxxxx";
@andrewwatson
andrewwatson / saystuff.xml
Created June 15, 2011 20:21
Say Stuff Demo
<Response>
<Say>I am a man. This is how I talk. 1 2 3 4. Skippy Dippy Waffle Sauce.</Say>
<Pause length="1" />
<Say voice="woman">I am a woman. I have a much nicer voice than that man.</Say>
<Pause length="1" />
<Say language="es">Por favor, manténgase alejado de las puertas</Say>
</Response>
@andrewwatson
andrewwatson / secret.php
Created June 16, 2011 18:09
SMS To Demo
<?php
header("Content-type: text/xml");
if ($_POST['Digits'] == "12345") {
$response = '
<Say>That is Correct</Say>
<Gather action="send.php" numDigits="10">
<Say>Type the number of the person to message</Say>
</Gather>
';