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
var sip = require('sip'); | |
var sys = require('sys'); | |
var redis = require('redis'); | |
//Trim leading and trailing whitespace from string values. | |
function trim(str) { | |
return str.replace(/^\s+|\s+$/g, ''); | |
} | |
sip.start({},function(request) { |
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
--http://wiki.wireshark.org/Lua/Examples | |
-- voip.lua | |
-- Written by: Jason Garland <jgarland@jasongarland.com> | |
print("Starting voip.lua script.") | |
rex = require "rex_pcre" | |
--MySQL database connection |
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
import sys | |
import logging | |
import getpass | |
from optparse import OptionParser | |
import sleekxmpp | |
from sleekxmpp.xmlstream import ET, tostring | |
# Python versions before 3.0 do not use UTF-8 encoding |
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
var lineLayer = new OpenLayers.Layer.Vector("Line Layer"); | |
map.addLayer(lineLayer); | |
map.addControl(new OpenLayers.Control.DrawFeature(lineLayer, OpenLayers.Handler.Path)); | |
var points = new Array( | |
new OpenLayers.Geometry.Point(lon1, lat1), | |
new OpenLayers.Geometry.Point(lon2, lat2) | |
); | |
var line = new OpenLayers.Geometry.LineString(points); |
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
--- | |
# The common tasks | |
- name: copy yum repo files | |
copy: src={{ item }} dest=/etc/yum.repos.d/ | |
with_items: | |
- epel.repo | |
- epel-openstack-grizzly.repo | |
- name: Create the GPG key for EPEL |
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
def start_server(host, port, keyfile, level): | |
paramiko_level = getattr(paramiko.common, level) | |
paramiko.common.logging.basicConfig(level=paramiko_level) | |
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True) | |
server_socket.bind((host, port)) | |
server_socket.listen(BACKLOG) | |
while True: |
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
ls /sys/class/net/bond0/ | |
addr_assign_type addr_len broadcast dev_id duplex flags ifindex link_mode operstate queues slave_eth3 statistics tx_queue_len uevent | |
address bonding carrier dormant features ifalias iflink mtu power slave_eth2 speed subsystem type |
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
var tracker = Piwik.getTracker( '{{PIWIK_URL}}', '1' ); | |
var info = tracker.getVisitorInfo(); | |
var optin = false; | |
var alreadyTracking = info[0] != '1' || info[3] > 0; | |
if (!alreadytracking) { | |
optin = confirm( 'Opt-in to use cookies?' ); | |
} | |
if (optin || alreadyTracking) { |
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
nosetests --exe --nocapture -vv | |
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] | |
test_connection (test.WebSocketTest) ... ok | |
test_no_action (test.WebSocketTest) ... ERROR | |
test_websocket_http_fail (test.WebSocketTest) ... ok | |
====================================================================== | |
ERROR: test_no_action (test.WebSocketTest) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): |
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
#!KAMAILIO | |
debug=4 | |
log_facility=LOG_LOCAL7 | |
log_name="kamailio" | |
mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/" | |
loadmodule "sl.so" | |
loadmodule "pv.so" | |
loadmodule "tm.so" | |
loadmodule "tmx.so" |