Skip to content

Instantly share code, notes, and snippets.

View malston's full-sized avatar

Mark Alston malston

View GitHub Profile
@malston
malston / retrieve-credhub-creds.sh
Last active January 28, 2022 22:25
Retrieves credhub credentials by running a remote shell script on opsman vm
#!/usr/bin/env bash
set -o errexit
usage() {
echo "$0 [name of the credential to retrieve]"
echo "Example: $0 /credhub-service-broker/credhub/99f0c44c-1cb5-4c5f-91a8-873090e035aa/credentials"
}
if [ "$#" -lt 1 ]; then
#!/bin/bash
set -e
# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
function usage() {
echo "Usage:"
echo " $0 [flags]"
echo ""

Keybase proof

I hereby claim:

  • I am malston on github.
  • I am malston (https://keybase.io/malston) on keybase.
  • I have a public key ASBFgz1JBJbchseiJxqleq3YvgxDZYE0hbb4hPLb7WgqfAo

To claim this, I am signing this object:

@malston
malston / atom-shortcuts.md
Last active February 5, 2019 14:41
Atom Keyboard Shortcuts

Atom Keyboard Shortcuts

This page lists keyboard shortcuts for the Atom text editor that I find valuable and use a lot. Feel free to fork the page and add your own favorites. Pull Requests welcome!

This list is by no means meant to be a complete listing of every available shortcut. It simply lists the shortcuts that I use on a regular basis. For a complete listing of all available shortcuts, consult the Settings > Keybindings page in Atom.

Since I'm using a Mac, I have mainly listed the keyboard shortcuts macOS. Please feel free to add the Windows or Linux shortcuts.

Where the shortcut is provided by a package, I have added a link to the package.

@malston
malston / 2headsetsplitter.jpg
Last active January 11, 2019 17:17
Remote Collaboration
2headsetsplitter.jpg
@malston
malston / create-nsx-certs.sh
Created December 20, 2018 22:46
Generate an ssl certificate for nsx edge
#!/bin/bash -e
NSX_MANAGER=nsxmgr-01.cf.markalston.net
NSX_USER=admin
if [ -z "$NSX_PASSWORD" ]; then
echo "NSX_PASSWORD must be set"
return 1
fi
@malston
malston / ca.md
Created July 2, 2018 22:42 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@malston
malston / gist:f2f63451b5bb363fc95e2c5f36dc14e6
Created March 18, 2018 17:03 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@malston
malston / downloadJarFromNexus
Last active October 26, 2022 13:02
A bash script to download any jar from nexus
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=${NEXUS_BASE-:http://repository.example.com:8081/nexus}
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@malston
malston / upload_pivnet_product
Last active May 31, 2016 16:40
upload_pivnet_product
upload_product() {
PRODUCT_FILE=$1
OPSMGR_HOST=$2
OPSMGR_USER=$3
OPSMGR_PASSWORD=$4
OPSMGR_IP=$5
LOG_FILE=upload.txt
if [ -z $OPSMGR_IP ]; then
curl -k -XPOST -H "Application/json" -H "Host: $OPSMGR_HOST" -u "opsman:" \
--data "username=$OPSMGR_USER&password=$OPSMGR_PASSWORD&client_id=opsman&grant_type=password&response_type=token" \