Skip to content

Instantly share code, notes, and snippets.

View jsmcnair's full-sized avatar

jsmcnair

  • Stroud, United Kingdom
View GitHub Profile
@jsmcnair
jsmcnair / arch-linux-setup.sh
Last active February 22, 2024 22:48
Arch Linux Setup
# As root
MAIN_USER=${MAIN_USER:?"Must set MAIN_USER env prior to running"}
GITHUB_USERNAME=${GITHUB_USERNAME:-"jsmcnair"}
TIMEZONE="Europe/London"
KEYS=${KEYS:-"uk"}
LOCALE=${LOCALE:"en_GB.UTF-8"}
### Localization
# Set the TZ
@jsmcnair
jsmcnair / arch-linux-arm-pi4-sd-prepare.sh
Last active November 5, 2023 14:56
Arch Linux ARM SD card configuration (Raspberry Pi 4)
# Based on https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4
# Find the disk to work with
# lsblk | grep -v loop
DISK=${DISK-"mmcblk0"}
BOOTPART=${BOOTPART-"mmcblk0p1"}
ROOTPART=${ROOTPART-"mmcblk0p2"}
# Erase all partitions on the disk and create a new layout
@jsmcnair
jsmcnair / Get-OctaneBenchScore.ps1
Last active July 31, 2019 11:32
Downloads and unzips OctaneBench, then runs 3 benchmarks and returns the average score
function Get-OctaneBenchScore {
$source = "https://render.otoy.com/downloads/a/787/7e324f5a-3598-41b2-9b07-3fbf678163af/OctaneBench_4_00c_win.zip"
$out = "C:\OctaneBench4.zip"
$obfolder = "C:\octanebench\"
$obpath = Join-Path $obfolder "OctaneBench_4_00c_win\octane-cli.exe"
$log = Join-Path $obfolder "log.txt"
if(-not (Test-Path $obpath)) {
# Download
Invoke-WebRequest -Uri $source -OutFile $out
@jsmcnair
jsmcnair / Get-CinebenchScore.ps1
Last active June 13, 2021 02:25
PowerShell Cinebench score generator
function Get-CinebenchScore {
$source = "http://http.maxon.net/pub/cinebench/CinebenchR20.zip"
$out = "C:\CinebenchR20.zip"
$cbfolder = "C:\cinebench\"
$cbpath = Join-Path $cbfolder "cinebench.exe"
$log = Join-Path $cbfolder "log.txt"
if(-not (Test-Path $cbpath)) {
# Download
Invoke-WebRequest -Uri $source -OutFile $out
@jsmcnair
jsmcnair / Set-PSUserPathEnvironmentVariables.ps1
Created September 5, 2018 09:36
Set the environment variables required to make scripts and modules installed in the user context available on the PATH by default
<#
.SYNOPSIS
Set up user environment variables for installed scripts and modules
.DESCRIPTION
PowerShell seems to be neglecting the configuration of PATH and PSMODULEPATH
enviroments in the user context when installing scripts and modules using
PackageManagement. This function set those envronment vairables up so these
are available by default.
NOTE: PSMODULEPATH is replaced, PATH is appended
#>
@jsmcnair
jsmcnair / BoxstarterVMSetup
Last active June 27, 2017 19:31
Boxstarter Setup Script
Set-ExplorerOptions -showHidenFilesFoldersDrives -showFileExtensions
# Enable-RemoteDesktop
cinst cmder
cinst sysinternals
cinst rsat
cinst git
cinst git-credential-winstore
cinst poshgit