Skip to content

Instantly share code, notes, and snippets.

@mrgarymartin
mrgarymartin / StreamLabsCloudbot.md
Created Dec 14, 2020
Streamlabs Cloudbot Commands updated 12/2020
View StreamLabsCloudbot.md

====== Streamlabs Cloudbot 2020 Updated======

***This is a updated doc for Cloudbot. Supported by Tunerzedge.

Streamlabs Chatbot (SLCB), formerly known as AnkhBot, is a self-hosted bot solution developed by [https://twitter.com/ankhheart|AnkhHeart] for Twitch streamers with a number of unique features, as well as now officially integrates with [https://www.streamlabs.com/|Streamlabs] and its exclusive services. Not to mention the software and all of its features are completely free.

There's numerous resources for learning how to utilize the bot to its fullest potential, but this documentation is an attempt at an all in one, quick and simple source for getting started and beyond. It's also important to note that a lot of these commands use an external API, coded and provided by the user [https://decapi.me/|Decicus] that would otherwise be impossible to do with the bot alone.


@mrgarymartin
mrgarymartin / cleanup-docker.sh
Last active Dec 9, 2020
This script installs automated docker cleanup via "docker image prune"
View cleanup-docker.sh
#!/bin/sh
# This script installs automated docker cleanup via "docker image prune"
# onto systemd-based systems.
# It requires that docker is installed properly
# source: https://techoverflow.net/2019/10/03/how-to-automatically-cleanup-prune-docker-images-daily/
cat >/etc/systemd/system/PruneDocker.service <<EOF
[Unit]
Description=PruneDocker
@mrgarymartin
mrgarymartin / firewall.sh
Created Feb 23, 2018
Updated version to whitelist all cloudflare ips in firewalld
View firewall.sh
#!/usr/bin/env bash
#https://techstat.net/automatic-whitelist-cloudflare-ips-firewalld-bash-script-via-cron-job/
SERVER_IP=xxx.xxx.xxx.xxx
for i in $(curl "https://www.cloudflare.com/ips-v4"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="'$i'" port port=80 protocol=tcp accept'; done
for i in $(curl "https://www.cloudflare.com/ips-v4"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="'$i'" port port=443 protocol=tcp accept'; done
for i in $(curl "https://www.cloudflare.com/ips-v6"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv6" source address="'$i'" port port=80 protocol=tcp accept'; done
for i in $(curl "https://www.cloudflare.com/ips-v6"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv6" source address="'$i'" port port=443 protocol=tcp accept'; done
@mrgarymartin
mrgarymartin / centos-build.sh
Last active Feb 13, 2018
build centos 7.4 with php7 mysql 5.7 and nginx nodejs composer
View centos-build.sh
#!/usr/bin/env bash
# update system
sudo yum update -y
# install basic items
sudo yum install -y vim wget git epel-release
#set timezone
timedatectl set-timezone America/Chicago
@mrgarymartin
mrgarymartin / mysql_5-7_update.sh
Last active Jul 20, 2016 — forked from dj1020/migrate.sh
Upgrade MAMP to Mysql 5.7 tested by Ken Lin 2015/11/09
View mysql_5-7_update.sh
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@mrgarymartin
mrgarymartin / mysql_5-6_update.sh
Last active Jul 19, 2016 — forked from tobi-pb/migrate.sh
Upgrade MAMP to Mysql 5.6
View mysql_5-6_update.sh
#!/bin/sh
curl -O http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz
tar xfvz mysql-5.6*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@mrgarymartin
mrgarymartin / convertArrayToOject.php
Last active May 4, 2016
Convert Array to Object Function
View convertArrayToOject.php
<?php
/**
* Convert Arrays to Class Objects
* Author: Gary Martin
* Date: 5/2/2016
*
* Description: This Converts arrays to Objects that have getters and setters preventing.
* If the $key is not defined in the model it gets skipped.
* The model must have a getAttributes function that returns the attributes in a array.
* This code will reduce that to check if its in the array.
@mrgarymartin
mrgarymartin / lockdown.sh
Created Dec 11, 2015
Lockdown IPTables to all traffic Expect STATIC IPs.
View lockdown.sh
#!/usr/bin/env bash
## Author: Gary Martin
##
## Usage ./lockdown.sh {IPADDRESS} {IPADDRESS2}
function valid_ip()
{
local ip=$1
local stat=1
@mrgarymartin
mrgarymartin / index.html
Created Oct 8, 2015
Bare Boostrap Template with CDNs
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">