Posts in Category: Tips

Proxy using an SSH tunnel

Browse the web through your SSH server by turning it into a proxy server.
Secure Shell (SSH) client-server encrypted connection icon
Continue reading

How to auto-start services on boot in CentOS / Red Hat / Oracle Linux?

To auto-start services in CentOS, Red Hat, or Oracle Linux, you can use the built-in chkconfig utility. It is located in the /sbin directory. If you are a regular user (non-root), /sbin may not be in your PATH, so you may have to use the full path to run the chkconfig utility.

centos

Continue reading

Display calibration

Since I use the same monitor (LG W2486L) for my Nintendo Wii U and my computer, I never paid attention to the fact that sometimes I couldn’t see certain colors simply due to wrong calibration on my display.

I use Adobe Lightroom on this PC to enhance my photos, so how could I know if my display was showing what I needed to see?

A friend of mine told me about some videos that could help me with that; at the link below, you can download the videos and find more information.

AVS HD 709: Blu-ray & MP4 Calibration (AVSForum)

I just used the basic settings and now my display looks much better, and I can see a better range of whites and blacks.

You can also run quick browser-based color uniformity, dead-pixel, contrast, and gradient checks directly with my Display Tester (listed on Ferramentas).

YouTube Background for Android 2.2+

YouTube Background Android playback utility launcher icon

I made this app for a friend who wanted to play YouTube videos just to listen to the audio. It’s very simple: it works by sharing a YouTube video URL with the app or googling the video (for instance, go to google.com and type “YouTube lindsey”).

Unfortunately, Google removed this app from Google Play, so it’s archived here.

Historical Note: This APK was built for legacy Android 2.2 (Froyo) devices in 2014; modern Android versions and current TLS/YouTube APIs have evolved considerably since then.

Download

Zabbix

Zabbix open-source infrastructure monitoring platform logo

Very cool tool for sysadmins! Check it out! 🙂 https://www.zabbix.com/

With lightweight agents, SNMP polling for routers and switches, flexible triggers, and auto-discovery, Zabbix is still one of my go-to open-source tools for monitoring Linux servers and network hardware.

CLI Database optimization

Command-line database server optimization and maintenance icon

MariaDB & MySQL:

sudo apt install default-mysql-client   # or: mariadb-client
mysqlcheck -h yourdatabasehost -u root -p --auto-repair --check --all-databases
mysqlcheck -h yourdatabasehost -u root -p --auto-repair --optimize --all-databases
# Note: MariaDB 11+ also provides mariadb-check; --optimize rebuilds InnoDB tables, so schedule on busy databases carefully.

PostgreSQL:

vacuumdb -afvz -h yourdatabasehost -U postgres
reindexdb -a -h yourdatabasehost -U postgres

Updated (November 4, 2021): Docker example:

docker exec -it postgres-server vacuumdb -afvz -U postgres

Check your website performance

Web performance audit magnifying glass over global network icon

WebPageTest, GTmetrix, PageSpeed Insights, and Website Grader can test your website and web server and help you see if you are using optimal configurations!

GNU/Linux CLI image optimizer

Lossy and lossless CLI image optimization example comparing JPEG compression quality

There are major speed benefits to image optimization using optipng for PNGs, gifsicle for GIFs, and jpegoptim for JPEGs. Optimized graphics transfer faster and improve perceived load times. Below, optipng and gifsicle optimize PNG/GIF files losslessly, whereas adding --max=85 or ImageMagick -quality 80 applies bounded lossy compression to JPEGs (omit --max=85 if you only want lossless metadata stripping).

Ubuntu / Debian:

sudo apt update && sudo apt install optipng gifsicle jpegoptim imagemagick

Run these commands inside the target directory as the user who owns those images (note the quoted '*.ext' globs so the shell never expands them prematurely):

find . -type f -iname '*.png' -exec optipng -o7 --strip all {} \;
find . -type f -iname '*.gif' -exec gifsicle -O2 -b {} \;
# Strictly lossless JPEG strip:
find . -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) -exec jpegoptim --strip-all {} \;
# Optional bounded lossy + progressive pass for web assets:
find . -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) -exec jpegoptim --strip-all --max=85 {} \;
find . -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) -exec convert -interlace line -quality 80 {} {} \;

For WordPress automation, you can install EWWW Image Optimizer or convert assets to WebP/AVIF.