Skip to content

Instantly share code, notes, and snippets.

Avatar

Fotis Evangelou fevangelou

View GitHub Profile
@fevangelou
fevangelou / my.cnf
Last active Feb 27, 2021
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated February 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@fevangelou
fevangelou / my.cnf
Last active Feb 27, 2021
Optimized my.cnf configuration for MySQL/MariaSQL (on cPanel/WHM servers)
View my.cnf
# === Optimized my.cnf configuration for MySQL/MariaSQL (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated February 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@fevangelou
fevangelou / install_sis_graphics_on_linux.sh
Last active Feb 21, 2021
Bash script to install SiS Mirage 3+ graphics drivers on Linux
View install_sis_graphics_on_linux.sh
#!/bin/bash
# Bash script to install SiS Mirage 3+ graphics drivers on Linux
# Supports 671/672MX graphics cards
#
# Created in March 2019
#
# Tested on:
# - Lubuntu 18.04 (32-bit) with X.Org v1.19
# - Xubuntu 18.04 (64-bit) with X.Org v1.20
View Software RAID 1 setup on Ubuntu Server 20.04.md

Looking to create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04?

Screen Shot 2020-06-05 at 20 55 31

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/installation-advanced) is outdated/wrong.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage step of the installer
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.
View bash_handbook.md

bash-handbook

[![CC 4.0][cc-image]][cc-url] [![NPM version][npm-image]][npm-url] [![Gitter][gitter-image]][gitter-url]

This document was written for those who want to learn Bash without diving in too deeply.

Tip: Try learnyoubash — an interactive workshopper based on this handbook!

@fevangelou
fevangelou / install_nano_v4.0_on_mac.sh
Created Mar 24, 2019
Install Nano Editor v4.0 (with syntax highlighting) on the Mac
View install_nano_v4.0_on_mac.sh
#!/bin/bash
# Install Nano Editor (https://www.nano-editor.org) with syntax highlighting on the Mac
# Version 4.0 ("Thy Rope of Sands") released March 24th 2019
cd ~/
wget https://www.nano-editor.org/dist/v4/nano-4.0.tar.gz
tar -xvf nano-4.0.tar.gz
mv nano-4.0 .nano
cd .nano/
@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active Feb 8, 2021
The perfect Varnish configuration for Joomla, WordPress & other CMS based websites
View default.vcl_PREFACE.md

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites.

This configuration requires an HTTP Header and a user cookie to identify if a user is logged in a site, in order to bypass caching overall (see how it's done for Joomla & WordPress). If your CMS provides a way to add these two requirements, then you can use this configurati

@fevangelou
fevangelou / database.sh
Created Sep 4, 2019
Frequent MySQL/MariaDB operations
View database.sh
MySQL Operations
--------------------------------------
In this document:
- Export/Import DB
- Export/Import Table from DB
- mysqladmin
- Repair DB
--------------------------------------
@fevangelou
fevangelou / book.md
Created Jan 2, 2021
Pure Bash Bible
View book.md
@fevangelou
fevangelou / bootstrap.sh
Last active Dec 26, 2020
New Ubuntu Desktop Preparation (18.04+ LTS)
View bootstrap.sh
#!/bin/bash
# Short URL: https://git.io/fjY3J
#
# How to use:
# $ cd ~/Downloads
# $ wget -O bootstrap.sh https://git.io/fjY3J
# $ chmod +x bootstrap.sh
# $ sudo ./bootstrap.sh
#