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 / cheats.sql
Last active May 10, 2024 23:51
MySQL Cheatsheet
-- Create a new database
CREATE DATABASE database_name;
-- Create a new user
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
-- Allow user connections to server
GRANT USAGE ON *.* TO 'username'@'%';
-- Grant user privileges on database
@csdy
csdy / screenshots.ps1
Created May 3, 2024 21:00
Capture Screenshot of All Monitors
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function CaptureScreenshot([Drawing.Rectangle]$Bounds, $Path) {
# Initialize image
$Image = New-Object Drawing.Bitmap $Bounds.Width, $Bounds.Height
$Graphics = [Drawing.Graphics]::FromImage($Image)
$Graphics.CopyFromScreen($Bounds.Location, [Drawing.Point]::Empty, $Bounds.Size)
# Save screenshot
$Image.Save($Path)
@csdy
csdy / README.md
Created April 18, 2024 16:21
Get Public IP Address

Via Browser:
https://ifconfig.me/ip

Via cURL:
curl http://ifconfig.me/ip

Via PowerShell:
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content

@csdy
csdy / firewall-toggle.ps1
Created February 1, 2024 16:53
Toggle Windows Firewall via PowerShell
# Disable Firewall
Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False
# Enable Firewall
Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled True
@csdy
csdy / README.md
Last active August 27, 2023 15:39
Common Log Files and Locations

Common Log Locations

Windows

Windows OS

Event Logs
Event logs capture a wide range of system and application events, including errors, warnings, information messages, and security-related events.
Location: %SystemRoot%\System32\winevt\Logs\

@csdy
csdy / README.md
Last active August 27, 2023 14:32
IIS — Recycle Application Pool

Recycle the Application Pool

Windows Control Panel

  • Login to the Windows Control Panel
  • Navigate to Website Settings > IIS Settings > Advanced
  • Click the "Recycle" button

IIS Manager (Manual)

  • Establish a remote desktop connection to the server
  • Launch the IIS Manager application
@csdy
csdy / README.md
Last active August 27, 2023 14:58
PHP — Error Display

Enabling Error Display

Server-Wide Error Display (VPS Only)

Windows (VPS Only)

Enable Error Display

  • Establish a remote desktop connection to the server
  • Open Explorer
  • Navigate to C:\PHP\X.X (where "X.X" is the PHP version you wish to modify)
@csdy
csdy / README.md
Created August 27, 2023 13:30
IIS — Error Display

Enabling Error Display

Windows Control Panel

Enabling Error Display

  • Login to the Windows Control Panel
  • Navigate to Website Settings > IIS Settings > Advanced
  • Change the Error Mode to "Detailed"
  • Click the "Save" button
@csdy
csdy / README.md
Last active August 27, 2023 13:22
ColdFusion — Robust Exceptions

Enabling Robust Exceptions

Server-Wide Exceptions (VPS Only)

Enabling Exceptions

  • Login to the Windows Control Panel
  • Navigate to Website Settings > IIS Settings > Advanced
  • Change the Error Mode to "Detailed"
  • Click the "Save" button
  • Login to the ColdFusion Administrator
@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