Skip to content

Instantly share code, notes, and snippets.

View jdeathe's full-sized avatar
💭
Taking a break from development projects to focus other things

James Deathe jdeathe

💭
Taking a break from development projects to focus other things
View GitHub Profile
@jdeathe
jdeathe / grow-root.service
Last active February 22, 2021 09:26
CentOS-7 Systemd Unit File to Grow the Root LVM Disk on AWS EC2 Instances with an ext4 File System.
# To install:
# sudo cat grow-root.service > /etc/systemd/system/grow-root.service
# sudo systemctl daemon-reload
# sudo systemctl enable -f grow-root.service
#
# Start (auto disables after first successful expansion):
# sudo systemctl start grow-root.service
#
# Debugging:
# sudo systemctl status grow-root.service
@jdeathe
jdeathe / jadu-cms-readable-urls-for-custom-scripts.md
Last active September 19, 2017 09:18
Jadu Continuum CMS - Readable URLs for Custom Scripts

Jadu Continuum CMS - Readable URLs for Custom Scripts

The recommended location for custom scripts written for the Jadu CMS platform is within /public_html/site/custom_scripts/ but this can lead to long and unfriendly URLs. Here we show how to use the Readable URLs feature to create a cleaner URL structure for a simple custom script.

Installation

  1. Create a new directory <install-path>/public_html/site/custom_scripts/php_version and populate it with the following files:
  • htaccess_readable
@jdeathe
jdeathe / keybase.md
Created September 15, 2017 21:56
keybase.md

Keybase proof

I hereby claim:

  • I am jdeathe on github.
  • I am jdeathe (https://keybase.io/jdeathe) on keybase.
  • I have a public key whose fingerprint is B076 A415 B14E 9393 BD6A BCE7 9071 AD75 7AE1 E9CE

To claim this, I am signing this object:

@jdeathe
jdeathe / centos-keeping-time-with-chrony.md
Last active May 21, 2019 19:02
Keeping Time with Chrony on CentOS

CentOS - Keeping Time with Chrony

Both CentOS-6 and CentOS-7 provide chrony as an alternative to the traditional ntp service. Chrony is a good fit for virtualised guests - a Vagrant box using the VirtualBox provider where you don't have/want the VirtualBox Guest Additions installed on the guest.

Installation

First install the chrony package with yum.

# yum -y install chrony
@jdeathe
jdeathe / centos-how-to-configure-time-zone.md
Last active April 27, 2018 14:15
How to Configure the Time Zone on CentOS

CentOS - Configure Time Zone

System TimeZone

Setup a default ZONE environment variable.

Export the required local time zone value using the ZONE environment variable.

Skip this step if setting up a system with the default UTC time zone.

@jdeathe
jdeathe / centos-how-to-require-password-change.md
Created September 1, 2017 08:08
CentOS - How to Remove a User's Password and Require a New Password on First Access

CentOS - How to Require Password Change.

Running the following command, as the root, removes the existing password and forces password change on first login for the for the user "root".

# passwd -d root \
  && chage -d 0 root

When root next logs in they will receive the following message:

@jdeathe
jdeathe / centos-6-enable-mysql-query-cache.md
Created August 10, 2017 18:26
How to Enable MySQL Query Cache on CentOS-6

MySQL Query Cache

How to add a 32M query cache with an item limit of 1M.

Enable on a Running MySQL Server

NOTE: You might need to add '-p' to the following command if 'root'@'localhost' requires a password on your environment.

# mysql \
@jdeathe
jdeathe / centos-ssh-varnish-example.md
Last active October 13, 2018 13:36
CentOS Docker Varnish Cache with Apache HTTP Backend

Docker - Varnish Cache with Apache HTTP Backend

Create Network

$ docker network create \
  --driver bridge \
  bridge_t1
@jdeathe
jdeathe / install-modern-memcached-on-centos-6.md
Last active February 28, 2018 12:59
Installing Memcached with support for max_item_size > 1M on CentOS-6

Installing modern memcached on CentOS-6

The version of memcached available in the CentOS-6 repositories is currently 1.4.4. This performs well with small items however there is a limit of 1M and an issue with slab imbalance.

Install the remi repository and install memcached

# rpm -q remi-release-6.8-2.el6.remi.noarch \
  &> /dev/null \
|| yum -y install \
@jdeathe
jdeathe / using-curl-to-capture-website-response-time.md
Last active June 28, 2017 22:32
Using CURL to Capture Website Response Time

Using CURL to Capture Website Response Time

Generate 2 CURL templates, the first is for readability and the second is for generating a CSV report over time.

$ tee &> /dev/null ~/.curl_report <<-EOT
       url_effective: %{url_effective}\n
           http_code: %{http_code}\n
\n
      speed_download: %{speed_download}\n