Skip to content

Instantly share code, notes, and snippets.

View shubhamsre's full-sized avatar
🎯
Focusing

Shubh shubhamsre

🎯
Focusing
View GitHub Profile
@Dufgui
Dufgui / gist:72debe81068bf3ecd7d8
Last active April 25, 2023 14:34 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@mfdj
mfdj / wildcard_ssl_certificate.sh
Last active October 29, 2022 11:08
Bash script that uses openssl to generate a wildcard certificate suitable for use in a local testing environment: not vetted for a production/public internet purposes. Usage: `$ ./wildcard.sh yourdomain.local` — generates a private key, certificate request, and ssl certificate.
#!/usr/bin/env bash
DOMAIN=$1
if [ -z "$DOMAIN" ]; then
echo -n 'Enter root domain (no www): '
read input_d
DOMAIN=$input_d
fi
@seveas
seveas / gitconfig.sh
Created April 20, 2012 20:47
Git config from ldap (/etc/profile.d/gitconfig.sh)
# Set git user/email based on ldap values
test -x /usr/bin/git || return
test -x /usr/bin/ldapsearch || return
git config --global user.name > /dev/null || {
name=$(ldapsearch -x -LLL "(uid=$USER)" cn | sed -ne 's/^cn: //p')
test -n "$name" && git config --global user.name "$name"
}