Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
daily-scripts
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
daily-scripts
Commits
4285f9d0
There was an error fetching the commit references. Please try again later.
Commit
4285f9d0
authored
4 weeks ago
by
Recolic
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
f323caf1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
archived/filter-syn-without-ack.py
+34
-0
34 additions, 0 deletions
archived/filter-syn-without-ack.py
mybin/ban-xunlei-d.sh
+3
-3
3 additions, 3 deletions
mybin/ban-xunlei-d.sh
with
37 additions
and
3 deletions
archived/filter-syn-without-ack.py
0 → 100644
+
34
−
0
View file @
4285f9d0
# use filter tcp.flags.syn == 1, export packet dissections as csv
import
csv
def
filter_unsynacks
(
input_csv
):
syn_packets
=
[]
synacks
=
set
()
with
open
(
input_csv
,
'
r
'
)
as
infile
:
reader
=
csv
.
reader
(
infile
)
for
row
in
reader
:
description
=
row
[
-
1
]
if
'
[SYN
'
in
description
:
src_port
=
description
.
split
(
'
>
'
)[
0
].
strip
().
split
()[
-
1
]
dst_port
=
description
.
split
(
'
>
'
)[
1
].
strip
().
split
()[
0
]
if
'
ACK]
'
in
description
:
synacks
.
add
((
src_port
,
dst_port
))
with
open
(
input_csv
,
'
r
'
)
as
infile
:
reader
=
csv
.
reader
(
infile
)
for
row
in
reader
:
description
=
row
[
-
1
]
if
'
[SYN
'
in
description
:
src_port
=
description
.
split
(
'
>
'
)[
0
].
strip
().
split
()[
-
1
]
dst_port
=
description
.
split
(
'
>
'
)[
1
].
strip
().
split
()[
0
]
if
(
src_port
,
dst_port
)
not
in
synacks
and
(
dst_port
,
src_port
)
not
in
synacks
:
print
(
row
)
# Example usage
input_csv
=
'
3l2exp2.csv
'
filter_unsynacks
(
input_csv
)
This diff is collapsed.
Click to expand it.
mybin/ban-xunlei-d.sh
+
3
−
3
View file @
4285f9d0
...
@@ -19,12 +19,12 @@ function curl_wrapped () {
...
@@ -19,12 +19,12 @@ function curl_wrapped () {
}
}
function
show_mercy
()
{
function
show_mercy
()
{
#
This is only valid after NEXT
q
B
it
T
orrent
restart
#
not valid if
q
b
it
t
orrent
is already running
local
conf_path
=
"
$
USER
/.config/qBittorrent/qBittorrent.conf"
local
conf_path
=
"
$
HOME
/.config/qBittorrent/qBittorrent.conf"
[[
-f
"
$conf_path
"
]]
&&
sed
-i
's/^BannedIPs=[, ]*[0-9a-f].*$/BannedIPs=/'
"
$conf_path
"
[[
-f
"
$conf_path
"
]]
&&
sed
-i
's/^BannedIPs=[, ]*[0-9a-f].*$/BannedIPs=/'
"
$conf_path
"
}
}
echo
"Unban all banned client, because IP might be reused by legit users... (valid
after NEXT
q
B
it
T
orrent
startup
)"
echo
"Unban all banned client, because IP might be reused by legit users... (valid
only if
q
b
it
t
orrent
is not running
)"
show_mercy
show_mercy
echo
"Checking all peers every 5 seconds..."
echo
"Checking all peers every 5 seconds..."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment