Skip to content

Instantly share code, notes, and snippets.

@vladfau
vladfau / fast-my-keyboard.sh
Created May 14, 2020 18:16
Mac keyboard input made faaaast
#!/bin/zsh
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write -g KeyRepeat -int 1
defaults write -g InitialKeyRepeat -int 10
@vladfau
vladfau / perms-ldap.groovy
Created June 18, 2019 02:49
Jenkins Active Permissions via LDAP
def userid = User.current().id
def auths = Jenkins.instance.securityRealm.loadUserByUsername(userid)
.authorities.collect{a -> a.authority}
@NonCPS
def collectLDAPS(uid) {
println uid
return Jenkins.instance.securityRealm.loadUserByUsername(uid).authorities.collect{a -> a.authority}
}
@vladfau
vladfau / MavenBOC.groovy
Created February 16, 2019 21:34
Maven Build only Changed
import hudson.FilePath
import hudson.model.Hudson
import java.nio.file.Paths
import java.rmi.UnexpectedException
return this;
/**
* Dope thing to enhance analysis of inter-module dependencies in Maven and getting info about what was changed
@vladfau
vladfau / post.groovy
Last active October 31, 2024 10:14
Sending POST + JSON Body + Auth - Libs in Java/Groovy (e.g. create tag on GitHub)
import groovy.json.JsonOutput
import java.io.BufferedWriter
import java.io.OutputStreamWriter
import java.net.URL
import java.util.Scanner
def url = new URL("https://${github}/api/v3/repos/${org}/${repo}/git/refs")
def urlConnection = url.openConnection()
urlConnection.setDoOutput(true)
set -g default-terminal "screen-256color"
set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash...
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
set-option -g mouse on
set -g status-interval 3
set-option -g status-bg colour153
set -g status-right-length 150
set -g status-right "#[fg=colour236]| #[fg=colour25] %d %b :: #(date +%%H:%%M) "