Skip to content

Instantly share code, notes, and snippets.

@cmcginty
cmcginty / powershell-non-domain-remoting.md
Last active March 26, 2024 16:16
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
@cmcginty
cmcginty / linux_retro_gaming.md
Last active February 27, 2024 12:54
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
cmcginty / keypass-setup-and-sync.md
Last active October 6, 2023 14:12
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.

@cmcginty
cmcginty / p4-trigger-style-check.md
Last active September 21, 2021 23:12
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
cmcginty / badblocks.md
Last active August 5, 2021 04:45
Hard Drive Integrity Tests with Badblocks Command

Before installing a new hard drive, use the following steps to detect any IMF issues.

  1. Install badblocks tool.
brew install e2fsprogs
brew ln --force e2fsprogs
@cmcginty
cmcginty / zip_cookbook.md
Last active October 5, 2020 03:14
Zip and 7z Cookbook

List all ZIP files and their uncompressed size in a dir

find "$(pwd)" -name *.zip | while read -r; do 
  echo -n "$REPLY\t"; 
  unzip -l $REPLY | tail -1 | awk '{print $1}'; 
done

List all 7z files and their uncompressed size in a dir

@cmcginty
cmcginty / versionbump.py
Last active August 12, 2017 07:26
Command-line tool for automated software version numbering.
import sys
import click
MIN_DIGITS = 2
MAX_DIGITS = 3
@click.command()
@click.argument('version')

A General Guide to Upgrading Mint Linux

Last Updated for Mint 18

Pre-Install

  1. Backup application list
    • Menu -> Backup Tool
    • Backup software selection
    • USER/Desktop, Select All, Apply
  2. Create a new LVM partition for root
  • lvdisplay
@cmcginty
cmcginty / logitech_keymap.md
Created April 29, 2017 09:41
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
cmcginty / enable-mythweb-direct-download.md
Last active December 16, 2016 08:55
Enable Mythweb Direct Download Links on Ubuntu

Enable Mythweb Direct Download Links on Ubuntu

"The requested URL /mythweb/mythweb.pl/pl/stream/2199/1399343400 was not found on this server."

Requesting just /mythweb/mythweb.pl 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