Skip to content

Instantly share code, notes, and snippets.

@leophys
leophys / HOWTO.rst
Last active April 13, 2018 08:31
Quick intro to iSCSI

iSCSI

TGT - Server side

Using tgt from tgt aur package. Following this guide from fedora.

Create a user

@leophys
leophys / git-merge-pick
Last active June 28, 2018 14:46
An extension for git to git-merge a single specified file from another revision
#!/usr/bin/env bash
usage () {
cat << EOH
git merge-pick [flags] <tree-ish> path/to/file
being <tree-ish> a commit-like object (a commit sha1,
a branch name or a tag).
[flags]
@leophys
leophys / build-tmux.sh
Last active October 19, 2018 08:38 — forked from sdygt/build-tmux.sh
HOWTO build a statically linked tmux in one script (downloads and builds dependencies from source)
#!/bin/bash
if [ -z "${TARGETDIR}" ]; then
TARGETDIR=$(realpath $PWD)
fi
NCORES=${1:-"1"}
echo "TARGETDIR=${TARGETDIR}"
echo "NCORES=${NCORES}"
FROM debian:stretch
ARG UID=1000
ENV DEBIAN_FRONTEND=noninteractive
ENV TARGETDIR="/home/builder/target"
RUN apt-get update \
&& apt-get install -y \
build-essential \
curl \
@leophys
leophys / I-still-dont-get-async-await.md
Created April 2, 2019 14:21
Tinkering with async/await in python>3.5

Async/await magic

As far as I got from the internet, the async/await stuff is a sort of paradigm enrichment of the python ecosystem. One can now access a for of concurrent execution thanks to an event loop. Much like in the browser. I'm ok with that, but I don't really get how to bridge what one knows from the classic synchronous execution workflow, so I experimented a bit. The async_iter_over_tcp.py is just a playground that can be invoked like this (ITER_TIMES defaults to 5):

@leophys
leophys / sway-coredump.1.log
Created April 9, 2020 09:43
Qt5-application-related sway coredumps
Mar 31 10:00:21 emmy sway[1514]: xkbcommon: ERROR: Couldn't read Compose file /usr/share/X11/locale/: No such device
Mar 31 10:00:21 emmy sway[1514]: [091 10:00:21.674037] [glfw error 65544]: Failed to create XKB compose table for locale
Mar 31 10:00:21 emmy sway[1514]: xkbcommon: ERROR: Couldn't read Compose file /usr/share/X11/locale/: No such device
Mar 31 10:00:21 emmy sway[1514]: [091 10:00:21.679748] [glfw error 65544]: Failed to create XKB compose table for locale
Mar 31 10:00:21 emmy sway[1514]: xkbcommon: ERROR: Couldn't read Compose file /usr/share/X11/locale/: No such device
Mar 31 10:00:21 emmy sway[1514]: [091 10:00:21.685593] [glfw error 65544]: Failed to create XKB compose table for locale
Mar 31 10:00:21 emmy sway[1514]: xkbcommon: ERROR: Couldn't read Compose file /usr/share/X11/locale/: No such device
Mar 31 10:00:21 emmy sway[1514]: [091 10:00:21.691244] [glfw error 65544]: Failed to create XKB compose table for locale
Mar 31 10:00:21 emmy sway[1514]: xkbcommon: ERROR: Couldn't read Compose
@leophys
leophys / from_aegis_to_pass.md
Last active October 6, 2020 20:40
Migrate from Aegis App to password store

From Aegis to pass

[Aegis][0] is a nice android app to manage OTP tokens. [pass][1] is the password manager for *nix systems. I know that the whole point of the two factor authentication philosophy is to physically separate the bearers of authentication information, but the lifetime of my physical devices is quite random, so WHATEVER: I concoted this procedure to copy the OTP passwords from aegis to pass.

@leophys
leophys / update_bat.sh
Created November 15, 2020 16:29
Script to update bat from the github release page for debian derivatives.
#!/usr/bin/env bash
if ! which curl > /dev/null; then
echo "You need to install curl"
exit 1
fi
if ! which jq > /dev/null; then
echo "You need to install jq"
exit 1
@leophys
leophys / How_to_raspberry_debian.md
Created January 10, 2021 20:59
How to Debian on a Raspberry Pi

Flash debian on a microSD card to be used on a raspberry pi

Download

Download from here the appropriate image.

Flash

@leophys
leophys / zfs_on_raspberry_pi_4.md
Created January 13, 2021 20:41
ZFS on raspberry pi 4

How to install ZFS on raspberry pi 4

Pin dependencies

Place this in /etc/apt/preferences.d/90_zfs:

Package: libnvpair1linux libuutil1linux libzfs2linux libzpool2linux spl-dkms zfs-dkms zfs-test zfsutils-linux zfsutils-linux-dev zfs-zed
Pin: release n=buster-backports
Pin-Priority: 990