Skip to content

Instantly share code, notes, and snippets.

View dmcbane's full-sized avatar

H. Dale McBane dmcbane

  • Naval Information Warfare Center Atlantic
  • North Charleston, SC
View GitHub Profile
@dmcbane
dmcbane / printer.cfg
Created March 18, 2023 14:36
OctoKlipper config for Ender 3 with v4.2.7 board and BLTouch
# This file contains pin mappings for the Creality "v4.2.7" board. To
# use this config, during "make menuconfig" select the STM32F103 with
# a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
@dmcbane
dmcbane / CleanupLaunchpad.md
Last active April 4, 2024 02:33
How to remove applications from the macOS LaunchPad

How to remove applications from the macOS LaunchPad

sqlite3 $(find /private/var/folders \( -name com.apple.dock.launchpad -a -user $USER \) 2> /dev/null)/db/db "SELECT * FROM apps;"

sqlite3 $(find /private/var/folders \( -name com.apple.dock.launchpad -a -user $USER \) 2> /dev/null)/db/db "DELETE FROM apps WHERE title='APP_NAME_CASE_SENSITIVE';" && killall Dock

How to remove an icon from launchpad that does not appear in the Finder?

@dmcbane
dmcbane / init.lua
Created July 8, 2022 21:54
Hammerspoon configuration with middle button scrolling and mouse scrollwheel reversal
-- SETUP THE LOGGER
local log = hs.logger.new('macOS','debug')
-- HANDLE SCROLLING WITH MOUSE BUTTON PRESSED
local scrollMouseButton = 2
local deferred = false
overrideOtherMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(e)
-- log.d("down")
local pressedMouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber'])

Pop-OS User missing from Login Screen

After reinstalling Pop-OS on my machine, my login account wasn't visible on the login screen, but it was still fully functional when I entered my username and password. After a good bit of searching, I discovered that the installer had marked the existing accounts as system accounts. Changing them back solved the problem. This is how I made the change.

sudo vim /var/lib/AccountsService/users/<old username>

Change the line that looks like the following

@dmcbane
dmcbane / README.md
Created April 28, 2022 14:09
VMWare vmmod & vmnet build problem

VMWare vmmod & vmnet build problem

Correction for the problem with building vmmod and vmnet not building on Pop OS! I was building against kernel 5.16.19 and vmware workstation pro 16.2.3

cd /usr/lib/vmware/modules/source
sudo tar xvf vmmon.tar
sudo tar xvf vmnet.tar
@dmcbane
dmcbane / README.md
Last active May 10, 2024 11:17
Setup Ubuntu for PIN login

Setup Ubuntu for PIN Login Instead of Long Password

  • Install packages if they aren't already installed.
sudo apt install libpam-pwdfile whois
  • Backup the Original PAM Configuration File
@dmcbane
dmcbane / generating-random-names.markdown
Last active April 24, 2022 18:09
Generating Random Names
@dmcbane
dmcbane / readme.md
Created December 27, 2021 15:18
Creating an Oak texture with The Gimp

Creating an Oak texture with The Gimp

This guide was created with The Gimp version 2.10.30. It should work largely unchanged with 2.8.x versions. You'll have to adapt it significantly for earlier versions.

  1. Create a new image significantly larger (at least 20%) than what you need because this process results in an unusable margin around the outside of the image. I generally create a much larger image and then cherry pick the section that I want for my texture. My image is 3654 pixels wide and 2160 pixels high.

  2. Fill the background with the lighter base color for your piece of wood. All of the manipulations that we employ to create the grain will darken this tone. I often use something like #8d6949

    • starting background color

Universal Two Factor (U2F) Authentication for Debian 10 Buster

This document describes how I setup two factor authentication (what I know, my password, and what I have, my U2F device) on my Debian 10 laptop. My goal was to provide two factor protection for local login and for sudo authentication. The following proceedure was tested using a Google Titan version T3 and a YubiKey 4.

NOTE: While this procedure is simple, you can lock yourself out of your system if you mistype commands or skip steps. A good way to prevent this from happening is to create another user that you can use to log into your system in the event that your key file is configured incorrectly. This user should have the ability to become the root user (using su or sudo) in order to repair any mistakes that you might make. You might also want to secure one PAM authorization module (sudo, gdm-password

#! /bin/sh
#based on https://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
rreadlink() ( # Execute the function in a *subshell* to localize variables and the effect of `cd`.
target=$1 fname= targetDir= CDPATH=
# Try to make the execution environment as predictable as possible:
# All commands below are invoked via `command`, so we must make sure that `command`