Skip to content

Instantly share code, notes, and snippets.


Wudi wudi

Block or report user

Report or block wudi

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 balance_udp_packet_dispath.patch
diff --git a/src/network/ReactorThread.c b/src/network/ReactorThread.c
index e3aac4f5..a9617ff3 100644
--- a/src/network/ReactorThread.c
+++ b/src/network/ReactorThread.c
@@ -197,14 +197,14 @@ static int swReactorThread_onPackage(swReactor *reactor, swEvent *event)
pkt.port = ntohs(info.addr.inet_v4.sin_port);
pkt.addr.v4.s_addr = info.addr.inet_v4.sin_addr.s_addr;
- = pkt.addr.v4.s_addr;
+ = pkt.port;
wudi / aes_enc_dec.php
Created Jul 11, 2019 — forked from turret-io/aes_enc_dec.php
AES encryption/decryption in PHP
View aes_enc_dec.php
// DEFINE our cipher
define('AES_256_CBC', 'aes-256-cbc');
// Generate a 256-bit encryption key
// This should be stored somewhere instead of recreating it each time
$encryption_key = openssl_random_pseudo_bytes(32);
// Generate an initialization vector
// This *MUST* be available for decryption as well
wudi /
Last active May 23, 2019 — forked from htp/
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host:" \
--header "Origin:" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
wudi /
Last active May 8, 2019
Swoole Issues
View gist:8fbf2f067974c2d67251be5bff4c76d2
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
      • Centralized locking can be based on this K/V store.
View Price-Time Matching Engine.c
* QuantCup 1: Price-Time Matching Engine
* Submitted by: voyager
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
wudi /
Last active Sep 16, 2019 — forked from stefanfoulis/
How to sync svn to git
#!/usr/bin/env bash
# Run this script inside a SVN checkout of the project
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
wudi /
Last active Dec 26, 2018
clean elasticsearch expired data
#!/usr/bin/env bash
#Copyright (C) 2018 Eagle <>
SEVEN_DAYS_AGO=$(date -d "-7 day" +%Y.%m.%d)
THREE_DAYS_AGO=$(date -d "-3 day" +%Y.%m.%d)
declare -a INDEX_FOR_SEVEN=(
# A script to enable TCP BBR on a Linux system.
# @author Dumitru Uzun (DUzun.Me)
# @version 1.0.0
# @distro ArchLinux/Manjaro
old_cc=`sysctl net.ipv4.tcp_congestion_control | awk -F= '{print $2}' | sed -e s/\^\\s//`
wudi / closure_in_extension.c
Created Aug 14, 2018
closure in extension include USE
View closure_in_extension.c
/* laravel extension for PHP */
# include "config.h"
#include "php.h"
#include "ext/standard/info.h"
#include "php_laravel.h"
You can’t perform that action at this time.