Skip to content

Instantly share code, notes, and snippets.

View DavidPesticcio's full-sized avatar
🚀
¯\_(ツ)_/¯

David Pesticcio DavidPesticcio

🚀
¯\_(ツ)_/¯
View GitHub Profile
@DavidPesticcio
DavidPesticcio / jenkins.groovy
Created November 18, 2018 11:59
Jenkins bits n bobs
//all job name
jenkins.model.Jenkins.instance.items.each {
println "Job: ${it.name}"
}
//method list of Jenkins instance
jenkins.model.Jenkins.instance.class.methods.each {
println "Jenkins method: ${it.name}"
}
@DavidPesticcio
DavidPesticcio / Jenkins
Created October 6, 2018 14:48 — forked from johnbuhay/Jenkins
Jenkins | Configurations done via init.groovy.d
This file used to name this gist.
@DavidPesticcio
DavidPesticcio / Certified.Kubernetes.Application.Developer.Notes.md
Created October 3, 2018 20:01
Certified Kubernetes Application Developer Notes

Certified Kubernetes Application Developer

Kubernetes Playground

Create a namespace called 'mynamespace' and a pod with image nginx called nginx on this namespace

show

kubectl create namespace mynamespace
@DavidPesticcio
DavidPesticcio / Jenkinsfile.groovy
Created October 3, 2018 17:51 — forked from Faheetah/Jenkinsfile.groovy
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"
@DavidPesticcio
DavidPesticcio / tmux.md
Created July 4, 2018 10:06 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@DavidPesticcio
DavidPesticcio / docker-registry-delete-image.txt
Created June 28, 2018 20:47
remove images from docker registry v2.4
How to delete an image tag/image from docker registry v2.4
1) Re/Start registry with delete option enabled
Edit the config.yml
storage:
delete:
enabled: true
@DavidPesticcio
DavidPesticcio / awk.sh
Created May 31, 2018 18:55
AWK: One-liners
sed -r "/$EXCLUDING_PATTERN_1|$EXCLUDING_PATTERN_2/!s/$FIND_STRING/$REPLACE_STRING/"
@DavidPesticcio
DavidPesticcio / .gitconfig
Created May 1, 2018 14:31 — forked from rambabusaravanan/.gitconfig
Git Diff and Merge Tool - IntelliJ IDEA
# Linux
# add the following to "~/.gitconfig" file
[merge]
tool = intellij
[mergetool "intellij"]
cmd = /usr/local/bin/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
@DavidPesticcio
DavidPesticcio / clamav-notes
Created March 27, 2018 19:43 — forked from AfroThundr3007730/00-clamav-notes.sh
My notes on getting ClamAV working on CentOS 7
# How to get ClamAV working on CentOS 7
yum -y install epel-release && yum -y update
yum -y install clamav clamav-data clamav-scanner clamav-scanner-systemd clamav-server clamav-server-systemd clamav-unofficial-sigs clamav-update
cat <<EOF > /etc/clamd.d/freshclam.conf
# Automatically created by the clamav-freshclam postinst
Bytecode true
CompressLocalDatabase no
ConnectTimeout 30
@DavidPesticcio
DavidPesticcio / .bash_extras
Last active June 18, 2018 17:27
Does your wifi drop because of dodgy infrastructure or hardware?
# Put the function below in your .profile or .bashrc or other suitable file
# Name the function whatever you fancy - I chose wifi
# Change remote & delay accordingly
# Call it with no parameters, to watch and recover the existing wifi connection with feedback
# Call it with any parameter(s) to check and/or recover the existing wifi connection with feedback
# Capture some stats to a logfile as evidence of your crappy infrastructure. :-)
function wifi () {
# TODO: Use GNU date to calculate seconds instead of SECONDS