Skip to content

Instantly share code, notes, and snippets.

为什么关心 AS

因特网上的一个 IP 必定属于某个 AS,也就是一个自治系统。一般一个 AS 里的 IP 具有共性,比如网络质量较高或者较差,欺诈风险较高或者较低。 在使用 mtr 或者 traceroute 查看路由时,通过确认中间路由节点 IP 的 AS,可以确认路由质量。 举例说明,对于常见的 CN2 线路,通过 mtr 看到有经过 59.43.138.70,使用 whois 命令查看 IP 信息如下

~$ whois 59.43.138.70
route:          59.43.0.0/16
descr:          Chinatelecom Next Carrying Network backbone
origin:         AS4809
mnt-by: MAINT-CHINANET
@KaraRyougi
KaraRyougi / full-subnet-proxy.md
Last active December 12, 2023 14:57
IPv6 完全随机化连接

使用整段 IPv6 以避免被墙的设置方案:

服务端

假设我们拥有 2602:feda:db8::/48 这段 IPv6 地址,且该段地址被静态路由至我们的服务器。

首先配置防火墙,详略。

将整段 IPv6 地址配置至服务器:

@gugutt
gugutt / 1.md
Last active January 8, 2023 03:50
writeup

Writeup

首先运行一下 python ether_v2.py,这个程序需要输一串东西,而输各种东西都只能看到一个 You are too vegetable please try again!。试图劫持各种函数,也发现对获取程序逻辑没有太大帮助,那么还是老老实实看字节码吧。

试着反编译了一下,但是也出错。把 dis 模块的代码拷过来调试,发现程序一开始就是个大跳转,而很多不会被执行的地方也有很多非法指令。可以按照跳转的顺序输出字节码,就能得到比较容易分析的结果了。

import marshal
from opcode import *
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@aveao
aveao / bird1-bird-vultr.conf
Last active May 17, 2024 03:20
BIRD 1 and 2 configs for BGP stuffs (HE Tunnelbroker, Vultr etc)
router id [our IPv4];
protocol bgp vultr
{
local as [our ASN];
source address [our IPv4 from vultr];
import all;
export filter {
if net ~ [[the IPv4 block we want to announce]] then accept;
reject;
@holmberd
holmberd / linux-kill-pts.md
Last active April 25, 2024 15:50
Kill tty/pts sessions in Linux

Kill user tty/pts sessions in Linux

Commands

  • w: show who is logged on and what they are doing
  • who: show who is logged on
  • tty: show current users pseudo terminal
  • ps -ft pts/1: get process id for the pseudo terminal
  • pkill: signal process based on name and other attributes
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active May 20, 2024 21:37
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@pR0Ps
pR0Ps / gen-flac-visuals
Created January 22, 2017 01:54
Generates spectrogram and waveform images from flac files
#!/bin/sh
# Requires: audiowaveform (https://github.com/bbc/audiowaveform), metaflac, sox
zoom_start=60
zoom_duration=4
zoom_end=$((zoom_start + zoom_duration))
if [ $# -lt 1 ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
echo "Generates spectrogram and waveform images from flac files"
@zhuyifei1999
zhuyifei1999 / signbot.py
Last active April 15, 2022 14:53
Commons Signbot code
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# DUAL LICENSED: You are free to choose either or both of below licenses:
#
# 1.
#
# Published by zhuyifei1999 (https://wikitech.wikimedia.org/wiki/User:Zhuyifei1999)
# under the terms of Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
# https://creativecommons.org/licenses/by-sa/3.0/
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 12, 2024 19:12
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4