Skip to content

Instantly share code, notes, and snippets.

View ruhnet's full-sized avatar

Ruel Tmeizeh ruhnet

View GitHub Profile
@ruhnet
ruhnet / gist:587ee87e706db211299284c7659dbaf6
Last active January 28, 2018 00:25
Promise.all What's wrong with this?
function processAllObjects(bunchOfObjects) {
return Promise.all(bunchOfObjects.map(function (object, i) { //for each object
if (object.testProperty) {
console.log('OBJECT #'+i+': '+object.Id+' IS VALID! Checking...');
return Promise.try(function() {
return checkLoadDB(object); //check if exists in DB, mark it.
})
.then(function(object) {
console.log(' Looking up '+object.Id+'...');
return getObjectDetails(object); //get more details on object and add them.
@ruhnet
ruhnet / lcd.c
Created February 3, 2018 20:45
LCD Character Set Test Program
//LCD CHARACTER SET TEST PROGRAM 2018-02-03
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
}
void loop() {
lcd.begin(16, 2);
@ruhnet
ruhnet / couchclone.sh
Last active September 3, 2024 15:55 — forked from janoskk/couchclone.sh
Create (if necessary) and replicate all databases from a couchdb server to another one
#!/bin/sh
#
# Janos Kasza (@janoskk)
# Modified by Ruel Tmeizeh @ruhnet
#
# Creates (if necessary) and replicates all databases from a couchdb server to another one
#
if [ -z "$2" ]; then
cat <<EOF
@ruhnet
ruhnet / sup-commands.md
Created March 21, 2020 19:12
All Kazoo 4.2.x sup-commands
@ruhnet
ruhnet / KazooCentos7DigitalOcean.md
Last active August 23, 2024 01:04
Kazoo Centos 7 Cluster on Digital Ocean

Kazoo Cluster on CentOS 7 ON DIGITALOCEAN

This file provided by "fink" in #2600hz on Freenode

Prerequisites

Set Hostname

Ensure the hostname is set appropriately. Modify as required and reboot, if needed.

Environment Variables

@ruhnet
ruhnet / 2600Hz_Kazoo.md
Last active August 23, 2024 01:04
2600Hz Kazoo 4.3 Notes

RuhNet: 2600Hz Kazoo Notes

Cluster Topology Possibilities

Any service can be separated and run on its own server. Commonly used config:

  • Kazoo Servers: HAProxy, RabbitMQ, Kamailio SIP Proxy, Kazoo eCall Manager, Kazoo Applications, (Monster UI)
  • Freeswitch Servers: HAProxy, Freeswitch
  • Bigcouch Database Servers: Bigcouch or CouchDB (I use CouchDB v3.0)
@ruhnet
ruhnet / extensions_custom.conf
Created December 18, 2020 21:00 — forked from backslash7/extensions_custom.conf
How to strip destination number from SIP To: header and use it as DID
; Assign this context to your incoming SIP trunk settings
[custom-get-did-from-sip]
exten => _X.,1,Noop(Fixing DID using information from SIP TO header)
exten => _X.,n,NOOP(Header is: ${SIP_HEADER(TO)})
exten => _X.,n,Set(pseudodid=${SIP_HEADER(TO)})
exten => _X.,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => _X.,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => _X.,n,Noop(Pseudo DID is: ${pseudodid})
exten => _X.,n,Goto(from-trunk,${pseudodid},1)

Archive.org Scanned Book Downloader Bookmarklet

A simple "1-click" javascript approach to downloading a scanned book from archive.org to read at your leisure on the device of your choosing w/out having to manually screenshot every pages of the book by hand. In short it's a glorified "Save Image As..." approach but consolidated down to "1 click". BTW there may be a much better option than this out there - I just built this as an autistic project to see if it would work.

Demo Video

Archive.org SBDL Demo

Obligatory Legal/Disclaimer:

By using this script you agree to delete all book files/images after your 1 hour or 14 days is up! I don't support using this script for any other use cases. After all, none of us have ever kept a library book past it's return date, right?