Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Matovu mtvbrianking

View GitHub Profile
@mtvbrianking
mtvbrianking / digital-ocean-apache-php-mysql-https.md
Last active Aug 5, 2020
Setup digital ocean apache web server php mysql
View digital-ocean-apache-php-mysql-https.md

Login

root@ubuntu-512mb-nyc3-01:~# ssh root@xxx.xxx.xxx.xxx

Update package manager

root@ubuntu-512mb-nyc3-01:~# apt-get update

root@ubuntu-512mb-nyc3-01:~# apt-get upgrade

@mtvbrianking
mtvbrianking / build-nested-tree.php
Last active Jul 28, 2020
Build nested tree from flat array.
View build-nested-tree.php
<?php
$categories = [
['id' => 1, 'name' => 'TV & Home Theater', 'parent_id' => null,],
['id' => 2, 'name' => 'Tablets & E-Readers', 'parent_id' => null,],
['id' => 3, 'name' => 'Computers', 'parent_id' => null,],
['id' => 4, 'name' => 'Laptops', 'parent_id' => 3,],
['id' => 5, 'name' => 'PC Laptops', 'parent_id' => 4,],
['id' => 6, 'name' => 'Macbooks (Air/Pro)', 'parent_id' => 4,],
['id' => 7, 'name' => 'Desktops', 'parent_id' => 3,],
@mtvbrianking
mtvbrianking / mtn-momo-api.md
Last active Jul 22, 2020
MTN MOMO API Requests
View mtn-momo-api.md
@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

@mtvbrianking
mtvbrianking / supervisor-setup.md
Last active Jul 18, 2020
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 / dynamic-charts.js
Last active Jul 6, 2020
Create dynamic charts using ChartJS
View dynamic-charts.js
<!DOCTYPE html>
<html>
<head>
<title>Dynamic Charts</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div id="wrapper" class="row"></div>
</div>
@mtvbrianking
mtvbrianking / redis.md
Created Jun 1, 2020
Install Redis on Xampp - Windows
@mtvbrianking
mtvbrianking / laravel eloquent query debug.md
Last active May 29, 2020
Laravel debug (dump) database queries
View laravel eloquent query debug.md

Laravel debug database queries

Raw SQL

SELECT
  users.name AS staff,
  facilities.name AS facility
FROM
  users
@mtvbrianking
mtvbrianking / gitlab-ci.yml
Created Mar 28, 2020
Gitlab pages deploy swagger docs
View gitlab-ci.yml
# https://gitlab.com/mbrian/ects-ea-docs/-/ci/lint
# This file is a template, and might need editing before it works on your project.
image: node:10-alpine
# specify the location of the Open API Specification files within your project
# and the filename of the specification that you would like to display by default
variables:
DOCS_FOLDER: "specs"
SPEC_TO_DISPLAY: "rects.yaml"
@mtvbrianking
mtvbrianking / swagger editor setup.md
Created Mar 16, 2020
Swagger editor local setup
View swagger editor setup.md
You can’t perform that action at this time.