Skip to content

Instantly share code, notes, and snippets.

@gebv
gebv / Makefile
Last active July 5, 2023 03:17
Useful Makefile tasks (replenishable gist)
CHANGELOG ?= docker run --rm \
-v ${PWD}:/workdir \
-w /workdir \
quay.io/git-chglog/git-chglog
PROTOC ?= docker run --rm -u ${shell id -u} \
-v ${PWD}:/defs namely/protoc-all:1.51_1 \
-l go \
--with-validator \
-o ./ \
/*
* m1racle-poc: a basic proof of concept for the M1RACLES vulnerability in the Apple M1.
*
* This program allows you to read and write the state of the s3_5_c15_c10_1 CPU register.
*
* Please visit m1racles.com for more information.
*
* Licensed under the MIT license.
*/
@gebv
gebv / debug_handlers.go
Created February 16, 2023 20:01
Golang debug handlers
mux.HandleFunc("/debug/pprof/", pprof.Index)
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
mux.Handle("/debug/pprof/block", pprof.Handler("block"))
mux.Handle("/debug/pprof/heap", pprof.Handler("heap"))
mux.Handle("/debug/pprof/goroutine", pprof.Handler("goroutine"))
mux.Handle("/debug/pprof/threadcreate", pprof.Handler("threadcreate"))
mux.Handle("/debug/vars", expvar.Handler())
@gebv
gebv / README.md
Last active January 4, 2023 19:04
GPG and sops by mozilla
@gebv
gebv / main.go
Last active November 10, 2022 20:07
OTEL Example serialize to raw for transport
// You can edit this code!
// Click here and start typing.
package main
import (
"context"
"fmt"
"time"
"go.opentelemetry.io/contrib/propagators/b3"
@gebv
gebv / README.md
Last active September 11, 2022 01:29
Example of encode and decode a binary message from proto
# encode
echo 'foo: "bar", nested: { obj: {foo: "bar"}}' | protoc  \
  --proto_path=${PWD} \
  --encode="package.full.naem.v1.MessageFooBar" \
  ${PWD}/path/to/file.proto > message.bin
  
# decode
cat message.bin | protoc \
 --proto_path=${PWD} \
@gebv
gebv / README.md
Last active June 7, 2022 11:24
USDT for Crypto Punk. How create new wallet and uses for regular cases.

USDT can be different

  • USDT ERC20 - Ethereum (ETH) network. Hex address start with 0x...
  • USDT BEP20 - Binance Smart Chain (BSC) network. Hex address start with 0x...
  • USDT TRC20 - TRON network. Hex address start with T... (?)

How create new wallet for USDT ERC20 and USDT BEP20?

BEP20 and BEP20 based on ETH. This means that the BSC address is the same as in ETH only on different networks

Following example code in Go (use playground execute result with caution)

@gebv
gebv / README.md
Last active September 14, 2021 04:55
Get pair network interface to container name
@gebv
gebv / README.md
Created September 12, 2021 22:36
Resolve bash/shell variables. Format variables as in bash\shell