Skip to content

Instantly share code, notes, and snippets.

View qawemlilo's full-sized avatar

Qawelesizwe Mlilo qawemlilo

View GitHub Profile
@qawemlilo
qawemlilo / ping-monitor-ideas.md
Last active January 29, 2023 08:27
Ideas on how to integrate notification channels with ping-monitor
const Monitor = require('ping-monitor');

// how to get channels
const Mailer = require('@ping-monitor/email');
const Slakey = require('@ping-monitor/slack');
const TwiT = require('@ping-monitor/twitter');
const SMS = require('@ping-monitor/sms');
/bootstrap/compiled.php
/vendor
bower_components/
node_modules/
composer.phar
.env.*.php
.env.php
.env.local.php
.env.local
@qawemlilo
qawemlilo / random_color_array.js
Created October 31, 2022 07:34 — forked from mucar/random_color_array.js
Javascript Random Color Array
var colorArray = ['#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6',
'#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D',
'#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A',
'#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC',
'#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC',
'#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399',
'#E666B3', '#33991A', '#CC9999', '#B3B31A', '#00E680',
'#4D8066', '#809980', '#E6FF80', '#1AFF33', '#999933',
'#FF3380', '#CCCC00', '#66E64D', '#4D80CC', '#9900B3',
'#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF'];
@qawemlilo
qawemlilo / dropbox-php-auth.md
Created August 24, 2022 07:38 — forked from phuze/dropbox-php-auth.md
Dropbox API V2: PHP Authentication Process

Effective September 2021, Dropbox will be deprecating long-lived access tokens.

This GIST generally describes how to authenticate requests to Dropbox API v2, for anyone working on a server-side PHP Dropbox implementation.

It's important to understand three types of codes you'll encounter:

  1. Access Code - this is a one-time code that represents user-granted app access.
  2. Access Token - this is short-lived token that provides access to Dropbox API endpoints.
  3. Refresh Token - this is a long-lived token that allows you to fetch a fresh Access Token.
@qawemlilo
qawemlilo / fail2ban.md
Created March 18, 2022 08:05 — forked from AntoOnline/Fail2Ban Cheat Sheet.md
Fail2Ban Cheat Sheet

Fail2Ban Cheat Sheet

Note:

  • Fail2ban picks up the first date and syslong on Ubuntu 20.04 does not contain a year. Change syslog config to add year to timestamp. See my syslog gist for more info.
  • When using Docker you can change the log driver to syslog

Typical file paths:

@qawemlilo
qawemlilo / fail2ban.md
Created March 18, 2022 08:04 — forked from pixelchrome/fail2ban.md
fail2ban - cheatsheet

fail2ban

Installation - Ubuntu / Debian

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fail2ban
@qawemlilo
qawemlilo / index.html
Created June 18, 2021 13:47 — forked from larsbouwens/index.html
The Netherlands GeoJSON
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<title>The Netherlands gejson map</title>
<script src="js/d3.v3.min.js"></script>
<style type="text/css">
path {fill: #000; stroke: #fff; stroke-width: 1;}}
</style>
@qawemlilo
qawemlilo / WordPress.class.php
Created October 8, 2020 15:47 — forked from Jamesking56/WordPress.class.php
Read Wordpress Export XML to PHP
<?php
/**
* WordPress class - Manages the WordPress XML file and gets all data from that.
*/
class Wordpress
{
public static $wpXML;
@qawemlilo
qawemlilo / node_nginx_ssl.md
Created April 27, 2020 07:36 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@qawemlilo
qawemlilo / mv.sh
Created April 14, 2020 10:02 — forked from premek/mv.sh
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv form renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)