Skip to content

Instantly share code, notes, and snippets.

@paladin-dranser
paladin-dranser / authorizeProjectConfiguration.groovy
Last active January 14, 2021 16:45
Jenkins: Groovy script to configure Authorize Project settings
/**
* The script removes Build Authorization settings
* (Jenkins - Configure Global Security - Access Control for Builds)
* and creates:
* - Per-project 'Run as Specific User'
* - Default Project 'Run as User Who Triggered Build'
*
* Issue:
* Authorize Project plugin doesn't full support JCasC plugin configuration
* For more details, see: https://github.com/jenkinsci/authorize-project-plugin/pull/44
@tehmoon
tehmoon / iptables-reload.sh
Last active January 13, 2024 09:21
IPtables and docker reload!
#!/bin/sh
set -e
## SEE https://medium.com/@ebuschini/iptables-and-docker-95e2496f0b45
## You need to add rules in DOCKER-BLOCK AND INPUT for traffic that does not go to a container.
## You only need to add one rule if the traffic goes to the container
CWD=$(cd "$(dirname "${0}")"; pwd -P)
FILE="${CWD}/$(basename "${0}")"
@docwhat
docwhat / Jenkinsfile
Last active December 16, 2023 13:53
Example pipeline usage of the Jenkins Mask Passwords plugin
// Requires https://plugins.jenkins.io/mask-passwords to run
/**
* Runs code with secret environment variables and hides the values.
*
* @param varAndPasswordList - A list of Maps with a 'var' and 'password' key. Example: `[[var: 'TOKEN', password: 'sekret']]`
* @param Closure - The code to run in
* @return {void}
*/
def withSecretEnv(List<Map> varAndPasswordList, Closure closure) {
@agnivade
agnivade / commit-msg
Last active October 19, 2021 08:33
Bash file to check commit message structure
#!/bin/bash
#http://chris.beams.io/posts/git-commit/#seven-rules
cnt=0
while IFS='' read -r line || [[ -n "$line" ]]; do
cnt=$((cnt+1))
length=${#line}
if [ $cnt -eq 1 ]; then
# Checking if subject exceeds 50 characters
if [ $length -gt 50 ]; then
echo "Your subject line exceeds 50 characters."
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active May 15, 2024 19:11
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 21, 2024 12:57
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname