Skip to content

Instantly share code, notes, and snippets.

View JPRuskin's full-sized avatar

James Ruskin JPRuskin

View GitHub Profile
@trey
trey / git-commit-author-rewrite.md
Last active April 26, 2024 17:52
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <email@address.com>"

or

$ git commit --amend --reset-author
@Hexalon
Hexalon / Install-WMF5.ps1
Last active June 21, 2017 12:36
Automates installation of Windows Management Framework 5
#Requires -Version 4.0
[CmdletBinding()]
Param(
[switch]$OnlineInstall = $false
)
<#
.NOTES
@JarvisPrestidge
JarvisPrestidge / Pok3r.ahk
Last active April 11, 2024 08:32
Personal AutoHotKey script that turns any keyboard into a Pok3r.
#CommentFlag //
#InstallKeybdHook
// Author: Jarvis Prestidge
// Description: Simulates my preferred keyboard layout, similiar to that of the Pok3r 60% keyboard
// on any keyboard without programmable keys. i.e. my laptop ^^
// <COMPILER: v1.1.22.00>
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 22, 2024 19:07
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@choco-bot
choco-bot / Update-AUPackages.md
Last active May 24, 2024 00:19
Update-AUPackages Report #powershell #chocolatey
@fatherjack
fatherjack / PowerShell Prompt.ps1
Last active August 23, 2019 21:32
provides some useful information to your PowerShell prompt
function Prompt {
<#
.Synopsis
Your custom PowerShell prompt
# borrowing heavily from https://dbatools.io/prompt but formatting the execution time without using the DbaTimeSpanPretty C# type
.Description
Custom prompt that includes the following features:
@Jaykul
Jaykul / Counting Lines.md
Last active December 9, 2020 17:17
PowerShell Line Counting

Lines Of Code is a useful metric

How would you count the "Lines of Code" in HowManyLines.ps1 below? Go ahead and look, I'll wait here. 😉 Do you count lines that have nothing but braces on them? Do you count opening and closing braces? Do you count the "else" line?

Apparently, PowerShell AST doesn't support Allman style 😁

If we use the Language Parser to count lines, we can take every statement's begin and end line and then count how many unique lines have code on them. But suprisingly, the else keyword doesn't show up as a token, because it's just part of the IfStatementAst ...

$Ast = [System.Management.Automation.Language.Parser]::ParseFile((Convert-Path "HowManyLines.ps1"), [ref]$Null, [ref]$Null)
@48klocs
48klocs / voltron.txt
Last active October 27, 2021 20:36
48klocs gigant0r #dimwishlists dump file
This file has been truncated, but you can view the full file.
// Mercules' Erentil FR4 breakdown
// https://www.reddit.com/r/DestinyTheGame/comments/cbxao7/massive_breakdown_of_erentil_fr4_including_stats/
// Erentil FR4
dimwishlist:item=3027844941&perks=194952923,3868766766,280464955,1600092898
dimwishlist:item=3027844941&perks=194952922,3868766766,280464955,1600092898
dimwishlist:item=3027844941&perks=194952923,2969185026,280464955,1600092898
dimwishlist:item=3027844941&perks=194952922,2969185026,280464955,1600092898
dimwishlist:item=3027844941&perks=194952923,3868766766,1645158859,1600092898
dimwishlist:item=3027844941&perks=194952922,3868766766,1645158859,1600092898
@darrenjrobinson
darrenjrobinson / Get-Unifi-Details.ps1
Last active June 30, 2023 08:28
PowerShell Script to get Ubiquiti Unifi Sites, Devices and Active Clients. Associated blogpost https://blog.darrenjrobinson.com/accessing-your-ubiquiti-unifi-network-configuration-with-powershell/
# Unifi Controller Login Base URI
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443'
# Identifier of the site in UniFi. Set to default for the default site
$uSiteID = "default"
$uUsername = 'adminuser' # yourAdmin UserID
$uPassword = 'yourPassword' # yourAdmin User Password
$uAuthBody = @{"username" = $uUsername; "password" = $uPassword }
$uHeaders = @{"Content-Type" = "application/json" }
@steviecoaster
steviecoaster / Get-DadJokeSound.ps1
Created August 30, 2019 02:04
Get-DadJokes.....WITH SOUND!!!!
function Get-DadJoke {
[cmdletBinding()]
Param()
process {
$header = @{
Accept = "application/json"
}
$joke = Invoke-RestMethod -Uri "https://icanhazdadjoke.com/" -Method Get -Headers $header