Skip to content

Instantly share code, notes, and snippets.

View martinus's full-sized avatar
😎
warp! Help, I'm trapped in a time

Martin Leitner-Ankerl martinus

😎
warp! Help, I'm trapped in a time
View GitHub Profile
@martinus
martinus / linux_for_parents.md
Last active January 7, 2024 11:10
Linux Setup for Parents

Linux Setup for Parents

Fedora Silverblue, default installation.

  • No automatic login (it's strange UI)

Automatic Updates

Set up fully automatic updates, in /etc/rpm-ostreed.conf set AutomaticUpdatePolicy=stage

@martinus
martinus / out.txt
Created December 5, 2023 16:13
chrt -i 0 make -j32 check
This file has been truncated, but you can view the full file.
Making check in src
make[1]: Entering directory '/home/martinus/git/github.com/martinus/bitcoin/src'
make[2]: Entering directory '/home/martinus/git/github.com/martinus/bitcoin/src'
make[3]: Entering directory '/home/martinus/git/github.com/martinus/bitcoin'
make[3]: Leaving directory '/home/martinus/git/github.com/martinus/bitcoin'
GEN obj/build.h
make minisketch/test
make[3]: Entering directory '/home/martinus/git/github.com/martinus/bitcoin/src'
make[3]: 'minisketch/test' is up to date.
@martinus
martinus / secp256k1-benchmark.md
Last active December 4, 2023 15:27
secp256k1 benchmark

Benchmark System

  • AMD Ryzen 9 7950X
  • ./configure CXX=clang++ CC=clang && make && ./bench
  • clang version 17.0.4 (Fedora 17.0.4-1.fc39)

master (d3e29db)

Benchmark                     ,    Min(us)    ,    Avg(us)    ,    Max(us)
@martinus
martinus / nostr.md
Created July 1, 2023 19:51
nostr proof

I'm now on #nostr: npub1yyz6z2ze997eu5pe94fmy09rfjce0gqk2u62ptq7uudjcfrmdlfs0enkcm

@martinus
martinus / dotfiles-in-git.md
Last active January 30, 2023 17:47
Dotfiles in Git

Configuration

DOTFILES=$HOME/git/martinus__dotfiles3
alias dotfiles="GIT_WORK_TREE=$HOME GIT_DIR=$DOTFILES"
alias dgit="dotfiles git"

Initializing

CPU

get CPU hot:

stress-ng -t 2200 --matrix 0 --matrix-size 128

Monitor CPU with

sudo intel-undervolt measure
@martinus
martinus / cfoa.hpp
Last active December 28, 2022 18:43
/* Fast open-addressing hash table.
*
* Copyright 2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See https://www.boost.org/libs/unordered for library home page.
*/
@martinus
martinus / NodePoolResource.h
Last active June 5, 2022 20:42
Fast & simple memory pool for node based allocators. Wohoo!
/**
* TODO
*
* Usage is like so:
*
* using CCoinsMap = std::pmr::unordered_map<COutPoint, CCoinsCacheEntry, SaltedOutpointHasher>;
* auto mr = NodePoolResource<256>(); // large enough to fit nodes size
* auto map = CCoinsMap{0, SaltedOutpointHasher{}, std::equal_to<COutPoint>{}, &mr};
*/
template <size_t MAX_BLOCK_SIZE_BYTES>
@martinus
martinus / times.h
Last active November 22, 2021 07:58
#pragma once
#include <cstddef>
#include <type_traits>
namespace basics {
class Times {
size_t m_times;
@martinus
martinus / .zshrc
Created August 17, 2021 08:18
helpful aliases for development
# cd to native directory and run the commands
run_in_venv() (
if [ -z "$VIRTUAL_ENV" ]; then
source ~/git/venv/bin/activate
fi
$@
)
# Sets CPU into a fixed state for the call, then resets it back.
bench() (