Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Matovu mtvbrianking

View GitHub Profile
@mtvbrianking
mtvbrianking / redis.md
Last active Oct 11, 2021
Install Redis on Xampp - Windows
View redis.md

Redis

Linux

jdoe@home-pc:~# apt-get install redis-server
jdoe@home-pc:~# systemctl enable redis-server@.service
jdoe@home-pc:~# apt-get update
jdoe@home-pc:~# apt-cache pkgnames | grep php7.4
jdoe@home-pc:~# apt install php7.4-redis
View ubuntu_20_lamp_setup.txt
-- Prerequisites
apt update
apt upgrade
-- Supervisor
apt install supervisor -y
supervisord --version
@mtvbrianking
mtvbrianking / linux-foundation.md
Created Oct 5, 2021
Linux Foundation Certifiactions - LFCA . LFCS . LFCE
View linux-foundation.md

Linux Foundation Certified

IT Associate (LFCA)

Linux Fundamentals - 20%

  • Linux Operating System
  • File Management Commands
  • System Commands
  • General Networking Commands
@mtvbrianking
mtvbrianking / supervisor-setup.md
Last active Sep 19, 2021
Setup supervisor process monitor, centos
View supervisor-setup.md

[TOC]

Supervisor is a process monitor for the Linux operating system.

Prerequisites

Check CentOS version

sudo rpm -q centos-release
@mtvbrianking
mtvbrianking / digital-ocean-apache-php-mysql-https.md
Last active Sep 18, 2021
Setup digital ocean apache web server php mysql
View digital-ocean-apache-php-mysql-https.md

Prerequisties

Login

bmatovu@home-pc:~# ssh root@xxx.xxx.xxx.xxx

root@ubuntu-512mb-nyc3-01:~$ sudo su

root@ubuntu-512mb-nyc3-01:~#
@mtvbrianking
mtvbrianking / ssh.sh
Created Aug 9, 2021
SSH into remote servers
View ssh.sh
#!/bin/bash
# https://stackoverflow.com/q/13928116/2732184
# https://stackoverflow.com/q/1405324/2732184
SERVERS=("LOCAL", "REMOTE")
HOSTS=("127.0.0.1", "165.56.23.4")
PORTS=("22", "3409")
USERS=("root", "jdoe")
KEYS=("secret", "Ytrewq!123")
@mtvbrianking
mtvbrianking / xmltidy.sh
Last active Jul 25, 2021
xmllint indent and file overwrite helpers
View xmltidy.sh
# https://stackoverflow.com/a/40190976/2732184
# https://unix.stackexchange.com/a/50202/315380
# https://askubuntu.com/a/222371/575565
file=""
indent=" "
overwrite=0
while [ $# -gt 0 ]
do
View sublime-text-context-menu-install.bat
@echo off
SET sublPath=C:\Program Files\Sublime Text\sublime_text.exe
rem add context menu to all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text" /t REG_SZ /v "" /d "Edit with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%sublPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text\command" /t REG_SZ /v "" /d "%sublPath% \"%%1\"" /f
rem add context menu to folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@mtvbrianking
mtvbrianking / array-of-objects-search.js
Last active May 27, 2021
Javascript array of objects search
View array-of-objects-search.js
"use strict";
var users = [
{
id: 1,
alias: "jdoe",
name: "John Doe"
},
{
id: 2,
@mtvbrianking
mtvbrianking / centos-cron-jobs.md
Created Jul 8, 2019
Setup cron jobs on centos
View centos-cron-jobs.md

Centos cron jobs

  1. Let's create a directory this purpose.

# cd

[root@server ~]# mkdir crontests

[root@server ~]# cd crontests