Skip to content

Instantly share code, notes, and snippets.

View jpSimkins's full-sized avatar

Jeremy Simkins jpSimkins

  • Florida
View GitHub Profile
@jpSimkins
jpSimkins / fixPermissionsSshDir.sh
Last active May 8, 2022 18:47
Fix .ssh permissions for all files and sub-directories
sudo chown -R $USER:$USER ~/.ssh
find ~/.ssh -type f -exec chmod 400 -- {} +
find ~/.ssh -type f -name '*.pub' -exec chmod 444 -- {} +
sudo chmod 600 ~/.ssh/authorized_keys
sudo chmod 664 ~/.ssh/config
@jpSimkins
jpSimkins / terraform-plan-debug
Created June 4, 2019 14:35
Debug for: An argument named "root_block_device" is not expected here
This file has been truncated, but you can view the full file.
2019/06/04 10:29:16 [INFO] Terraform version: 0.12.0
2019/06/04 10:29:16 [INFO] Go runtime version: go1.12.4
2019/06/04 10:29:16 [INFO] CLI args: []string{"/home/jpsimkins/bin/terraform", "plan"}
2019/06/04 10:29:16 [DEBUG] Attempting to open CLI config file: /home/jpsimkins/.terraformrc
2019/06/04 10:29:16 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/06/04 10:29:16 [INFO] CLI command args: []string{"plan"}
2019/06/04 10:29:16 [INFO] Setting AWS metadata API timeout to 100ms
2019/06/04 10:29:17 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2019/06/04 10:29:17 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
@jpSimkins
jpSimkins / WebServerPolicyForAssetsBucket
Last active August 20, 2018 15:26
AWSUserPolicyForW3TotalCacheCDN
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:ListAllMyBuckets"
],
@jpSimkins
jpSimkins / 1installLetsEncryptForCentOS.sh
Last active September 23, 2019 15:53
Install LetsEncrypt on Amazon AMI or CentOS
# Install LetsEncrypt
mkdir /opt/letsencrypt
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
# Create config file for LetsEncrypt (Replace YOUR_EMAIL with... well...)
mkdir /etc/letsencrypt/
touch /etc/letsencrypt/config.ini
echo "rsa-key-size = 4096" >> /etc/letsencrypt/config.ini
echo "email = YOUR_EMAIL" >> /etc/letsencrypt/config.ini
# Run LetsEncrypt to get cert (Replace DOMAIN_NAME and WEBROOT appropriately)
# DOMAIN_NAME nuff said
@jpSimkins
jpSimkins / Dashboard.php
Created April 17, 2018 19:08
Remove dashboard widgets from users dashboard and allows admin full dashboard experience.
<?php
/**
* Remove dashboard widgets from users dashboard
* Allows Admin full dashboard experience
*/
// Deny direct access
defined('ABSPATH') or die("No script kiddies please!");
/**
@jpSimkins
jpSimkins / get-page-by-slug.php
Last active March 7, 2018 16:38 — forked from matheuseduardo/get-page-by-slug.php
get_page_by_slug - wordpress
<?php
/**
* Retrieve a page given its slug.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $page_slug Page slug
* @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A.
* Default OBJECT.
* @param string|array $post_type Optional. Post type or array of post types. Default 'page'.
@jpSimkins
jpSimkins / gist:4ab6dd25215de0e886eaa60503f6c129
Created June 29, 2017 01:28
Converge Log for chef-git version issue on CentOS 7.3
I, [2017-06-28T21:18:53.286497 #25341] INFO -- default-centos-73: -----> Cleaning up any prior instances of <default-centos-73>
I, [2017-06-28T21:18:53.286928 #25341] INFO -- default-centos-73: -----> Destroying <default-centos-73>...
I, [2017-06-28T21:18:54.734821 #25341] INFO -- default-centos-73: ==> default: Forcing shutdown of VM...
I, [2017-06-28T21:18:55.832010 #25341] INFO -- default-centos-73: ==> default: Destroying VM and associated drives...
I, [2017-06-28T21:18:56.025565 #25341] INFO -- default-centos-73: Vagrant instance <default-centos-73> destroyed.
I, [2017-06-28T21:18:56.026326 #25341] INFO -- default-centos-73: Finished destroying <default-centos-73> (0m2.74s).
I, [2017-06-28T21:18:56.026415 #25341] INFO -- default-centos-73: -----> Testing <default-centos-73>
I, [2017-06-28T21:18:56.026486 #25341] INFO -- default-centos-73: -----> Creating <default-centos-73>...
I, [2017-06-28T21:18:57.023700 #25341] INFO -- default-centos-73: Bringing machine 'default' up with 'virtualbox' provid
@jpSimkins
jpSimkins / make.sh
Created April 21, 2016 02:42 — forked from artzub/make.sh
Install JetBrains Hub + YouTrack + UpSource + Nginx
#!/bin/bash
apt-get install mc htop git unzip wget curl -y
echo
echo "====================================================="
echo " WELCOME"
echo "====================================================="
echo
echo "Hub"
@jpSimkins
jpSimkins / getDatesForSpecificDayBetweenDates.php
Last active August 1, 2018 17:39
Returns an array of dates for the day of the week between two date ranges
<?php
/**
* Returns an array of dates for the day of the week between two date ranges
* Modified from stackoverflow question and improved for broader usage
* @link http://stackoverflow.com/a/4482605/650206
* @param string|int $startDate
* @param string|int $endDate
* @param int $weekdayNumber
* @param string $dateFormat
* @param string $dateWeekNumberFormat w: 0 (sunday) - 6 (saturday) | N: 1 (monday) - 7 (sunday)