Skip to content

Instantly share code, notes, and snippets.

@ephemient
ephemient / .SRCINFO
Last active January 10, 2018 02:14
nodejs-watchman-processor
pkgbase = nodejs-watchman-processor
pkgdesc = Folder synchronization tool with a simple dashboard
pkgver = 2.2.0
pkgrel = 1
url = https://github.com/markis/watchman-processor
arch = any
license = MIT
makedepends = npm
depends = nodejs
depends = rsync
@ephemient
ephemient / ⁄etc⁄systemd⁄network⁄90-wifi.network
Created January 29, 2018 19:26
systemd-networkd + wpa_supplicant integration
[Match]
Type=wlan
[Network]
DHCP=yes
[DHCP]
RouteMetric=2048
/dev/zram0 none swap defaults,pri=8192 0 0
import android.graphics.Canvas
import android.graphics.DashPathEffect
import android.graphics.Paint
import android.text.style.LineBackgroundSpan
import android.text.style.UnderlineSpan
/** Draws a dotted underline (as opposed to solid [UnderlineSpan]). */
class DottedUnderlineSpan : LineBackgroundSpan {
private val paint = Paint()
private val dashIntervals = FloatArray(2)
[Unit]
Description=Map absolute input touch device to fixed output
BindsTo=dev-input-%i.device
After=dev-input-%i.device
[Service]
Type=oneshot
ExecStart=/bin/sh -c ' \
/usr/bin/libinput list-devices | \
/usr/bin/awk \' \
#!/bin/sh
set -euo pipefail
case ${1:-0} in
0|normal) rot=normal mat=( 1 0 0 0 1 0 0 0 1) ;;
1|left) rot=left mat=( 0 -1 1 1 0 0 0 0 1) ;;
2|flip) rot=inverted mat=(-1 0 1 0 -1 1 0 0 1) ;;
3|right) rot=right mat=( 0 1 0 -1 0 1 0 0 1) ;;
*)
echo "Usage: $(basename "$0") [<0|1|2|3>|<normal|left|flip|right>]" >&2
#!/usr/bin/env python3
import contextlib, ctypes, os, pathlib, subprocess, sys
EFIVARSFS = pathlib.Path('/sys/firmware/efi/efivars')
LOADER_GUID = '4a67b082-0a4c-41cf-b6c7-440b29bb8c4f'
LOADER_ENTRY_ONE_SHOT = 'LoaderEntryOneShot'
FS_IMMUTABLE_FL = 0x00000010 # see <linux/fs.h>
try:
pkgbase = eve-v-drivers-dkms
pkgdesc = Patched drivers for Eve V
pkgver = 4.15.9
pkgrel = 1
url = https://www.kernel.org/
arch = x86_64
license = GPL2
depends = dkms
source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.15.tar.xz
source = https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.15.tar.sign
#!/bin/bash
set -euo pipefail
inhibit() {
while { read -n1 -r -s -t30 || [[ $? -gt 128 ]]; } && [[ -z ${REPLY} ]]; do
dbus-send --session --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SimulateUserActivity
done
}
if [[ $# -gt 0 ]]; then
coproc inhibit >&2
command "$@" {COPROC[0]}<&- {COPROC[1]}>&-
@ephemient
ephemient / sc.md
Created September 25, 2018 21:52
Sister cities

Source: Sister Cities of the World + Graphviz

7158 18672 2463 731 0.7578 198 0.8743

  • 7158 nodes
  • 18672 edges
  • 2463 connected components
  • 731 strongly connected components
  • 0.7578 fraction of nodes in a non-trivial strongly connected components
  • 198 maximum degree