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 | |
function is_library($filename) | |
{ | |
static $libraryNames = array( | |
'/Zend/', | |
'/html2ps', | |
'/simpletest/', | |
'/phpMailer/', | |
'/dompdf', |
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
""" | |
Finds all Snom brand phones in a /24 and tells them to key in 6405 turn on the hands free speaker. | |
(6405 is an extension that plays the stock monkies sound from Asterisk) | |
""" | |
import urllib2 | |
import socket | |
import sys | |
def enumerate_snom_ips(base): |
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 ctypes | |
import ctypes.wintypes | |
import win32con | |
class GlobalHotKeys(object): | |
""" | |
Register a key using the register() method, or using the @register decorator | |
Use listen() to start the message pump |
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 os | |
import struct | |
""" | |
Crimsonland (Steam) pak file format | |
Header format: | |
50 40 4B 00 56 31 31 00 ("PAK" NUL "V11" NUL) |
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
; Detect which party hungup an Asterisk call | |
; If we (the caller) hangup after Dial() we jump directly to h | |
; Because of the 'g' option if the other party hangs up we continue on | |
exten => s,1,Set(whoHungUp=CALLER) | |
exten => s,n,Dial(IAX2/provider/${number},,g) | |
exten => s,n,Set(whoHungUp=OTHERPARTY) | |
exten => s,n,Hangup | |
exten => h,1,NoOp(whoHungUp ${whoHungUp}) |
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
BinaryFile = {} | |
BinaryFile.new = function(file) | |
return setmetatable({file=file}, {__index=BinaryFile}) | |
end | |
BinaryFile.readint32 = function(self) | |
local data = self.file:read(4) | |
return (data:byte(4) * (256^3)) + | |
(data:byte(3) * (256^2)) + |
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
local function readsection(f) | |
local colon = f:read(1) | |
if colon == nil then return nil end | |
if colon ~= ':' then error('section did not start with colon') end | |
local data = '' | |
while true do | |
local char = f:read(1) | |
if(char:byte() == 13) then | |
f:read(1) -- eat cr | |
return 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
local function setoptions(f) | |
local options = {} | |
local currentname = nil | |
local env = setmetatable({}, | |
{ | |
__index = function(self, method) | |
if method == 'set' then | |
return function(name) | |
if currentname ~= nil then | |
error('need to call "to" first') |
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
--noescape-- | |
local tag = doku.xml_tag | |
local unit = 19*2 -- Unit size, mapped straight to pixels | |
local space = 4 -- Spacing between keys (as pixels again) | |
local halfspace = space/2 | |
local doublespace = space*2 | |
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
@echo off | |
call :inputbox "Video ID" "Download Youtube video as MP3" | |
youtube-dl.exe -x --audio-format mp3 https://www.youtube.com/watch?v=%input% | |
exit /b | |
:InputBox | |
set input= | |
set heading=%~2 | |
set message=%~1 | |
echo wscript.echo inputbox(WScript.Arguments(0),WScript.Arguments(1)) >"%temp%\input.vbs" |
OlderNewer