Skip to content

Instantly share code, notes, and snippets.

@SingingBush
SingingBush / godot-fedora.md
Created April 1, 2018 01:25
setting up Godot on Fedora Linux

Godot 3.0.2 (Mono Version)

Get the latest Mono

Godot requires Mono 5.4.x but the Fedora repo is still stuck on an older version. Install the latest directly from the Mono Project (currently 5.10.x).

http://www.mono-project.com/download/stable/#download-lin

rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
@SingingBush
SingingBush / .bash_profile
Last active December 8, 2017 15:11
bash profile
#
# either ~/.bashrc or ~/.bash_profile
#
#
# User specific aliases and functions
alias du='du -kshc'
alias ls='ls -lhaGF --color'
export GOPATH=$HOME/.go
@SingingBush
SingingBush / List-GitRepos.ps1
Created July 3, 2017 11:08
list local git repos using powershell
Function List-GitRepos {
<#
.SYNOPSIS
List local Git repositories
.DESCRIPTION
Use this command to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
.PARAMETER Path
The top level path to search.
.EXAMPLE
@SingingBush
SingingBush / PgpEncryption.java
Last active February 8, 2021 12:57
Spring Bean for PGP file encryption
//
// This is a variation of the example found in the Bouncy Castle Java examples on github.
// I'm using a public key provided by 3rd party to encrypt a file before sending to them. They
// have the private key so it's a one-way system, I have no need for a decrypt method. This is
// being used in a Spring Boot app, hence the annotations.
//
import org.bouncycastle.bcpg.CompressionAlgorithmTags;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.*;
@SingingBush
SingingBush / hexPhotos.ps1
Created January 11, 2017 14:55
Export VARBINARY images from a SQL Server query to jpeg files
<#
.SYNOPSIS
Script generating images from HEX values
.DESCRIPTION
Given a CSV dump of id's, usernames, and image data (HEX value of a VARBINARY field in SQL Server), generate a jpeg image for each row of csv data and also create a new csv file that lists the path of each image.
.EXAMPLE
hexPhotos.ps1 -f '.\db-dump.csv'
@SingingBush
SingingBush / gitconfig
Last active September 13, 2017 08:47
The changes I like to use in my global git config
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
@SingingBush
SingingBush / gist:fccd964259f282d85de3c0e8d74f84a8
Created June 13, 2016 14:59
Create a Java 8 Stream of Strings matching a regex on a given String
private Stream<String> regexPatternMatchStream(final String pattern, final String target) {
final Matcher matcher = Pattern.compile(pattern).matcher(target);
final Stream.Builder<String> sb = Stream.builder();
while (matcher.find()) {
sb.add(matcher.group());
}
return sb.build();
}
@SingingBush
SingingBush / deploy-war
Last active June 12, 2020 11:55
This powershell script can be used within TeamCity to deploy a Java web app (war file) to a Tomcat installation on a remote Windows Server
<#
Deployment Script (SingingBush, 9-may-2014)
Usage:
In TeamCity 'Buildstep: Powershell' make sure that script is set to file and
in 'Failure Conditions' the checkbox is ticked for: 'the build process exit code is not zero'.
YOU MUST ENSURE THAT ALL THE FOLLOWING ARGS ARE USED: