Skip to content

Instantly share code, notes, and snippets.

View palopezv's full-sized avatar

Pedro A. López-Valencia palopezv

  • 2561 meters closer to the stars.
View GitHub Profile
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active April 4, 2024 10:29 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@palopezv
palopezv / adiantum-encryption-how-to.md
Last active January 8, 2024 09:47
How to create a LUKS partition encrypted with Adiantum, ideal for low end and older devices/computers

How to create a LUKS partition encrypted with the Adiantum scheme

Important note

  • Sector size and key size are fixed, you cannot change them!
  • You can play with the hash but using less than sha256 is irresponsible!
  • You can convert an already existing luks2 partition with cryptsetup(8).

Very low end devices or computers (say, an old Pentium, Celeron, Raspberry Pi or older SoC)

@palopezv
palopezv / mpv.conf
Last active July 31, 2023 21:20
my personal mpv windows configuration.
# 2023-08-01
# use quotes for text that may contain spaces.
term-status-msg = "Time: ${time-pos}"
#
vo = gpu-next
#
hwdec = auto
gpu-api = vulkan
gpu-context = winvk
@palopezv
palopezv / config
Last active April 16, 2023 17:14
sway config file
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
@palopezv
palopezv / py4th.py
Created January 29, 2012 15:10
Forth implementation in python
#!/usr/Util/bin/python
#
# @(#)py4th.py 1.1 94/12/06
#
# Forth in Python (py4th).
#
## This module implements a postfix interpreter class that
## can be instantiated as the inner interpreter or as a forth-ish
## interactive interpreter. The inner interpreter has two methods
## called p_compile and p_interp that are the core methods. Compile
@palopezv
palopezv / enable SMB_anonymous_share_access_in_win10.txt
Last active February 7, 2022 15:18
Enable insecure SMB (1/2/3) anonymous share access in windows 10
#
# run command in administrator mode.
#
reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters /v AllowInsecureGuestAuth /t reg_dword /d 00000001 /f
#
#
@palopezv
palopezv / gnucoreutils-aliases.sh
Last active July 2, 2021 16:04
coreutils aliases on non GNU systems
# prefer GNU version of most core utilities (interactive shell only).
#
# originally from http://tomayko.com/writings/gnu-is-killing-solaris
#
New location: https://github.com/palopezv/gnu-coreutils-aliases
@palopezv
palopezv / PKGBUILD_libtorrent-rasterbar
Created September 16, 2020 14:34
libtorrent-rasterbar PKGBUILD that fixes upstream ABI breakage
pkgname=libtorrent-rasterbar
pkgver=1.2.10
pkgrel=1
epoch=1
pkgdesc="A C++ BitTorrent library that aims to be a good alternative to all the other implementations around"
url="https://www.rasterbar.com/products/libtorrent/"
arch=('x86_64')
license=('BSD')
depends=('boost-libs')
makedepends=('boost' 'python2' 'python')
@palopezv
palopezv / rclone_mount_commands.txt
Last active March 28, 2020 17:18
mounting cloud storage with rclone
# Unix-like OSs
#
# From the command line or a script, if using systemd
#
systemd-run --scope --user --nice=10 rclone mount --vfs-cache-mode full --vfs-cache-max-age <hours>h<minutes>m --write-back-cache --option big_writes remote: /home/<user>/<target>
#
# From a session manager or an OS using a diffent process manager...
#
rclone mount --vfs-cache-mode full --vfs-cache-max-age <hours>h<minutes>m --write-back-cache --option big_writes remote: /home/<user>/<target>
#
@palopezv
palopezv / intel_gen4_gpu_linux_fix.md
Last active March 28, 2020 16:52
Intel Gen 4 mobile integrated GPU (GMA X3100 a.k.a. Crestline) Linux fix

Not needed with Linux 5.3 or later

To fix slow boot and spurious drm error with a gen 4 mobile integrated GPU (GL960, GLE960, GM965 and GME965) add the following to your kernel bootparams:

video.allow_duplicates=1 video=SVIDEO-1:d

The problem is the existence of a SVGA port, even if it is not wired out to a connector.