This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*******************************************************Podcast Meta-boxes *******************/ | |
//Add Metabox | |
//Source: http://wordpress.stackexchange.com/questions/139841/add-metabox-with-media-uploader-in-a-custom-post-type | |
add_action( 'add_meta_boxes', 'add_upload_file_metaboxes' ); | |
function add_upload_file_metaboxes() { | |
add_meta_box( 'swp_file_upload', 'File Upload', 'swp_file_upload', 'videos', 'normal', 'default' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Author: Gary Martin | |
## | |
## Usage ./lockdown.sh {IPADDRESS} {IPADDRESS2} | |
function valid_ip() | |
{ | |
local ip=$1 | |
local stat=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Goodbye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert Arrays to Class Objects | |
* Author: Gary Martin | |
* Date: 5/2/2016 | |
* | |
* Description: This Converts arrays to Objects that have getters and setters preventing. | |
* If the $key is not defined in the model it gets skipped. | |
* The model must have a getAttributes function that returns the attributes in a array. | |
* This code will reduce that to check if its in the array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -O http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz | |
tar xfvz mysql-5.6* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz | |
tar xfvz mysql-5.7* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# update system | |
sudo yum update -y | |
# install basic items | |
sudo yum install -y vim wget git epel-release | |
#set timezone | |
timedatectl set-timezone America/Chicago |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#https://techstat.net/automatic-whitelist-cloudflare-ips-firewalld-bash-script-via-cron-job/ | |
SERVER_IP=xxx.xxx.xxx.xxx | |
for i in $(curl "https://www.cloudflare.com/ips-v4"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="'$i'" port port=80 protocol=tcp accept'; done | |
for i in $(curl "https://www.cloudflare.com/ips-v4"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="'$i'" port port=443 protocol=tcp accept'; done | |
for i in $(curl "https://www.cloudflare.com/ips-v6"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv6" source address="'$i'" port port=80 protocol=tcp accept'; done | |
for i in $(curl "https://www.cloudflare.com/ips-v6"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv6" source address="'$i'" port port=443 protocol=tcp accept'; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script installs automated docker cleanup via "docker image prune" | |
# onto systemd-based systems. | |
# It requires that docker is installed properly | |
# source: https://techoverflow.net/2019/10/03/how-to-automatically-cleanup-prune-docker-images-daily/ | |
cat >/etc/systemd/system/PruneDocker.service <<EOF | |
[Unit] | |
Description=PruneDocker |
OlderNewer