Skip to content

Instantly share code, notes, and snippets.

View dale-c-anderson's full-sized avatar

Dale Anderson dale-c-anderson

View GitHub Profile
@dale-c-anderson
dale-c-anderson / matteromost-solarized-light-theme.json
Last active December 6, 2022 18:19
Mattermost Solarized Light theme
{"sidebarBg":"#e8e4d9","sidebarText":"#2e2e2e","sidebarUnreadText":"#cb4b16","sidebarTextHoverBg":"#DCD6C6","sidebarTextActiveBorder":"#cb4b16","sidebarTextActiveColor":"#cb4b16","sidebarHeaderBg":"#e8e6df","sidebarHeaderTextColor":"#424242","onlineIndicator":"#52adad","awayIndicator":"#d4b579","dndIndicator":"#f74343","mentionBj":"#ffffff","mentionColor":"#ffffff","centerChannelBg":"#fdf6e3","centerChannelColor":"#444444","newMessageSeparator":"#f2777a","linkColor":"#2aa198","buttonBg":"#cb4b16","buttonColor":"#ffffff","errorTextColor":"#fd5960","mentionHighlightBg":"#ebd8c2","mentionHighlightLink":"#cb4b16","codeTheme":"github","mentionBg":"#cb4b16"}
@dale-c-anderson
dale-c-anderson / nginx-wordpress-vhost.conf
Created December 14, 2018 08:37
Secure wordpress NGINX example config (two files)
########################################################################
# THERE ARE TWO FILES WORTH OF CODE IN THIS GIST
########################################################################
#####
# /etc/nginx/includes/account-project.php-fpm.conf
#####
## PHP socket config has been broken out into its own file, since it needs to be reused from many places.
@dale-c-anderson
dale-c-anderson / ip.php
Last active February 19, 2021 18:09
A php page that simply spits out the IP address of the visitor. Served as plain text for terminal (curl), HTML for browsers.
<?php
/**
##################
ip.php
##################
A php page that simply displays the IP address of the visitor.
Serves plain text by default, serves a pretty html version by request, or if
@dale-c-anderson
dale-c-anderson / install_node_exporter.centos6.sh
Created October 3, 2018 20:37
Install and configure Prometheus Node Exporter on a CentOS 6 box
#!/bin/bash
# Install Prometheus Node Exporter on CentOS 6.
set -eu
set -o pipefail
set -x
REPOFILE='/etc/yum.repos.d/coprs.ibotty.prometheus-exporters.repo'
INSTALLED=0
@dale-c-anderson
dale-c-anderson / certbot-auto-fake
Last active October 3, 2021 08:55
A fake LetsEncrypt simulator for use in testing inside isolated environments. Creates self signed certs instead of real ones.
#!/bin/bash -ue
################################################################################
# Simulates the certificate files that LetsEncrypt creates, creating self signed ones instead
# Ignores all arguments except the last one, which is assumed to be your FQDN.
################################################################################
if [ $# -lt 1 ]; then
>&2 echo "I need at least a FQDN to do anything."
exit 1
@dale-c-anderson
dale-c-anderson / .bash_aliases
Created November 1, 2017 18:04 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@dale-c-anderson
dale-c-anderson / update-wordpress.sh
Last active November 8, 2019 22:24
Keep wordpress updated on the server
#!/bin/bash -ue
# update-wordpress.sh
# To be run from a nightly cron.
# Assumes cron email notifications are working correctly.
WORKINGDIR="/var/www/mysite/public_html"
cd "$WORKINGDIR"
# Don't let errors before pipes go unnoticed.
@dale-c-anderson
dale-c-anderson / whois.php
Last active February 11, 2024 08:49
Simple PHP whois lookup script
<form method=GET action="<?php htmlentities(basename(_FILE_)); ?>">
<input type=text name="q" value="<?php echo htmlentities($_REQUEST["q"]); ?>">
<input type=submit value="WHOIS">
</form>
<pre><?php
/*
* whois.php
*/
main();
@dale-c-anderson
dale-c-anderson / ubuntu-remove-php55.yml
Created February 24, 2017 18:44
ansible php 5.5 removal from ubuntu 14.04
---
- hosts: all
gather_facts: true
become: yes
tasks:
- name: Remove php5-fpm
apt: name=php5-fpm
update_cache=no
#!/bin/bash
W_PATH="$(xclip -selection clipboard -o)"
U_PATH="$(echo "$W_PATH" | sed -e 's/\\/\//g' -e 's/A:/\/media\/accounts/g')"
nautilus "$U_PATH"