Skip to content

Instantly share code, notes, and snippets.

@pasindud
pasindud / gist:8b8661e8a055a4dfdde7
Created September 2, 2014 16:18
Basic Ideamart Send n Recieve SMS
<?php
function sendSMS ($message ,$addresses ,$applicationId , $password ){
$req = array("message"=>$message,
"destinationAddresses"=>$addresses,
"applicationId"=>$applicationId,
"password"=>$password);
<?php
/**
* (C) Copyright 1997-2013 hSenid International (pvt) Limited.
* All Rights Reserved.
*
* These materials are unpublished, proprietary, confidential source code of
* hSenid International (pvt) Limited and constitute a TRADE SECRET of hSenid
* International (pvt) Limited.
*
* hSenid International (pvt) Limited retains all title to and intellectual
function reciveUssd() {
$array = json_decode(file_get_contents('php://input'), true);
if (!((isset($array['sourceAddress']) && isset($array['message'])))) {
throw new Exception("Some of the required parameters are not provided");
} else {
$responses = array("statusCode" => "S1000", "statusDetail" => "Success");
header("Content-type: application/json");
echo json_encode($responses);
}
var Docker = require('dockerode');
var docker = new Docker({ host: 'http://192.168.59.103' , port : 2375});
docker.run('ncthis/ceresi', [], process.stdout, function (err, data, container) {
console.log(data,container);
docker.listContainers(function (err, containers) {
console.log(containers);
apt-get update
apt-get install git
apt-get install nodejs
apt-get install npm
git clone https://github.com/listopio/varys
@pasindud
pasindud / asd
Created September 28, 2014 10:16
list
I need to see my #ec2/ec2publicips
calories in a red bull #wolfram/ask
intercepts of (x^2+2)(x^2-1) #wolfram/ask:processing
recent wso2 blogposts #rss/wso2
jehanr shit sri lankan mothers say #youtube/search
@pasindud
pasindud / listopnpminstaller
Created September 28, 2014 11:11
listop installer
http://54.68.114.161:5050/api/v1/npm/install/listop-sms
http://54.68.114.161:5050/api/v1/npm/install/listop-github
http://54.68.114.161:5050/api/v1/npm/install/listop-youtube
http://54.68.114.161:5050/api/v1/npm/install/listopio-rss
http://54.68.114.161:5050/api/v1/npm/install/listop-wolfram
@pasindud
pasindud / listop_backup
Created September 28, 2014 11:21
listop_backup_installer
http://54.210.239.96:5050/api/v1/npm/install/listop-sms
http://54.210.239.96:5050/api/v1/npm/install/listop-github
http://54.210.239.96:5050/api/v1/npm/install/listop-youtube
http://54.210.239.96:5050/api/v1/npm/install/listopio-rss
http://54.210.239.96:5050/api/v1/npm/install/listop-wolfram
@pasindud
pasindud / proxy.php
Last active August 29, 2015 14:10
Ideamart Proxy
<?php
// Use this like this
// proxy.php?url=
$ch = curl_init( $_GET['url']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents('php://input'));
$appid = "APP_000001";
$apppassword = "password";
try {
$receiver = new SMSReceiver();
$address = $receiver->getAddress();
$message = $receiver->getMessage();
// Setting up CAAS
$cass = new DirectDebitSender("http://127.0.0.1:7000/caas/direct/debit",$appid,$apppassword);
$sender = new SmsSender("http://localhost:7000/sms/send", $appid,$apppassword);
try {