Skip to content

Instantly share code, notes, and snippets.

@jimklimov
jimklimov / Jenkins-credump
Last active December 8, 2023 11:17
Jenkins script to dump credential contents
// Inspired by https://www.codurance.com/publications/2019/05/30/accessing-and-dumping-jenkins-credentials
// and https://stackoverflow.com/questions/35205665/jenkins-credentials-store-access-via-groovy
// and sources for found relevant credential classes (see their individual getters)
// Copyright (C) 2022-2023 by Jim Klimov, MIT License
import com.cloudbees.plugins.credentials.common.StandardCertificateCredentials;
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
//com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class,
@FreddieOliveira
FreddieOliveira / docker.md
Last active April 18, 2024 09:31
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@baconglucose
baconglucose / git-setup.md
Last active March 29, 2024 17:09
How to configure a repository to push to github.

Setting up git

One-time key setup procedures

SSH

Create an SSH key:

ssh-keygen -t rsa -b 4096 -C "Desired comment"
# Give the file a descriptive name.

GPG / PGP

Best Practices

  • Generate your master key only on an air-gapped PC booted from a live Linux distribution on a bootable USB drive
  • Generate your master key only with only the CERTIFY action
  • Add separate subkeys for SIGN, ENCRYPT, and AUTHENTICATE actions
  • Set an expiration date for all subkeys
  • Export your secret master key in ASCII armored output
  • Do not transfer your secret master and subkeys to a hardware authentication device UNTIL you have exported them in ASCII armored output
  • Export your secret subkeys in ASCII armored output
  • Store your exported secret master and subkeys offline, never on a PC with network access

How to GPG as a Scala OSS Maintainer

tl;dr Generate a GPG key pair (exercising appropriate paranoia). Send it to key servers. Create a Keybase account with the public part of that key. Use your keypair to sign git tags and SBT artifacts.

GPG is probably one of the least understood day-to-day pieces of software in the modern developer's toolshed. It's certainly the least understood of the important pieces of software (literally no one cares that you can't remember grep's regex variant), and this is a testament to the mightily terrible user interface it exposes to its otherwise extremely simple functionality. It's almost like cryptographers think that part of the security comes from the fact that bad guys can't figure it out any more than the good guys can.

Anyway, GPG is important for open source in particular because of one specific feature of public/private key cryptography: signing. Any published software should be signed by the developer (or company) who published it. Ideally, consu

@bk2204
bk2204 / local.sh
Created October 31, 2016 23:45
Reasonably portable technique for local variables in shell scripts
#!/bin/sh -e
# This shell script demonstrates how to use the local keyword to create
# dynamically-scoped variables in various shells. Notably, this technique works
# with AT&T ksh, as well as bash, dash, mksh, pdksh, zsh, busybox sh, and other
# Debian Policy-compliant sh implementations.
# Simple Perl-compatible testing framework. Produces TAP output.
COUNT=0
is () {
@Stanback
Stanback / nginx.conf
Last active April 5, 2024 11:40 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which