Skip to content

Instantly share code, notes, and snippets.

Fotis Evangelou fevangelou

Block or report user

Report or block fevangelou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active Dec 9, 2019
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 3 minute (180 sec) cache time. You can safely increase this to 5 mins for less busier sites or drop it to 1 min or even 30s 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 in the Joomla section). If your CMS provides a way to add these 2 requirements, then you can use this configuration to speed up your site or entire server. You can even exclude the domains you don't want to cach

@fevangelou
fevangelou / my.cnf
Last active Dec 8, 2019
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@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 / my.cnf
Last active Nov 12, 2019
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 December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@fevangelou
fevangelou / bootstrap_fedora.sh
Last active Nov 8, 2019
New Fedora Workstation Preparation
View bootstrap_fedora.sh
#!/bin/bash
# ~ Setup a newly installed PC with Fedora Workstation 31 ~
# ~ Updated Nov 2019 ~
# Update the system
sudo dnf -y update
# Common Packages
sudo dnf install -y dnf-plugin-system-upgrade fedora-workstation-repositories
@fevangelou
fevangelou / install_elasticsearch_in_centos.sh
Last active Nov 2, 2019
Install ElasticSearch with the Cerebro UI on CentOS 6 & 7 (with or without cPanel)
View install_elasticsearch_in_centos.sh
#!/bin/bash
# /**
# * @version 1.0
# * @package Install ElasticSearch with the Cerebro UI on CentOS 6 & 7 (with or without cPanel)
# * @author Fotis Evangelou (https://kodeka.io)
# * @url https://engintron.com
# * @copyright Copyright (c) 2018 - 2019 Kodeka OÜ. All rights reserved.
# * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
# */
@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 / bootstrap.sh
Last active Sep 24, 2019
New Ubuntu Desktop 18.04 Preparation
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
#
@fevangelou
fevangelou / install_sis_graphics_on_linux.sh
Last active Sep 24, 2019
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
@fevangelou
fevangelou / display_song.html
Created Jul 1, 2019
RadioWave - Live song name from streaming server
View display_song.html
<div>Now playing: <span id="currentlyPlaying">[song info loading...]</span></div>
<script>
var url = '/path/to/get_songs.php';
function updateTitle() {
fetch(url)
.then((resp) => resp.json())
.then(function(data) {
if (data.length) {
var name = data[0].name;
document.getElementById('currentlyPlaying').innerHTML = name;
You can’t perform that action at this time.