## Usage:
## banaction = ssh-iptables[remote-host=user@192.0.2.1, type=multiport]
## banaction_allports = ssh-iptables[remote-host=user@192.0.2.1, type=allports]
[INCLUDES]
before = iptables.conf
This file contains 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/result-org.txt" "b/result-fix.txt" | |
--- "a/result-org.txt" | |
+++ "b/result-fix.txt" | |
% # with 4KB buffersize: | |
% setup { set ch [::tclTestPerf-Chan::_get_test_chan 4096]; fconfigure $ch -buffersize } | |
4096 | |
% # 10 * 1M: | |
% read $ch [expr {int(1e6)}] | |
-6757.00 µs/# 10 # 147.99 #/sec 67.570 net-ms | |
+36189.9 µs/# 10 # 27.632 #/sec 361.899 net-ms |
This file contains 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
#! /bin/sh | |
printf '%s' ' | |
#include <inttypes.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <unistd.h> |
This file contains 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
proc prepare {type args} { | |
set sp "CREATE TEMPORARY TABLE pages ( type VARCHAR(20), id VARCHAR(10), content varchar(50), PRIMARY KEY (type, id) )" | |
set spd "CREATE TEMPORARY TABLE pages_done ( type VARCHAR(20), id VARCHAR(10), PRIMARY KEY (type, id) )" | |
switch -- $type { | |
mysql { | |
package require tdbc::mysql | |
append sp " ENGINE = MEMORY"; append spd " ENGINE = MEMORY"; | |
tdbc::mysql::connection create db {*}$args | |
} | |
sqlite3 { |
This file contains 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
#!/usr/bin/env tclsh | |
# ------------------------------------------------------------------------- | |
# Script to detect following zero-width or invisible characters: | |
# | |
# LRE U+202A RLE U+202B LRO U+202D RLO U+202E LRI U+2066 RLI U+2067 FSI U+2068 PDF U+202C PDI U+2069 | |
# ZWS U+200B ZWNJ U+200C ZWJ U+200D ZWNBSP U+FEFF | |
# | |
# Copyright (c) 2016-2020 by Sergey G. Brester aka sebres | |
# ------------------------------------------------------------------------- |
This file contains 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
# | |
# IMPORTANT: | |
# note to get correct results you should warm up Tcl and Python, | |
# so better execute it 3 times before you take results for | |
# the comparison | |
## ============================================================ | |
## Tcl | |
## ============================================================ |
This file contains 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
proc parseUAG {uag} { | |
array set a {cltype "" clver "" os "" plat "" safari 0 ffox 0 chrome-compat 0 webkit-compat 0} | |
if {![regexp {^(\w+)/(\d+(?:\.\d+){0,4})\s+\((?:(\w+);(?:\s*U;)?\s*)?(\w+)\s*(\d+(?:\.\d+){0,4})} $uag _ a(cltype) a(clver) a(os) a(plat)]} { | |
regexp {^(\w+)/(\d+(?:\.\d+){0,4})\M} $uag _ a(cltype) a(clver) | |
if {![regexp {\((\w+);(?:(?:\s*U;)?\s*)?(\w+)\s*(\d+(?:\.\d+){0,4})} $uag _ a(os) a(plat)]} { | |
regexp {\((\w+);\s*(?:CPU\s+(\w+)\s+)?(?:OS\s+(\S+)\s+)(?:like\s+([^)]+))\)} $uag _ a(plat) a(cpu) a(osver) a(osdesc) | |
} | |
} | |
regexp {\mChrome/(\d+(?:\.\d+){0,4})} $uag {} a(chrome-compat) | |
regexp {\mAppleWebKit/(\d+(?:\.\d+){0,4})} $uag {} a(webkit-compat) |
This file contains 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
/* | |
* embedeval.c -- example of tcl-code embedding | |
* | |
* Compile: | |
* mingw: gcc -O2 -DUSE_TCL_STUBS=1 -I$tcl/win -I$tcl/generic embedeval.c -shared -o embedeval.dll libtclstub86.a | |
* *nix: gcc -O2 -DUSE_TCL_STUBS=1 -I$tcl/unix -I$tcl/generic embedeval.c -shared -o embedeval.so libtclstub86.a | |
* | |
* Usage: | |
* $ tclsh86 | |
* % load embedeval |
This file contains 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
hexchat.register("bot-bridge-nicks", "0.1", "Rewrites messages of bots to display bridge users as IRC users") | |
-- ijchain, ischain, liberachain are bridges: | |
botspattern = {"i.*chain", "^[<«](.-)[>»] (.*)$", "^<?(.-)>? (.*)$"} | |
botspattern2 = {"l.*chain", "^[<«](.-)[>»] (.*)$", "^%* (.-) (.*)$"} | |
local function fullname(user, nick) | |
return user:gsub("%s+", "-").."!"..user:gsub("%s+", "_").."@behind.the.bridge/"..nick | |
end |
This file contains 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
proc cm args { | |
array set in {-out auto} | |
array set in $args | |
set scr "" | |
puts -nonewline "%cm% "; flush stdout | |
while {[gets stdin line] >= 0 && ($line ni {/cm /exit} || $scr ne "")} { | |
append scr $line "\n" | |
if {![info complete $scr]} { | |
puts -nonewline " ... "; flush stdout | |
continue |
NewerOlder