Skip to content

Instantly share code, notes, and snippets.

Christian Lück clue

Block or report user

Report or block clue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:11254932
$buffer = '';
$conn->on('data', function($data, $conn) use (&$buffer) {
$buffer .= $data;
// check to see if the buffer contains any line feeds (detect end of line)
while (false !== ($pos = strpos($buffer, PHP_EOL))) {
// get the first line from the buffer (up to the EOL)
$line = substr($buffer, 0, $pos);
// remove the line from the buffer (advance behind the EOL)
View gist:4212c21860f4078a89dc
git clone source
cd source
# list all branches that should be preserved
# only version branches listed, as to skip WIP branches
git branch 0.3 origin/0.3
git branch 0.4 origin/0.4
#master is already included (default from clone)
# remove reference from origin to speed up rewriting its references
View EnterpriseApi.php
class EnterpriseApi extends Clue\React\Soap\Proxy
public function __call($method, $args)
if (!in_array($method, array('DoAuthenticateUserWithPlaintextPassword', 'BypassTheAuthenticationFramework', 'debug'))) {
$d = new React\Promise\Deferred();
$d->reject(new \Exception('This is an enterprise API!!11'));
return $d->promise();
clue / ssl.php
Created Aug 31, 2014
Reproduce SSL buffering issue
View ssl.php
use React\SocketClient\Connector;
use React\SocketClient\SecureConnector;
use React\Socket\Server;
use React\Stream\Stream;
require __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
clue / gist:4428883931c295ec82db
Created Oct 20, 2014
AMI command: sip show peers
View gist:4428883931c295ec82db
Action: command
Command: sip show peers
Response: Follows
Privilege: Command
Name/username Host Dyn Forcerport ACL Port Status Description
100 (Unspecified) D a 0 UNKNOWN
111 (Unspecified) D a 0 UNKNOWN
1111 (Unspecified) D a 0 Unmonitored
114 (Unspecified) D a 0 UNKNOWN
View gist:29f48b134f273efcfcfa
# active call from 50 -> 49
Action: CoreShowChannels
Response: Success
EventList: start
Message: Channels will follow
Event: CoreShowChannel
Channel: SIP/49-1-00000011
View gist:76936f29984dc79f1fa0
Action: pong
Response: Error
Message: Invalid/unknown command: pong. Use Action: ListCommands to show available commands.
View gist:366bf7fa98f99d3d466b
Response: Success
Ping: Pong
Timestamp: 1403277378.612099
clue /
Created Oct 20, 2014
sudo apt-get install rubygems
sudo gem install fpm
sudo apt-get install wget
chmod 755 psocksd.phar
fpm -s dir -t deb -n psocksd -v 0.3.1 -a all -d 'php5-cli > 5.3' --license MIT ./psocksd.phar=/usr/bin/psocksd
dpkg -c psocksd_0.3.1_all.deb
sudo dpkg -i psocksd_0.3.1_all.deb
View gist:347e6a359a7fa9765d2d
$loop = React\EventLoop\Factory::create();
$logger = new \Zend\Log\Logger();
$writer = new \Zend\Log\Writer\Syslog(array('application' => 'movim'));
$connector = new Ratchet\Client\Factory($loop);
You can’t perform that action at this time.