Skip to content

Instantly share code, notes, and snippets.

🏡
Watering my routers

Phil Porada pgporada

🏡
Watering my routers
Block or report user

Report or block pgporada

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pgporada
pgporada / packetnet_vip_failover.sh
Last active May 2, 2018
Packet.net Elastic IP Failover Script
View packetnet_vip_failover.sh
#!/bin/bash
function usage() {
echo "USAGE: ./$(basename ${0})"
echo
}
# if ((${EUID:-0} || "$(id -u)")); then
# usage
# exit 1
View gist:7391863e37d329e37a746b5207510a07
#!/bin/bash
# AUTHOR: Phil Porada
DOMAIN=${1}
CERT=$(openssl s_client -connect ${DOMAIN}:443 2>&1 < /dev/null | sed -n '/-----BEGIN/,/-----END/p')
SANS=$(openssl x509 -noout -text -in <(echo "${CERT}") | grep '^[[:space:]]*Subject: CN=' | sed 's/^[[:space:]]*Subject: CN=//')
echo "${SANS}"
##################################################
##################### OUTPUT #####################
@pgporada
pgporada / caddy.sh
Created Dec 11, 2017 — forked from TomHetmer/caddy.sh
caddy for SELinux
View caddy.sh
setcap cap_net_bind_service=+ep /usr/local/bin/caddy
nano /etc/systemd/system/caddy.service
semanage fcontext -a -t httpd_exec_t /usr/local/bin/caddy
restorecon /usr/local/bin/caddy
chown www-data:www-data /etc/ssl/caddy/
semanage fcontext -a -t httpd_sys_rw_content_t /etc/ssl/caddy
restorecon /etc/ssl/caddy
View gist:5e6d80af902adf37eef4736f5c4a9fc9
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
View gist:cbf8bab9411c3612fe273fdde2e9206f
[user@work packet]$ terraform plan -var-file environments/test/test.tfvars
packet_project.phil: Refreshing state... (ID: 1a7e5ef9-758e-4c84-bf84-27d8cdd1bf8c)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
View ocsp-tester.sh
#!/bin/bash
if [ "${EUID}" -ne 0 ]; then
echo "Please run with sudo privs"
exit 1
fi
if [ $# -ne 1 ]; then
echo "Pass a website to the script"
echo "Example"
View keybase.md

Keybase proof

I hereby claim:

  • I am pgporada on github.
  • I am pgporada (https://keybase.io/pgporada) on keybase.
  • I have a public key whose fingerprint is E4FE F2E5 C527 B320 695F AA0D 607D 013E EEA3 E2C0

To claim this, I am signing this object:

@pgporada
pgporada / gist:7369684744cb2f077dba541362c7723d
Last active Mar 23, 2017
everything and the kitchen sink
View gist:7369684744cb2f077dba541362c7723d
phil at laptappy in ~
$ kitchen sink
___
' _ '.
/ /` `\ \
| | [__]
| | {{
| | }}
_ | | _ {{
@pgporada
pgporada / part_of_main.tf
Last active Mar 20, 2017
Phil's terraform-vpc
View part_of_main.tf
.
├── bumpver.sh*
├── environments/
│   ├── mgmt/
│   │   └── mgmt.tfvars
│   └── prod/
│   └── prod.tfvars
├── main.tf
├── Makefile
├── modules/
View gist:48ed430b5c568feab16f07ac60733d73
---
- hosts myinventory
remote_user: dudeguy
gather_facts: true
roles:
- {role: ansible-role-repo-epel, tags: ["epel","repo"]}
- {role: ansible-role-httpd, tags: ["httpd"]}
- {role: ansible-role-jenkins, tags: ["jenkins"]}
- {role: ansible-role-jenkins-backups, tags: ["jenkins","backups"]}
You can’t perform that action at this time.