Skip to content

Instantly share code, notes, and snippets.

mybigman / paginator.go
Created September 21, 2023 12:35 — forked from alochym01/paginator.go
Create a simple Pagination - golang programming
View paginator.go
package main
import (
mybigman /
Created December 9, 2022 09:45 — forked from asukakenji/
Go (Golang) GOOS and GOARCH
mybigman /
Created December 6, 2022 07:15 — forked from pvmart/
Install arch linux on btrfs raid1
set -e
set -o pipefail
dd if=/dev/zero of=/dev/sda bs=1024 count=10
dd if=/dev/zero of=/dev/sdb bs=1024 count=10
RAM=$(free -m | awk '/Mem:/{print $2}')
mybigman / ecb.go
Created November 9, 2022 11:33 — forked from yinheli/ecb.go
golang 标准库不支持 AES/ECB/PKCS5Padding issues: 别人的补丁.
View ecb.go
package main
import (
type ecb struct {
b cipher.Block
blockSize int
mybigman / obsidian-pagebreaks.css
Created November 1, 2022 23:16 — forked from liamcain/obsidian-pagebreaks.css
Obsidian Pagebreaks
View obsidian-pagebreaks.css
Create pagebreaks in exported Obsidian PDFs.
# Heading 1
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
mybigman / blog20181109-01.cfg
Created September 26, 2022 02:12 — forked from haproxytechblog/blog20181109-01.cfg
Application-Layer DDoS Attack Protection with HAProxy
View blog20181109-01.cfg
backend per_ip_rates
stick-table type ip size 1m expire 10m store http_req_rate(10s)
mybigman / swag-podman
Created September 24, 2022 13:45 — forked from e-minguez/swag-podman
View swag-podman
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=443:proto=tcp:toport=8443 --permanent
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=443:proto=tcp:toport=8443
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=80:proto=tcp:toport=8080 --permanent
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=80:proto=tcp:toport=8080
$ sudo firewall-cmd --zone=trusted --add-service=https --permanent
$ sudo firewall-cmd --zone=trusted --add-service=https
$ sudo firewall-cmd --zone=trusted --add-service=http --permanent
$ sudo firewall-cmd --zone=trusted --add-service=http
$ sudo firewall-cmd --zone=trusted --add-masquerade
View example_binary_marshal_unmarshal_redis.go
package main
import (
redis ""
mybigman / graceful_shutdown.go
Created September 8, 2022 12:56 — forked from aladhims/graceful_shutdown.go
Graceful Shutdown Go App
View graceful_shutdown.go
package main
// operation is a clean up function on shutting down
type operation func(ctx context.Context) error
// gracefulShutdown waits for termination syscalls and doing clean up operations after received it
func gracefulShutdown(ctx context.Context, timeout time.Duration, ops map[string]operation) <-chan struct{} {
wait := make(chan struct{})
go func() {
s := make(chan os.Signal, 1)
mybigman / main.go
Created August 25, 2022 01:05 — forked from dopey/main.go
How to generate secure random strings in golang with crypto/rand.
View main.go
package main
import (