Skip to content

Instantly share code, notes, and snippets.

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

David Pesticcio DavidPesticcio

🚀
¯\_(ツ)_/¯
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / main.go
Created November 24, 2018 14:30 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@DavidPesticcio
DavidPesticcio / docker-passwd.txt
Created January 28, 2019 12:01
Use an insecure docker installation to force change your password as root, without exposing how.
1. Copy and paste the two lines below, followed by CTRL-D to force change your passwd on an insecure docker installation:
export X=$(cat); eval $X
ID=user_id docker run -ti --rm --privileged --name passwd --hostname passwd -v /:/rooted alpine sh -c "chroot /rooted passwd $ID" ; unset X
2. To clean up the command line history, use:
up-arrow, CTRL-U, down-arrow, ENTER