Skip to content

Instantly share code, notes, and snippets.

@rosco-pc
rosco-pc / x11_cursor.md
Last active July 22, 2022 16:11
X11 cursor on hdpi screens

The default X cursor font exists both as a bitmap font (file cursor.pcf.gz) and as a Type 1 font (file cursor.pfa). The recipe provided below makes the bitmap font unavailable to the system and turns the font name cursor into an alias for the appropriately rescaled Type 1 font (via the fonts.alias file).

  • TODO: figure out how to make this permanent so sysupgrade will not overwrite the changes

  • rm /usr/X11R6/lib/X11/fonts/misc/cursor.pcf.gz to remove the bitmap font

  • mkfontdir /usr/X11R6/lib/X11/fonts/misc/ to remove the bitmap font from the font directory.

  • Create the file /usr/X11R6/lib/X11//Type1/fonts.alias with the following contents, adjusting 801 to the desired cursor size.

    echo "cursor -xfree86-cursor-medium-r-normal--0-801-0-0-p-0-adobe-fontspecific" > /usr/X11R6/lib/X11//Type1/fonts.alias

  • mkfontdir /usr/X11R6/lib/X11/fonts/Type1/ to install the new Type1 font.

  • fc-cache -r and re-login to make the Type 1 font available to the system.

@rosco-pc
rosco-pc / unifi.md
Last active April 22, 2024 14:13
Unifi commands.md

Unifi AP useful commands

using SSH:

  • log in to AP: $ ssh ubnt@<IP>
  • default username & password: ubnt & ubnt

Generic

Command Example Function
@rosco-pc
rosco-pc / cbr2cbz.py
Created March 11, 2021 12:10
convert CBR to CBZ
#!/usr/bin/env python
import sys
import os
import shutil
import tempfile
import rarfile
import zipfile