Skip to content

Instantly share code, notes, and snippets.

View jan-bar's full-sized avatar
🤡
It's me!

janbar jan-bar

🤡
It's me!
  • None
  • China
View GitHub Profile
@jan-bar
jan-bar / proxy.go
Created May 14, 2024 08:21
proxy server
package main
import (
"bufio"
"bytes"
"errors"
"flag"
"fmt"
"io"
"log"
@jan-bar
jan-bar / win32.go
Last active December 7, 2022 09:49 — forked from nathan-osman/win32.go
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@jan-bar
jan-bar / Golang-IP-to-CIDR-1.go
Last active November 9, 2022 03:26 — forked from P-A-R-U-S/Golang-IP-to-CIDR
Go: Convert IP to CIDR
// Convert IPv4 range into CIDR
// https://blog.ip2location.com/knowledge-base/how-to-convert-ip-address-range-into-cidr/
func iPv4RangeToCIDRRange(ipStart string, ipEnd string) (cidrs []string, err error) {
cidr2mask := []uint32{
0x00000000, 0x80000000, 0xC0000000,
0xE0000000, 0xF0000000, 0xF8000000,
0xFC000000, 0xFE000000, 0xFF000000,
0xFF800000, 0xFFC00000, 0xFFE00000,
@jan-bar
jan-bar / 7-zip-build.bat
Last active December 5, 2021 08:10 — forked from myfreeer/7-zip-build.bat
7-zip build script
@echo off
setlocal EnableExtensions EnableDelayedExpansion
pushd "%~dp0"
:Download_7zip
set version=7z1803
appveyor DownloadFile https://www.7-zip.org/a/%version%-src.7z
7z x %version%-src.7z
:Patch