Skip to content

Instantly share code, notes, and snippets.

cf a| awk '{print $1}{system("cf env " $1)}' | grep postgres | grep uri
@zekizeki
zekizeki / startCFapps.sh
Created March 16, 2018 12:14
start all Cloud Foundry apps in a space
cf apps | grep stopped | awk '{print $1}{system("cf start " $1)}'
@zekizeki
zekizeki / stopCFapps.sh
Created March 16, 2018 12:14
Stop all CloudFoundry apps in a space
cf apps | grep started | awk '{print $1}{system("cf stop " $1)}'
master:
image: rancher/server
container_name: master
volumes_from:
- mysql
ports:
- "8080:8080"
links:
- mysql
environment:
# download the iop docker image and pdf if you don't have them already
curl -LOk http://ibm-open-platform.ibm.com/repos/images/docker/IOP_v4100_201508.zip
curl -LOk http://ibm-open-platform.ibm.com/repos/images/docker/IOP_v4100_readme.pdf
# unzip the file using "The Unarchiver" https://itunes.apple.com/gb/app/the-unarchiver/id425424353?mt=12
# create a new vm with 8gb of ram named sparkiop (name doesnt matter if you want to change it)
docker-machine create --driver virtualbox --virtualbox-disk-size 20480 --virtualbox-memory 8192 sparkiop
# check the ip address of the sparkiop machine
@zekizeki
zekizeki / gist:3075659
Created July 9, 2012 10:31
node.js socket dump debug server
// a simple server that accepts connections on 1337 and then dumps and incoming data to standard out
// useful for debugging
var net = require('net');
var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
console.log('client connected');
socket.on('data',function(buffy){
@zekizeki
zekizeki / arabic_transliteration.php
Created July 9, 2012 10:28
A php script to provide simple english->arabic arabic->english transliteration
<?php
/*
* Created on 05-Jul-2006
* rob.s.smart@gmail.com
* Translator class calls external machine translation component
*/
class Phonetics
{
@zekizeki
zekizeki / mqttpublish.php
Last active December 9, 2020 23:33
Simple pure MQTT publish client written in PHP
<?php
/**
*
* The MQTTClient class allows you to connect to an MQTT message broker and publish messages
* @author rob.s.smart@gmail.com
*
* Example use
* $client = new MQTTClient("robphptest","realtime.ngi.ibm.com",1883);
* $client->connect();