Skip to content

Instantly share code, notes, and snippets.

@matdave
matdave / sucuri_whitelist.sh
Last active December 4, 2023 16:25
Bulk Sucuri Whitelist
#!/bin/bash
# This script will whitelist the IP address of the server in Sucuri's firewall.
# Variables
# The API key for the Sucuri API
API_KEY=""
# The API secret for the Sucuri API
API_SECRET=""
@matdave
matdave / d1
Created December 1, 2023 16:12
mxmkjvgsdzfhseightonetwoeight7
3five4s84four9rtbzllggz
75sevenzdrpkv1onetwo
3q7ctkghhqkpb5four
ccxpblrgrjxcgrhjxfmtwonine8eightzzrdn4
6lqjrhbnxxcqlpnmjsthreesixxsxcgqsxmdx7
35llbrhh
fivethreejcqpfqmcmvjlmhlbzpxlsmktzkmtmv8p
3369eightnine89
onesix4qqnlzdsevennmmrcgkndlsgm3
@matdave
matdave / myzendesktickets.py
Last active July 11, 2023 13:59
Pipedream Scripts
import requests
import json
import os
from pipedream.script_helpers import (steps, export)
from datetime import timedelta, datetime
from dotenv import load_dotenv
load_dotenv()
# Zendesk API credentials
ZENDESK_SUBDOMAIN = os.getenv("ZENDESK_SUBDOMAIN")
@matdave
matdave / waka2clockify.py
Last active June 23, 2023 16:04
Clockify Python Scripts
# Script rewritten for PipeDream.com
import requests
import datetime
import base64
import os
# Wakatime API endpoint for getting time entries
WAKATIME_API_ENDPOINT = "https://wakatime.com/api/v1/users/current/summaries"
# Your Wakatime API Key
@matdave
matdave / wp_posts-to-modx_site_content.sql
Last active March 27, 2023 14:24
WordPress to MODX MySQL Base Scripts
SELECT
ID id,
'document' type,
post_title pagetitle,
post_excerpt description,
post_name alias,
1 published,
0 isfolder,
REGEXP_REPLACE(post_content, '<!-- (.*) -->', '') content,
1 richtext,
@matdave
matdave / teleport.modxcloud.md
Last active November 29, 2022 22:21
Using teleport in MODX Cloud

Install Composer

SSH into the primary clouds as the cXXXX user, then run the following commands:

> cd www
> curl http://modx.co/scripts/install.sh | sh
> source ~/.profile
@matdave
matdave / gitifysetup.md
Last active September 1, 2022 21:15
Hooking up a staging environment to gitify

Hooking up a staging environment to a Gitify Project

Install Gitify

Use composer to install Gitify on your environment

composer global require modmore/gitify:^2

Install a clean MODX environment

@matdave
matdave / logid.cfg
Created May 4, 2022 14:22
LogiOps MX Master 2S
devices: (
{
name: "Wireless Mouse MX Master 2S";
smartshift:
{
# Do not enable free scroll
on: true;
threshold: 15; # 7 is ideal for work
};
hiresscroll:
@matdave
matdave / FredPreview.plugin.php
Created April 20, 2022 19:07
Make Fred play nice w/ Preview
<?php
//** On WebPage Pre-Render **//
$corePath = $modx->getOption('preview.core_path', null, $modx->getOption('core_path') . 'components/preview/');
require_once $corePath . '/model/preview/preview.class.php';
$preview = new Preview($modx);
if(!$modx->user->hasSessionContext('mgr')) return; // currently forcing manager context
if(!$modx->getOption('preview.frontendEnabled')) return; // currently forcing manager context
$qsItem = $modx->getOption('preview.previewKey');
$compareItem = $modx->getOption('preview.compareKey');
@matdave
matdave / index.php
Created November 5, 2021 17:41
PHP to HTML
<?php
$base_path = dirname(__FILE__) . '/content/';
if($_GET['q']) {
$q = explode('?', $_GET['q']);
$file_check = $base_path.preg_replace('"\.html$"', '.php', $q[0]);
if (substr($file_check, -1) == "/") {
$file_check .= "index.php";
}