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
#!/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
@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-r17b01.sh
Created June 30, 2014 10:10
Script to install Erlang R17B01
# You will need to make this file executable (chmod u+x) and run it with sudo
apt-get update
apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libglu1-mesa-dev fop xsltproc libxml2-utils
mkdir -p /usr/src/erlang
cd /usr/src/erlang
wget http://www.erlang.org/download/otp_src_17.1.tar.gz
tar -xvzf otp_src_17.1.tar.gz
cd otp_src_17.1
./configure
make
@areski
areski / wp_htaccess
Created September 14, 2014 18:00
Wordpress HTAccess
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A300
ExpiresByType application/x-javascript A3600
ExpiresByType text/css A3600
ExpiresByType image/gif A3600
ExpiresByType image/png A3600
ExpiresByType image/jpeg A3600
ExpiresByType text/plain A300
@areski
areski / robots.txt
Last active August 29, 2015 14:06
Wordpress robots.txt
User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /trackback
Disallow: /feed
Disallow: /comments
@areski
areski / a2billing_webservice.conf
Created September 14, 2014 21:49
a2billing_webservice.conf
Alias /a2b_webservice /usr/share/a2billing/current/stable/webservice/
<Directory /usr/share/a2billing/current/stable/webservice/>
AllowOverride all
Options Indexes FollowSymLinks
order allow,deny
allow from all
<IfModule mod_php5.c>
@areski
areski / playriak.py
Created January 9, 2015 16:25
Play with Riak - Python
#
# Play with Riak
#
import riak
myClient = riak.RiakClient(pb_port=8087, protocol='pbc')
myBucket = myClient.bucket('test')
val1 = 1
@areski
areski / outbound_async_server_test
Created February 8, 2011 19:10
more on outbound_async_server_test
python outbound_async_server_test.py
2011-02-08 20:08:44,895 outbound_async_server_test[15489]: INFO: Start server ('127.0.0.1', 8084) ...
2011-02-08 20:08:51,646 outbound_async_server_test[15489]: INFO: New request from ('127.0.0.1', 41712)
2011-02-08 20:08:51,646 outbound_async_server_test[15489]: INFO: [connect] args=''
2011-02-08 20:08:51,656 outbound_async_server_test[15489]: INFO: <CommandResponse headers=Event-Name: CHANNEL_DATA\nCore-UUID: 27f31c16-339d-11e0-bf48-834f981de622\nFreeSWITCH-Hostname: openplanet-desktop\nFreeSWITCH-IPv4: 192.168.0.5\nFreeSWITCH-IPv6: ::1\nEvent-Date-Local: 2011-02-08 20:08:51\nEvent-Date-GMT: Tue, 08 Feb 2011 19:08:51 GMT\nEvent-Date-Timestamp: 1297192131647364\nEvent-Calling-File: mod_event_socket.c\nEvent-Calling-Function: parse_command\nEvent-Calling-Line-Number: 1786\nChannel-Username: 1000\nChannel-Dialplan: XML\nChannel-Caller-ID-Name: Areski\nChannel-Caller-ID-Number: 1000\nChannel-Network-Addr: 192.168.0.5\nChannel-ANI: 1000\nChannel-Destination-Number: 55555\nCh
@areski
areski / test_outbound
Created February 8, 2011 18:19
Telephonie failed with AttributeError
python outbound_sync_server_test.py
2011-02-08 19:17:56,286 outbound_sync_server_test[14999]: INFO: Start server ('127.0.0.1', 8084) ...
2011-02-08 19:18:03,592 outbound_sync_server_test[14999]: INFO: New request from ('127.0.0.1', 40567)
2011-02-08 19:18:03,593 outbound_sync_server_test[14999]: INFO: [connect] args=''
Traceback (most recent call last):
File "/home/areski/.virtualenvs/telephonie/lib/python2.6/site-packages/gevent/greenlet.py", line 405, in run
result = self._run(*self.args, **self.kwargs)
File "outbound_sync_server_test.py", line 62, in do_handle
self._handle_class(socket, address, self.log, filter=self._filter)
File "outbound_sync_server_test.py", line 15, in __init__
@areski
areski / gist:908000
Created April 7, 2011 15:27
telephonie - hangup event
# -*- coding: utf-8 -*-
from telephonie.core.inboundsocket import InboundEventSocket
from telephonie.core.errors import ConnectError
from telephonie.utils.logger import StdoutLogger
import gevent.event
class MyEventSocket(InboundEventSocket):
def __init__(self, host, port, password, filter, log=None):
InboundEventSocket.__init__(self, host, port, password, filter)
self.log = log