This file contains hidden or 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 coroutine = coroutine; | |
local tonumber = tonumber; | |
local string = string; | |
local setmetatable, getmetatable = setmetatable, getmetatable; | |
local pairs = pairs; | |
local deadroutine = coroutine.create(function() end); | |
coroutine.resume(deadroutine); |
This file contains hidden or 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 setmetatable = setmetatable; | |
local pcall = pcall; | |
local type = type; | |
local t_concat = table.concat; | |
local print = print; | |
local socket_url = require "socket.url"; | |
local http = require "socket.http"; | |
local ltn12 = require "ltn12"; |
This file contains hidden or 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 | |
/** | |
* A command line interface for automatic downloads of image feeds | |
* | |
* @package easypopulate | |
* @author Waqas Hussain | |
* @copyright 2010 | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License (v2 only) | |
*/ |
This file contains hidden or 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
-- Prosody IM | |
-- Copyright (C) 2008-2009 Matthew Wild | |
-- Copyright (C) 2008-2009 Waqas Hussain | |
-- | |
-- This project is MIT/X11 licensed. Please see the | |
-- COPYING file in the source package for more information. | |
-- | |
local datamanager = require "util.datamanager"; | |
local log = require "util.logger".init("usermanager"); |
This file contains hidden or 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 st = require "util.stanza"; | |
local lxp = require "lxp"; | |
-- XML parser | |
local parse_xml = (function() | |
local ns_prefixes = { | |
["http://www.w3.org/XML/1998/namespace"] = "xml"; | |
}; | |
local ns_separator = "\1"; |
This file contains hidden or 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
== Pseudo-code for a new caps hash algorithm == | |
- Not susceptible to trivial preimage attacks | |
- No escaping required | |
- Can be implemented efficiently | |
- Pseudo-code uses functional primitives, but easily translatable to non-functional languages (like C) | |
- No undefined edge cases, everything fully specified, including when attributes/elements are missing or duplicated | |
- 'ver' based on JSON-isque delimiters, using null byte '\0' as escape | |
- Possibly controversial aspects: | |
- Concious decision to not fail on missing required elements/attributes |
This file contains hidden or 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 st, uuid = require "util.stanza", require "util.uuid"; | |
local xmlns_cmd = "http://jabber.org/protocol/commands"; | |
local states = {} | |
local _M = {}; | |
function _cmdtag(desc, status, sessionid, action) | |
local cmd = st.stanza("command", { xmlns = xmlns_cmd, node = desc.node, status = status }); |
This file contains hidden or 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
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua | |
--- a/util/sasl_cyrus.lua | |
+++ b/util/sasl_cyrus.lua | |
@@ -97,6 +97,9 @@ | |
local data; | |
if self.mechanism then | |
+ if self.mechanism == "PLAIN" then | |
+ message = (message or ""):match("(%z.*)"); | |
+ end |
This file contains hidden or 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
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua | |
--- a/util/sasl_cyrus.lua | |
+++ b/util/sasl_cyrus.lua | |
@@ -97,6 +97,9 @@ | |
local data; | |
if self.mechanism then | |
+ if self.mechanism == "PLAIN" then | |
+ message = (message or ""):match("(%z.*)"); | |
+ end |
This file contains hidden or 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
-- expects XML file as first argument | |
-- call in a loop over all files | |
-- e.g., on windows I can do: for %x in (xml\*.xml) do @ j2offline.lua %x | |
-- prosody stuff needs to be on LUA_PATH and LUA_CPATH, or add it here: | |
package.path = "../?.lua;"..package.path; | |
package.cpath = "../?.dll;../?.so;"..package.cpath; | |
prosody = { } |