This file contains 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 | |
# At the end you will have 6 files: | |
# ca/ca.pem - used by both client and server to verify each other certificates | |
# ca/ca-key.pem - keep it in secret it may be used to generate new certificates | |
# client/cert.pem, client/key.pem - in conjunction with /ca/ca.pem will be used by client to speak with server | |
# server/cert.pem, server/key.pem - in conjunction with /ca/ca.pem will be used by server | |
# | |
# NOTICE: DO NOT FORGET to set your **Server** ip and dns in server/openssl.cnf each time you generating new server certificates | |
# |
This file contains 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
DROP FUNCTION IF EXISTS apportion_lrm(NUMERIC, JSONB, INTEGER, NUMERIC, BOOLEAN); | |
CREATE FUNCTION apportion_lrm | |
( | |
IN apportion_amt NUMERIC, | |
IN proportions JSONB, | |
IN data_scale INTEGER DEFAULT 0, | |
IN proportion_total NUMERIC DEFAULT NULL, | |
IN allow_truncate_apportion BOOLEAN DEFAULT FALSE | |
) | |
RETURNS JSONB AS $BODY$ |
This file contains 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
// Test when ran using the postgresql connector | |
// Create a new instance of the model | |
loopback:connector:postgresql SQL: INSERT INTO "public"."phone_cdr"("caller_name","caller_number","phone_number_dialed","call_start_date_gmt","call_status") VALUES($1,$2,$3,to_timestamp($4,'yyyy-mm-dd hh24:mi:ss.ms'),$5) RETURNING "id" | |
Parameters: ["test","1234567","7654321","2015-01-01T00:00:00.000Z","A"] +465ms | |
loopback:connector:postgresql { | |
"command": "INSERT", | |
"rowCount": 1, | |
"oid": 0, | |
"rows": [{ |
This file contains 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
Installing: | |
sudo apt-get install wondershaper | |
Use: | |
(Speeds are in KB) | |
sudo wondershaper eth0 downspeed upspeed | |
e.g. sudo wondershaper eth0 500 500 | |
Restoring normal speed: |