TechOps and IT operations cheat sheet
IT operations on a few screens: Linux admin commands, systemd and journalctl, a network diagnosis ladder with Linux, macOS and Windows commands side by side, store network troubleshooting, accounts and MFA, the device fleet and the service desk. Keep it open on the support desk and on store visits.
Linux admin: "I want to..."
Commands for Debian, Ubuntu and the RHEL family. Where they differ, both are shown. Check the host name in your prompt before anything destructive (Linux CLI).
| I want to... | Command | Lesson |
|---|---|---|
| Know which machine and OS this is | hostname, cat /etc/os-release, uname -r (kernel) | Linux CLI |
| See load, memory and disk | uptime, free -h, df -h | Linux CLI |
| Find what fills the disk | sudo du -sh /var/* | sort -h; big files: sudo find / -xdev -type f -size +500M | Linux CLI |
| See the heaviest processes | ps aux --sort=-%cpu | head, or top (press M to sort by memory) | Linux CLI |
| Stop a process politely, then firmly | kill <pid> (TERM), then kill -9 <pid> only if it ignores that | Linux CLI |
| Follow a log file | tail -f /var/log/syslog (Debian, Ubuntu) or /var/log/messages (RHEL) | Linux CLI |
| Install updates | sudo apt update && sudo apt upgrade or sudo dnf upgrade | Device fleet |
| Add a user with a home folder | sudo useradd -m -s /bin/bash ama, then sudo passwd ama | Accounts and MFA |
| Give a user admin rights | sudo usermod -aG sudo ama (Debian, Ubuntu) or -aG wheel (RHEL) | Accounts and MFA |
| Lock an account when someone leaves | sudo usermod -L ama and sudo chage -E 0 ama; remove their SSH keys | Accounts and MFA |
| See a user's groups and recent logins | id ama, last -n 20 | Accounts and MFA |
| Set file owner and permissions | sudo chown sync:sync /opt/sync/config.yml, chmod 640 /opt/sync/config.yml | Linux CLI |
| Make an SSH key and install it | ssh-keygen -t ed25519, then ssh-copy-id user@host | Accounts and MFA |
| Copy a folder to another host | rsync -avz ./reports/ user@host:/srv/reports/ (add --dry-run first) | Shell scripts |
| Pack and unpack an archive | tar -czf logs.tar.gz /var/log/app, tar -xzf logs.tar.gz | Linux CLI |
| Run a job on a schedule | crontab -e; 15 2 * * * /opt/sync/nightly.sh = 02:15 every day | Shell scripts |
systemd and journalctl
On systemd distributions (most current ones) services are units. After editing a unit file, run sudo systemctl daemon-reload before restarting it (Linux CLI).
| I want to... | Command | Lesson |
|---|---|---|
| See whether a service runs, and its last log lines | systemctl status nginx | Linux CLI |
| Start, stop, restart, reload config | sudo systemctl start|stop|restart|reload nginx | Linux CLI |
| Start now and at every boot | sudo systemctl enable --now sync-agent | Linux CLI |
| List everything that failed | systemctl --failed | Linux CLI |
| Read a service's logs for the last hour | journalctl -u nginx --since "1 hour ago" | Linux CLI |
| Follow logs live | journalctl -u sync-agent -f | Linux CLI |
| Only errors since this boot | journalctl -p err -b | Linux CLI |
| Logs from the previous boot (after a crash) | journalctl -b -1 (needs persistent journal storage) | Linux CLI |
| See and shrink journal disk use | journalctl --disk-usage, sudo journalctl --vacuum-time=14d | Linux CLI |
| See scheduled timers | systemctl list-timers | Shell scripts |
A service unit to copy
Save as /etc/systemd/system/sync-agent.service. It restarts the store sync agent if it crashes and waits for the network at boot (Linux CLI).
[Unit]
Description=Mangrove store sync agent
After=network-online.target
Wants=network-online.target
[Service]
User=sync
ExecStart=/opt/sync/bin/sync-agent
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetSafer shell scripts
Start every bash script with strict mode, quote every variable, and run ShellCheck on it before it touches 320 stores (Shell scripts).
#!/usr/bin/env bash
set -euo pipefail # stop on errors, unset variables and failed pipes
store="${1:?usage: rotate-logs.sh STORE_ID}"
dry_run="${DRY_RUN:-1}" # default to a dry run
for f in /var/log/pos/"$store"/*.log; do
if [[ "$dry_run" == "1" ]]; then
echo "would compress $f"
else
gzip -- "$f"
fi
doneNetwork diagnosis ladder
Work from the bottom up and stop at the first rung that fails. On Windows PowerShell 5.1, curl is an alias for Invoke-WebRequest; type curl.exe to get real curl, which ships with Windows 10 and 11 (Store networks, Networking).
| Question | Linux and macOS | Windows | Lesson |
|---|---|---|---|
| Do I have an address, and which one? | ip a (macOS: ifconfig) | ipconfig /all | Store networks |
| What is my gateway? | ip route (macOS: netstat -rn) | ipconfig, route print | Store networks |
| Can I reach the gateway, then the internet? | ping -c 4 192.168.10.1, then ping -c 4 1.1.1.1 | ping -n 4 192.168.10.1 | Store networks |
| Does the name resolve? | dig api.example.com +short or nslookup | Resolve-DnsName api.example.com or nslookup | Networking |
| Where along the path does it stop? | traceroute, or mtr if installed | tracert, pathping | Networking |
| Is the port open? | nc -vz api.example.com 443 | Test-NetConnection api.example.com -Port 443 | Store networks |
| Does the web service answer? | curl -I https://api.example.com/health | curl.exe -I https://api.example.com/health | Request journey |
| Is the certificate valid? | openssl s_client -connect api.example.com:443 -servername api.example.com | Open the URL in a browser; view the certificate | Cryptography |
| What is listening here? | sudo ss -tulpn (macOS: lsof -iTCP -sTCP:LISTEN) | netstat -ano, Get-NetTCPConnection -State Listen | Linux CLI |
| Which devices are on my segment? | ip neigh (macOS: arp -a) | arp -a | Store networks |
| Clear a stale DNS cache | resolvectl flush-caches (systemd-resolved); macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | ipconfig /flushdns | Networking |
| Get a fresh DHCP address | Depends on the network manager; reconnect the interface | ipconfig /release, then ipconfig /renew | Store networks |
Store network: if you see X, check Y
Mangrove's tills keep selling offline and queue sales for upload, so "the internet is down" is rarely a stop-the-store emergency. Card payments and app orders are the urgent part (Store networks, Offline sync).
| You see | Likely cause | Check first | Lesson |
|---|---|---|---|
| All tills offline, phones on mobile data fine | Store line or router down | Router lights and WAN status; fail over to the 4G backup link if the store has one | Store networks |
| One till offline, the others fine | Cable, switch port or that till's settings | Link light; swap the cable or port; ipconfig /all on the till | Store networks |
| Address starts with 169.254 | No DHCP answer (Windows gave itself an address) | DHCP server or scope full; VLAN on the switch port | Store networks |
| Websites by IP work, by name do not | DNS | nslookup against the store's DNS and a public one | Networking |
| Handheld scanners drop in the cold room or stockroom | Weak Wi-Fi signal or roaming between access points | Signal strength at that spot; access point placement and channels | Store networks |
| Everything slow at the same time each day | Link saturated: backups, updates or video streams | Router traffic graphs; schedule updates at night; traffic priority for payments | Store networks |
| "Certificate not valid" on many devices at once | Device clocks wrong, or a certificate expired | Date and time on the device; NTP; the certificate's expiry date | Cryptography |
| Sales queue on tills never empties | Sync service down or rejecting batches | Sync agent status and logs; quarantine of rejected batches | POS sales sync |
Network numbers worth remembering
| What | Value | Lesson |
|---|---|---|
| Private IPv4 ranges | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | Networking |
| Hosts per subnet | /24 = 254, /23 = 510, /22 = 1,022, /25 = 126 | Store networks |
| Self-assigned address (no DHCP) | 169.254.0.0/16 | Store networks |
| Common ports | 22 SSH, 53 DNS, 67 and 68 DHCP, 80 HTTP, 123 NTP, 443 HTTPS, 445 SMB, 3389 RDP, 5432 Postgres, 6379 Redis | Networking |
| 2.4 GHz Wi-Fi channels that do not overlap | 1, 6 and 11 | Store networks |
| Round trip, rough | Same building under 5 ms; same country 10 to 50 ms; another continent 100+ ms | Networking |
Accounts and MFA
Every account belongs to one named person, created from HR data and removed the same day they leave. Shared logins on tills become personal PINs or badges, so every sale and refund has a name (Accounts and MFA, Identity).
| Event | Do | Watch for | Lesson |
|---|---|---|---|
| Joiner | Create from the HR record; give the role's standard groups; enrol MFA on day one | Copying another person's access ("make her like Leila") | Accounts and MFA |
| Mover | Add the new role's access and remove the old role's on the same ticket | Access that only ever grows | Accounts and MFA |
| Leaver | Disable on the last day, revoke sessions and tokens, collect devices, transfer files | Accounts still active weeks later; personal phones still enrolled | Accounts and MFA |
| Admin access | A separate admin account with phishing-resistant MFA, used only for admin work | Daily email on an account with domain admin rights | Identity |
| Break-glass | Two emergency accounts, long random passwords stored offline, alert on every use | Nobody knowing where they are when the identity provider is down | Identity |
| Review | Managers confirm their team's access every quarter | Reviews that approve everything without reading | Accounts and MFA |
| MFA reset request | Verify the person by a second channel (call back on the HR number, manager confirms) | Resetting MFA because a caller sounds stressed | Breaches |
| Windows and Active Directory task | Command | Note |
|---|---|---|
| Who am I and which groups am I in | whoami /groups | Built in |
| Look up a domain user | net user ama /domain | Built in |
| Last logon and lockout state | Get-ADUser ama -Properties LastLogonDate,LockedOut | Needs the ActiveDirectory module (RSAT) |
| Find and unlock locked accounts | Search-ADAccount -LockedOut, Unlock-ADAccount ama | Needs the ActiveDirectory module (RSAT) |
| Disable a leaver | Disable-ADAccount ama | Needs the ActiveDirectory module (RSAT) |
The device fleet
Mangrove runs about 400 tills, 1,000 handheld scanners and the head-office laptops. Every device is in an asset register and enrolled in a device management tool (MDM) before it leaves the warehouse (Device fleet).
| Stage | Do | Mangrove example | Lesson |
|---|---|---|---|
| Enrol | Register serial, owner and location; enrol in MDM; encrypt the disk | Scanner SC-0412 enrolled to store S-014 before shipping | Device fleet |
| Configure | Apply a standard profile; lock single-purpose devices into kiosk mode | Scanners run only the Store app; no browser, no app store | Device fleet |
| Patch | Rings: IT first, then pilot stores, then everyone, with a deadline by severity | Till updates go to 5 pilot stores overnight, then all stores a week later | Device fleet |
| Monitor | Check-in date, OS version, disk encryption, battery health | Report: scanners not seen for 7 days, by store | Device fleet |
| Lost or stolen | Lock or wipe remotely; revoke its certificates and tokens; log the incident | A rider's phone lost on a delivery run | Device fleet |
| Retire | Wipe, remove from MDM and the directory, update the register, recycle properly | Old tills replaced in a store refit | Device fleet |
| Windows desk-side task | Command |
|---|---|
| Windows version and build | winver; details: systeminfo |
| Pull group policy now, see what applied | gpupdate /force, gpresult /r |
| Check BitLocker | manage-bde -status (admin prompt) |
| Repair system files | DISM /Online /Cleanup-Image /RestoreHealth, then sfc /scannow (admin prompt) |
| List installed updates | Get-HotFix |
| Restart now | shutdown /r /t 0 |
Service desk basics (ITIL words)
Use the same words as the rest of the business and the tickets sort themselves (Service desk).
| Ticket type | Means | Mangrove example | Goal |
|---|---|---|---|
| Incident | Something that worked is broken or degraded | Till 2 at S-014 will not print receipts | Restore service fast, even with a workaround |
| Service request | A normal ask from the catalogue | New starter needs a laptop and a Store app login | Fulfil to the promised time |
| Problem | The unknown cause behind one or more incidents | Receipt printers fail across 30 stores after an update | Find and remove the root cause |
| Change | Adding, modifying or removing something that could affect service | New router firmware for every store | Make it safely: plan, approve, schedule, roll back if needed |
| Known error | A problem with a documented cause and workaround | "Restart the print spooler" until the driver fix ships | Let the first line fix it on the first call |
Priority matrix
Priority comes from impact (how many people or how much money) and urgency (how fast it gets worse). The targets below are an example; agree your own with the business (Service desk).
| Impact \ Urgency | High | Medium | Low |
|---|---|---|---|
| High (many stores, card payments, app checkout) | P1: respond 15 min, work until fixed | P2: respond 30 min, fix in 4 h | P3: respond 4 h, fix in 2 days |
| Medium (one store, one team) | P2: respond 30 min, fix in 4 h | P3: respond 4 h, fix in 2 days | P4: respond 1 day, fix in 5 days |
| Low (one person, has a workaround) | P3: respond 4 h, fix in 2 days | P4: respond 1 day, fix in 5 days | P4: respond 1 day, fix in 5 days |
A ticket the next person can act on
Summary: Receipt printer offline on till 2, store S-014
Reported: Ama (store manager), 09:40, by phone
Impact: 1 of 4 tills; customers offered e-receipts; queue normal
Priority: P3 (medium impact, medium urgency)
Done: Power cycled printer; checked USB cable; test page fails
Found: Printer shows "paper jam" light, no paper inside
Next: Swap printer from the spare stock; ship faulty unit to the DC
Status: Waiting on store to fit spare (ETA 11:00)Good first response: confirm what you understood, say what happens next and when you will update them. Close only when the user agrees it is fixed, and turn repeat fixes into a knowledge article so the first line can solve them (Service desk, Toil).
Glossary
Plain definitions of the IT operations terms used in the TechOps course.
- Asset register
- The list of every device with its serial, owner, location and status. Device fleet
- Break-glass account
- An emergency admin account for when normal sign-in is broken, kept offline and alerted on. Identity
- Change advisory
- The review that approves risky changes and their timing and rollback plans. Service desk
- CIDR
- Writing a network as an address and prefix length, such as 192.168.10.0/24 (254 usable hosts). Store networks
- Cron
- The Linux scheduler that runs commands at set times from a crontab. Shell scripts
- DHCP
- The service that hands devices an IP address, gateway and DNS server when they join a network. Store networks
- DNS
- The system that turns names like api.example.com into IP addresses. Networking
- Gateway
- The router a device sends traffic to when the destination is outside its own network. Store networks
- Joiner, mover, leaver (JML)
- The three moments when someone's access must change: they start, change role or leave. Accounts and MFA
- Journal
- systemd's log store, read with journalctl. Linux CLI
- Kiosk mode
- Locking a device to one or a few apps, as on handheld scanners and tills. Device fleet
- Knowledge article
- A short, searchable fix for a known issue, written so the first line can solve it. Service desk
- MDM
- Mobile device management: a tool that enrols, configures, updates and wipes devices remotely. Device fleet
- MFA
- Multi-factor authentication: a second proof besides the password. Accounts and MFA
- NTP
- Network Time Protocol, which keeps device clocks right; wrong clocks break certificates and logs. Store networks
- Patch ring
- A group that gets updates at a set stage, so problems show up on a few devices first. Device fleet
- Problem
- In ITIL, the underlying cause of one or more incidents. Service desk
- Shift left
- Moving fixes to the earliest level that can handle them: self-service, then first line. Service desk
- SLA
- Service level agreement: the response and fix times promised for each priority. Service desk
- systemd unit
- A file that tells systemd how to run and restart a service, timer or mount. Linux CLI
- VLAN
- A separate virtual network on the same switches, such as tills apart from guest Wi-Fi. Store networks
- Workaround
- A way to restore service before the root cause is fixed. Service desk
Courses on Kolom
- TechOps: Linux, Networks and IT Operations: the Linux command line, shell scripts, store networks, accounts and MFA, the device fleet and the service desk.
- Security Foundations: identity, networks and incidents from the defender's side.
- How the Web Works: DNS, TCP, TLS and what happens on every request.
- Site Reliability Engineering: incidents, postmortems and getting rid of toil.
What to read next
- The Linux Command Line by William Shotts, free at linuxcommand.org. From the first command to shell scripts.
- Windows commands reference at learn.microsoft.com. Every built-in command with its options.
- ShellCheck at shellcheck.net. Paste a script and it explains each bug it finds.
- The Practice of System and Network Administration by Thomas Limoncelli, Christina Hogan and Strata Chalup. How good IT teams run fleets, help desks and changes.
- NIST SP 800-63B at pages.nist.gov. The guidance behind modern password and MFA rules.