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 / debug-rsyslog-on-systemd-based-platforms.md
Last active March 23, 2021 08:50
Debug RSyslog on RHEL, CentOS, Oracle Linux (el7/el8 platform)
@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 / 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 / centos-6-php-ius-audit.md
Created June 8, 2018 10:51
Identify Unavailable IUS Packages Between PHP 5.6 and 7.1

Identify Unavailable IUS PHP Packages Between 5.6 and 7.1

For all installed packages prefixed with php56u, check for availability php71u package.

# yum list installed \
| grep -o '^php56u[^ ]*' \
| { \
  mapfile -t packages; \
 for package in "${packages[@]}"; do \
@jdeathe
jdeathe / centos-certbot.md
Last active December 4, 2019 08:30
Installation and Usage of Certbot on CentOS to obtain a Let’s Encrypt TLS/SSL certificate.

Installation and Usage of Certbot on CentOS

Installation

Install certbot-auto

# mkdir -p /opt/{bin,certbot/bin} \
  && curl -sS \
 -o /opt/certbot/bin/certbot-auto \
@jdeathe
jdeathe / docker-compose.yml
Last active September 23, 2019 02:03
Docker Compose definition to run a local Jenkins service in a Docker container.
# ------------------------------------------------------------------------------
# Ref: https://docs.docker.com/compose/compose-file/
#
# Install docker for Mac:
# https://www.docker.com/products/docker
#
# docker-compose -p local_jenkins down
# docker-compose -p local_jenkins up -d
# docker-compose -p local_jenkins logs
#
@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 / php-curl-status.php
Last active February 8, 2019 19:45
Basic health status check using PHP curl
<?php
$responseCode = 500;
$responseCodeOk = 200;
$responseCodeFail = 503;
$url = 'https://www.deathe.org/';
$ch = curl_init();
curl_setopt_array(
@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 / file-listing-by-date.md
Last active October 2, 2018 10:14
Linux / Simple File List for Review

Generate a File Listing for Review

Fields

  • Last Modified
  • Size (bytes)
  • Relative Path

Command

Replace {{search-path}} with the path to search.