Skip to content

Instantly share code, notes, and snippets.

View imfht's full-sized avatar
🎯
Focusing

imfht imfht

🎯
Focusing
View GitHub Profile
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@Zate
Zate / get_go.sh
Last active February 5, 2024 18:19
Shell script to download and install latest golang
#! /bin/bash
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69)
# Download latest Golang release for AMD64
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')
@chmike
chmike / checkDomain.go
Last active December 1, 2023 19:21
Check domain name validity in Go
// Please use the package https://github.com/chmike/domain as is it maintained up to date with tests.
// checkDomain returns an error if the domain name is not valid.
// See https://tools.ietf.org/html/rfc1034#section-3.5 and
// https://tools.ietf.org/html/rfc1123#section-2.
func checkDomain(name string) error {
switch {
case len(name) == 0:
return nil // an empty domain name will result in a cookie without a domain restriction
case len(name) > 255:
package main
import (
"bytes"
"fmt"
"net"
"runtime"
"sync"
"sync/atomic"
"time"
@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"
)
@akkuman
akkuman / 加速创宇云反爬第二层.js
Created December 8, 2020 03:45
加速创宇云反爬第二层解密
var jsSha1 = require("js-sha1")
function go(config) {
function check() {
var userAgent = window.navigator.userAgent,
checkFlags = ['Phantom'];
for (var i = 0; i < checkFlags.length; i++) {
if (userAgent.indexOf(checkFlags[i]) != -1) {
return true;
}
@darren
darren / rtp_http.go
Last active December 13, 2023 00:50
最简单的Go代码实现联通的iptv转换为HTTP流, 实现类似udpxy的功能
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"os"
"strings"
@xen0bit
xen0bit / Dockerfile
Created October 11, 2023 04:19
CVE-2023-38545
FROM debian:latest
RUN apt-get update && apt-get install -y \
git \
build-essential \
wget \
python3
WORKDIR /build