Skip to content

Instantly share code, notes, and snippets.

View budgester's full-sized avatar

Martin Stevens budgester

View GitHub Profile
budgester@thor ~ $ docker images --digests
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
python 3.10.4-slim sha256:557745c5e06c874ba811efe2e002aff21b6cc405b828952fcfa16dea52d56dbb 56cb06bdaede 7 months ago 125MB
343327909574.dkr.ecr.eu-west-1.amazonaws.com/python-test 3.10.4-slim sha256:b4473ae501f273874a4379f489ea0270dd4dd479d26c72d6d520fb4e717493c6 56cb06bdaede 7 months ago 125MB
343327909574.dkr.ecr.eu-west-2.amazonaws.com/python-test2 3.10.4-slim sha256:b4473ae501f273874a4379f489ea0270dd4dd479d26c72d6d520fb4e717493c6 56cb06bdaede 7 months ago 125MB
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
post {
success{
slackSend channel: "#budgester-alerts", color: "good", message: "Deploy (<https://budgester.com|Budgester>) : (<${env.BUILD_URL}|Open>)"
}
failure {
slackSend channel: "#budgester-alerts", color: "danger", message: "Deploy (<https://budgester.com|Budgester>) : (<${env.BUILD_URL}|Open>)"
}
cleanup {
cleanWs()
}
psql -h <hostname or ip address> -p <port number> -d <database> -U <username>
aws cognito-idp list-users --user-pool-id ***** --query 'Users[]' | jq -r '.[] | [.UserStatus, .Attributes[2].Value] | @tsv' | sort
@budgester
budgester / Jenkinsfile.groovy
Created October 5, 2021 13:12 — 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"
@budgester
budgester / gist:5ef21fdfb4eb705930b621c325b7b072
Last active November 24, 2023 15:38
Search and Replace
Your find should look like that to avoid sending directory names to sed:
find ./ -type f -exec sed -i -e 's/apple/orange/g' {} \;
Delete lines in file
find ./ -type f -exec sed -i -e '/email/d' {} \;
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class,
Jenkins.instance,
null,
null
);
for (c in creds) {
println( ( c.properties.privateKeySource ? "ID: " + c.id + ", UserName: " + c.username + ", Private Key: " + c.getPrivateKey() : ""))
}
for (c in creds) {
### Keybase proof
I hereby claim:
* I am budgester on github.
* I am budgester (https://keybase.io/budgester) on keybase.
* I have a public key ASCAAwDvXJxzauxKKrMT9Yf3-2Jx_m-Me6TX0Yv-hhOnGgo
To claim this, I am signing this object:
@budgester
budgester / celery.sh
Created January 21, 2020 15:06 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),