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 | |
# THIS SCRIPT SETS UP SOME BASIC IP TABLES RULES FOR YOUR SYSTEM. | |
# YOU SHOULD BUY A BOOK AND GOOGLE TO UNDERSTAND WHAT IS GOING ON HERE. | |
# YOUR SYSTEM'S SECURITY SHOULD NOT BE LEFT UP TO A SCRIPT APPLICATION | |
# OR ME. IT IS YOUR RESPONSIBILITY TO ENSURE YOUR OWN SECURITY. | |
# THIS IS PRESENTED WITHOUT ANY WARRANTY. ANY USE OF THIS IS AT YOUR OWN RISK | |
# | |
# Written by James Finstrom (james.finstrom@schmoozecom.com) | |
# |
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
#!/usr/bin/env python | |
# Copyright (c) 2014 James Finstrom. | |
# Copyright (c) 2014 Schmoozecom Inc | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms are permitted | |
# provided that the above copyright notice and this paragraph are | |
# duplicated in all such forms and that any documentation, | |
# advertising materials, and other materials related to such | |
# distribution and use acknowledge that the software was developed by Schmoozecom. |
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
<?php | |
class US_Federal_Holidays | |
{ | |
private $year, $list; | |
const ONE_DAY = 86400; // Number of seconds in one day | |
function __construct($year = null, $timezone = 'America/Chicago') | |
{ | |
try | |
{ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# rhino_genconf | |
VERSION = "svn" | |
# Copyright 2012 James Finstrom <jfinstrom@gmail.com> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
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
#!/usr/bin/env python | |
import subprocess | |
import json | |
callerid = {} | |
speeddial = {} | |
p = subprocess.Popen(["asterisk", "-rx", "database show"], stdout=subprocess.PIPE) | |
out = p.communicate() | |
out = out[0].splitlines() | |
for line in out: | |
if line.startswith('/cidname'): |
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
#!/usr/bin/env python | |
import requests | |
data=[('res','login'),('value','1012'),('gw_addr','10.10.12.1'),('gw_port','2060'),('password','newspaper'),('submit', 'True')] | |
r = requests.post('http://192.168.182.1:2060/index.php?res=login&gw_id=1012&gw_address=10.10.12.1&gw_port=2060&gw_mac=00%3A15%3A6D%3AC9%3A46%3AA7&username=&password=&mac=54%3A35%3A30%3A8c%3Ab2%3A83&url=http%253A%252F%252Fallviewnetworksdb.com%252Flocalproject%252FpageV2%252F%253Fid%253D2056"', data=data) |
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
#!/usr/bin/env python | |
import hashlib | |
import sys | |
m = hashlib.md5() | |
for x in range(1000,9999): | |
ext = str(x) | |
m.update(ext+":asterisk:"+ext) | |
if m.hexdigest() == sys.argv[1]: | |
print ext | |
print m.hexdigest() |
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
#!/usr/bin/env python | |
# | |
# Usage: backup_hook.py <id> | |
# | |
import requests | |
import sys | |
import base64 | |
import tempfile | |
hookurl = '' | |
TMPDIR = tempfile.gettempdir() |
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
#!/usr/bin/env python | |
import sys | |
import xml.etree.ElementTree as ET | |
tree = ET.parse(sys.argv[1]) | |
root = tree.getroot() | |
version = root.find('version').text | |
description = root.find('description').text |
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
#!/usr/bin/env php | |
<?php | |
if (!@include_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { | |
include_once('/etc/asterisk/freepbx.conf'); | |
} | |
$outfile = '/tmp/report.csv'; | |
$dbh = \FreePBX::Database(); | |
$sql = "SELECT * FROM asteriskcdrdb.cdr WHERE date(calldate) >= date(now()-interval 30 day);"; | |
$stmt = $dbh->prepare($sql); | |
$stmt->execute(); |
OlderNewer