Skip to content

Instantly share code, notes, and snippets.

@MOZGIII
MOZGIII / incus-profile-default.yaml
Last active March 2, 2025 22:20
Some profiles for incus deployments
name: default
description: Default Incus profile
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
path: /
@MOZGIII
MOZGIII / mapAtom.ts
Created December 28, 2024 05:12
Reatom computed map
import { Atom, atom, Ctx, CtxSpy } from "@reatom/framework";
export type MapAtom<K, V> = Atom<Map<K, V>>;
export type AnyKeysShape<Key> = Key[] | Map<Key, any>;
export const buildMapAtom = <
Key,
Value,
KeysAtom extends Atom<AnyKeysShape<Key>>,
// A helper script to verify runtime upgrade execution related to polkadot-v0.9.42.
//
// - download forked-chain-local by the following url
// `https://drive.google.com/drive/folders/1_xzDs9PUSWzMj0K-GpGrTKapq7Z4a76Y?usp=share_link`
//
// - run the peer
// `./target/release/humanode-peer --chain forked-chain-local.json --alice --tmp`
//
// - run the script passing wasm code path containing updated runtime spec version
@MOZGIII
MOZGIII / certgen.sh
Last active August 19, 2024 20:03
TLS cert gen from existing key and with SANs
openssl req -x509 -new -key server.key -sha256 -days 3650 -nodes \
-out server.crt -subj "/CN=server" \
-addext "subjectAltName=DNS:server.local,DNS:server,DNS:localhost,IP:127.0.0.1"
@MOZGIII
MOZGIII / .config
Created May 25, 2023 07:08
AMDSEV kernel config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.1.0-rc4 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90400
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23400
@MOZGIII
MOZGIII / script.sh
Created May 4, 2023 03:13
Docker Install Oneliner
curl -fsSL get.docker.com | bash
/// A step in a process.
pub trait Step<Context> {
/// The next step in the process.
type NextStep: Step<Context>;
/// The error.
type Error;
/// A function to allow the step to progress.
fn progress(self, context: Context) -> Result<Self::NextStep, Self::Error>;
@MOZGIII
MOZGIII / e2e_test_extract.sh
Created October 6, 2021 16:48
One of our end-to-end tests
#!/bin/bash
set -euo pipefail
get_address() {
"$COMMAND" key inspect "$@" | grep "SS58 Address:" | awk '{print $3}'
}
# Set up command.
COMMAND="$1"
@MOZGIII
MOZGIII / cfbulkrm
Created March 29, 2021 13:26
Bulk DNS records removal from Cloudflare
#!/bin/bash
set -euo pipefail
AUTH_TOKEN="$1"
ZONE_ID="$2"
api() {
curl -sSL -H "Authorization: Bearer $AUTH_TOKEN" "$@"
}
@MOZGIII
MOZGIII / vimrc.local
Created June 21, 2019 11:30
VIM with fckn mouse support off
" /etc/vim/vimrc.local
" honor skip_defaults_vim from the master /etc/vim/vimrc file
if ! exists('skip_defaults_vim')
" Source the defaults file manually from here
source $VIMRUNTIME/defaults.vim
endif
" avoid loading the defaults twice
let g:skip_defaults_vim = 1