Skip to content

Instantly share code, notes, and snippets.

cmcginty /
Last active Aug 12, 2017
Command-line tool for automated software version numbering.
import sys
import click
cmcginty /
Created Apr 29, 2017
Logitech Keyboard Mappings
if [ -n "${DISPLAY+x}" ]; then
  xmodmap -e "keycode 62 = Up"
  xmodmap -e "keycode 111 = Shift_R"
  xmodmap -e "add shift = Shift_R"
  xset r 62
  xset -r 111
  xmodmap -e "keycode 66 = Control_L"
  xmodmap -e "clear Lock"
  xmodmap -e "add Control = Control_L"
cmcginty /
Last active Jul 7, 2020
How to build a retro-gaming box with ChromeBox + Lubuntu + Retroarch

Retro-Gaming Box (Chromebox + Lubuntu + Retroarch)

A basic guide on how to setup a Chromebox running Retroarch as a retro-gaming living room device.

Chromebox Retro

Table of Contents

cmcginty /
Last active Dec 16, 2016
Enable Mythweb Direct Download Links on Ubuntu

Enable Mythweb Direct Download Links on Ubuntu

"The requested URL /mythweb/ was not found on this server."

Requesting just /mythweb/ would download the PERL script, indicating that CGI wasn't working. To get it working, I needed to make the following changes:

  1. sudo ln -s /etc/apache2/mods-available/cgi.load /etc/apache2/mods-enabled/cgi.load

  2. In /etc/apache2/mods-available/mime.conf, add:

     AddHandler cgi-script .cgi .pl
cmcginty /
Last active Jun 19, 2020
KeePass2 Password Manager Settings and Auto-Synchronization

KeePass2 Setup and Auto-Synchronization Guide

KeePass is a password management utility for Windows, Linux, and Mac.

The first section describes the steps needed to setup KeyPass2 in Linux and how to add FireFox and Chrome plugin integrations.

The (optional) second section documents a robust way to automatically synchronize the password DB across multiple devices.


Keybase proof

I hereby claim:

  • I am cmcginty on github.
  • I am cmcginty ( on keybase.
  • I have a public key whose fingerprint is CDEB 856B FAB2 2C72 CE62 3BB1 BA02 2962 0046 D260

To claim this, I am signing this object:

cmcginty /
Last active Jan 12, 2018
Perforce Python trigger to reject unmodified files and new code with TAB indents (instead of spaces).

This is a working example of a Perforce submit-change trigger that can run checks on new files and new or modified lines of code.

Tested on Python2 in Linux and Windows. It does not require the P4Python API, which would probably be a little cleaner, but makes it less portable.

The install instructions are below in the Python file. Before using, the hard-coded P4 user value builds must be created on your server, or changed to a valid user. To prevent having to set the user password in the script, the builds user must be part of a group with the Timeout field set to unlimited to allow for the user to remain logged in on the server.

cmcginty /
Last active Aug 29, 2015
Gradle DeploymentDescriptor EAR Plugin

Gradle DeploymentDescriptor EAR Plugin

Use this Gradle plugin to directly access the DeploymentDescriptor class internal to the EAR plugin.

// custom Gradle task for creating EAR deployment descriptors (i.e. application.xml)
// author:
import org.gradle.api.*
import org.gradle.api.file.*
import org.gradle.api.tasks.*
cmcginty /
Last active Aug 8, 2020
Windows Powershell Remoting into Non-Domain Joined System

Powershell Remoting to a Non-Domain Host

  1. From an admin shell, enable PS remoting on the machine you wish to access:
New-ItemProperty -Name LocalAccountTokenFilterPolicy `
  -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System `
  -PropertyType DWord -Value 1

Enable-PsRemoting -Force

A General Guide to Upgrading Mint Linux

Last Updated for Mint 18


  1. Backup application list
    • Menu -> Backup Tool
    • Backup software selection
    • USER/Desktop, Select All, Apply
  2. Create a new LVM partition for root
    • lvdisplay
You can’t perform that action at this time.