Skip to content

Instantly share code, notes, and snippets.

@hyc
hyc / idlekbd3.c
Last active May 20, 2023 22:53
Toggle keyboard backlight using OpenRGB on Lenovo Legion 7
/* Author: Howard Chu <[email protected]> 2023-05-20
*
* monitor keyboard activity and toggle keyboard backlight
* for Lenovo Legion 7 gen6.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
@hyc
hyc / ITS#9112.txt
Created October 29, 2019 05:29
Stack trace and log snippet for identifying bug in ITS#9112
The backtrace for this clearly shows that the GSSAPI library is closing a socket that doesn't belong to it.
Thread 1 (Thread 0x7fc11edfe700 (LWP 54101)):
#0 0x00007fc65e1c7207 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007fc65e1c88f8 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007fc65e1c0026 in __assert_fail_base () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007fc65e1c00d2 in __assert_fail () from /lib64/libc.so.6
@hyc
hyc / benchmark.txt
Created October 22, 2019 01:52
RandomX benchmark on 32 core Ampere eMAG ARM server
root@randomx:~/RandomX/build# ./randomx-benchmark --auto --verify
RandomX benchmark v1.1.4
- Argon2 implementation: reference
- light memory mode (256 MiB)
- JIT compiled mode
- hardware AES mode
- small pages mode
Initializing ...
Memory initialized in 1.42558 s
Initializing 1 virtual machine(s) ...
@hyc
hyc / dif.txt
Created May 30, 2019 20:47
Private testnet block versions
commit a4838d293e34ea9eb52a52183ba31ee62f54d036
Author: Howard Chu <[email protected]>
Date: Thu May 30 10:06:44 2019 +0100
debug branch
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 108de6a0c..86c44c38f 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@hyc
hyc / readwhilewriting.txt
Last active October 7, 2017 21:09
quick test with badger
[hyc@gamba dbbench]$ bin/t_lmdb
LMDB: version LMDB 0.9.70: (December 19, 2015)
Date: Sat Oct 7 19:18:38 2017
CPU: 4 * AMD A10-4600M APU with Radeon(tm) HD Graphics
CPUCache: 2048 KB
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
@hyc
hyc / gist:4422efdca16512363ef201507cd624f4
Created September 28, 2017 01:53
dbbench quick test
violino:/home/software/dbbench/bin> foreach i (*)
foreach? rm -rf /tmp/dbbench-1000/*
foreach? ./$i
foreach? end
Basho LevelDB: version 1.9
Date: Thu Sep 28 02:45:11 2017
CPU: 4 * Intel(R) Core(TM)2 Extreme CPU Q9300 @ 2.53GHz
CPUCache: 6144 KB
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
@hyc
hyc / Monero 0.9.3, local daemon
Last active August 20, 2016 22:55
New Wallet refresh time
/home/software/bitmonero/build/release.64/bin.0.9.3$ /usr/bin/time -v ./simplewallet --generate-new-wallet wall --password foobar
Creating the logger system
Monero 'Hydrogen Helix' (v0.9.3.0-release)
Logging at log level 0 to /home/software/bitmonero/build/release.64/bin.0.9.3/./simplewallet.log
List of available languages for your wallet's seed:
0 : English
1 : Spanish
2 : German
3 : Italian
4 : Portuguese
@hyc
hyc / FastRefresh.txt
Last active April 14, 2016 01:19
Wallet restore optimization
Restoring a wallet using https://github.com/LMDB/bitmonero/commit/be15f5a6d945c3926781133bca8c838d5f94a218
The blockchain had 1025121 blocks, the first block containing a txn for the wallet is 882230. So 86% of the
blockchain would have been scanned without having anything relevant.
See https://github.com/monero-project/bitmonero/issues/805 for more discussion.
violino:/home/software/bitmonero/build/debug/bin> /usr/bin/time -v ./simplewallet --restore-deterministic-wallet --wallet-file wall1 --password tester1
Creating the logger system
Monero 'Hydrogen Helix' (v0.9.4.0-be15f5a)
Logging at log level 0 to /home/software/bitmonero/build/debug/bin/./simplewallet.log
Specify Electrum seed: xxx
Some results from working with the blockchain DB on a 5400rpm HDD (WD20EARX), starting with blockchain.raw from 2015-12-19 (874830 blocks).
The blockchain.raw file is on a separate drive, an SSD.
Import using v0.9.4
2016-Apr-08 16:46:38.540175 End of file reached
2016-Apr-08 16:46:39.038292 Number of blocks imported: 874829
2016-Apr-08 16:46:39.038366 Finished at block: 874829 total blocks: 874830
2016-Apr-08 16:46:39.038984 Closing IO Service.
Command being timed: "./blockchain_import --data-dir /mnt/1/bitmo --database lmdb#nosync --verify off --input-file /home/hyc/Public/blockchain.raw"
@hyc
hyc / gist:be05ac1b5af0dccb6ac722307be61d53
Last active April 22, 2016 22:04
New Monero database schema
blocks
uint64_t (block height) -> blobdata (block_to_blob(blk))
block_info
uint64_t (block_height) -> mdb_block_info {timestamp, coins, size, difficulty, hash}
block_heights
crypto::hash -> uint64_t (block height)