Skip to content

Instantly share code, notes, and snippets.

View clue's full-sized avatar

Christian Lück clue

View GitHub Profile
@clue
clue / TimeoutConnector.php
Last active April 6, 2017 12:36
TimeoutConnector skeleton
<?php
namespace React\SocketClient;
use React\SocketClient\ConnectorInterface;
use React\EventLoop\LoopInterface;
use React\Promise\Timer;
class TimeoutConnector implements ConnectorInterface
{
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
<?php
$loop = React\EventLoop\Factory::create();
$logger = new \Zend\Log\Logger();
$writer = new \Zend\Log\Writer\Syslog(array('application' => 'movim'));
$logger->addWriter($writer);
$connector = new Ratchet\Client\Factory($loop);
@clue
clue / build.sh
Created October 20, 2014 18:15
psocksd.deb
sudo apt-get install rubygems
sudo gem install fpm
sudo apt-get install wget
wget http://lueck.tv/psocksd/psocksd.phar
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
Action:ping
Response: Success
Ping: Pong
Timestamp: 1403277378.612099
@clue
clue / gist:76936f29984dc79f1fa0
Created October 20, 2014 12:39
AMI invalid action
Action: pong
Response: Error
Message: Invalid/unknown command: pong. Use Action: ListCommands to show available commands.
@clue
clue / gist:29f48b134f273efcfcfa
Created October 20, 2014 12:39
AMI CoreShowChannels
# active call from 50 -> 49
Action: CoreShowChannels
Response: Success
EventList: start
Message: Channels will follow
Event: CoreShowChannel
Channel: SIP/49-1-00000011
@clue
clue / gist:4428883931c295ec82db
Created October 20, 2014 12:38
AMI command: sip show peers
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
@clue
clue / ssl.php
Created August 31, 2014 09:46
Reproduce SSL buffering issue
<?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();
<?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();