Skip to content

Instantly share code, notes, and snippets.

View rkitover's full-sized avatar

Rafael Kitover rkitover

  • San Francisco, CA, United States
View GitHub Profile
@rkitover
rkitover / ble-setup.md
Last active May 6, 2024 23:12
Setup ble.sh for PowerShell-like history completion in bash

Setup ble.sh for PowerShell-like history completion in bash

These settings will give you PowerShell-like history completion in bash using ble.sh.

History completions will be displayed in grey, press UP-ARROW or F8 to accept the completion and ENTER.

To cancel a completion, press CTRL-K or DOWN-ARROW.

@rkitover
rkitover / upnp-port-forwards
Last active April 25, 2024 15:14
script for forwarding ports using UPnP (run every hour)
#!/bin/sh
# Set up UPnP port forwards based on a table.
#
# See: upnpc --help
#
# cron installation:
#
# mkdir -p ~/.local/bin
# cp upnp-port-forwards ~/.local/bin
@rkitover
rkitover / addendum-to-letter-to-public-defender.txt
Last active April 19, 2024 11:34
letter to my public defender
Hi Mr. Waterman,
I forgot to mention a couple of things, and it seems my letter did not go
through. I would like to meet with you for a minute at your office to hand you
the printout of my previous letter and this one.
First thing is that they edit all of my communications and often block them
entirely. A message I may want to send on an internet channel may not go through
or be edited. An email I may want to send may not go through at all or be edited
in order to offend the receiving party or delete information etc..
@rkitover
rkitover / make-zfs-filesystems
Last active February 26, 2024 11:31
zfs setup for freebsd and gentoo and/or nixos dual boot
#!/bin/sh
#
# References:
#
# "Cohabiting FreeBSD and Gentoo Linux on a Common ZFS Volume"
# https://ericmccorkleblog.wordpress.com/2016/11/15/cohabiting-freebsd-and-gentoo-linux-on-a-common-zfs-volume/
#
# "ZFS Datasets for NixOS"
# https://grahamc.com/blog/nixos-on-zfs
#
@rkitover
rkitover / systemd-237-static-libudev.patch
Last active January 22, 2024 07:42
patch to build a static libudev from systemd 237 sources
diff -ruN systemd-237/meson.build systemd-237.new/meson.build
--- systemd-237/meson.build 2018-01-28 10:58:17.000000000 -0500
+++ systemd-237.new/meson.build 2018-02-17 06:01:17.921840048 -0500
@@ -805,7 +805,7 @@
libmount = dependency('mount',
version : '>= 2.30',
- required : not fuzzer_build)
+ required : false)
@rkitover
rkitover / winedt-with-sumatra.md
Last active November 25, 2023 19:18
How to use SumatraPDF with WinEdt

How to use SumatraPDF with WinEdt

Go to Options -> Execution Modes -> PDF Viewer.

Uncheck the Auto-detect checkbox.

Click the top magnifying glass icon.

For portable SumatraPDF install:

@rkitover
rkitover / boot-linux.ps1
Last active October 22, 2023 02:15
trivial script to delete GRUB env to boot Linux
# Script to remove the GRUB environment file, resetting the default GRUB entry
# to what is usually the user's latest Linux kernel.
$grubenv = 'z:/grub/grubenv'
# Relaunch as an elevated process.
if (-not ([security.principal.windowsprincipal] [security.principal.windowsidentity]::getcurrent() `
).isinrole([security.principal.windowsbuiltInrole]::administrator) `
) {
$pwsh = [system.diagnostics.process]::getcurrentprocess().mainmodule.filename
@rkitover
rkitover / uudecode_gawk.awk
Last active September 29, 2023 17:03
fast uudecode in GNU awk and some others (like OpenBSD awk)
#!/bin/sh
# uudecode in GNU awk (and some others, like OpenBSD) decodes stdin to stdout
#
# Copyright (c) 2014, Rafael Kitover <rkitover@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@rkitover
rkitover / weston.service
Last active June 10, 2023 17:10
weston.service for systemd
[Unit]
Description=Weston Wayland compositor startup
RequiresMountsFor=/run
[Service]
User=rkitover
EnvironmentFile=-/etc/default/weston
Environment="XDG_RUNTIME_DIR=/run/user/1000"
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/dbus/user_bus_socket"
ExecStartPre=/usr/bin/sudo /bin/mkdir -p /run/user/1000/dbus
--- glib-original/meson.build 2023-05-31 01:05:34
+++ glib/meson.build 2023-05-31 04:32:57
@@ -2103,6 +2103,8 @@
libintl_deps = []
libintl_prefix = '#include <libintl.h>'
libintl = dependency('intl', required: false, allow_fallback: false)
+libiconv = dependency('iconv', required: false)
+mac_cf = dependency('appleframeworks', modules: ['CoreFoundation'], required: false)
if libintl.found()
# libintl supports different threading APIs, which may not