Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Matovu mtvbrianking

View GitHub Profile
@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
View ubuntu_20_lamp_setup.txt
-- Prerequisites
apt update
apt upgrade
-- Supervisor
apt install supervisor -y
supervisord --version
@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 / filter-on-return.js
Created Oct 31, 2020
jQuery filter on return
View filter-on-return.js
$.extend(true, $.fn.dataTable.defaults, {
initComplete: function(settings, json) {
var api = this.api();
var dtFilter = $.fn.dataTable.settings[0].aanFeatures.f;
var dtFilterInput = $('input', dtFilter);
dtFilterInput.unbind();
View laravel-routes.php
<?php
use Illuminate\Support\Facades\Route;
function matches($patterns, $subject)
{
if(! is_array($patterns)) {
return preg_match($patterns, $subject);
}
@mtvbrianking
mtvbrianking / vuejs-select-binding-2.vue
Last active Oct 19, 2020
vuejs select element binding
View vuejs-select-binding-2.vue
<template>
<div id="checkout">
<div class="row mt-3">
<slot></slot>
<div class="col-12 form-group">
<label class="text-small text-uppercase required" for="payment_gateway">Payment Method</label>
<select id="payment_gateway" name="payment_gateway" class="form-control"
v-on:change="chooseGateway($event)" v-model="selected">
<option v-for="_gateway in gateways"
v-bind:value="_gateway.value"
View jquery-single-vs-multiple-selection.html
<!DOCTYPE html>
<html>
<head>
<title>jQuery Single vs Multiple Selection</title>
<style>
.items {
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
@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,