Skip to content

Instantly share code, notes, and snippets.

@deomorxsy
deomorxsy / setup-qus-rpi.md
Last active June 7, 2024 20:29
Debug a raspberry pi 3 model b v1.2 - raspberry pi 2015 on a 6.9.0-1-MANJARO LiveCD with qemu-user-static, binfmt_misc and chroot
sudo pacman -Sy yay lib32-ncurses ncurses tmux qemu-user-static qemu-user-static-binfmt neovim
setxkbmap -model abnt2 -layout br -variant abnt2

cat <<"EOF" > ~/.tmux.conf
## ~/.tmux.conf

## Use vim keybindings in copy mode
set-option -g mouse on
setw -g mode-keys vi

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@deomorxsy
deomorxsy / ccr.sh
Created April 18, 2024 22:10
ccr: check container runtime. If podman exists, set the DOCKER_HOST variable to the Podman Service systemd's socket unit file, part of Podman API. Inspired by @/rhatdan's Podman in Action
#!/usr/bin/bash
#
# ccr: check container runtime
#
checker() {
exists_wgh=$(which podman 2>&1 | grep -o "no" | head -n 1)
exists_command=$(command -v podman &>/dev/null)
# bash square bracket eval to check for empty expanded variable in a string,
@deomorxsy
deomorxsy / slim-rust-oci.md
Last active April 15, 2024 14:24
on running slim rust (and calling wasm with wasm-bindgen) binaries inside OCI containers: common return messages

slim Rust+wasm OCI Containers: common error return messages

This post covers the outcome of a multi-stage Dockerfile for Rust, which handles the app artifact binary to the last layer, discarding the build layer.

  • High-level container runtime: Podman
  • Low-level container runtime: crun
  • Trunk with wasm-bidgen as dependency for a Yew project.

OCI Setup specs:

@deomorxsy
deomorxsy / gallery-cli.md
Created April 15, 2024 02:07
find all filetype png, sort by time, newest first, grep a pattern, filter the stream of its filename and pass the filename as stdin to the sxiv image viewer.
@deomorxsy
deomorxsy / virtual_storage.md
Last active April 8, 2024 05:25
storage virtualization handling for QEMU and others

Virtual Storage for QEMU

quick notes about the different ways to handle storage virtualization for QEMU

0. mknod

[31/03/2024 10:07] mknod can be used for creating block or character special files, such asdevice nodes (special directories). It is an alternative for the powerful dd command which could wipe your root system at runtime.

@deomorxsy
deomorxsy / jar.md
Last active April 7, 2024 19:46
handling jar compressed files

Handling jar compressed files

Quick notes about handling jars on the CLI in maven projects with java. Dependencies:

  • jar
  • unzip
  • mvn

generate jar passing the directory the pom.xml is located:

; mvn package -f ./server/
@deomorxsy
deomorxsy / update-git-fork.md
Last active March 6, 2024 00:33
commands to update the git repo fork from the upstream
# check the origin
git ls-remote --get-url origin

# add remote
## for configured SSH environments as remote connection:
git remote add upstream git@github.com:{user/org}/repo.git
## for for configured HTTPS environments as remote connection:
git remote add upstream https://github.com/{user/org}/repo.git
@deomorxsy
deomorxsy / sl_port-v1.lua
Last active October 29, 2023 19:11
simple nvim lua statusline, old version, lil broken
vim.opt.laststatus = 2
vim.opt.statusline = sl_values
-- local sl_values
-- statusline functions
local function StatuslineMode()
local mode = vim.fn.mode()
if mode == 'n' then
@deomorxsy
deomorxsy / sed_varexp.md
Created October 11, 2023 22:13
sed variable expansion and its relation with delimiters (you can't use the same character for both).

source

[asari@asari nvim]$ sed -e "s/p3hp_placeholder/$roco/g" mock.lua
sed: -e expressão #1, caractere 21: opção desconhecida para o comando `s' (s///?)
[asari@asari nvim]$
[asari@asari nvim]$
[asari@asari nvim]$
[asari@asari nvim]$ sed -e "s@p3hp_placeholder@$roco@g" mock.lua
require("user.remap")
require("tools")