Skip to content

Instantly share code, notes, and snippets.

View Sherlockboy's full-sized avatar
:octocat:
Focused

Khurshidbek Kobilov Sherlockboy

:octocat:
Focused
View GitHub Profile
@Sherlockboy
Sherlockboy / ubuntu-system-info.sh
Created September 14, 2025 08:26
Ubuntu System Info One-Liner - Display CPU, RAM, and Storage with usage percentages
#!/bin/bash
# Ubuntu System Info One-Liner
# Displays CPU cores, RAM size, and storage info with usage percentages
printf "CPU: %d cores, " $(nproc) && printf "%.1f%% used, %.1f%% available\n" $(awk '{u=$2+$4; t=$2+$4+$5; if (NR==3) printf "%.1f %.1f", u*100/t, (100-u*100/t)}' /proc/stat) && printf "RAM: %s total, " $(free -h | awk 'NR==2{print $2}') && printf "%s used (%.1f%%), %s available (%.1f%%)\n" $(free -h | awk 'NR==2{printf "%s %.1f %s %.1f", $3, ($3/$2)*100, $7, ($7/$2)*100}') && printf "Storage: " && df -h / | awk 'NR==2{printf "%s total, %s used (%s), %s available\n", $2, $3, $5, $4}'
# Sample Output
# CPU: 4 cores, 2.5% used, 97.5% available
# RAM: 7.6Gi total, 1.0Gi used (13.2%), 6.6Gi available (86.8%)
# Storage: 75G total, 60G used (83%), 13G available
@Sherlockboy
Sherlockboy / Zip Codes to DMAs
Created May 15, 2025 17:47 — forked from clarkenheim/Zip Codes to DMAs
TSV file containing zip codes and the DMA they fall in to. Method: calculate the centre point of every zip code geo boundary, plot those points on a DMA boundary map, find the containing DMA of each zip centroid
This file has been truncated, but you can view the full file.
zip_code dma_code dma_description
01001 543 SPRINGFIELD - HOLYOKE
01002 543 SPRINGFIELD - HOLYOKE
01003 543 SPRINGFIELD - HOLYOKE
01004 543 SPRINGFIELD - HOLYOKE
01005 506 BOSTON (MANCHESTER)
01007 543 SPRINGFIELD - HOLYOKE
01008 543 SPRINGFIELD - HOLYOKE
01009 543 SPRINGFIELD - HOLYOKE
@Sherlockboy
Sherlockboy / vscode-setup-for-php
Last active August 30, 2024 12:43
PHPStorm like VSCode setup for PHP/Laravel development with smart intellisense, code formatting and service discovery. Import this JSON file into your VSCode
{"name":"php","settings":"{\"settings\":\"{\\n \\\"workbench.colorTheme\\\": \\\"GitHub Dark Default\\\",\\n \\\"workbench.iconTheme\\\": \\\"vscode-jetbrains-icon-theme-2023-dark\\\",\\n \\\"files.autoSave\\\": \\\"afterDelay\\\",\\n \\\"workbench.activityBar.location\\\": \\\"bottom\\\",\\n \\\"workbench.statusBar.visible\\\": false,\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"window.commandCenter\\\": false,\\n \\\"workbench.layoutControl.enabled\\\": false,\\n \\\"editor.fontFamily\\\": \\\"JetBrains Mono\\\",\\n \\\"editor.fontLigatures\\\": true,\\n \\\"[php]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"open-southeners.laravel-pint\\\"\\n },\\n \\\"editor.codeLensFontFamily\\\": \\\"JetBrains Mono\\\",\\n \\\"terminal.integrated.fontFamily\\\": \\\"JetBrains Mono\\\",\\n \\\"laravel-pint.enable\\\": true,\\n \\\"editor.formatOnSave\\\": true\\n}\"}","extensions":"[{\"identifier\":{\"id\":\"adrianwilczynski.alpine-js-intellisense\",\"uuid\":\"
@Sherlockboy
Sherlockboy / Makefile
Created November 22, 2023 10:08
Makefile template for Laravel and Sail
.PHONY: help
SAIL := ./vendor/bin/sail
help: ## Display all available commands.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
install: ## Setup project and install dependencies.
@cp .env.example .env
@cp .env.example .env.testing