Skip to content

Instantly share code, notes, and snippets.

View penwelldlamini's full-sized avatar

Penwell Dlamini penwelldlamini

View GitHub Profile
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 30, 2024 12:19
crack activate Office on mac with license file
@mattrude
mattrude / cloudkey-update-cert.sh
Last active May 5, 2021 05:45
Install a Let's Encrypt certificate on a UniFi Cloud Key controller
#!/bin/sh
HOSTNAME="unifi.lan.therudes.com"
EMAIL="matt@mattrude.com"
# Update the System before we start
rm -f /tmp/installed-packages.txt
echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list
dpkg --get-selections |awk '{print $1}' |sed 's/:amd64//g' |sed 's/:armhf//g' > /tmp/installed-packages.txt
UPDATE="" # Start out with UPDATE being NULL
@stroebs
stroebs / make-chr.sh
Last active May 26, 2024 07:02
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@heri16
heri16 / NetwatchGatewayStates.rsc
Last active December 19, 2021 11:13
Mikrotik RouterOS Script to do proper uplink failover/failback (more reliable than Netwatch)
# Mikrotik RouterOS Script to do proper uplink failover/failback (more reliable than Netwatch).
# Supports both Generic and PPPoE interfaces.
# Policy: read, write, policy, test
### Configuration ###
# Define Names of all Interfaces that will be checked:
:local "interface-names" { "internet-speedy";"internet-biznet" };
@k0nsl
k0nsl / php-ping.php
Created January 21, 2015 17:19
PHP ping script
<?php
/*
*
* Use the examples below to add your own servers. Coded by clone1018 [?]
*
*/
$title = "Simple Server Status"; // website's title
$servers = array(
'Google Web Search' => array(
@patotoma
patotoma / ContactForm.md
Last active October 7, 2023 07:39
secure php contact form

Secured PHP Contact Form

<?php
  if(isset($_POST['submit'])){
    $name = htmlspecialchars(stripslashes(trim($_POST['name'])));
    $subject = htmlspecialchars(stripslashes(trim($_POST['subject'])));
    $email = htmlspecialchars(stripslashes(trim($_POST['email'])));
    $message = htmlspecialchars(stripslashes(trim($_POST['message'])));
    if(!preg_match("/^[A-Za-z .'-]+$/", $name)){