This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Play with Riak | |
# | |
import riak | |
myClient = riak.RiakClient(pb_port=8087, protocol='pbc') | |
myBucket = myClient.bucket('test') | |
val1 = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Newfies-Dialer License | |
# http://www.newfies-dialer.org | |
# | |
# Copyright (C) 2011-2015 Star2Billing S.L. | |
# Arezqui Belaid <[email protected]> | |
# | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
FS_CONFIG_PATH=/etc/freeswitch | |
FS_CONF_PATH=/usr/src/newfies-dialer/install/freeswitch-conf | |
#Set branch to install develop / default: master | |
if [ -z "${INSTALL_FS}" ]; then | |
INSTALL_FS='yes' | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Benchmark PLLUA | |
-- | |
DROP TABLE accumulator; | |
CREATE TABLE accumulator (id BIGSERIAL PRIMARY KEY, new_value INT, sum_previous INT); | |
CREATE OR REPLACE FUNCTION fillaccumulator() RETURNS void AS $$ | |
local query = server.execute('SELECT count(*), SUM(new_value) FROM accumulator', true, 1) -- read-only, only 1 | |
local random = math.random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Benchmark PLV8 | |
-- | |
DROP TABLE accumulator; | |
CREATE TABLE accumulator (id BIGSERIAL PRIMARY KEY, new_value INT, sum_previous INT); | |
-- DROP FUNCTION IF EXISTS fillaccumulator(); | |
CREATE OR REPLACE FUNCTION fillaccumulator () RETURNS void AS $$ | |
var rows = plv8.execute( "SELECT count(*), SUM(new_value) FROM accumulator" ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Benchmark PLPGSQL | |
-- | |
DROP TABLE accumulator; | |
CREATE TABLE accumulator (id BIGSERIAL PRIMARY KEY, new_value INT, sum_previous INT); | |
CREATE OR REPLACE FUNCTION "fillaccumulator"() RETURNS boolean AS | |
$BODY$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- PLLUAU example calling API when new Customer are created | |
-- | |
CREATE TABLE customer ( | |
id bigserial primary key, | |
full_name varchar(200) NOT NULL, | |
email varchar(200) NOT NULL, | |
created_date timestamp default NOW() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: freeswitch | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: Freeswitch debian init script. | |
# Author: Matthew Williams | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Arezqui Belaid <[email protected]> | |
# | |
FS_CONFIG_PATH=/etc/freeswitch | |
FS_BASE_PATH=/usr/src | |
FS_VERSION=v1.7 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import hashlib | |
import requests | |
from datetime import datetime | |
utc_str_date = datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT") | |
secret = 'SECRET' | |
api_key = "API KEY" | |
url = 'https://rest.messagemedia.com/v1/messages' |