Skip to content

Instantly share code, notes, and snippets.

View jamesmacwhite's full-sized avatar

James #FFFFFF jamesmacwhite

View GitHub Profile
@jamesmacwhite
jamesmacwhite / m190411_125323_craft2_focal_point_fields.php
Last active April 11, 2019 21:26
Migrate Craft 2 focal point field data
<?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use craft\db\Query;
/**
* m190411_125323_craft2_focal_point_fields migration.
@jamesmacwhite
jamesmacwhite / m190412_182837_tablemaker_update_fieldtype.php
Created April 12, 2019 18:36
Field type migration for Table Maker for Craft 2 to Craft 3 migrations
<?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use supercool\tablemaker\fields\TableMakerField;
/**
* m190412_182837_tablemaker_update_fieldtype migration.
@jamesmacwhite
jamesmacwhite / m190416_110112_update_retour_widget_type.php
Created April 16, 2019 11:13
Migration for updating Retour widget from Craft 2
<?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use nystudio107\retour\widgets\RetourWidget;
/**
* m190416_110112_update_retour_widget_type migration.

Keybase proof

I hereby claim:

  • I am jamesmacwhite on github.
  • I am jamesmacwhite (https://keybase.io/jamesmacwhite) on keybase.
  • I have a public key whose fingerprint is 7E6F 9A74 C332 D284 8B14 80CA BCB2 5A84 0CFB 1C8E

To claim this, I am signing this object:

@jamesmacwhite
jamesmacwhite / nanobox-net-share-manual.md
Last active January 29, 2020 23:54
Nanobox and manually fixing failed mounting on Windows

Nanobox manual mounting of codebase folder

Sometimes Nanobox will fail to mount the codebase of an app through the usual nanobox run command. This will lead to a constant loop of attempting to mount the codebase folder before Nanobox gives up after a few tries, despite entering the correct password. If you look at the logs, this will often be due to a host is down error.

This can often because the mount has not been correctly set. You can do this manually, by running net share as per:

https://github.com/nanobox-io/nanobox/blob/a512a85c181cab4ca454456a915bee5147796a8b/util/provider/share/share_windows.go#L81

The syntax is:

@jamesmacwhite
jamesmacwhite / README.md
Last active December 5, 2020 09:44
Modifying Google Chrome policies with examples for Windows and MacOS

How to override Google Chrome Cloud policies

Google Chrome Managed by somecompany.com? Is your organisation forcing extensions or specific Chrome settings in your work profile that are just getting in the way? NOT ANYMORE. Time to fight the cloud with machines policies!

It should be obvious, but you will need either full administrator or sudo rights to do this. Obviously if you are trying to do this on a managed machine controlled by your organisation, don't be a noob. If however you find some organisation policies creeping in on personal or non managed devices. RISE UP. Follow the guidance below, depending on your environment, the instructions and payload needed differ.

DISCLAIMER: If you get in trouble or your arse fired for subverting organisational policies, RIP, but these are just the tools required, you have to use them, so it is on you. BUT YOU WANT THAT SWEET INCOGNITO MODE THO RIGHT?

Why do organisations typically block incognito mode? Well... Because Google Chrome extensions can't track

Removing metadata from MP4 files

Often MP4 files will have metadata such as titles, comments and other data stored behind the media file. In some cases you'll never notice it, but some media players such as VLC, will use the information like titles and display them. In addition to media players, media organisers like Plex, may also use the metadata information, depending on if "local file information" is treated with a higher priority than indexers like The Movie DB or The TV DB.

Using mp4box (part of GPAC) provides a way to remove standard metadata information from an MP4 file, essentially rewriting the MP4 container, without modifying the original stream.

In place metadata removal

This will remove the metadata from the file in place, a file with out_ is created temporarily for the new ISO data to be written, once completed it will overwrite the original source file.

@jamesmacwhite
jamesmacwhite / apc-powerchute-business-edition-log4j-CVE-mitigation.bat
Last active January 1, 2022 21:15
APC PowerChute Business Edition 10.x Log4j CVE mitigation (CVE-2021- 44228 CVE-2021- 45046)
:: CVE-2021-44228 and CVE-2021-45046 mitigation for APC PowerChute Business Edition 10.x
:: Reference: https://www.se.com/ww/en/download/document/SESB-2021-347-01/
:: This batch script must be run as administrator and have 7-Zip installed.
@echo off
cd "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\lib"
net stop apcpbeagent
"C:\Program Files\7-Zip\7z.exe" d log4jcore-2.14.1.jar JndiLookup.class -r
net start apcpbeagent
@jamesmacwhite
jamesmacwhite / schannel_enable_tls1.2.reg
Last active January 23, 2022 11:05
Reg file for disable anything below TLS 1.2 for both servers and clients via SCHANNEL. This will also enable TLS 1.2 for server and client.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client]
"DisabledByDefault"=dword:00000001
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server]
"DisabledByDefault"=dword:00000001
"Enabled"=dword:00000000
@jamesmacwhite
jamesmacwhite / DotNetFrameworkTlsSettings.reg
Created January 23, 2022 11:18
Configure .NET Framework to support strong cryptography and allows .NET to use the OS configuration for TLS
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v2.0.50727]
"SystemDefaultTlsVersions"=dword:00000001
"SchUseStrongCrypto"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"SystemDefaultTlsVersions"=dword:00000001
"SchUseStrongCrypto"=dword:00000001