sysop@hub:~/cheat-sheets$
cheat-sheets
Commands, queries and lookup tables you can copy. Each sheet has its own filter, and every snippet is in the site search.
microsoft 365 9
Exchange, Teams, SharePoint, compliance and licences.
exchange-onlineMailbox delegation, mail flow rules, message trace and audit.19 snippetsmail-flowMessage trace, quarantine, spam verdict headers, forwarding, connectors and DKIM.22 snippetsemail-error-codesExchange Online and Microsoft 365 bounce codes with the usual fix.14 codessharepoint-teamsPnP PowerShell for SharePoint sites and Teams policies.16 snippetsteams-phoneAssign numbers, voice routing, dial plans, Direct Routing, auto attendants and queues.19 snippetspurview-complianceAudit log search, retention, DLP, labels, eDiscovery.12 snippetslicense-comparisonMicrosoft 365 and Entra ID plans side by side: what is really included in each.25 featuresdefender-office-365Read the mail protection policies, find risky allows, quarantine, block lists, purge a phish, hunting queries.27 snippetssharepoint-sharingTenant and site sharing levels, Anyone links, guest expiry, who may invite, guests in groups, sharing audit.27 snippets identity 6
Entra ID, hybrid identity, roles and permissions.
graphMicrosoft Graph PowerShell for users, licences, sign-in logs and Conditional Access.11 snippetsentra-pimEligible and standing role assignments, activation, role settings, access reviews.18 snippetsentra-connectSync cycles, staging mode, ImmutableID matching, password hash sync and dsregcmd.22 snippetsentra-id-rolesWhat common Entra ID directory roles can actually do.21 rolesgraph-permissionsDelegated vs application permissions and what each one allows.23 permissionscertificate-authenticationCertificate stores, PFX export/import, smart card readers, Windows Hello for Business.10 snippets hunting and logs 5
Queries and the places to look when something is wrong.
devices 8
Intune, Autopilot, encryption and updates.
intune-defenderJoin state, MDM sync, diagnostics, Defender status, scans and attack surface reduction.13 snippetsintune-app-deploymentWin32 packaging, silent installs, detection scripts, return codes, logs and retries.22 snippetsautopilot-deploymentHardware hash export, device registration, group tags, ESP diagnostics.10 snippetsbitlockerStatus, recovery keys from device, AD and Entra ID, suspend before firmware updates.19 snippetswindows-lapsRead and rotate local admin passwords, set permissions, check the active policy.18 snippetswindows-updateWhich policy applies, WSUS leftovers, safeguard holds, logs and the classic repairs.21 snippetsmacos-adminSystem info, updates, users, FileVault, Gatekeeper, MDM, network and DNS, logs, disks, launchd.33 snippetsprinter-troubleshootingStuck queue, spooler, add and remove printers and drivers, the print log, 0x0000011b and friends.24 snippets windows and active directory 6
On-premises servers, the domain and the classic tools.
powershellEveryday PowerShell for Exchange Online, Active Directory and Windows security checks.14 snippetsactive-directoryLockouts, stale accounts, replication, DC health and the checks an attacker runs first.25 snippetsgroup-policyList, report, back up and find links for Group Policy objects.7 snippetswindows-troubleshootingsfc, DISM, gpresult, services, processes and network resets.19 snippetswindows-server-rolesAD DS, AD CS, DNS, DHCP, IIS, Hyper-V, WSUS and more explained.13 rolesntfs-share-permissionsRead and fix permissions with icacls and PowerShell, find who has access, copy with permissions intact.22 snippets network and crypto 14
Connectivity, DNS, certificates and what is still safe to use.
networkingnmap, dig, curl, openssl, tcpdump and Wireshark filters.16 snippetswifi-networkWi-Fi status, saved profiles and connectivity tests on Windows.6 snippetsdns-record-typesA, AAAA, MX, TXT, SPF, DKIM, DMARC, CAA, SRV and DNSSEC explained.15 record typessshKeys, port forwarding, jump hosts, copying files and hardening sshd.18 snippetsopensslInspect and convert certificates, build a CSR, check a chain, test a TLS endpoint.17 snippetscryptoHashes, encryption, keys and TLS rated recommended to broken.24 entrieshttp-status-codesHTTP response codes with common causes and what to check.37 codeswireguardKeys, server and client config, site-to-site, routing and NAT, and why there is no handshake.24 snippetsopenvpnRead the log, the usual errors, certificates and revocation, routes and DNS, testing by hand.23 snippetsswitching-vlanFind a device by MAC, VLANs and trunks, why a port is down, spanning tree, PoE, LLDP.26 snippetsdns-dhcpNo address or 169.254, leases and reservations, rogue DHCP servers, name resolution step by step.27 snippetssnmp-monitoringsnmpwalk and snmpget for v2c and v3, the OIDs worth knowing, counters into bandwidth, quick checks.18 snippetsvoip-sip-troubleshootingHow a call is set up, one-way audio and NAT, codecs, QoS, SIP response codes, capturing a call.18 snippetslets-encryptcertbot for nginx and Apache, DNS challenge for wildcards, renewal, hooks, staging, fixing a failed renewal.13 snippets cloud and devops 14
Azure, infrastructure as code, containers and Linux.
azure-cliAzure CLI commands for subscriptions, resource groups, VMs, roles, networking and storage checks.16 snippetsazure-limitsDefault Azure subscription and service limits.23 limitsbicep-armDeployments, what-if, modules, loops and Key Vault references.12 snippetsterraformAzure resources, variables, remote state, count, for_each, core workflow.14 snippetsdockerDocker and Compose commands for containers, images, logs, cleanup and safer runs.17 snippetsdocker-composeVolumes, networks, health checks, overrides and resource limits.10 snippetslinuxLinux commands for admins and security checks.14 snippetsgitEveryday Git: branches, undo, stash, rebase and finding who changed what.15 snippetsazure-networkingSubnets, NSG rules open to the internet, effective routes, Network Watcher checks, private endpoints, DNS, VPN.25 snippetssystemd-journalctlWhy a service failed, logs by unit and time, overrides, timers, writing a unit, journal size.28 snippetslinux-users-permissionsAccounts, groups, sudo rules, chmod and chown, shared folders, ACLs, and why access is denied.29 snippetslinux-disks-lvmWhat fills the disk, add and mount a disk, grow a volume with LVM, snapshots, SMART, swap, repair.27 snippetsnginx-apacheTest and reload, virtual hosts, reverse proxy, HTTPS, Let's Encrypt, log analysis, 502 and 504.28 snippetsansibleInventory, ad-hoc commands, playbooks, check mode, vault, roles, limiting a run.20 snippets virtualisation and storage 4
Hypervisors, virtual machines, ZFS and the disks underneath.
proxmoxVMs and containers, snapshots, vzdump backup and restore, storage, cluster and quorum, migration.29 snippetshyper-vVMs, checkpoints and leftover AVHDX files, virtual disks, switches and VLANs, export, migration, replication.27 snippetsvmware-esxiList and control VMs, end a stuck VM, forgotten snapshots, datastores, networking, esxtop, logs.27 snippetszfs-nasPool health and scrubs, replacing a disk, datasets, snapshots, replication, SMART tests, testing shares.29 snippets databases 6
SQL itself, and keeping PostgreSQL, MySQL and SQL Server alive.
sql-basicsSelect, filter, join, group, change data safely, and the patterns that answer most questions.26 snippetspostgresql-adminLook around, users and rights, running queries and locks, sizes, vacuum, backup and restore.29 snippetsmysql-mariadb-adminUsers and grants, process list and locks, sizes, slow query log, InnoDB, backup and restore.28 snippetssql-server-adminRunning queries and blocking, backup and restore, the full log file, sizes, indexes, integrity checks.27 snippetsdatabase-backup-restoreNightly dumps, point-in-time recovery, restore tests, and what makes a backup worthless.23 snippetssql-window-functionsROW_NUMBER, RANK, running totals, LAG and LEAD, top N per group, percent of total, gaps, duplicates.15 snippets scripting 3
Bash, PowerShell and Python for people who automate on the side.
bash-scriptingA safe skeleton, arguments, tests, loops over odd file names, trap, locking, logging, retries.27 snippetspowershell-scriptingParameters, error handling, objects and the pipeline, CSV and JSON, REST, remoting, credentials, scheduled tasks.26 snippetspython-for-adminsFiles, CSV and JSON, running commands, HTTP, regex, arguments, logging, ports, many hosts at once.28 snippets Nothing here matches. Try the site search with Ctrl+K.