Skip to content

Instantly share code, notes, and snippets.

Fotis Evangelou fevangelou

View GitHub Profile
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.
@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 / 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 / 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;
@fevangelou
fevangelou / install_elasticsearch_in_centos.sh
Last active May 8, 2020
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 / bootstrap.sh
Last active Apr 16, 2019
ClearLinux Desktop Preparation
View bootstrap.sh
#!/bin/bash
sudo swupd check-update
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
#sudo hostnamectl set-hostname fe-thinkpad-x240
sudo swupd bundle-add desktop-apps-extras desktop-assets desktop-lxqt fonttools libreoffice wget
@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 Jul 3, 2020
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 / 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 / index.desktop_or_mobile.php
Created Dec 18, 2018
Code to utilize different sub-templates for desktop and mobile in Joomla. Usage: Add right after the opening <html> tag
View index.desktop_or_mobile.php
// Desktop to Mobile redirect and vise-versa
// Usage: Add right after the opening <html> tag
// For the desktop template:
<!-- Browser detect and redirect -->
<script type="text/javascript">
(function() {
// Get URL query strings
function getQS(v) {
You can’t perform that action at this time.