Skip to content

Instantly share code, notes, and snippets.

View mmahut's full-sized avatar
💭
return nil;

Marek Mahut mmahut

💭
return nil;
View GitHub Profile
@mmahut
mmahut / i.sh
Last active January 10, 2023 15:38
set -eu
set -o pipefail
set -x
echo "[+] Wiping disks and creating partitions..."
partprobe
wipefs -a /dev/sda
partprobe
Oct 08 08:48:59 [smash-node:Info:27] [2020-10-08 08:48:59.27 UTC] Cardano.Db tip is at empty (genesis)
Oct 08 08:48:59 [smash-node:Info:34] [2020-10-08 08:48:59.27 UTC] Running DB thread
Oct 08 08:48:59 [smash-node.fetch:Info:35] [2020-10-08 08:48:59.27 UTC] Runing Offline fetch thread
Oct 08 08:48:59 [smash-node.fetch:Info:35] [2020-10-08 08:48:59.29 UTC] fetchLoop: 192 runnable, 0 pending
Oct 08 08:48:59 [smash-node.fetch:Info:35] [2020-10-08 08:48:59.29 UTC] Pools without offline metadata: 192
Oct 08 08:48:59 [smash-node.fetch:Info:35] [2020-10-08 08:48:59.29 UTC] Request: http://
Oct 08 08:48:59 [smash-node.fetch:Warning:35] [2020-10-08 08:48:59.32 UTC] HTTP Exception: InvalidDestinationHost ""
Oct 08 08:48:59 [smash-node.fetch:Info:35] [2020-10-08 08:48:59.32 UTC] Request: http://104.198.40.237/poolmeta.json
Oct 08 08:49:03 [smash-node:Info:34] [2020-10-08 08:49:03.18 UTC] insertShelleyBlock pool info: slot 10580652, block 4791282
[root@oracle1:~]# cat /etc/crontab
SHELL=/nix/store/g9dkn6v4zz0wa71r5c2clsdw0ar53nxp-bash-4.4-p23/bin/bash
PATH=/nix/store/lhg8v3l7q4agva377wqbffirm7zlbix9-system-path/bin:/nix/store/lhg8v3l7q4agva377wqbffirm7zlbix9-system-path/sbin
NIX_CONF_DIR=/etc/nix
TOKEN=xxx
* * * * * root /nix/store/m3rg2cw5771psmpgq9dz8yrpilkjzzwi-ergo_prom/bin/ergo_prom > /var/lib/prometheus-node-exporter-text-files/ergo.prom.next; mv /var/lib/prometheus-node-exporter-text-files/ergo.prom.next /var/lib/prometheus-node-exporter-text-files/ergo.prom
[root@oracle1:~]# cat /nix/store/m3rg2cw5771psmpgq9dz8yrpilkjzzwi-ergo_prom/bin/ergo_prom
$ curl https://cutt.ly/poolmeta_json
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112763434-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-112763434-1');
</script>
# Generate this airgap image by running
# $ nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=airgap.nix
{ config, lib, pkgs, ...}:
let
cardano-node = import (builtins.fetchTarball {
url = "https://github.com/input-output-hk/cardano-node/archive/2e5269cdd356f5475b48c24bb0805d2acd9dd32d.tar.gz";
sha256 = "1031lransr2yk5wjx3bn3zmpi4k4kfahpdpn0k5fzq7gn9v4icl8";
}) {};
cardano-addresses = import (builtins.fetchTarball {
@mmahut
mmahut / gist:f016d21526c1844a6cbb54a0159fea11
Created May 4, 2020 13:03
Holo-nixpkgs new cache test
~ $ nix-store -r /nix/store/9v78r3afqy9xn9zwdj9wfys6sk3vc01d-coreutils-8.31 --option substituters https://cache.holo.host --option trusted-public-keys "cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ=" --add-root /nix/var/nix/gcroots/coreutils_test
/nix/var/nix/gcroots/coreutils_test
~ $ find /nix/var/nix/gcroots/coreutils_test/ | head
/nix/var/nix/gcroots/coreutils_test/
/nix/var/nix/gcroots/coreutils_test/libexec
/nix/var/nix/gcroots/coreutils_test/libexec/coreutils
/nix/var/nix/gcroots/coreutils_test/libexec/coreutils/libstdbuf.so
/nix/var/nix/gcroots/coreutils_test/bin
/nix/var/nix/gcroots/coreutils_test/bin/ln
/nix/var/nix/gcroots/coreutils_test/bin/split

Install card drivers

   services.pcscd.enable = true;
   services.pcscd.plugins = [ pkgs.acsccid ];
   environment.systemPackages = [ pkgs.qdigidoc ];

Verify access to the card

$ qdigidoc4
$ cat default.nix
with import <nixpkgs> {};
let
python = let
packageOverrides = self: super: {
trezor = super.trezor.overridePythonAttrs(old: rec {
version = "master";
src = ./.;
});
mahut@highhopes ~/repo/nixpkgs (master) $ cat ./pkgs/development/python-modules/trezor/default.nix
{ lib, fetchPypi, buildPythonPackage, isPy3k, python, pytest
, typing-extensions
, protobuf
, hidapi
, ecdsa
, mnemonic
, requests
, pyblake2
, click
@mmahut
mmahut / delegate_thru_jcli.md
Last active December 31, 2019 10:09
Delegate using jcli
  1. Download cardano-wallet, at https://hydra.iohk.io/jobset/Cardano/cardano-wallet#tabs-jobs find you architecture, for example ''cardano-wallet-jormungandr-linux64'' and download the latest build, for example I downloaded ''cardano-wallet-jormungandr-2019.12.23-linux64.tar.gz'.

  2. Recover your private key from your mnemonic:

$ cardano-wallet-jormungandr-2019.12.23/cardano-wallet-jormungandr mnemonic reward-credentials
Please enter your 15–24 word mnemonic sentence: ...