Skip to content

Instantly share code, notes, and snippets.

View mash187's full-sized avatar

Mike Ash mash187

  • SiteCrafting, Inc.
  • Spokane, WA
View GitHub Profile
@mash187
mash187 / password-generator.sh
Created June 6, 2018 00:55
Function to generate passwords quickly from the command line. Optionally takes two parameters for length and quantity of passwords to generate.
#================================================================
# description Function to generate passwords quickly from the
# command line. Optionally takes two parameters for
# length and quantity of passwords to generate. Add
# to the profile file for your shell. Written
# specifically for bash.
# usage $ pw 32 4
# version 0.1
# author Mike Ash
# copyright Copyright 2018 Mike Ash
@mash187
mash187 / vhost-header-insert.sh
Last active June 28, 2017 22:59
A quick way to add a set of headers to all the VirtualHost directives on a server.
#!/bin/bash
#DIR=/etc/httpd/vhosts.d/
DIR=/etc/apache2/sites-enabled/
FIND="<\/VirtualHost>"
HDR=""
HDR=${HDR}"Header always set Strict-Transport-Security \"max-age=15768000; includeSubDomains; preload\" \n"
HDR=${HDR}"Header always append X-Frame-Options SAMEORIGIN \n"
HDR=${HDR}"Header always set X-Content-Type-Options nosniff"

Keybase proof

I hereby claim:

  • I am mash187 on github.
  • I am mash187 (https://keybase.io/mash187) on keybase.
  • I have a public key ASDI3F36VEuTuo6G5wqytRciSzykod-4XdZgCWAc2vW2sQo

To claim this, I am signing this object: