Skip to content

Instantly share code, notes, and snippets.

View mgrandi's full-sized avatar

Mark Grandi mgrandi

  • Arizona, USA
View GitHub Profile
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@SMSAgentSoftware
SMSAgentSoftware / Get-WindowsVersion.ps1
Last active April 21, 2024 19:47
Finds the Windows version including Edition, Version and OS Build numbers for local or remote computers
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$true,
ValueFromPipeline=$true
)]
[string[]]$ComputerName = $env:COMPUTERNAME
)
@mikaelhg
mikaelhg / 01_pkcs12-cacerts-workaround.sh
Last active August 4, 2023 06:01
Workaround for java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
# Ubuntu 18.04 and various Docker images such as openjdk:9-jdk throw exceptions when
# Java applications use SSL and HTTPS, because Java 9 changed a file format, if you
# create that file from scratch, like Debian / Ubuntu do.
#
# Before applying, run your application with the Java command line parameter
# java -Djavax.net.ssl.trustStorePassword=changeit ...
# to verify that this workaround is relevant to your particular issue.
#
# The parameter by itself can be used as a workaround, as well.
@leodutra
leodutra / windows-10-git.md
Last active November 1, 2023 05:01
Enable long paths on Windows 10 and Git

If you run Windows 10 Home Edition you could change you Registry to enable Long Paths.

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in regedit and then set LongPathsEnabled to 1.

If you have Windows 10 Pro or Enterprise you could also use Local Group Policies.

Go to Computer Configuration > Administrative Templates > System > Filesystem in gpedit.msc, open Enable Win32 long paths and set it to Enabled.

git config --system core.longpaths true
@briangordon
briangordon / git-review-aliases.txt
Last active September 16, 2022 17:51
Aliases for code reviewing GitHub pull requests using a GitFlow/OneFlow branching model
*****************************************************************************************************************************
Introduction
The code review workflow that I prefer is to check out a feature branch, then `reset --soft` to move the branch HEAD to
just before the changes. That way I still have all of the changes in my working copy, and those exact changes are staged
for commit. My IDE will highlight the changed lines right in the editor and let me click the gutter to view a quick diff.
This is incredibly useful. But problems arise when develop has been merged into a running PR, bringing along a whole bunch
of other unrelated changes that have already been reviewed. I don't want all of those other changes to be highlighted in
my IDE, but I do want them in my working copy.
@coolreader18
coolreader18 / segfault.py
Last active March 30, 2024 08:05
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@jonbarrow
jonbarrow / archive.py
Last active April 11, 2021 04:24
Rip SMM1 course data and metadata from Nintendo's servers using NEX
'''
Credit Jonathan Barrow 2021
This will rip courses from SMM1 using NEX to automate the process
Use at your own risk, I am not resposible for any bans
Requires Python 3 and https://github.com/Kinnay/NintendoClients
Licensed under GNU GPLv3
'''
@WorryingWonton
WorryingWonton / lacewords.py
Last active July 12, 2023 07:54
Program to cheat at the iOS game Word Laces
from itertools import permutations
class LaceWords:
def __init__(self, dictionary=None, interface=None):
self.dictionary = dictionary
if not dictionary:
self.dictionary = 'scrabble_2020_dict'
self.interface = interface
if not self.interface: