Skip to content

Instantly share code, notes, and snippets.

@memreflect
memreflect / README.md
Last active April 8, 2024 03:00
Sway/Wayland screen locker

Requirements

  • [swayidle][]
  • [swaylock][]
  • any shell supporting sh syntax and execution of tasks in the background (job control is not necessary); just make sure that you fix the path to the shell at the top of the script if it isn't /bin/sh

Installation

@memreflect
memreflect / go.mod
Last active May 31, 2021 08:12
Print memory segments in current process with wx or rwx permissions using procstat(1) on FreeBSD
module printwx
go 1.16
require github.com/mattn/go-isatty v0.0.13
@memreflect
memreflect / Makefile.diff
Last active September 8, 2020 09:50
Patch providing options to enable/disable QtHelp or HTML documentation for devel/cmake-doc port
Index: /usr/ports/devel/cmake-doc/Makefile
===================================================================
--- /usr/ports/devel/cmake-doc/Makefile (revision 547972)
+++ /usr/ports/devel/cmake-doc/Makefile (working copy)
@@ -16,15 +16,24 @@
DISTINFO_FILE= ${.CURDIR}/../cmake/distinfo
+OPTIONS_DEFAULT= HTML
+OPTIONS_MULTI= FORMAT
@memreflect
memreflect / errval.c
Created July 22, 2020 04:33
Bounded line input routine `get_line`
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "errval.h"
static char const* errstrings[] = {
[ErrOK] = "no error",
[ErrIO] = "I/O error",
[ErrMore] = "more data available",
@memreflect
memreflect / poudriere-ncurses.sh
Created May 10, 2020 20:14
Install devel/ncurses into a Poudriere jail, so ports can be built against it
# Path to packages/xxx/All
PKGS=/usr/local/poudriere/data/packages/12amd64/All
# Name of ZFS pool containing Poudriere jail
ZPOOL=zpool
# Path to jail, without ZPOOL/ prefix
JAIL=poudriere/jails/12amd64
#
# End of customizable variables
#