Skip to content

Instantly share code, notes, and snippets.

@thecliguy
thecliguy / decode.php
Last active February 10, 2020 19:30 — forked from robocoder/decode.php
PHP Decoding MySQL's .mylogin.cnf
<?php
// 2019-01-28: Tested with PHP 7.0.32 (AR)
// tested with PHP 7.1.7
$start = microtime(true);
const LOGIN_KEY_LEN = 20;
const MY_LOGIN_HEADER_LEN = 24;
const MAX_CIPHER_STORE_LEN = 4;
@thecliguy
thecliguy / wordpress-install.ps1
Created January 15, 2019 10:57 — forked from TechnologistAU/wordpress-install.ps1
WordPress Installation Script for Windows Server 2016 and Windows 10 (PowerShell)
<#
================================================================================
===== WordPress Installation Script for Windows Server 2016 and Windows 10 =====
================================================================================
#>
"`r`nWordPress Installation Script for Windows Server 2016 and Windows 10"
"===================================================================="
cd ~\Downloads
$TriggerParams = @{
Daily = $true
At = '12am'
ErrorAction = 'Stop'
}
$SettingsParams = @{
ExecutionTimeLimit = [TimeSpan]::FromHours(2)
ErrorAction = 'Stop'
}
$TaskParams = @{
@thecliguy
thecliguy / weechat_bot2human.py
Last active July 14, 2018 01:24 — forked from bigeagle/weechat_bot2human.py
Replace IRC message nicknames with regex match from chat text
# -*- coding:utf-8 -*-
# Bot2Human
#
# Replaces messages from bots to humans
# typically used in channels that are connected with other IMs using bots
#
# For example, if a bot send messages from XMPP is like `[nick] content`,
# weechat would show `bot | [nick] content` which looks bad; this script
# make weecaht display `nick | content` so that the messages looks like
# normal IRC message
@thecliguy
thecliguy / win10colors.cmd
Created September 17, 2017 19:38 — forked from mlocati/win10colors.cmd
ANSI Colors in standard Windows 10 shell
@echo off
cls
echo  STYLES 
echo ^<ESC^>[0m Reset
echo ^<ESC^>[1m Bold
echo ^<ESC^>[4m Underline
echo ^<ESC^>[7m Inverse
echo.
echo  NORMAL FOREGROUND COLORS 
echo ^<ESC^>[30m Black (black)
@thecliguy
thecliguy / moodle_upgrade.sh
Created August 25, 2017 11:47 — forked from derhofbauer/moodle_upgrade.sh
Bash Moodle Upgrade Script
#!/bin/sh
echo "This script updates your moodle installation."
echo "You will need a few pieces of information to complete this process."
echo ""
echo "Warning: This will disable Web-Access to the moodle installation!"
echo "Make sure nobody is logged in at the moment or activate maintenance mode manually so no data is lost."
echo ""
echo ""
@thecliguy
thecliguy / TcpChatMessenger.cs
Created July 21, 2017 22:36 — forked from define-private-public/TcpChatMessenger.cs
Synchronous, single-threaded TCP Chat Server in C#
// Filename: TcpChatMessenger.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
@thecliguy
thecliguy / jeykll-post-counter.liquid
Created February 26, 2017 14:12 — forked from Phlow/jeykll-post-counter.liquid
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts the your jekyll posts
*
{% endcomment %}{% assign counter = 1 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}