Skip to content

Instantly share code, notes, and snippets.

@piaverous
piaverous / setup_ssh_agent_with_apple_keychain.sh
Last active April 26, 2022 01:31
A simple bash snippet to add to your .bashrc or .zshrc in order to easily load password protected SSH Keys from the Apple Keychain, and never worry about them again !
###
# SSH keys setup with Apple keychain
###
if [ -z "$SSH_AUTH_SOCK" ] && [ -z "$SSH_AGENT_PID" ]; then
# If no SSH Agent is running, start one and load keys from Apple keychain
eval `ssh-agent -s` &> /dev/null
ssh-add --apple-load-keychain &> /dev/null
else
if [ -z "$(ssh-add -l | grep SHA256)" ]; then
# If agent is running but has no keys, load keys from Apple keychain
@dmikusa
dmikusa / cfenv.sh
Last active August 29, 2015 14:02
A handy function that you can add to your profile for managing connections to different CloudFoundry instances.
function cfenv () {
function curenv () {
if [ "$1" == "" ]; then
CURENV="default"
else
CURENV="$(echo "$1" | cut -d '-' -f 2)"
fi
}
function listenvs () {
echo "Listing available environments..."
@AstonJ
AstonJ / gist:2896818
Created June 8, 2012 16:47
Install/Upgrade Ruby on CentOS 6.2
#get root access
$su -
$ cd /tmp
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel