Skip to content

Instantly share code, notes, and snippets.

View hluaces's full-sized avatar

Héctor Luaces hluaces

View GitHub Profile
@hluaces
hluaces / lvm-cache-fedora.md
Created September 30, 2020 14:05 — forked from gabrieljcs/lvm-cache-fedora.md
Instructions to create an LVM cache for root in Fedora

LVM cache in Fedora

From the man-pages: "The cache logical volume type uses a small and fast LV to improve the performance of a large and slow LV. It does this by storing the frequently used blocks on the faster LV. LVM refers to the small fast LV as a cache pool LV. The large slow LV is called the origin LV. Due to requirements from dm-cache (the kernel driver), LVM further splits the cache pool LV into two devices - the cache data LV and cache metadata LV. The cache data LV is where copies of data blocks are kept from the origin LV to increase speed. The cache metadata LV holds the accounting information that specifies where data blocks are stored (e.g. on the origin LV or on the cache data LV). Users should be familiar with these LVs if they wish to create the best and most robust cached logical volumes. All of these associated LVs must be in the same VG."

Assuming LVM is already setup in HDD (e.g. from anaconda) and SSD is untouched.

Create a physical

@hluaces
hluaces / phpcgi-watcher.sh
Last active February 20, 2019 15:21 — forked from josesayago/phpcgi-watcher.sh
PHP-CGI Watcher, a little BASH script to kill PHP-CGI orphan processes draining server resources.
#!/bin/bash
#
# @author Jose SAYAGO
# @uri http://josesayago.com/blog/
#
# Process to monitor how many PHP-CGI processes are running, and kill them
# if they exceed the limit
#
# Set the maximum number of CGI Processes allowed
MAX_CGI=25;
@hluaces
hluaces / queueCounter.sh
Last active June 21, 2019 11:18 — forked from agarzon/queueCounter.sh
Alert based in mail queue size for postfix and plesk forked from [agarzon's](https://gist.github.com/heartshare/7bdeebfab74ed436e72c163aadbb3004) and slightly tuned.
#!/bin/bash -e
# Binary locations
readonly MAIL_BIN=$(command -v mail)
readonly QUEUE_SIZE=$(/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}')
readonly QUEUE_SUMMARY=$(/usr/sbin/qshape -s deferred | head)
readonly CONTROL_FILE="/tmp/queueCounter"
# Comma-separated list of email addreses that should be notified when the
# queue grows above the defined threshold
@hluaces
hluaces / testio.sh
Created January 23, 2019 17:59 — forked from jsandas/testio.sh
Disk IO test for linux
#!/bin/bash
# References
# https://devopsideas.com/benchmarking-disk-iops-aws-vs-digitalocean/
# https://wiki.mikejung.biz/Benchmarking#Fio_Test_Options_and_Examples
# https://tobert.github.io/post/2014-04-17-fio-output-explained.html
# Requires linux packages: fio ioping
@hluaces
hluaces / wp_config.php
Last active January 14, 2019 08:32 — forked from butlerblog/wp_config.php
Configura la función wp_mail de WordPress para que use envíos por SMTP y no la función mail() local. Fork en español del gist de Chad Butler: https://gist.github.com/butlerblog/c5c5eae5ace5bdaefb5d | http://b.utler.co/Y3
<?php
/**
* Empieza por poner las siguientes constantes en tu archivo wp-config.php.
*
* Has de ponerlas antes de la línea que define la cosntante ABSPATH.
*
* Ten en cuenta que has de cambiar el valor de todas las constantes acorde a
* la configuración de correo electrónico que te facilite tu proveedor de correo.
*/