This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install-jdk12.sh | |
# Written: 2019-08-13 | |
# Author: [email protected] | |
# License: A-GPL | |
# | |
# This handy shell script downloads OpenJDK 12.02 from the OpenJDK website | |
# Inspired by some instructions from https://solarianprogrammer.com/2018/09/28/installing-openjdk-macos/ | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# audit-s3-buckets.sh | |
# David Sanabria, @Philozopher, 30-May-2019 | |
# CC-BY-SA | |
# https://creativecommons.org/licenses/by-sa/4.0 | |
# | |
# This script pulls all S3 Buckets out of S3 using the credentials that are configured | |
# for your AWS command line. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This script will create base62_encode() and base62_decode() in the current schema of a postgresql database. | |
* Give it a star if you find it useful. | |
*/ | |
CREATE OR REPLACE FUNCTION base62_encode( long_number bigint ) | |
RETURNS text | |
AS $BODY$ | |
/* | |
* base62_encode() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Make all files visible (relaunch Finder to see files) | |
defaults write com.apple.finder AppleShowAllFiles YES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ $(aws s3api list-buckets --query 'Buckets[?starts_with(Name,`my-bucket`)].[Name]' --output text) = 'my-bucket' ]]; then | |
echo "You're a genius. Now do something useful"; | |
fi | |
## Alternate Syntax | |
if [[ $(aws s3api list-buckets --query 'Buckets[?Name == `my-bucket`].[Name]' --output text) = 'my-bucket' ]]; then | |
echo "You're a specific genius. Now do something useful"; | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# CheckIP.sh | |
# Check your public IP address from the command line using Dynamic DNS | |
# Source: user "lv4tech" post to commandlinefu.com | |
# | |
# This script will display just your IP address as it appears from the | |
# CheckIP service as dyndns.com | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH_CONFIG example | |
# David Sanabria, 2017-01-24 | |
# | |
# This is an example of a personal SSH config file. You need to add this | |
# file to the ssh root directory on your computer, which is typically found in your | |
# home directory (e.g. ~/.ssh/config). You can learn more from the command line by | |
# typing "man ssh_config" from your terminal (*nix) or from my blog entry on this topic | |
# at http://bit.ly/2jX2GQr (Wordpress). | |
# | |
# You can safely delete every line in this example gist that starts with the "#" comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f ~/.ssh/config ]; then | |
#Print simple list | |
grep ~/.ssh/config -e 'Host ' | awk '{print $2}' | |
#provide list in Select form to allow quickly connecting to the target | |
select TGT in $(grep ~/.ssh/config -e 'Host ' | awk '{print $2}'); | |
do | |
ssh $TGT | |
done; | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get-ssid.sh | |
# To use these commands, identify the snippet that applies to your OS. | |
# This script currently does not check the OS version, so if you run this command you will | |
# get unexpected results. | |
# | |
## | |
## MacOS 10.10+ | |
## |