Last active
April 14, 2022 13:42
-
-
Save grunka/f2c2532807a3afbabbf7323ab7352336 to your computer and use it in GitHub Desktop.
Fish Functions
This file contains 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
function check-cert-dates -d "Gets the start and end date for a SSL certificate on a domain" | |
echo "" | openssl s_client -servername $argv -connect $argv:443 2>/dev/null | openssl x509 -noout -dates | |
end |
This file contains 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
function connect-vpn -d "Connect to VPN with Viscosity" | |
osascript -e "tell Application \"Viscosity\" to connect \"$argv\"" | |
end |
This file contains 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
function debug-smtp -d "Start debug SMTP server" | |
sudo python -m smtpd -n -c DebuggingServer localhost:25 | |
end |
This file contains 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
function disconnect-vpn -d "Disconnect from VPN with Viscosity" | |
osascript -e "tell Application \"Viscosity\" to disconnect \"$argv\"" | |
end |
This file contains 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
function freshbrew -d "Update all Homebrew packages" | |
brew update && brew upgrade && brew cleanup | |
end |
This file contains 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
function get-functions -d "Fetches functions from gist" | |
pushd . | |
set gist f2c2532807a3afbabbf7323ab7352336 | |
set tmp (mktemp -d) | |
cd $tmp | |
gh gist clone $gist | |
cp -v $gist/*.fish ~/.config/fish/functions | |
rm -rf $gist | |
popd | |
rmdir $tmp | |
end |
This file contains 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
function kubectl-admin -d "Open up kubernetes admin interface" | |
kubectl -n kube-system describe secret (kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') | grep "^token" | awk '{print $2}' | pbcopy | |
echo "Token copied to clipboard" | |
kubectl proxy -p 18001 & | |
open "http://localhost:18001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/pod?namespace=default" | |
fg | |
end |
This file contains 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
function set-java-11 -d "Set Java 11 as current version" | |
set -gx JAVA_HOME /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home/ | |
end |
This file contains 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
function set-java-8 -d "Set Java 8 as current version" | |
set -gx JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/ | |
end |
This file contains 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
function set-java-default -d "Resets used Java to system default" | |
set -e JAVA_HOME | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment