Skip to content

Instantly share code, notes, and snippets.

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 / book.md
Created Jan 2, 2021
Pure Bash Bible
View book.md
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/install/storage) is outdated/wrong. And as of March 2021 it's possible that there's a bug as well with how the bios_grub partitions are created when using multiple disks.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage configuration 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 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
#
@fevangelou
fevangelou / install_sis_graphics_on_linux.sh
Last active Apr 2, 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