Skip to content

Instantly share code, notes, and snippets.

View deardooley's full-sized avatar

Rion Dooley deardooley

View GitHub Profile
@deardooley
deardooley / format-ssh-config
Created January 19, 2022 06:06
Simple bash script to format ssh config files in place.
#!/usr/bin/env bash
# format-ssh-config
#
# author: [email protected]
#
# Simple utility to format a ssh config.
# - Commented out lines are ignored.
# - Option and values are column aligned
# - Most frequently used options are formatted. Uncomment any others you need and adjust column spacing accordingly.
@deardooley
deardooley / README.md
Last active September 22, 2020 16:10
Applescript for Cisco VPN autologin on OSX

This is a little AppleScript utility for mac that will allow you to login to Cisco vpn without manually entering your password over and over again.

  1. Open Script Editor on your mac.
  2. Paste in the file contents.
  3. Update with your username, password, and vpn name.
  4. Save to disk somewhere it won't get accidentally deleted. (~/Library/Scripts/cisco-vpn.scpt).
  5. Add an alias to your environment to call the script whenever you want to login to vpn: alias vpnup='osascript ~/Library/Scripts/dmc-vpn.scpt'
@deardooley
deardooley / brew install [email protected]
Created June 29, 2020 11:01
Installing the now deprecated Homebrew [email protected] on macOS
To install the deprecated [email protected] on macOS using Homebrew, run the following commands:
```bash
git -C "$(brew — repo homebrew/core)" checkout d541efc^ — Formula/[email protected]
brew install [email protected]
pecl install xdebug
pecl install igbinary
pecl install redis
```
If you are using PHPStorm as your IDE, you can configure xdebug by removing the extension lines added to your php.ini file by default and adding the following files to the `/usr/local/homebrew/etc/php/7.1/conf.d` folder.
```ini
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@deardooley
deardooley / cidr2ip
Last active November 1, 2024 05:54
cidr to ip range or list. This script prints the ip ranges for a cidr by default. Full ip lists can be obtained with the -a or --all flags.
#!/usr/bin/env bash
# Print usage
function usage {
echo -n "$(basename $0) CIDR...
$(basename $0) [OPTION] CIDR...
This script prints the ip range or full list of ip addresses for one or more CIDR.
Options:
@deardooley
deardooley / random_tree_gen.sh
Last active April 25, 2019 08:39
Shell script to generate a directory tree of randomized test data.
#!/usr/bin/env bash
# http://stackoverflow.com/questions/13400312/linux-create-random-directory-file-hierarchy
set -o errexit #abort if any command fails
usage() {
echo -n "$(basename $0) [OPTIONS]
This script creates a directory tree of random depth, width and file size. All parameters are
@deardooley
deardooley / RUNBOOK.md
Created February 27, 2019 04:30 — forked from voxxit/RUNBOOK.md
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@deardooley
deardooley / ldap2json.sh
Created January 27, 2019 00:24
Parse output of ldapsearch to json
#!/usr/bin/env bash
# ldap2json.sh
#
# Example shell script showing how to parse LDIF output from the
# ldapsearch command into a json array. Please note that this
# script almost certainly does not handle every edge case, and
# is best used to pull a handful of fields a user or group
# record in a FreeIPA ldap server and format them as JSON for use
# in other tools.
@deardooley
deardooley / docker.aliases.sh
Created July 20, 2018 17:11
Some extra CLI sugar to make working with the Docker command line a bit less painful. Curated from around the web and extended with prompts, regex matching and extra aliases and shortcuts.
#!/bin/bash
# Use these in your .dotfiles to help make Docker more manageable
#alias dip='dmachine ip 2> /dev/null'
alias drund="docker run -d -P"
alias drun="docker run -t -i -P"
alias dimg="di"
alias dexec='dx'
alias dc='docker-compose'
@deardooley
deardooley / keybase.md
Created March 5, 2017 01:39
keybase.md

Keybase proof

I hereby claim:

  • I am deardooley on github.
  • I am deardooley (https://keybase.io/deardooley) on keybase.
  • I have a public key whose fingerprint is 5969 9C3F 1F93 B12C 3DCB 59F4 4486 8378 4860 6209

To claim this, I am signing this object: