Skip to content

Instantly share code, notes, and snippets.

View w22gb8's full-sized avatar

w22gb8 w22gb8

View GitHub Profile
@darren
darren / rtp_http.go
Last active May 7, 2024 06:59
最简单的Go代码实现联通的iptv转换为HTTP流, 实现类似udpxy的功能
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"os"
"strings"
@felix021
felix021 / tunnel.go
Created January 6, 2021 18:29
A fast secure tunnel written in Golang
package main
import (
"crypto/md5"
"crypto/rand"
"errors"
"flag"
"fmt"
"io"
"net"
@felix021
felix021 / socks5_proxy.go
Created November 21, 2020 08:12
Minimal socks5 proxy implementation in Golang
package main
import (
"encoding/binary"
"errors"
"fmt"
"io"
"net"
)
@nanmu42
nanmu42 / pkcs7padding.go
Last active March 5, 2026 20:38
Golang PKCS7 Padding/Unpadding
// pkcs7strip remove pkcs7 padding
func pkcs7strip(data []byte, blockSize int) ([]byte, error) {
length := len(data)
if length == 0 {
return nil, errors.New("pkcs7: Data is empty")
}
if length%blockSize != 0 {
return nil, errors.New("pkcs7: Data is not block-aligned")
}
padLen := int(data[length-1])
@tavinus
tavinus / rem_proxmox_popup.sh
Last active December 22, 2024 00:21
Remove PROXMOX 5.x / 6.x / 7.3-4 subscription message popup
#!/bin/sh
#######################################################
#
# Edits the proxmox Subscription file to make it
# think that it has a Subscription.
#
# Will disable the annoying login message about
# missing subscription.
#
@hackerb9
hackerb9 / extract_cookies.sh
Last active December 2, 2025 08:45 — forked from spk/extract_cookies.sh
Extract cookies.sqlite to cookies.txt for use in wget or curl.
#!/bin/bash -e
# extract_cookies.sh:
#
# Convert from Firefox's cookies.sqlite format to Netscape cookies,
# which can then be used by wget and curl. (Why don't wget and curl
# just use libsqlite if it's installed?)
# USAGE:
#
# $ extract_cookies.sh > /tmp/cookies.txt
@technoknol
technoknol / ip-range-CIDR-to-IP-list.php
Last active September 25, 2024 06:59
IP Range CIDR to ALL IP LIST
<?php
// IP Range CIDR to ALL IP LIST
// e.g. 220.78.168.0/21 to all IP list Range
$start_ip = '220.78.168.0';
$prefix = '28';
$ip_count = 1 << (32 - $prefix);
$start = ip2long($start_ip);
for ($i = 0; $i < $ip_count; $i++) {
echo $ip = long2ip($start + $i) . '<br />';
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active January 13, 2026 08:29
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@5t111111
5t111111 / email_zpool_status.py
Created September 15, 2013 16:01
Send alert-email via Gmail when FreeNAS ZPool fails.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import socket
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import formatdate
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""