Skip to content

Instantly share code, notes, and snippets.

View ngrogg's full-sized avatar

Nicholas Grogg ngrogg

View GitHub Profile
@ngrogg
ngrogg / FedoraFirstSteps.sh
Created August 31, 2025 11:16
Fedora first steps for new installs
# Configure dnf for faster downloads
sudo echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf
sudo echo "fastestmirror=True" >> /etc/dnf/dnf.conf
# Enable rpmfusion repos
sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# Update system
sudo dnf update -y && sudo dnf upgrade -y && sudo dnf autoremove -y
@ngrogg
ngrogg / genericApacheVhost.conf
Created August 1, 2025 00:59
Generic Apache Vhost
#TODO: Replace * w/ server private IP
<VirtualHost *:80>
ServerName temp.com
ServerAlias www.temp.com
# Use 302 for SEO
Redirect 302 / https://temp.com/
</VirtualHost>
#TODO: Replace * w/ server private IP
<VirtualHost *:443>
@ngrogg
ngrogg / genericNginxVhost.conf
Last active August 1, 2025 00:57
Generic Nginx Vhost
# HTTP Section
server {
## Listen on HTTP port
listen 80;
listen [::]:80;
#TODO: Replace w/ domain
## Domain
server_name temp.com www.temp.com;
@ngrogg
ngrogg / LinuxKeychronLauncherNotes.md
Last active July 24, 2025 12:50
Fix for keychron keyboard not showing up on launcher.keychron.com on Linux

Chromium based browser required per launcher site.
In this writing Brave Browser is used, Opera, Edge etc. should be similar if not idential process.

Replicate issue,
URL: https://launcher.keychron.com/#/keymap
Choose "Connect +"
Select device
Message HID Device Connected with a red X.
"Connect +" spins on "Connecting".

@ngrogg
ngrogg / SWAP notes
Created February 19, 2025 05:20
SWAP notes
One-liner for screen sessions
4 GB
dd if=/dev/zero of=/swapfile bs=1M count=4096 status=progress; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile; echo "/swapfile none swap defaults 0 0" >> /etc/fstab; swapon --show; exit
2 GB
dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile; echo "/swapfile none swap defaults 0 0" >> /etc/fstab; swapon --show; exit
1 GB
dd if=/dev/zero of=/swapfile bs=1M count=1024 status=progress; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile; echo "/swapfile none swap defaults 0 0" >> /etc/fstab; swapon --show; exit
@ngrogg
ngrogg / someUsefulTCPPorts.md
Created July 5, 2024 20:41
Some useful TCP ports and their default services

Some useful TCP ports and their default services

21, FTP, not HIPAA compliant!
22, SSH and SFTP
23, telnet used for checking ports
25, SMTP
53, domain name services (such as BIND); TCP and UDP are the same
80, HTTP
110, Post Office Protocol 3
443, HTTPS

@ngrogg
ngrogg / someUsefulOpenssl.md
Last active July 5, 2024 04:33
Some useful OpenSSL commands

Some useful OpenSSL commands

Generate self-signed SSL and key,
sudo openssl req -x509 -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.cert

/etc/apache2 (deb)
/etc/httpd/conf.d (rpm)

Generate CSR:
openssl req -nodes -newkey rsa:4096 -keyout privkey.pem -out csr.pem

@ngrogg
ngrogg / databaseCommands.md
Created June 30, 2024 23:30
Some useful database commands

Some useful database commands

PostgreSQL/PSQL

To access postgres from database server as postgres user,
su - postgres
psql

To access as specific user to specific database,
psql -d DATABASE -U USER -W

@ngrogg
ngrogg / csfCommands.md
Created June 30, 2024 10:21
Some useful CSF commands

Some useful CSF firewall commands

csf -a IP; Allow IP, use /etc/csf/csf.allow instead
csf -d IP; Block an IP
csf -dr IP; Remove an IP block
csf -e; Enable csf
csf -g IP; Check for blocks on IP
csf -ra; Restart csf
csf -cd; cluster deny ip
csf -cr; cluster unblock ip

@ngrogg
ngrogg / PowerShellCommands.md
Last active June 26, 2024 12:37
Some useful PowerShell commands

Some useful PowerShell commands

Check disk use (Windows), run in PowerShell as admin:
Get-ChildItem c:\ -r -ErrorAction SilentlyContinue –Force |sort -descending -property length | select -first 10 name, DirectoryName, @{Name="MB";Expression={[Math]::round($_.length / 1MB, 2)}}
gci C:\inetpub -r| sort -descending -property length | select -first 10 name, @{Name="GB";Expression={[Math]::round($_.length / 1GB, 2)}}

Get subdirectory size in PowerShell:
$colItems = Get-ChildItem C:\ -ErrorAction SilentlyContinue -Force | Where-Object {$_.PSIsContainer -eq $true} | Sort-Object
foreach ($i in $colItems)
{