Skip to content

Instantly share code, notes, and snippets.

View Tardis07's full-sized avatar
😿
A Whisker Away

奶茶说 Tardis07

😿
A Whisker Away
View GitHub Profile
@Tardis07
Tardis07 / list_cn_ip.rb
Created August 6, 2022 08:01 — forked from quark-zju/list_cn_ip.rb
List allocated china ip addresses
View list_cn_ip.rb
#!/usr/bin/env ruby
# List latest china IPv4 list
require 'open-uri'
(ARGF.path == '-' ? open('http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest') : ARGF).lines.each do |l|
next if !l.include?('ipv4') || l.include?('*')
cc, type, start, value = l.split('|')[1, 4]
@Tardis07
Tardis07 / wipe-pts.sh
Last active July 6, 2023 03:48
kill dead ssh sessions
View wipe-pts.sh
#!/bin/bash
########
# ~ ps ax
# PID TTY STAT TIME COMMAND
# 1 ? Ss 7:05 /lib/systemd/systemd --system --deserialize 22
# 2 ? S 0:03 [kthreadd]
# 3 ? I< 0:00 [rcu_gp]
# ......
# 1787740 pts/1 S+ 0:00 grep --color=auto grep
# ~ w