Skip to content

Instantly share code, notes, and snippets.

View scoutman57's full-sized avatar

Shannon Warren scoutman57

View GitHub Profile
### Keybase proof
I hereby claim:
* I am scoutman57 on github.
* I am scoutman57 (https://keybase.io/scoutman57) on keybase.
* I have a public key ASA_ZypSpn1GIPUgdja25Ubp6XduLvos2dIeedTlvLlsPgo
To claim this, I am signing this object:
@scoutman57
scoutman57 / keychaincli.md
Created November 7, 2017 06:52
Storing CLI password in Keychain on Mac OS X

Secure CLI Passwords with Keychain Services on Mac OS X

Creating a Password

Dump a password into keychain. I'm using the creator/kind codes "asbl" for Ansible, but you can use any 4 character code. It's useful for doing lookups later.

$ security add-generic-password -a "root" -c "asbl" -C "asbl" -D "Ansible Vault" -s "ansible secrets" -w "secret123password456"

From man security:

@scoutman57
scoutman57 / sample_app.php
Created April 29, 2017 05:09
sample app using provided DDL
/*
Using the DDL provided, write a small PHP application that allows a user to type the title of a post in a form field and have it fetch the title and body of that post from the "posts" table.
Key items:
The solution must echo the typed field back to the user
The file must work in PHP 5.2
The DB configuration should be editable at the top of the file.
The solution must protect against XSS, SQL Injection and CSRF attacks, but should allow for HTML in the returned content.
Use any combination of procedural and OOP that you see fit
Write your code sample below:
@scoutman57
scoutman57 / ResizeLaunchpadIcons.sh
Created April 29, 2017 05:07
Resize Launchpad Icons
#Resize Launchpad icons
# To default value
# defaults delete com.apple.dock springboard-columns
# Arranging Launchpad (http://macnews.tistory.com/633)
defaults write com.apple.dock springboard-columns -int 10;
defaults write com.apple.dock springboard-rows -int 10;
killall Dock
@scoutman57
scoutman57 / vagrant plugin install script.sh
Created April 29, 2017 05:07
vagrant plugin install script
vagrant box add dummy https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box;
vagrant box add dummy https://github.com/displague/vagrant-linode/raw/master/box/linode.box;
vagrant box add dummy https://github.com/audiolize/vagrant-softlayer/raw/master/dummy.box;
vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box;
vagrant box add gce https://github.com/mitchellh/vagrant-google/raw/master/google.box;
vagrant box add dummy https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box;
vagrant box add ikoulacloud https://github.com/klarna/vagrant-cloudstack/raw/master/dummy.box;
vagrant plugin install vagrant-rackspace;
vagrant plugin install vagrant-linode;
#!/usr/bin/env ruby
puts "This program will add the OSX folder icon to your global .gitignore file."
puts "Enter the full path to your global .gitignore file."
print "Path: "
location = gets.chomp
if (location.nil?)
puts "No path specified, program exiting."
@scoutman57
scoutman57 / update_git_repos.sh
Created November 28, 2016 20:20 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@scoutman57
scoutman57 / myvpn_connect.scpt
Last active November 7, 2016 05:15
IPSec VPN Apple Script with keychain access and Google Auth integration
-- Author: Shannon Warren
-- [email protected]
-- github: scoutman57
-- Two Keychain entries will need to be create with your sensitive information
-- These two variables come from the settings inside keychain access, they need to match
set keychain_mgmt_vpn_name to "'My Company VPN'"
set keychain_mgmt_vpn_user to "user.name"
-- 1. Create a new generic password entry in Keychain Access called "WHATEVER_AnyConnect_VPN" (the name in Keychain access must match that in line 39 below) with your password for the Cisco AnyConnect VPN server.
-- 2. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility.
-- 4. Enable the above .app so it can access Accessibility
-- 5. Copy and paste a nice icon on the generic Applescript icon (I used a copy of the default AnyConnect one)
-- 6. Add the new .app to /Users/[yourshortname]/Applications with a shortcut to your Dock
-- 7. Enjoy the fast connection with no need to enter password and increased security of not having a sensitive password stored as plain text
-- 8. Run script again to close connection
-- AnyConnect now refered to as targetApp
@scoutman57
scoutman57 / fixPHPStormSSH.sh
Created November 2, 2016 01:49 — forked from cimmwolf/fixPHPStormSSH.sh
Fix PHPStorm ssh client error "Algorithm negotiation fail"
KEXALGORITHM='KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1'
ISSET_KEXALGORITHM=`grep -c "$KEXALGORITHM" /etc/ssh/sshd_config`
if [ "$ISSET_KEXALGORITHM" -eq 0 ]; then
echo "$KEXALGORITHM" >> /etc/ssh/sshd_config
sudo service ssh restart
fi