Skip to content

Instantly share code, notes, and snippets.

View keyganker's full-sized avatar
💭
I may be slow to respond.

Stephen keyganker

💭
I may be slow to respond.
View GitHub Profile
@keyganker
keyganker / killcx
Last active September 26, 2023 06:25 — forked from kisel/killcx
killcx - 关闭一个tcp链接(比tcpkill更好,因为tcpkill只有在链接有数据传输的时候才能获取到序列号来发送rst包)#perl #shell
#!/usr/bin/perl
######################################################################
# killcx :
#
# Close a TCP connection under Linux.
#
# (c) Jerome Bruandet - <floodmon@spamcleaner.org>
#
# version 1.0.3 - 18-May-2011
#
@keyganker
keyganker / mac_proxy_via_command.md
Last active September 26, 2023 06:25 — forked from jordelver/gist:3073101
Set the Mac OS X SOCKS proxy on the command line #shell

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@keyganker
keyganker / tcp_connect.stp
Created January 25, 2018 01:49 — forked from fireflyc/tcp_connect.stp
systemtap统计TCP连接数量
#!/usr/bin/stap
global connections
global filter_port = 80
//
global report
global spend_time
global active_count
global have_spend_time = 0
@keyganker
keyganker / gist:fd676069c38a4b263ba9a6292002d2ca
Created August 31, 2017 08:52 — forked from windwiny/gist:c85dd8c2571b4374f874
Linux 基于策略的路由(Linux Policy Routing)(Linux 多个网卡使用相同网段的IP地址设置)
----
Linux 基于策略的路由(Linux Policy Routing)
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部
ip rule
@keyganker
keyganker / CurlRoll.php
Last active September 26, 2023 06:27 — forked from luxixing/CurlRoll.php
php并发调用 #php
<?php
/**
* Use php curl multi, rolling request url.
*
* @author liwanghui@dratio.com
*/
class CurlRoll
{
/**