Skip to content

Instantly share code, notes, and snippets.

View scoutman57's full-sized avatar

Shannon Warren scoutman57

View GitHub Profile
@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 / 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
-- 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 curve25519-sha256@libssh.org,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
@scoutman57
scoutman57 / anyconnect.scpt
Created May 18, 2016 14:30 — forked from andrewh/anyconnect.scpt
Applescript to automate the Cisco AnyConnect SSL VPN client on OS X Mavericks
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
activate
end tell
@scoutman57
scoutman57 / CiscoVPNConnection.scpt
Created May 18, 2016 14:25 — forked from twksos/CiscoVPNConnection.scpt
Cisco VPN connection auto connect AppleScript
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
set isConnected to connected of current configuration of VPNService
@scoutman57
scoutman57 / tinder-api-documentation.md
Created December 25, 2015 00:16 — forked from rtt/tinder-api-documentation.md
Tinder API Documentation

Tinder API documentation

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

Note: this was written in April/May 2014 and the API may have changed since

API Details

@scoutman57
scoutman57 / DirectoryStructure
Last active September 7, 2015 18:43 — forked from satooshi/DirectoryStructure
Directory structure of Domain Driven Design application with Symfony2, Doctrine2.
sf2-ddd
├── app
├── bin
├── build
├── lib
├── src
│   └── __VendorPrefix
│   ├── Application
│   │   └── __DomainNameBundle
│   │   ├── Command
0
101
21012
3210123
432101234
54321012345
6543210123456
765432101234567
87654321012345678
9876543210123456789
@scoutman57
scoutman57 / README.md
Last active August 29, 2015 14:07 — forked from nikcub/README.md