Skip to content

Instantly share code, notes, and snippets.

View WhiteyDude's full-sized avatar

Whitey WhiteyDude

  • Australia
View GitHub Profile
require 'pl.stringx'
stringx.import()
socket = require 'socket'
posix = require 'posix'
function get_number()
return stringx.rjust(tostring(os.date('*t')['sec']) .. tostring(socket.gettime()):split('.',2)[2]:sub(3),4,"0")
end
for i=1,100 do
print(get_number())
[Unit]
Description=Redis Server 6380
After=network.target
[Service]
Type=simple
PIDFile=/var/run/redis_6380.pid
ExecStart=/usr/local/bin/redis-server /etc/redis/6380.conf
ExecStop=/bin/kill -15 $MAINPID
Restart=on-failure
#!/bin/bash
if [ -z $1 ]; then
echo "Syntax is $0 <port>"
exit 1
fi
if [ -f "/var/run/redis_$1.pid" ]; then
#pid=`cat /var/run/redis_$1.pid`
# kill -15 $pid
redis-cli -p $1 shutdown
fi
---
- hosts: all
become: true
become_user: "root"
become_method: sudo
tasks:
- name: Make .ssh directory
file:
path: "/root/.ssh"
state: directory
---
- hosts: all
become: true
become_user: "root"
become_method: sudo
tasks:
- name: Enable epel
shell:
cmd: '/usr/bin/amazon-linux-extras enable epel'
- name: Install epel
calls = require('./calls')
srf.invite((req, res) => {
const ms = req.app.locals.ms;
ms.connectCaller(req, res, next)
.then(({endpoint, dialog}) => {
setHandlers(req, res, dialog, endpoint)
to = calls.parseURI(req.msg.headers.to);
to_number = calls.convertToE164(to.user)
calls = require('./calls')
srf.invite((req, res) => {
return res.send(500);
const ms = req.app.locals.ms;
ms.connectCaller(req, res, next)
.then(({endpoint, dialog}) => {
console.log("Never get here")
});
}); // End ms.ConnectCaller
const calls = require('./calls');
srf.invite(async(req, res) => {
const ms = req.app.locals.ms;
const to_number = calls.convertToE164(req.calledNumber);
let ep, dlg;
try {
const {endpoint, dialog} = await ms.connectCaller(req, res);
ep = endpoint;
dlg = dialog;
const Srf = require('drachtio-srf');
const Mrf = require('drachtio-fsmrf');
const config = require('config');
const srf = new Srf() ;
const mrf = new Mrf(srf) ;
// Connect to drachtio server using SRF - sync
srf.connect(config.get('drachtio'), (err, srf) => {
if (err) return log_to_console(false, `error connecting to drachtio: ${err}`);
});
@WhiteyDude
WhiteyDude / appspec.yml
Last active July 25, 2020 13:34
CodeDeploy ruby 2.5+ non empty directories fix
files:
- source: files/codedeploy_install_instruction.patch
destination: /tmp
hooks:
AfterInstall:
- location: scripts/patch_codedeploy_and_restart.sh
timeout: 300
runas: root