Skip to content

Instantly share code, notes, and snippets.

@System-Glitch
System-Glitch / generate_blocks.sh
Last active January 4, 2026 07:13
Tutorial for bitcoin regtest
# Script to generate a new block every minute
# Put this script at the root of your unpacked folder
#!/bin/bash
echo "Generating a block every minute. Press [CTRL+C] to stop.."
address=`./bin/bitcoin-cli getnewaddress`
while :
do
@pryorda
pryorda / ceph.conf.txt
Last active October 17, 2020 06:55
Ceph BlueStore Config Options
root@prod-ceph-node5:~# cat /etc/ceph/ceph.conf |egrep -i '(blue|read)'
bluestore default buffered read = true
osd disk threads = 12
filestore op threads = 12
bluestore compression mode = none
bluestore min alloc size ssd = 4096
bluestore min alloc size hdd = 4096
root@prod-ceph-node5:~#
@panta
panta / logging.go
Last active May 27, 2025 21:01
zerolog with file log rotation (lumberjack) and console output
package logging
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"io"
)
@jult
jult / jbt-rules.cf
Last active November 25, 2025 16:18
SpamAssassin rules
# Put this file under /etc/spamassassin/ and run an sa-update or reload amavis etc.
#
#--------------------------------------------------
# The only RBL I trust, UCEPROTECT1 (single IP, not IP-ranges or entire ISPs) http://uceprotect.net
#--------------------------------------------------
header RCVD_IN_UCEPROTECT1 eval:check_rbl_txt('uceprotect1', 'dnsbl-1.uceprotect.net')
describe RCVD_IN_UCEPROTECT1 Listed in dnsbl-1.uceprotect.net
tflags RCVD_IN_UCEPROTECT1 net
score RCVD_IN_UCEPROTECT1 1.8
@nakov
nakov / ECDSA-secp256k1-example.java
Last active January 12, 2026 03:35
ECDSA with secp256k1 in Java: generate ECC keys, sign, verify
import org.bouncycastle.util.encoders.Hex;
import org.web3j.crypto.*;
import java.math.BigInteger;
public class ECCExample {
public static String compressPubKey(BigInteger pubKey) {
String pubKeyYPrefix = pubKey.testBit(0) ? "03" : "02";
String pubKeyHex = pubKey.toString(16);
String pubKeyX = pubKeyHex.substring(0, 64);
@yellowbyte
yellowbyte / dynamic_loading.c
Last active July 12, 2024 07:58
example of using dlopen and dlsym to dynamically resolve call to `puts`. String reference to `puts` is also obfuscated.
// how to compile: gcc dynamic_loading.c -o dynamic_loading -ldl
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
#include <string.h>
int main(int argc, char **argv) {
void *handle;
void (*go)(char *);
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@tscholl2
tscholl2 / aes.go
Last active August 20, 2025 15:02
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@fxkraus
fxkraus / debian-install-megacli.md
Last active November 17, 2025 08:56
Install LSI MegaCli .deb package on Debian/Ubuntu

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
@naoto-ogawa
naoto-ogawa / MyLog02.hs
Created May 24, 2017 13:27
a small sample (the smallest ?) of MonadLogger
{-
a small sample (the smallest ?) of MonadLogger
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module MonadLoggerSample where
import Control.Monad.Logger