Skip to content

Instantly share code, notes, and snippets.

View mrhockeymonkey's full-sized avatar
😀
Making my own x-plat app with Flutter

Scott Matthews mrhockeymonkey

😀
Making my own x-plat app with Flutter
View GitHub Profile
@mrhockeymonkey
mrhockeymonkey / VimCheatsheet.md
Last active November 20, 2017 22:39
VIM cheatsheet

/ to search

? for regex search

dd to delete line

y+Move to yank

???? you can yank into seperate buffers

@mrhockeymonkey
mrhockeymonkey / Jenkinsfile
Last active April 20, 2024 01:17
Jenkins pipeline running a remote ansible playbook
#!groovy
pipeline {
agent any
//These params will be displayed for user input when running a build, They are also accepted by the API
parameters {
string(name: 'BUILD_HOSTNAME', description: 'The name of the server to build (from Mdb)')
string(name: 'ILO_IP', description: 'The IP address for the server ilo')
booleanParam(name: 'skipOneView', description: 'Skip the OneView stage?', defaultValue: false)
@mrhockeymonkey
mrhockeymonkey / gist:a0e73029b3ae1cfc1ae2f47969d3ef09
Created January 3, 2018 12:27
Trigger Jenkins build via API (with params)
$ApiUser =
$ApiToken =
$BuildTriggerToken =
#dirty hack to add trust for a cert to WinPE
& reg.exe IMPORT Z:\Control\Tools\JenkinsSelfSigned.reg
#create the required header
$bytes = [System.Text.Encoding]::ASCII.GetBytes("${ApiUser}:${ApiToken}")
$base64 = [System.Convert]::ToBase64String($bytes)
@mrhockeymonkey
mrhockeymonkey / Write-PSBoundParams.ps1
Created May 22, 2018 15:19
Show PSBoundParameter Values
$PSBoundParameters.GetEnumerator() |
ForEach-Object -Begin {
$Width = $PSBoundParameters.Keys.Length | Sort-Object | Select-Object -Last 1
} -Process {
"{0,-$($Width)} : '{1}'" -f $_.Key, ($_.Value -join ', ') |
Write-Verbose
}
@mrhockeymonkey
mrhockeymonkey / Jenkins-GitDiff.groovy
Last active March 16, 2024 02:11
Jenkins: git diff in pipeline to discover modified files
#!groovy
// https://medium.com/rocket-travel-engineering/running-advanced-git-commands-in-a-declarative-multibranch-jenkinsfile-e82b075dbc53
// Jenkins only checks out the branch for performance reasons so to be able to do more advanced git commands we need to
// also fetch master (or anything else you need)
pipeline {
agent any
stages {
stage ("info") {
when {
@mrhockeymonkey
mrhockeymonkey / InvokeSqlQuery-Legacy.ps1
Last active June 30, 2018 15:37
Invoke SQL queries the old way
# This is the old way I used to invoke sql queries.
# A better way now would be to use the SqlServer module and Invoke-SqlCommand
$tsqlQuery = @"
Select AccountName
From SUSDB.dbo.tbDownstreamServerTarget
"@
Try {
$conn.Open()
}
Catch {
@mrhockeymonkey
mrhockeymonkey / TerraformTrace.log
Created July 4, 2018 13:07
Trace log for Terraform issue
2018/07/04 13:50:53 [INFO] Terraform version: 0.11.7 41e50bd32a8825a84535e353c3674af8ce799161
2018/07/04 13:50:53 [INFO] Go runtime version: go1.10.1
2018/07/04 13:50:53 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2018/07/04 13:50:53 [DEBUG] Attempting to open CLI config file: /home/scott/.terraformrc
2018/07/04 13:50:53 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/07/04 13:50:53 [INFO] CLI command args: []string{"apply"}
2018/07/04 13:50:53 [INFO] command: empty terraform config, returning nil
2018/07/04 13:50:53 [DEBUG] command: no data state file found for backend config
2018/07/04 13:50:53 [DEBUG] New state was assigned lineage "73e74daa-be08-bfcc-39ed-cb987529f8fc"
2018/07/04 13:50:53 [INFO] command: backend initialized: <nil>
@mrhockeymonkey
mrhockeymonkey / github-release.py
Created July 10, 2018 10:57
Automating GitHub Releases
from __future__ import print_function
import json
import os
from optparse import OptionParser
import requests
import sys
import pprint
import logging as log
__author__ = 'ravi, scottm' #http://javawithravi.com/automating-github-releases-via-jenkins/
#!groovy
pipeline {
agent any
stages {
stage ("check") {
when {
branch 'master'
}
steps {
PS D:\fluffy-basson> docker network ls
NETWORK ID NAME DRIVER SCOPE
tsrtjyvcnda9 dsc_net overlay swarm
kecsl0ygqz7v ingress overlay swarm
250269d47835 nat nat local
262286df0819 none null local
PS D:\fluffy-basson> docker inspect dsc_net
[