Skip to content

Instantly share code, notes, and snippets.

@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
@MOZGIII
MOZGIII / 1.log
Last active March 31, 2019 07:41
Valgrind runs on cpal crash
==22472== Memcheck, a memory error detector
==22472== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==22472== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==22472== Command: ./target/debug/examples/crash
==22472==
==22472== Invalid write of size 8
==22472== at 0x4C367E3: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22472== by 0x9684359: memcpy (string3.h:53)
==22472== by 0x9684359: pulse_read (pcm_pulse.c:534)
==22472== by 0x4ECF9F7: ioplug_priv_transfer_areas (pcm_ioplug.c:564)
__GI_raise (@7ffff6ed8dd0..7ffff6ed8ed1:44)
__GI_abort (@7ffff6eda6c0..7ffff6eda8fc:70)
__libc_message (@7ffff6f23620..7ffff6f23907:171)
malloc_printerr (@7ffff6f2a90a..7ffff6f2a978:3)
free_check (@7ffff6f2c3b0..7ffff6f2cc5e:277)
free_check (@7ffff6f2c3b0..7ffff6f2cc5e:241)
__GI___libc_free (@7ffff6f31950..7ffff6f32781:170)
alloc::alloc::dealloc::h0de958ac6166530e (@555555599ad0..555555599b28:20)
_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Alloc$GT$::dealloc::h131e19760b84a430 (@5555555998d0..55555559990f:15)
_$LT$alloc..raw_vec..RawVec$LT$T$C$$u20$A$GT$$GT$::dealloc_buffer::h1489bef342d5e1b4 (@55555557efe0..55555557f094:41)
@MOZGIII
MOZGIII / ip-addr-show.sh
Created April 19, 2018 21:09
Print VM IP addresses with Docker for Mac
docker run -it --rm --privileged --pid=host justincormack/nsenter1 $(which ip) addr show
const readFile = path =>
new Promise<string>((resolve, reject) =>
fs.readFile(path, (err, data) => {
if (err) {
reject(err);
} else {
resolve(data.toString());
}
})
);