Skip to content

Instantly share code, notes, and snippets.

View csdy's full-sized avatar
💵
Working on the next big thing

David Cassidy csdy

💵
Working on the next big thing
View GitHub Profile
@csdy
csdy / 00_shortcuts.md
Last active September 5, 2022 14:35
Windows Server Management Cheat Sheet

Shortcut Keys

Copy/Paste

Copy

CTRL+C

Paste

@csdy
csdy / 00_inetmgr.md
Created September 5, 2022 12:49
IIS Administration Cheat Sheet

IIS Manager

The IIS Manager application can be started with with following command:

inetmgr.exe

Optionally, the file extension can be omitted:

@csdy
csdy / .htaccess
Last active January 31, 2025 16:18
Block User Agents
# Block User Agents
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} 360spider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} 404checker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} 404enemy [NC,OR]
RewriteCond %{HTTP_USER_AGENT} 80legs [NC,OR]
RewriteCond %{HTTP_USER_AGENT} abonti [NC,OR]
RewriteCond %{HTTP_USER_AGENT} aboundex [NC,OR]
RewriteCond %{HTTP_USER_AGENT} aboundexbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} acunetix [NC,OR]
@csdy
csdy / block-dropbox-lan-sync.ps1
Created January 15, 2020 05:09
[PowerShell] Firewall Dropbox Lan Sync
$myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent();
$myWindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($myWindowsID);
$adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator;
if ($myWindowsPrincipal.IsInRole($adminRole))
{
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)";
$Host.UI.RawUI.BackgroundColor = "DarkBlue";
Clear-Host;
}
else {
@csdy
csdy / README.md
Created December 22, 2019 04:16
[Laravel] Site-Wide Options w/ View Composers

[Laravel] Site-Wide Options w/ View Composers

Database Migration

php artisan make:migration --create=options create_options_table

database/migrations/########_######_create_options_table.php

@csdy
csdy / README.md
Last active February 17, 2020 09:48
[Laravel] Installation on Shared cPanel Hosting

[Laravel] Installation on Shared cPanel Hosting

# Switch to home directory
cd ~

# Remove existing public_html directory
rm -rf public_html

# Install Laravel
@csdy
csdy / gist:a92a5cd79483529c6e196619e2d9dd85
Created April 9, 2019 09:49
NodeJS on cPanel in Subdirectory
# Proxy Requests
# public_html/myapp/.htaccess
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^$ http://127.0.0.1:3000/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]
##################################################
@csdy
csdy / .htaccess
Created September 4, 2018 22:13
Prevent rewrite of Let's Encrypt Requests
RewriteRule "^.well-known/acme-challenge" - [L]
@csdy
csdy / cpcf4.sh
Created August 28, 2018 20:32
CPCF commands
cat /home/*/access-logs/* |awk '{print $1}' |sort |uniq -c |sort -n |tail
/opt/coldfusion11/cfusion
@csdy
csdy / php_curl.php
Last active May 3, 2018 03:20
A collection of useful PHP scripts used to test various features of your PHP installation.
<?php
// Initialize resource
$curl = curl_init();
// Set options
curl_setopt($curl, CURLOPT_URL, 'http://example.com');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
// Open connection