Skip to content

Instantly share code, notes, and snippets.

View areski's full-sized avatar
🤗
Working at DialerAI

Areski Belaid areski

🤗
Working at DialerAI
  • Star2Billing // DialerAI
  • Barcelona
  • X @areskib
View GitHub Profile
@areski
areski / luasql_config
Last active August 29, 2015 14:02
luasql_config
# Driver (leave uncommented ONLY the line with the name of the driver)
#T= mysql
#T= oci8
#T= odbc
T= postgres
#T= sqlite
#T=sqlite3
#T=firebird
# Installation directories
@areski
areski / install_luasql.sh
Last active August 2, 2022 12:38
Install LuaSQL for FreeSWITCH on Debian7
#!/bin/bash
#
# Install LuaSQL on Debian7
#
#Install Dependencies
apt-get install -y lua5.2 liblua5.2-dev
apt-get install -y libpq-dev
#apt-get install lua-sql-postgres-dev
#!/usr/bin/env python
"""
- Search Github for repos, return results and clone via menu selection.
- Created because we all spend far too much time looking for the repo addresses.
- Requires 'requests' lib, install on deb system with: sudo apt-get install python-pip; sudo pip install requests
- sudo wget https://gist.github.com/LukeBeer/9bb732dd6129ebd92fdc/raw/gitget.py -O /usr/local/bin/gitget; sudo chmod +x /usr/local/bin/gitget
"""
import sys
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.cfg:
[install]
@areski
areski / gist:4722239
Last active December 12, 2015 05:28
make_pi
#
# Display PI Number
#
def make_pi():
q, r, t, k, m, x = 1, 0, 1, 1, 3, 3
for j in range(10000):
if 4 * q + r - t < m * t:
yield m
q, r, t, k, m, x = 10*q, 10*(r-m*t), t, k, (10*(3*q+r))//t - 10*m, x
prefixlist = range(0, 100)
rate_list = VoIPRetailRate.objects.values('prefix', 'retail_rate', 'prefix__destination').filter(prefix__in=[int(s) for s in prefixlist])
print rate_list
@areski
areski / gist:2510165
Created April 27, 2012 15:28
Add accountcode to core.db in table channels
diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c
index d436c60..6ec8792 100644
--- a/src/switch_core_sqldb.c
+++ b/src/switch_core_sqldb.c
@@ -1254,14 +1254,15 @@ static void core_event_handler(switch_event_t *event)
break;
}
case SWITCH_EVENT_CHANNEL_CREATE:
- new_sql() = switch_mprintf("insert into channels (uuid,direction,created,created_epoch, name,state,callstate,dialplan,context,hostname) "
- "values('%q','%q','%q','%ld','%q','%q','%q','%q','%q','%q')",
@areski
areski / gist:2509756
Created April 27, 2012 14:36
Attempt to add accountcode to core.db in table channels
diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c
index d436c60..b9a920a 100644
--- a/src/switch_core_sqldb.c
+++ b/src/switch_core_sqldb.c
@@ -1254,14 +1254,15 @@ static void core_event_handler(switch_event_t *event)
break;
}
case SWITCH_EVENT_CHANNEL_CREATE:
- new_sql() = switch_mprintf("insert into channels (uuid,direction,created,created_epoch, name,state,callstate,dialplan,context,hostname) "
@areski
areski / Makfile.android.template
Created October 16, 2011 21:55 — forked from pmuellr/Makfile.android.template
skeletal makefile for phonegap android
#
# PhoneGap is available under *either* the terms of the modified BSD license *or* the
# MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
#
# Copyright (c) 2011, IBM Corporation
#
#-------------------------------------------------------------------------------
help:
@echo make targets available:
@areski
areski / gist:908274
Created April 7, 2011 17:39
new sample - telefonie
# -*- coding: utf-8 -*-
from telephonie.core.inboundsocket import InboundEventSocket
from telephonie.core.errors import ConnectError
from telephonie.utils.logger import StdoutLogger
import gevent.event
import random
random.seed()