Skip to content

Instantly share code, notes, and snippets.

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 / jadu-cms-readable-urls-for-custom-scripts.md
Last active Sep 19, 2017
Jadu Continuum CMS - Readable URLs for Custom Scripts
View jadu-cms-readable-urls-for-custom-scripts.md

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
View 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
Keeping Time with Chrony on CentOS
View centos-keeping-time-with-chrony.md

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 Apr 27, 2018
How to Configure the Time Zone on CentOS
View centos-how-to-configure-time-zone.md

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 Sep 1, 2017
CentOS - How to Remove a User's Password and Require a New Password on First Access
View centos-how-to-require-password-change.md

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 Aug 10, 2017
How to Enable MySQL Query Cache on CentOS-6
View centos-6-enable-mysql-query-cache.md

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 Oct 13, 2018
CentOS Docker Varnish Cache with Apache HTTP Backend
View centos-ssh-varnish-example.md

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 Feb 28, 2018
Installing Memcached with support for max_item_size > 1M on CentOS-6
View install-modern-memcached-on-centos-6.md

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 Jun 28, 2017
Using CURL to Capture Website Response Time
View using-curl-to-capture-website-response-time.md

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