<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/feed/styles.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Mohammad Abu Mattar | Cheatsheets</title><description>The latest Cheatsheets from Mohammad Abu Mattar.</description><link>https://mkabumattar.com/</link><item><title>Linux Networking</title><link>https://mkabumattar.com/cheatsheets/linux-networking/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/linux-networking/</guid><description>The commands you reach for to diagnose and manage Linux networks. ip for interfaces and routes, ss for sockets, dig for DNS, traceroute for paths, and tcpdump for packets.</description><pubDate>Tue, 21 Jul 2026 15:07:31 GMT</pubDate><content:encoded>&lt;h1&gt;Linux Networking&lt;/h1&gt;
&lt;p&gt;Every Linux box speaks the network through a small set of tools, and knowing them turns &amp;quot;the network is broken&amp;quot; into a specific, fixable answer. This cheatsheet covers the modern stack: &lt;code&gt;ip&lt;/code&gt; for interfaces and routes, &lt;code&gt;ss&lt;/code&gt; for sockets, &lt;code&gt;dig&lt;/code&gt; for DNS, &lt;code&gt;traceroute&lt;/code&gt; for the path, &lt;code&gt;tcpdump&lt;/code&gt; for the raw packets, and &lt;code&gt;curl&lt;/code&gt; for the application layer.&lt;/p&gt;
&lt;p&gt;When something won&amp;#39;t connect, work up the layers. Confirm the interface has an address and a route (&lt;code&gt;ip&lt;/code&gt;), check the port is listening (&lt;code&gt;ss&lt;/code&gt;), make sure the name resolves (&lt;code&gt;dig&lt;/code&gt;), trace where packets die (&lt;code&gt;traceroute&lt;/code&gt;), and only then capture the wire (&lt;code&gt;tcpdump&lt;/code&gt;) or test the app (&lt;code&gt;curl&lt;/code&gt;).&lt;/p&gt;
&lt;h2&gt;Key Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One tool per layer&lt;/strong&gt;: &lt;code&gt;ip&lt;/code&gt; for L2/L3, &lt;code&gt;ss&lt;/code&gt; for sockets, &lt;code&gt;dig&lt;/code&gt; for DNS, &lt;code&gt;tcpdump&lt;/code&gt; for packets, &lt;code&gt;curl&lt;/code&gt; for HTTP.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern replacements&lt;/strong&gt;: &lt;code&gt;ip&lt;/code&gt; supersedes &lt;code&gt;ifconfig&lt;/code&gt;/&lt;code&gt;route&lt;/code&gt;, and &lt;code&gt;ss&lt;/code&gt; supersedes &lt;code&gt;netstat&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ground truth on demand&lt;/strong&gt;: &lt;code&gt;tcpdump&lt;/code&gt; shows the actual bytes when higher-level tools disagree.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scriptable diagnostics&lt;/strong&gt;: &lt;code&gt;dig +short&lt;/code&gt; and &lt;code&gt;curl -w&lt;/code&gt; give clean, parseable output for automation.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>Linux</category><category>Networking</category><category>DevOps</category><category>CLI</category><category>SysAdmin</category><author>Mohammad Abu Mattar</author></item><item><title>kubectl</title><link>https://mkabumattar.com/cheatsheets/kubectl/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/kubectl/</guid><description>kubectl is the command-line tool for talking to a Kubernetes cluster. Use it to deploy apps, inspect and manage resources, stream logs, and debug running pods.</description><pubDate>Wed, 27 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;kubectl&lt;/h1&gt;
&lt;p&gt;kubectl is the command-line tool you use to talk to a Kubernetes cluster. Whatever you can do through a dashboard, you can do faster here: deploy apps, inspect resources, stream logs, run commands inside containers, and take nodes in and out of service.&lt;/p&gt;
&lt;p&gt;The mental model is simple. You tell kubectl a verb and a resource (&lt;code&gt;get pods&lt;/code&gt;, &lt;code&gt;delete deployment&lt;/code&gt;, &lt;code&gt;apply -f file.yaml&lt;/code&gt;), it talks to the cluster&amp;#39;s API server, and the cluster does the work. Get comfortable with &lt;code&gt;get&lt;/code&gt;, &lt;code&gt;describe&lt;/code&gt;, &lt;code&gt;logs&lt;/code&gt;, and &lt;code&gt;apply&lt;/code&gt; and you&amp;#39;re already most of the way there.&lt;/p&gt;
&lt;h2&gt;Key Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One tool for everything&lt;/strong&gt;: deploy, inspect, update, scale, and debug from a single CLI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Declarative or imperative&lt;/strong&gt;: apply YAML you keep in Git, or fire off quick one-off commands.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flexible output&lt;/strong&gt;: reshape any command into wide tables, JSON, YAML, JSONPath, or custom columns for scripting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built-in debugging&lt;/strong&gt;: stream logs, exec into containers, attach ephemeral debug containers, and forward ports to your laptop.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>DevOps</category><category>Kubernetes</category><category>CLI</category><category>Container Orchestration</category><category>Cloud Native</category><author>Mohammad Abu Mattar</author></item><item><title>Terraform Cheatsheet</title><link>https://mkabumattar.com/cheatsheets/terraform/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/terraform/</guid><description>Practical Terraform cheatsheet covering essential CLI commands, state management, import, workspaces, and key HCL patterns for variables, locals, outputs, dynamic blocks, and more. Perfect for daily IaC workflows.</description><pubDate>Sat, 28 Mar 2026 20:02:59 GMT</pubDate><content:encoded>&lt;h1&gt;Terraform Cheatsheet&lt;/h1&gt;
&lt;p&gt;A practical cheatsheet covering the Terraform CLI commands engineers reach for constantly — init, plan, apply, import, taint, and state operations — alongside essential HCL patterns for variables, locals, outputs, and dynamic blocks.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore Terraform cheatsheet commands, syntax, and examples.&lt;/p&gt;
</content:encoded><category>Infrastructure as Code</category><category>DevOps</category><author>Mohammad Abu Mattar</author></item><item><title>AWS CLI</title><link>https://mkabumattar.com/cheatsheets/aws-cli/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/aws-cli/</guid><description>An expert reference for the AWS CLI covering configuration precedence, EC2 lifecycle control, recursive S3 operations, JMESPath querying, output formatting, and secure SSM sessions.</description><pubDate>Wed, 25 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;AWS CLI&lt;/h1&gt;
&lt;p&gt;The AWS Command Line Interface (CLI) lets you orchestrate infrastructure, move cloud data, and configure security entirely from the terminal. This reference covers configuring identity profiles, managing EC2 instances, synchronizing S3 buckets, creating IAM roles, querying nested JSON with JMESPath, formatting output, and securing access with Systems Manager.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore command syntax, operational insights, and advanced configuration mechanics.&lt;/p&gt;
</content:encoded><category>Cloud Computing</category><category>AWS</category><category>DevOps</category><category>CLI</category><category>Automation</category><author>Mohammad Abu Mattar</author></item><item><title>Docker Swarm</title><link>https://mkabumattar.com/cheatsheets/docker-swarm/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/docker-swarm/</guid><description>Comprehensive Docker Swarm reference guide covering swarm initialization, node management, services, stacks, overlay networking, secrets, configs, rolling updates, and cluster monitoring.</description><pubDate>Sat, 07 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Docker Swarm Cheatsheet&lt;/h1&gt;
&lt;p&gt;This cheatsheet provides a comprehensive reference for managing Docker Swarm clusters, services, and stacks. It covers essential commands and best practices for scaling, updating, and monitoring your swarm applications.&lt;/p&gt;
</content:encoded><category>DevOps</category><category>Docker</category><category>Containers</category><category>Orchestration</category><category>Deployment</category><author>Mohammad Abu Mattar</author></item><item><title>SSH</title><link>https://mkabumattar.com/cheatsheets/0027-ssh/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/0027-ssh/</guid><description>Comprehensive SSH cheatsheet covering OpenSSH client usage, authentication methods, port forwarding, key management, X11 forwarding, and configuration options. Includes real-world examples and security best practices.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;export const components = {
  h1: &amp;#39;h1&amp;#39;,
  h2: &amp;#39;h2&amp;#39;,
  h3: &amp;#39;h3&amp;#39;,
  h4: &amp;#39;h4&amp;#39;,
  h5: &amp;#39;h5&amp;#39;,
  h6: &amp;#39;h6&amp;#39;,
  p: &amp;#39;p&amp;#39;,
  a: &amp;#39;a&amp;#39;,
  ul: &amp;#39;ul&amp;#39;,
  ol: &amp;#39;ol&amp;#39;,
  li: &amp;#39;li&amp;#39;,
  code: &amp;#39;code&amp;#39;,
  pre: &amp;#39;pre&amp;#39;,
  strong: &amp;#39;strong&amp;#39;,
  em: &amp;#39;em&amp;#39;,
  blockquote: &amp;#39;blockquote&amp;#39;,
  table: &amp;#39;table&amp;#39;,
  th: &amp;#39;th&amp;#39;,
  tr: &amp;#39;tr&amp;#39;,
  td: &amp;#39;td&amp;#39;,
};&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>Ansible</title><link>https://mkabumattar.com/cheatsheets/0028-ansible/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/0028-ansible/</guid><description>Comprehensive Ansible cheatsheet covering playbooks, inventories, roles, tasks, variables, handlers, ad-hoc commands, modules, and configuration options.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Ansible Quick Reference Cheatsheet&lt;/h1&gt;
&lt;p&gt;Ansible is a powerful automation tool for configuration management, application deployment, and orchestration. This cheatsheet provides quick reference guides for common Ansible tasks, modules, and best practices to help you get started and work efficiently with Ansible.&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>Chef</title><link>https://mkabumattar.com/cheatsheets/chef/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/chef/</guid><description>Comprehensive Chef reference guide covering installation, cookbooks, recipes, resources, knife commands, server management, and automation workflows for infrastructure configuration management.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Chef Quick Reference Cheatsheet&lt;/h1&gt;
&lt;p&gt;Chef is a powerful Infrastructure as Code platform for automating infrastructure configuration, deployment, and management. This cheatsheet provides comprehensive reference guides for Chef concepts, commands, patterns, and best practices to help you efficiently manage infrastructure with Chef Infra, Chef Server, and related tools.&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>Docker Compose</title><link>https://mkabumattar.com/cheatsheets/docker-compose/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/docker-compose/</guid><description>Comprehensive Docker Compose reference guide covering services, volumes, networks, ports, environment variables, commands, configurations, and container orchestration best practices.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Docker Compose Cheatsheet&lt;/h1&gt;
&lt;p&gt;Docker Compose is a tool for defining and running multi-container Docker applications. It uses a YAML file to configure application services, networks, and volumes. This cheatsheet provides a quick reference for common Docker Compose commands, configuration options, best practices, and troubleshooting tips.&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>Dockerfile</title><link>https://mkabumattar.com/cheatsheets/dockerfile/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/dockerfile/</guid><description>Comprehensive Dockerfile reference guide covering FROM, RUN, COPY, EXPOSE, CMD, ENTRYPOINT, environment variables, build optimization, best practices, and container image construction.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Dockerfile Cheat Sheet&lt;/h1&gt;
&lt;p&gt;This cheat sheet covers essential Dockerfile instructions, best practices, and common pitfalls for building efficient and secure Docker images. Whether you&amp;#39;re new to Docker or looking to optimize your builds, this guide provides practical examples and explanations to help you master Dockerfile authoring.&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>PostgreSQL</title><link>https://mkabumattar.com/cheatsheets/postgresql/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/postgresql/</guid><description>Comprehensive PostgreSQL reference guide covering psql commands, database creation, tables, queries, functions, joins, transactions, indexes, and advanced SQL operations.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;PostgreSQL Quick Reference Cheatsheet&lt;/h1&gt;
&lt;p&gt;Comprehensive PostgreSQL reference guide covering psql commands, database creation, tables, queries, functions, joins, transactions, indexes, and advanced SQL operations.&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>Redis</title><link>https://mkabumattar.com/cheatsheets/redis/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/redis/</guid><description>Comprehensive Redis reference guide covering commands, data types, keys, strings, lists, sets, hashes, sorted sets, transactions, pub/sub, and caching strategies.</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Redis&lt;/h1&gt;
&lt;p&gt;Comprehensive Redis reference guide covering commands, data types, keys, strings, lists, sets, hashes, sorted sets, transactions, pub/sub, and caching strategies.&lt;/p&gt;
</content:encoded><category>Reference</category><author>Mohammad Abu Mattar</author></item><item><title>VS Code</title><link>https://mkabumattar.com/cheatsheets/vscode/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/vscode/</guid><description>Complete VS Code keyboard shortcuts reference including command palette, navigation, editing, debugging, multicursor operations, and advanced features for macOS and Windows/Linux</description><pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Visual Studio Code Cheatsheet&lt;/h1&gt;
&lt;p&gt;A quick reference guide for Visual Studio Code, covering essential keyboard shortcuts, features, and best practices for efficient coding and navigation.&lt;/p&gt;
</content:encoded><category>Editor</category><category>Text Editor</category><category>Developer Tools</category><category>Productivity</category><category>Programming</category><category>Shortcuts</category><author>Mohammad Abu Mattar</author></item><item><title>AWK</title><link>https://mkabumattar.com/cheatsheets/awk/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/awk/</guid><description>AWK is a powerful text processing language that allows pattern scanning and data extraction. Essential for processing text files, extracting columns, and performing calculations on text data.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;AWK Complete Reference Guide&lt;/h2&gt;
&lt;h3&gt;Quick Start&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Print entire file
awk &amp;#39;{ print }&amp;#39; file.txt

# Print specific column
awk &amp;#39;{ print $1 }&amp;#39; file.txt

# Print lines matching pattern
awk &amp;#39;/pattern/ { print }&amp;#39; file.txt

# Sum all numbers in first column
awk &amp;#39;{ sum += $1 } END { print sum }&amp;#39; numbers.txt

# Replace text pattern
awk &amp;#39;{ gsub(/old/, &amp;quot;new&amp;quot;); print }&amp;#39; file.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;AWK Program Structure&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;awk &amp;#39;[BEGIN block] [pattern { action }] [END block]&amp;#39; [options] [file]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Essential Built-in Variables&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;NR&lt;/td&gt;
&lt;td&gt;Total record number (line)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FNR&lt;/td&gt;
&lt;td&gt;File record number&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NF&lt;/td&gt;
&lt;td&gt;Number of fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FS&lt;/td&gt;
&lt;td&gt;Field separator (input)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OFS&lt;/td&gt;
&lt;td&gt;Output field separator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RS&lt;/td&gt;
&lt;td&gt;Record separator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ORS&lt;/td&gt;
&lt;td&gt;Output record separator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FILENAME&lt;/td&gt;
&lt;td&gt;Current filename&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARGC&lt;/td&gt;
&lt;td&gt;Argument count&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARGV&lt;/td&gt;
&lt;td&gt;Argument array&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ENVIRON&lt;/td&gt;
&lt;td&gt;Environment variables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RSTART&lt;/td&gt;
&lt;td&gt;Start of match (from match())&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RLENGTH&lt;/td&gt;
&lt;td&gt;Length of match&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;Field Variables&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$0     # Entire line
$1     # First field
$2     # Second field
$NF    # Last field
$(NF-1) # Second-to-last field
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;String Functions Reference&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;length(str)           # String length
substr(str, s, l)     # Substring (start, length)
index(str, substr)    # Find substring position
split(str, arr, sep)  # Split string into array
sub(regex, repl)      # Replace first match
gsub(regex, repl)     # Replace all matches
match(str, regex)     # Test match, set RSTART/RLENGTH
tolower(str)          # Convert to lowercase
toupper(str)          # Convert to uppercase
sprintf(fmt, ...)     # Format string
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Math Functions Reference&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;int(x)        # Integer part
sqrt(x)       # Square root
sin(x)        # Sine (radians)
cos(x)        # Cosine (radians)
atan2(y,x)    # Arctangent
exp(x)        # e^x
log(x)        # Natural logarithm
rand()        # Random 0-1
srand(seed)   # Seed random
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Operators Quick Reference&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Arithmetic: +, -, *, /, %, ^
# Comparison: &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=, ==, !=
# Logical: &amp;amp;&amp;amp;, ||, !
# String: ~ (match), !~ (not match)
# Assignment: =, +=, -=, *=, /=, %=, ^=, ++, --
# Ternary: condition ? true_val : false_val
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Command-Line Options&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;-F sep         # Set field separator
-v var=val     # Set variable
-f script.awk  # Read program from file
-W version     # Show version
--posix        # POSIX mode
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Common One-Liners&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Print line numbers
awk &amp;#39;{ print NR, $0 }&amp;#39; file

# Print lines longer than 80 characters
awk &amp;#39;length($0) &amp;gt; 80 { print }&amp;#39; file

# Print every nth line
awk &amp;#39;NR % n == 0 { print }&amp;#39; file

# Reverse lines
awk &amp;#39;{ arr[NR] = $0 } END { for (i=NR; i&amp;gt;0; i--) print arr[i] }&amp;#39; file

# Print lines where column 2 &amp;gt; 100
awk &amp;#39;$2 &amp;gt; 100 { print }&amp;#39; file

# Transpose CSV
awk -F&amp;#39;,&amp;#39; &amp;#39;{ for(i=1;i&amp;lt;=NF;i++) a[i,NR]=$i } END { for(i=1;i&amp;lt;=NF;i++) { for(j=1;j&amp;lt;=NR;j++) printf &amp;quot;%s%s&amp;quot;, a[i,j], (j==NR?&amp;quot;\n&amp;quot;:&amp;quot;,&amp;quot;); print &amp;quot;&amp;quot; } }&amp;#39; file
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Tips and Best Practices&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Use single quotes to prevent shell interpretation&lt;/li&gt;
&lt;li&gt;Use -F flag to set different field separators&lt;/li&gt;
&lt;li&gt;Combine awk with pipes and other tools (grep, sort, uniq)&lt;/li&gt;
&lt;li&gt;Save complex programs in .awk files with -f flag&lt;/li&gt;
&lt;li&gt;Use printf for formatted output&lt;/li&gt;
&lt;li&gt;Initialize variables in BEGIN block&lt;/li&gt;
&lt;li&gt;Test on small files before processing large datasets&lt;/li&gt;
&lt;li&gt;Use comments (#) to document complex logic&lt;/li&gt;
&lt;li&gt;Consider performance with large files (avoid unnecessary loops)&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>Terminal</category><category>Text Processing</category><category>Linux</category><category>Command Line</category><category>Development Tools</category><category>Scripting</category><author>Mohammad Abu Mattar</author></item><item><title>Chmod</title><link>https://mkabumattar.com/cheatsheets/chmod/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/chmod/</guid><description>Complete chmod reference with numeric and symbolic permissions, special bits, directory permissions, and practical examples for managing file access</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Chmod Cheatsheet - File Permissions, Recursive Changes &amp;amp; Best Practices&lt;/h1&gt;
&lt;p&gt;Complete chmod reference covering file permissions, recursive changes with -v and -c, reference mode, logical operators, batch operations, practical examples, and security best practices for Linux file management.&lt;/p&gt;
</content:encoded><category>Terminal</category><category>Programming</category><category>Linux</category><category>File Management</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Cron</title><link>https://mkabumattar.com/cheatsheets/cron/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/cron/</guid><description>Cron is a time-based job scheduler in Unix/Linux that allows you to run scripts or commands periodically. Essential crontab syntax, scheduling patterns, and management commands.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Cron Cheatsheet&lt;/h1&gt;
&lt;h2&gt;Quick Reference&lt;/h2&gt;
&lt;h3&gt;Field Layout&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;Min  Hour Day  Month Weekday  Command
 *    *    *    *     *       /path/to/command

 ┬    ┬    ┬    ┬     ┬
 │    │    │    │     └─────  Weekday (0=Sunday, 6=Saturday)
 │    │    │    └──────────  Month (1-12)
 │    │    └───────────────  Day (1-31)
 │    └────────────────────  Hour (0-23)
 └─────────────────────────  Minute (0-59)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Operators&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any&lt;/td&gt;
&lt;td&gt;&lt;code&gt;* * * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every minute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;,&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0,30 * * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Minutes 0 and 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Range&lt;/td&gt;
&lt;td&gt;&lt;code&gt;9-17 * * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;9 AM to 5 PM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Step&lt;/td&gt;
&lt;td&gt;&lt;code&gt;*/15 * * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every 15 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;Special Strings&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;String&lt;/th&gt;
&lt;th&gt;Frequency&lt;/th&gt;
&lt;th&gt;Equivalent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@reboot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run at startup&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@hourly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every hour&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0 * * * *&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@daily&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every day&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0 0 * * *&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every week&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0 0 * * 0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@monthly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every month&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0 0 1 * *&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@yearly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every year&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0 0 1 1 *&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;Common Patterns&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0 * * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;*/15 * * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every 15 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0 0 * * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Daily at midnight&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0 9 * * 1-5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;9 AM on weekdays&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0 0 * * 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sunday at midnight&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0 0 1 * *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1st of month at midnight&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3&gt;Essential Commands&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;crontab -e              # Edit current user&amp;#39;s crontab
crontab -l              # List crontab jobs
crontab -r              # Delete current user&amp;#39;s crontab
crontab -u username -e  # Edit user&amp;#39;s crontab (root)
crontab -u username -l  # List user&amp;#39;s crontab (root)

# System-wide scheduling
ls /etc/cron.{hourly,daily,weekly,monthly}/
cat /etc/crontab
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Crontab Management&lt;/h2&gt;
&lt;h3&gt;Install from file&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;crontab /path/to/crontab.txt      # Replace entire crontab
crontab -l &amp;gt; backup.txt           # Backup before changes
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;System logs&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Debian/Ubuntu
journalctl -u cron -f             # Follow cron logs
grep CRON /var/log/syslog         # Historical logs

# CentOS/RHEL
tail -f /var/log/cron             # Follow cron logs
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Environment Setup&lt;/h2&gt;
&lt;p&gt;Always add at top of crontab file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOME=/home/username
LOGNAME=username
MAILTO=admin@example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://man7.org/linux/man-pages/man5/crontab.5.html&quot;&gt;Official Crontab Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://crontab.guru/&quot;&gt;Crontab Guru&lt;/a&gt; - Visual cron expression explainer&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://linux.die.net/man/5/crontab&quot;&gt;Linux Cron Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>Terminal</category><category>System Administration</category><category>Linux</category><category>Scheduling</category><category>Automation</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Curl</title><link>https://mkabumattar.com/cheatsheets/curl/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/curl/</guid><description>cURL is a command-line tool for making HTTP requests, transferring data using URLs, and testing APIs. Essential commands for web development and API testing.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Getting Started with Curl&lt;/h2&gt;
&lt;p&gt;cURL (client URL) is a powerful command-line tool for transferring data using URLs. It supports a wide range of protocols and is indispensable for web development, API testing, and automated scripting. Whether you&amp;#39;re testing a REST API, downloading files, or debugging HTTP connections, curl provides the tools you need.&lt;/p&gt;
&lt;h2&gt;What Makes cURL Essential&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Protocol Support&lt;/strong&gt;: HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TELNET, LDAP, LDAPS, and more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;: Works with virtually any web service or API&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scripting&lt;/strong&gt;: Perfect for automation and creating repeatable workflows&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debugging&lt;/strong&gt;: Verbose output helps diagnose connection and API issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lightweight&lt;/strong&gt;: No GUI required, runs on minimal resources&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Common Use Cases&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Test if an API endpoint is responding
curl https://api.github.com/users/github

# Download files
curl -O https://example.com/file.tar.gz

# POST data to a form
curl -X POST -d &amp;quot;username=user&amp;amp;password=pass&amp;quot; https://example.com/login

# Check API response status
curl -I https://api.example.com/health

# Debug API connections
curl -v https://api.example.com/endpoint
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Installation Quick Reference&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;macOS&lt;/strong&gt;: &lt;code&gt;brew install curl&lt;/code&gt;
&lt;strong&gt;Ubuntu/Debian&lt;/strong&gt;: &lt;code&gt;sudo apt-get install curl&lt;/code&gt;
&lt;strong&gt;CentOS/RHEL&lt;/strong&gt;: &lt;code&gt;sudo yum install curl&lt;/code&gt;
&lt;strong&gt;Windows&lt;/strong&gt;: Download from &lt;a href=&quot;https://curl.se/download.html&quot;&gt;curl.se&lt;/a&gt; or &lt;code&gt;choco install curl&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Essential Options Reference&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-X GET/POST/PUT/DELETE/PATCH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify HTTP method&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-H &amp;quot;Header: value&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add custom header&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-d &amp;#39;data&amp;#39;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send POST data (URL encoded)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-F &amp;quot;file=@path&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Upload file (multipart form)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-u user:pass&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HTTP Basic authentication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-b &amp;quot;cookie=value&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send cookie&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-c cookies.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Save response cookies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-i&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Include response headers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-I&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Headers only (HEAD request)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-L&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Follow redirects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-v&lt;/code&gt; / &lt;code&gt;-vv&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Verbose output (debug)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Silent mode (no progress)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-o file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Save to file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-O&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Save with original filename&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-w &amp;quot;%{http_code}&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Custom output format&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-k&lt;/code&gt; / &lt;code&gt;--insecure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Skip SSL verification (unsafe)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--cacert ca.pem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Use custom CA certificate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--max-time 10&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Timeout after 10 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;--compressed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Request compression&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;HTTP Methods Quick Start&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# GET - Retrieve data (default)
curl https://api.example.com/users

# POST - Create resource
curl -X POST -H &amp;quot;Content-Type: application/json&amp;quot; \
  -d &amp;#39;{&amp;quot;name&amp;quot;:&amp;quot;John&amp;quot;}&amp;#39; https://api.example.com/users

# PUT - Replace entire resource
curl -X PUT -H &amp;quot;Content-Type: application/json&amp;quot; \
  -d &amp;#39;{&amp;quot;name&amp;quot;:&amp;quot;Jane&amp;quot;,&amp;quot;age&amp;quot;:30}&amp;#39; https://api.example.com/users/1

# PATCH - Update specific fields
curl -X PATCH -H &amp;quot;Content-Type: application/json&amp;quot; \
  -d &amp;#39;{&amp;quot;age&amp;quot;:31}&amp;#39; https://api.example.com/users/1

# DELETE - Remove resource
curl -X DELETE https://api.example.com/users/1
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Workflow Examples&lt;/h2&gt;
&lt;h3&gt;Testing a REST API&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 1. Test get all users
curl https://api.example.com/users

# 2. Create a new user
curl -X POST -H &amp;quot;Content-Type: application/json&amp;quot; \
  -d &amp;#39;{&amp;quot;name&amp;quot;:&amp;quot;Alice&amp;quot;,&amp;quot;email&amp;quot;:&amp;quot;alice@example.com&amp;quot;}&amp;#39; \
  https://api.example.com/users

# 3. Get specific user
curl https://api.example.com/users/1

# 4. Update user
curl -X PATCH -H &amp;quot;Content-Type: application/json&amp;quot; \
  -d &amp;#39;{&amp;quot;email&amp;quot;:&amp;quot;alice.new@example.com&amp;quot;}&amp;#39; \
  https://api.example.com/users/1

# 5. Delete user
curl -X DELETE https://api.example.com/users/1
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Authenticated API Requests&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Using bearer token
TOKEN=&amp;quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&amp;quot;
curl -H &amp;quot;Authorization: Bearer $TOKEN&amp;quot; https://api.example.com/protected

# Using API key
API_KEY=&amp;quot;sk_live_abc123xyz789&amp;quot;
curl -H &amp;quot;X-API-Key: $API_KEY&amp;quot; https://api.example.com/data

# Using Basic auth
curl -u username:password https://api.example.com/protected

# OAuth2 flow
TOKEN=$(curl -X POST -d &amp;quot;client_id=xxx&amp;amp;client_secret=yyy&amp;amp;grant_type=client_credentials&amp;quot; https://auth.example.com/token | jq -r &amp;#39;.access_token&amp;#39;)
curl -H &amp;quot;Authorization: Bearer $TOKEN&amp;quot; https://api.example.com/data
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;File Handling&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Download file
curl -o myfile.txt https://example.com/file.txt

# Upload file
curl -F &amp;quot;file=@myfile.txt&amp;quot; https://api.example.com/upload

# Download and extract
curl -s https://example.com/archive.tar.gz | tar xz

# Resume interrupted download
curl -C - -o largefile.iso https://example.com/largefile.iso

# Upload multiple files
curl -F &amp;quot;files=@file1.txt&amp;quot; -F &amp;quot;files=@file2.txt&amp;quot; https://api.example.com/upload-multiple
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Debugging and Troubleshooting&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Verbose output (see all request/response details)
curl -v https://api.example.com/data

# More verbose (shows all low-level details)
curl -vv https://api.example.com/data

# Show headers only
curl -i https://api.example.com/data

# Check response time
curl -w &amp;quot;Total time: %{time_total}s\n&amp;quot; https://api.example.com/data

# Save full debug output
curl -v https://api.example.com/data &amp;gt; response.html 2&amp;gt; debug.txt

# Test with custom headers
curl -H &amp;quot;X-Custom: value&amp;quot; -v https://api.example.com/data
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Batch Processing&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Check multiple endpoints
for url in api1.com api2.com api3.com; do
  echo -n &amp;quot;$url: &amp;quot;
  curl -s -o /dev/null -w &amp;quot;%{http_code}\n&amp;quot; &amp;quot;https://$url&amp;quot;
done

# Process JSON array response
curl -s https://api.example.com/users | jq -r &amp;#39;.[] | .email&amp;#39; | \
  while read email; do
    echo &amp;quot;Processing: $email&amp;quot;
    curl -X POST -H &amp;quot;Content-Type: application/json&amp;quot; \
      -d &amp;quot;{\&amp;quot;email\&amp;quot;:\&amp;quot;$email\&amp;quot;,\&amp;quot;status\&amp;quot;:\&amp;quot;active\&amp;quot;}&amp;quot; \
      https://api.example.com/notify
  done

# Parallel requests
for i in {1..10}; do
  curl -s &amp;quot;https://api.example.com/data/$i&amp;quot; &amp;amp;
done
wait
echo &amp;quot;All requests completed&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Performance Tips&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use &lt;code&gt;--compressed&lt;/code&gt;&lt;/strong&gt; for APIs that support gzip/deflate compression&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add timeouts&lt;/strong&gt; with &lt;code&gt;--max-time&lt;/code&gt; and &lt;code&gt;--connect-timeout&lt;/code&gt; to prevent hanging&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Batch requests&lt;/strong&gt; with &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;wait&lt;/code&gt; for parallel execution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter responses&lt;/strong&gt; with &lt;code&gt;jq&lt;/code&gt; or &lt;code&gt;grep&lt;/code&gt; to reduce processing time&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use HEAD requests&lt;/strong&gt; (&lt;code&gt;-I&lt;/code&gt;) to check if resource exists without downloading&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Common Patterns&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Check if service is up&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -f -s -o /dev/null -w &amp;quot;%{http_code}\n&amp;quot; https://api.example.com/health
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Loop with retry&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;for attempt in {1..3}; do
  curl -f https://api.example.com/data &amp;amp;&amp;amp; break
  [ $attempt -lt 3 ] &amp;amp;&amp;amp; sleep 2
done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Extract and transform&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -s https://api.example.com/users | jq &amp;#39;[.[] | select(.active) | {name, email}]&amp;#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Save with authentication&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -u user:pass -H &amp;quot;Accept: application/json&amp;quot; https://api.example.com/data &amp;gt; data.json
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Best Practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Security First&lt;/strong&gt;: Always use HTTPS for authenticated requests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handle Errors&lt;/strong&gt;: Check exit codes and HTTP status codes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Variables&lt;/strong&gt;: Store tokens and credentials in environment variables, not in scripts&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validate Input&lt;/strong&gt;: Check JSON syntax and validate responses before processing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add Timeouts&lt;/strong&gt;: Prevent hanging requests with &lt;code&gt;--max-time&lt;/code&gt; and &lt;code&gt;--connect-timeout&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Log Carefully&lt;/strong&gt;: Redact sensitive data from logs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test Before Production&lt;/strong&gt;: Always test API calls against staging before production use&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Document Your Calls&lt;/strong&gt;: Comment curl commands explaining what they do and why&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;curl vs Other Tools&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;curl&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Command-line, scripts, quick testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;wget&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Large file downloads, mirroring sites&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Postman&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Interactive API testing with GUI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTPie&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;More intuitive syntax, pretty output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Python requests&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Complex automation and data processing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;Getting Help&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Manual&lt;/strong&gt;: &lt;code&gt;man curl&lt;/code&gt; or &lt;code&gt;curl --help&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Online&lt;/strong&gt;: &lt;a href=&quot;https://curl.se/docs/&quot;&gt;curl.se docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Examples&lt;/strong&gt;: &lt;a href=&quot;https://ec.haxx.se/everything-curl.pdf&quot;&gt;Everything curl book&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Common Issues&lt;/strong&gt;: Check &lt;a href=&quot;https://curl.se/docs/faq.html&quot;&gt;curl troubleshooting guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Pro Tip&lt;/strong&gt;: Create a &lt;code&gt;.curlrc&lt;/code&gt; file in your home directory to store default options and headers for commonly used APIs. This keeps your commands clean and consistent across multiple requests.&lt;/p&gt;
</content:encoded><category>Terminal</category><category>Web Development</category><category>APIs</category><category>HTTP</category><category>Command Line</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Dart</title><link>https://mkabumattar.com/cheatsheets/dart/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/dart/</guid><description>Dart is a statically-typed, strongly null-safe programming language optimized for building fast, multi-platform applications with excellent null safety, async/await, and object-oriented features.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Dart&lt;/h1&gt;
&lt;p&gt;Dart is a statically-typed, strongly null-safe programming language designed for building fast, multi-platform applications. Created by Google, Dart combines the best features of many languages while providing excellent tooling and powerful features for web, server, and mobile development.&lt;/p&gt;
&lt;p&gt;Key features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Strong Null Safety&lt;/strong&gt;: The type system enforces null safety, preventing null reference errors at compile-time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Async/Await&lt;/strong&gt;: First-class support for asynchronous programming with futures, streams, and async/await syntax.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Object-Oriented&lt;/strong&gt;: Full OOP support with classes, inheritance, mixins, and abstract classes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generics&lt;/strong&gt;: Powerful generic type system for reusable, type-safe code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extensions&lt;/strong&gt;: Extend existing types with new methods without inheritance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type Inference&lt;/strong&gt;: Automatic type inference while maintaining strict type safety.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hot Reload&lt;/strong&gt;: Rapid development cycle with instant code changes during debugging.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Browse the categories below to explore Dart syntax, advanced features, and best practices.&lt;/p&gt;
</content:encoded><category>Programming Language</category><category>Dart</category><category>Application Development</category><category>Type Safety</category><category>Null Safety</category><author>Mohammad Abu Mattar</author></item><item><title>Docker</title><link>https://mkabumattar.com/cheatsheets/docker/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/docker/</guid><description>Docker is a containerization platform for building, shipping, and running applications in isolated environments. This cheatsheet covers essential Docker CLI commands.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Docker&lt;/h1&gt;
&lt;p&gt;Docker is a containerization platform that packages applications with their dependencies into isolated, portable environments called containers. It enables developers to build, ship, and run applications consistently across different systems.&lt;/p&gt;
&lt;h2&gt;Key Benefits&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Run the same environment everywhere (dev, test, production)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Isolation&lt;/strong&gt;: Applications are isolated from each other and the host system&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portability&lt;/strong&gt;: Easily deploy containerized applications to any system with Docker&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: Lightweight compared to virtual machines, fast startup times&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Easy to scale applications horizontally by running multiple containers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Quick Start&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Install Docker&lt;/strong&gt;: Follow the installation guide in the Getting Started section.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Run your first container&lt;/strong&gt;: &lt;code&gt;docker run -d -p 8080:80 nginx:latest&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Access the service&lt;/strong&gt;: Open &lt;a href=&quot;http://localhost:8080&quot;&gt;http://localhost:8080&lt;/a&gt; in your browser.&lt;/p&gt;
&lt;h2&gt;Common Workflows&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Development&lt;/strong&gt;: Use containers to match production environment locally&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Building Images&lt;/strong&gt;: Create Dockerfiles and build images for your applications&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Running Services&lt;/strong&gt;: Run containers with proper networking and storage configuration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scaling&lt;/strong&gt;: Use container orchestration (Docker Swarm or Kubernetes) for production deployments&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Browse the sections above to learn Docker commands, networking, storage, and best practices for containerized applications.&lt;/p&gt;
</content:encoded><category>DevOps</category><category>Docker</category><category>Containers</category><category>Deployment</category><author>Mohammad Abu Mattar</author></item><item><title>Find</title><link>https://mkabumattar.com/cheatsheets/find/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/find/</guid><description>Complete find reference with file searching, filtering by type/size/time, permissions, advanced operations, and practical examples for locating files</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Best Practices for Find Command Usage&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Always quote patterns&lt;/strong&gt; to prevent shell expansion of special characters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -type f first&lt;/strong&gt; in find expressions for optimal performance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prune heavy directories early&lt;/strong&gt; like node_modules, .git, .venv&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -maxdepth&lt;/strong&gt; to limit search depth and improve performance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test commands first&lt;/strong&gt; with -ls or -printf before using -delete&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use + instead of ;&lt;/strong&gt; with exec for better performance on many files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Suppress permission errors&lt;/strong&gt; with 2&amp;gt;/dev/null for cleaner output&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Combine multiple criteria&lt;/strong&gt; to create efficient targeted searches&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -xdev&lt;/strong&gt; to skip other filesystems when needed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consider locate command&lt;/strong&gt; for quick name-only searches (faster than find)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Common Errors and Solutions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Permission denied&amp;quot;&lt;/strong&gt; → Use 2&amp;gt;/dev/null to suppress or run with sudo&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;No such file or directory&amp;quot;&lt;/strong&gt; → Verify path exists and is readable&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Unexpected operator or missing operand&amp;quot;&lt;/strong&gt; → Check parentheses are escaped: \( \)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Syntax error near token&amp;quot;&lt;/strong&gt; → Verify \; or + is present after -exec&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Find is too slow&amp;quot;&lt;/strong&gt; → Use -maxdepth, -prune, and -type filters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Deleted wrong files accidentally&amp;quot;&lt;/strong&gt; → Always preview with find first!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Pattern not matching expected files&amp;quot;&lt;/strong&gt; → Test pattern with -ls before -delete&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;xtype/executable not recognized&amp;quot;&lt;/strong&gt; → Use newer GNU find; some options are GNU-specific&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;ref: &lt;a href=&quot;https://man7.org/linux/man-pages/man1/find.1.html&quot;&gt;https://man7.org/linux/man-pages/man1/find.1.html&lt;/a&gt;&lt;/p&gt;
</content:encoded><category>Terminal</category><category>Programming</category><category>Linux</category><category>File Operations</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Git</title><link>https://mkabumattar.com/cheatsheets/git/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/git/</guid><description>Git is a distributed version control system for tracking code changes, collaborating with teams, and managing project history.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Git&lt;/h1&gt;
&lt;p&gt;Git is a distributed version control system that enables developers to track code changes, collaborate with teams, and manage project history efficiently. It&amp;#39;s the foundation of modern software development workflows.&lt;/p&gt;
&lt;h2&gt;Key Concepts&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Distributed&lt;/strong&gt;: Every developer has a complete copy of the repository history&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branching&lt;/strong&gt;: Create isolated lines of development for features and fixes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commits&lt;/strong&gt;: Snapshots of changes with descriptive messages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Merging&lt;/strong&gt;: Combine changes from different branches&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tracking&lt;/strong&gt;: Monitor changes across files and identify who changed what&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Common Use Cases&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Collaborative Development&lt;/strong&gt;: Multiple developers working on same project&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version Control&lt;/strong&gt;: Track all changes with full history&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branching Strategy&lt;/strong&gt;: Feature branches, release branches, hotfix branches&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Review&lt;/strong&gt;: Pull requests and merge reviews before integration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rollback Capability&lt;/strong&gt;: Revert to previous states if needed&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Quick Reference&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Initial Setup&lt;/strong&gt;: Configure your identity with &lt;code&gt;git config --global user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start Project&lt;/strong&gt;: Use &lt;code&gt;git init&lt;/code&gt; for new repos or &lt;code&gt;git clone&lt;/code&gt; to download existing&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Save Work&lt;/strong&gt;: &lt;code&gt;git add&lt;/code&gt; files, then &lt;code&gt;git commit -m &amp;quot;message&amp;quot;&lt;/code&gt; to create snapshots&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Share Changes&lt;/strong&gt;: &lt;code&gt;git push&lt;/code&gt; to upload, &lt;code&gt;git pull&lt;/code&gt; to download updates&lt;/p&gt;
&lt;p&gt;Browse the sections above to master Git workflows, from basic commands to advanced techniques for managing complex projects.&lt;/p&gt;
</content:encoded><category>Version Control</category><category>Git</category><category>SCM</category><category>Collaboration</category><category>Development Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Go</title><link>https://mkabumattar.com/cheatsheets/go/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/go/</guid><description>Go is a statically typed, compiled programming language designed for simplicity, efficiency, and concurrent programming. It&apos;s ideal for building fast, scalable server applications and system tools.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Go&lt;/h1&gt;
&lt;p&gt;Go is a statically typed, compiled programming language designed with simplicity and efficiency in mind. It excels at concurrent programming, making it ideal for building fast, scalable server applications and system tools.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore Go syntax, functions, concurrency patterns, and best practices.&lt;/p&gt;
</content:encoded><category>Programming Language</category><category>Go</category><category>Systems Programming</category><category>Web Development</category><category>Backend</category><category>Concurrency</category><author>Mohammad Abu Mattar</author></item><item><title>Grep</title><link>https://mkabumattar.com/cheatsheets/grep/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/grep/</guid><description>Complete grep reference with pattern matching, regular expressions, flags, context options, and practical examples for searching text files</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Best Practices for Grep Usage&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Always quote patterns&lt;/strong&gt; to prevent shell interpretation of special characters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -E flag for complex patterns&lt;/strong&gt; to avoid escaping issues with basic regex&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test patterns on sample data&lt;/strong&gt; before running on production systems&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -n with debugging&lt;/strong&gt; to quickly navigate to errors in code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Combine with pipes&lt;/strong&gt; to create powerful data processing pipelines&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -F for literal strings&lt;/strong&gt; when you don&amp;#39;t need regex (much faster)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use -w for word boundaries&lt;/strong&gt; to avoid partial word matches in code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use anchors extensively&lt;/strong&gt; (^ for start, $ for end) to match precise patterns&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exclude directories early&lt;/strong&gt; with grep -r to improve performance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use --color=always in pipes&lt;/strong&gt; to highlight matches in complex pipelines&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Common Errors and Solutions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;No such file or directory&amp;quot;&lt;/strong&gt; → Check file path exists and permissions are correct&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;grep: (standard input): No such device&amp;quot;&lt;/strong&gt; → Check input method; ensure piped input is valid&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Invalid regular expression&amp;quot;&lt;/strong&gt; → Check regex syntax; escape special characters or use -F for literals&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Binary file matches&amp;quot;&lt;/strong&gt; → Use -a flag or --binary-files=text to treat as text&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Nothing found when expecting matches&amp;quot;&lt;/strong&gt; → Verify pattern is correct; test pattern syntax with sample data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;error: &amp;quot;Searching too slowly&amp;quot;&lt;/strong&gt; → Use -F for literals, limit results with -m, exclude directories with --exclude-dir&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;ref: &lt;a href=&quot;https://man7.org/linux/man-pages/man1/grep.1.html&quot;&gt;https://man7.org/linux/man-pages/man1/grep.1.html&lt;/a&gt;&lt;/p&gt;
</content:encoded><category>Terminal</category><category>Programming</category><category>Linux</category><category>Text Processing</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Helm</title><link>https://mkabumattar.com/cheatsheets/helm/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/helm/</guid><description>Helm is the package manager for Kubernetes that simplifies deploying, managing, and upgrading applications through reusable charts. This cheatsheet covers essential Helm CLI commands and workflows.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Helm&lt;/h1&gt;
&lt;p&gt;Helm is the package manager for Kubernetes that simplifies the deployment, management, and upgrade of applications. It uses charts templated Kubernetes manifests to enable reusable, configurable application packages.&lt;/p&gt;
&lt;h2&gt;Key Benefits&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Simplified Deployment&lt;/strong&gt;: Deploy entire application stacks with a single command&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reusability&lt;/strong&gt;: Share and reuse charts across projects and teams&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration Management&lt;/strong&gt;: Override values without editing templates&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version Control&lt;/strong&gt;: Track and rollback to previous releases easily&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dependency Management&lt;/strong&gt;: Include and manage chart dependencies automatically&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Quickly deploy multiple instances with different configurations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Quick Start&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Install Helm&lt;/strong&gt;: Follow the Installation Setup section.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Add a repository&lt;/strong&gt;: &lt;code&gt;helm repo add bitnami https://charts.bitnami.com/bitnami&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Search for charts&lt;/strong&gt;: &lt;code&gt;helm search repo nginx&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Install a chart&lt;/strong&gt;: &lt;code&gt;helm install my-web bitnami/nginx --create-namespace&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Check status&lt;/strong&gt;: &lt;code&gt;helm status my-web&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Common Workflows&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;First Deploy&lt;/strong&gt;: Add repository, search chart, install with values&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration&lt;/strong&gt;: Customize with values files and flag overrides&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Upgrades&lt;/strong&gt;: Update releases with new chart versions and configuration changes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rollback&lt;/strong&gt;: Revert to previous versions if issues occur&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chart Development&lt;/strong&gt;: Create custom charts for your applications&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Production&lt;/strong&gt;: Manage multiple environments with versioned, auditable deployments&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Browse the sections above to master Helm from basics to advanced production scenarios.&lt;/p&gt;
</content:encoded><category>DevOps</category><category>Kubernetes</category><category>Helm</category><category>Package Management</category><category>Cloud Native</category><author>Mohammad Abu Mattar</author></item><item><title>JSON</title><link>https://mkabumattar.com/cheatsheets/json/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/json/</guid><description>JSON (JavaScript Object Notation) is a lightweight, text-based data format used for data exchange. It supports objects, arrays, strings, numbers, booleans, and null values, making it universal across all programming languages.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;JSON&lt;/h1&gt;
&lt;p&gt;JSON (JavaScript Object Notation) is a lightweight, text-based data exchange format. It&amp;#39;s universally supported across programming languages and provides a simple, readable way to structure and transmit data.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore JSON syntax, data types, and practical examples.&lt;/p&gt;
</content:encoded><category>Data Format</category><category>JSON</category><category>Data Serialization</category><category>Web API</category><category>Configuration</category><author>Mohammad Abu Mattar</author></item><item><title>Kubernetes</title><link>https://mkabumattar.com/cheatsheets/kubernetes/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/kubernetes/</guid><description>Kubernetes is an open-source container orchestration platform for automating deployment, scaling, and management of containerized applications.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Kubernetes&lt;/h1&gt;
&lt;p&gt;Kubernetes is the de facto standard for container orchestration. It automates deployment, scaling, and management of containerized applications across clusters of machines, providing declarative configuration and powerful self-healing capabilities.&lt;/p&gt;
&lt;h2&gt;Key Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automated Deployment&lt;/strong&gt;: Deploy containers to nodes automatically&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Self-Healing&lt;/strong&gt;: Restarts failed containers, replaces unhealthy pods&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Load Balancing&lt;/strong&gt;: Distribute traffic across pod replicas&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rolling Updates&lt;/strong&gt;: Gradually update application versions without downtime&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource Management&lt;/strong&gt;: Optimize cluster resource utilization with quotas and limits&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: Network policies, RBAC, and secret management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service Discovery&lt;/strong&gt;: Automatic DNS and load balancing for services&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Storage Orchestration&lt;/strong&gt;: Manage persistent and ephemeral storage&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Quick Start&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Install kubectl&lt;/strong&gt;: Follow the Install and Configure kubectl section.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Access cluster&lt;/strong&gt;: &lt;code&gt;kubectl cluster-info&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create deployment&lt;/strong&gt;: &lt;code&gt;kubectl create deployment web --image=nginx&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List resources&lt;/strong&gt;: &lt;code&gt;kubectl get pods,svc,deployments&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Check application status&lt;/strong&gt;: &lt;code&gt;kubectl describe deployment web&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Common Workflows&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Deploy Application&lt;/strong&gt;: Create Deployment with image, replicas, and resources&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Expose Service&lt;/strong&gt;: Create Service to access pods internally or externally&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure Access&lt;/strong&gt;: Set up Ingress or LoadBalancer for external traffic&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor Health&lt;/strong&gt;: Check pod status, logs, and events regularly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Update Application&lt;/strong&gt;: Use rolling updates or blue-green deployments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scale Load&lt;/strong&gt;: Adjust replicas manually or enable HPA for automatic scaling&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debug Issues&lt;/strong&gt;: Examine logs, describe resources, execute debugging containers&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Explore the sections above to master Kubernetes from basic pod management to advanced security and operations.&lt;/p&gt;
</content:encoded><category>DevOps</category><category>Kubernetes</category><category>Container Orchestration</category><category>Cloud Native</category><category>Cluster Management</category><author>Mohammad Abu Mattar</author></item><item><title>Markdown</title><link>https://mkabumattar.com/cheatsheets/markdown/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/markdown/</guid><description>Markdown is a lightweight markup language designed for creating formatted text using a simple, readable syntax. It&apos;s widely used for documentation, READMEs, blogs, and content creation across the web.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Markdown&lt;/h1&gt;
&lt;p&gt;Markdown is a lightweight markup language designed for creating formatted content with a simple, readable syntax. Originally created for web writing, it&amp;#39;s now used everywhere from documentation to blogs to note-taking apps.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore Markdown syntax, formatting options, and practical examples.&lt;/p&gt;
</content:encoded><category>Markup Language</category><category>Markdown</category><category>Documentation</category><category>Formatting</category><category>Content Creation</category><category>Writing</category><author>Mohammad Abu Mattar</author></item><item><title>Netcat</title><link>https://mkabumattar.com/cheatsheets/nc/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/nc/</guid><description>Complete netcat reference covering TCP/UDP connections, file transfers, server testing, port scanning, banner grabbing, and network troubleshooting with practical examples</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This comprehensive netcat cheatsheet provides complete coverage of TCP/UDP connections, file transfers, port scanning, banner grabbing, and advanced network operations.&lt;/p&gt;
</content:encoded><category>Terminal</category><category>Networking</category><category>Tools</category><category>System Administration</category><category>Port Scanning</category><author>Mohammad Abu Mattar</author></item><item><title>Netstat</title><link>https://mkabumattar.com/cheatsheets/netstat/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/netstat/</guid><description>Complete netstat reference covering network connections, listening ports, routing tables, and network statistics with practical examples</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This comprehensive netstat cheatsheet is now ready for your portfolio website. All 6 major categories have been created with detailed examples, explanations, and practical troubleshooting techniques.&lt;/p&gt;
</content:encoded><category>Terminal</category><category>System Administration</category><category>Linux</category><category>Networking</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Screen</title><link>https://mkabumattar.com/cheatsheets/screen/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/screen/</guid><description>GNU Screen is a terminal multiplexer that allows you to manage multiple terminal sessions, windows, and panes within a single screen. Essential commands for session, window management and splitting.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;GNU Screen Cheatsheet&lt;/h1&gt;
&lt;h2&gt;Getting Started&lt;/h2&gt;
&lt;p&gt;GNU Screen is a powerful terminal multiplexer that gives you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sessions&lt;/strong&gt;: Full terminal environments that persist even if you disconnect&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windows&lt;/strong&gt;: Multiple terminals (tabs) within a single session&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Splits&lt;/strong&gt;: Horizontal and vertical screen divisions for side-by-side work&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy/Paste&lt;/strong&gt;: Built-in text selection and clipboard management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automation&lt;/strong&gt;: Scripts to auto-setup complex terminal layouts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Start your first screen session:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;screen -S development
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then detach with &lt;code&gt;Ctrl+A d&lt;/code&gt; and reattach from anywhere:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;screen -r development
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Key Concepts&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Sessions&lt;/strong&gt;: Independent workspaces that continue running even if you disconnect. Great for long-running server processes and preserving work state.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;: Tabs within a session. Each window is a full terminal shell with independent directory and command history.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Splits&lt;/strong&gt;: Horizontal regions within a window. Allows side-by-side terminals without creating new windows (though for complex panes, tmux may be better).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Copy Mode&lt;/strong&gt;: Special mode for selecting and copying text from the scrollback buffer for pasting later.&lt;/p&gt;
&lt;h2&gt;Essential Keybindings&lt;/h2&gt;
&lt;p&gt;All keybindings use the prefix key &lt;code&gt;Ctrl+A&lt;/code&gt; (abbreviated as &lt;code&gt;C-a&lt;/code&gt;):&lt;/p&gt;
&lt;h3&gt;Session Management&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-a d&lt;/code&gt; - Detach from session (background)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a D D&lt;/code&gt; - Detach and logout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a q&lt;/code&gt; - Exit screen&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Windows&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-a c&lt;/code&gt; - Create new window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a n&lt;/code&gt; / &lt;code&gt;C-a p&lt;/code&gt; - Next/previous window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a [0-9]&lt;/code&gt; - Jump to window number&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a w&lt;/code&gt; - List all windows&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a k&lt;/code&gt; - Kill current window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a A&lt;/code&gt; - Rename window&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Splits and Regions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-a S&lt;/code&gt; - Split horizontally (regions)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a |&lt;/code&gt; - Split vertically (newer versions)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a Tab&lt;/code&gt; - Switch to next region&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a X&lt;/code&gt; - Remove current region&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a Q&lt;/code&gt; - Remove all regions&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Copy and Paste&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-a [&lt;/code&gt; - Enter copy/scroll mode&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Space&lt;/code&gt; - Start selection (in copy mode)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Enter&lt;/code&gt; - Copy selection (in copy mode)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a ]&lt;/code&gt; - Paste copied text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-a =&lt;/code&gt; - Show paste buffers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Common Screen Setup&lt;/h2&gt;
&lt;p&gt;Install and create your configuration file &lt;code&gt;~/.screenrc&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# ~/.screenrc - Essential configuration
# Increase scrollback history
defscrollback 10000

# Enable 256-color terminal
term screen-256color

# Don&amp;#39;t show startup message
startup_message off

# Enable visual bell for notifications
vbell on

# Automatically detach on connection loss
autodetach on

# Useful custom bindings
bind h select -1
bind l select +1
bind - split -h
bind _ split -v
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Load the config:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;screen -c ~/.screenrc
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Building a Development Session&lt;/h2&gt;
&lt;p&gt;Create a complete development environment automatically:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;#!/bin/bash
# dev-session.sh - Create development environment

SESSION=&amp;quot;dev&amp;quot;
screen -S &amp;quot;$SESSION&amp;quot; -d -m

# Create editor window
screen -S &amp;quot;$SESSION&amp;quot; -X new-window -t &amp;quot;editor&amp;quot;
screen -S &amp;quot;$SESSION&amp;quot; -p &amp;quot;editor&amp;quot; -X send-keys &amp;quot;cd ~/myproject &amp;amp;&amp;amp; vim&amp;quot; Enter

# Create server window
screen -S &amp;quot;$SESSION&amp;quot; -X new-window -t &amp;quot;server&amp;quot;
screen -S &amp;quot;$SESSION&amp;quot; -p &amp;quot;server&amp;quot; -X send-keys &amp;quot;cd ~/myproject &amp;amp;&amp;amp; npm start&amp;quot; Enter

# Create test window
screen -S &amp;quot;$SESSION&amp;quot; -X new-window -t &amp;quot;test&amp;quot;
screen -S &amp;quot;$SESSION&amp;quot; -p &amp;quot;test&amp;quot; -X send-keys &amp;quot;cd ~/myproject &amp;amp;&amp;amp; npm test&amp;quot; Enter

# Attach and start
screen -r &amp;quot;$SESSION&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Run it anytime: &lt;code&gt;bash dev-session.sh&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Tips for Productivity&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use Named Sessions&lt;/strong&gt;: &lt;code&gt;screen -S projectname&lt;/code&gt; is easier to remember than numbered sessions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Name Your Windows&lt;/strong&gt;: Use &lt;code&gt;C-a A&lt;/code&gt; to name windows (editor, server, monitor)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Detach Don&amp;#39;t Exit&lt;/strong&gt;: Always use &lt;code&gt;C-a d&lt;/code&gt; to detach, not &lt;code&gt;exit&lt;/code&gt;, so session persists&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create Session Templates&lt;/strong&gt;: Save setup scripts for recurring project types&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Organize by Project&lt;/strong&gt;: One session per project with windows for different tasks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Splits for Monitoring&lt;/strong&gt;: Split regions work well for watching logs while you work&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enable Scrollback&lt;/strong&gt;: Set &lt;code&gt;defscrollback 10000&lt;/code&gt; in ~/.screenrc for adequate history&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Combine with SSH&lt;/strong&gt;: Screen is invaluable over SSH for long-running remote tasks&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Quick Reference: Session Lifecycle&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create session
screen -S mywork

# Inside screen - work normally, then detach
Ctrl+A d

# Check sessions
screen -ls

# Reattach to session
screen -r mywork

# Kill session when done
screen -S mywork -X quit
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Screen vs Tmux&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Screen is better for:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Simplicity - smaller learning curve&lt;/li&gt;
&lt;li&gt;Systems where tmux isn&amp;#39;t available&lt;/li&gt;
&lt;li&gt;Simple split layouts (left/right only)&lt;/li&gt;
&lt;li&gt;Older servers that predate tmux&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Tmux is better for:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Complex pane management&lt;/li&gt;
&lt;li&gt;Modern development workflows&lt;/li&gt;
&lt;li&gt;Extensive plugin ecosystem&lt;/li&gt;
&lt;li&gt;Latest terminal features&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Official GNU Screen Manual: &lt;a href=&quot;https://www.gnu.org/software/screen/&quot;&gt;https://www.gnu.org/software/screen/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Linux Manual Page: &lt;a href=&quot;https://linux.die.net/man/1/screen&quot;&gt;https://linux.die.net/man/1/screen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Practical Screen Tutorial: &lt;a href=&quot;https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/&quot;&gt;https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>Terminal</category><category>Screen</category><category>Tools</category><category>Development</category><category>System Administration</category><author>Mohammad Abu Mattar</author></item><item><title>Sed</title><link>https://mkabumattar.com/cheatsheets/sed/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/sed/</guid><description>Complete sed reference with substitution, addressing, deletion, insertion, transformations, in-place editing, and real-world examples for text manipulation</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Sed (Stream Editor) Cheatsheet - Text Processing, Substitution, and Automation&lt;/h1&gt;
&lt;p&gt;This comprehensive sed reference covers everything from basic text substitution to advanced scripting techniques. Learn how to use sed for powerful text processing, file editing, and automation with practical examples and best practices.&lt;/p&gt;
</content:encoded><category>Terminal</category><category>Programming</category><category>Linux</category><category>Text Processing</category><category>Tools</category><author>Mohammad Abu Mattar</author></item><item><title>Tmux</title><link>https://mkabumattar.com/cheatsheets/tmux/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/tmux/</guid><description>Tmux is a terminal multiplexer that allows you to manage multiple terminal sessions, windows, and panes within a single screen. Essential commands for session, window, and pane management.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Tmux Cheatsheet&lt;/h1&gt;
&lt;p&gt;Tmux is a powerful terminal multiplexer that allows you to manage multiple terminal sessions, windows, and panes within a single screen. This cheatsheet covers essential commands, keybindings, and configuration options for effective tmux usage.&lt;/p&gt;
&lt;h2&gt;Quick Start&lt;/h2&gt;
&lt;p&gt;Start your first tmux session with a single command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tmux new -s development
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then detach with &lt;code&gt;C-b d&lt;/code&gt; and reattach from anywhere with:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tmux attach -t development
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Key Concepts&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Sessions&lt;/strong&gt;: Independent workspaces that continue running even if you disconnect. Useful for keeping servers and processes running.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;: Tabs within a session. Each window is a full terminal with its own working directory and history.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Panes&lt;/strong&gt;: Splits within a window. Allows multiple shells side-by-side without opening new windows.&lt;/p&gt;
&lt;h2&gt;Essential Keybindings&lt;/h2&gt;
&lt;p&gt;All keybindings use the prefix key &lt;code&gt;C-b&lt;/code&gt; (Ctrl+B) unless configured otherwise:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-b c&lt;/code&gt; - Create new window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b n&lt;/code&gt; / &lt;code&gt;C-b p&lt;/code&gt; - Next/previous window&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b %&lt;/code&gt; / &lt;code&gt;C-b &amp;quot;&lt;/code&gt; - Split vertical/horizontal&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b h/j/k/l&lt;/code&gt; - Navigate panes (requires vim-style config)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b [&lt;/code&gt; - Enter scroll/copy mode&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b d&lt;/code&gt; - Detach from session&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b ?&lt;/code&gt; - List all keybindings&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-b :&lt;/code&gt; - Enter command mode&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Popular Configuration&lt;/h2&gt;
&lt;p&gt;For vim-style navigation and mouse support, add to &lt;code&gt;~/.tmux.conf&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Enable 256 color support
set -g default-terminal &amp;quot;screen-256color&amp;quot;
set -ga terminal-overrides &amp;quot;,xterm-256color:RGB&amp;quot;

# Enable mouse
set -g mouse on

# Use vim keys for navigation
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# Resize panes with vim keys
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5

# Increase history limit
set -g history-limit 50000

# Reload config
bind r source-file ~/.tmux.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then reload with &lt;code&gt;C-b :&lt;/code&gt; and type &lt;code&gt;source-file ~/.tmux.conf&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Tips for Productivity&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use Named Sessions&lt;/strong&gt;: &lt;code&gt;tmux new -s work&lt;/code&gt; is easier to remember than session numbers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create Window Groups&lt;/strong&gt;: Organize windows logically within sessions (editor, server, testing)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pair Programming&lt;/strong&gt;: Multiple users can attach to the same session for collaboration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automation&lt;/strong&gt;: Use &lt;code&gt;tmux send-keys&lt;/code&gt; in scripts to automate setup and testing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mouse Support&lt;/strong&gt;: Enable &lt;code&gt;set -g mouse on&lt;/code&gt; for modern terminal comfort with familiar scrolling&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Official Tmux Manual: &lt;a href=&quot;https://linux.die.net/man/1/tmux&quot;&gt;https://linux.die.net/man/1/tmux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GitHub Repository: &lt;a href=&quot;https://github.com/tmux/tmux&quot;&gt;https://github.com/tmux/tmux&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Community Wiki: &lt;a href=&quot;https://github.com/tmux/tmux/wiki&quot;&gt;https://github.com/tmux/tmux/wiki&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>Terminal</category><category>Tmux</category><category>Tools</category><category>Development</category><category>System Administration</category><author>Mohammad Abu Mattar</author></item><item><title>TOML</title><link>https://mkabumattar.com/cheatsheets/toml/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/toml/</guid><description>TOML (Tom&apos;s Obvious, Minimal Language) is a configuration file format designed to be minimal, readable, and unambiguous. It&apos;s commonly used for application configuration, package manifests, and data serialization.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;TOML&lt;/h1&gt;
&lt;p&gt;TOML (Tom&amp;#39;s Obvious, Minimal Language) is a human-friendly configuration file format. Designed to be minimal, readable, and unambiguous, it&amp;#39;s used extensively in package manifests (like Cargo.toml and pyproject.toml) and application configuration files.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore TOML syntax, data types, and practical configuration examples.&lt;/p&gt;
</content:encoded><category>Data Format</category><category>TOML</category><category>Configuration</category><category>Data Serialization</category><category>Settings</category><author>Mohammad Abu Mattar</author></item><item><title>JavaScript</title><link>https://mkabumattar.com/cheatsheets/javascript/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/javascript/</guid><description>JavaScript is a versatile, high-level programming language that powers the web. It supports object-oriented, functional, and event-driven programming paradigms.</description><pubDate>Thu, 27 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;JavaScript&lt;/h1&gt;
&lt;p&gt;JavaScript is a versatile, high-level programming language that powers the web. It supports object-oriented, functional, and event-driven programming paradigms.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore JavaScript syntax, methods, and examples covering ES6+ features, async patterns, classes, modules, and more.&lt;/p&gt;
</content:encoded><category>Programming Language</category><category>Web Development</category><category>Frontend</category><category>Backend</category><category>Scripting</category><author>Mohammad Abu Mattar</author></item><item><title>Python</title><link>https://mkabumattar.com/cheatsheets/python/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/python/</guid><description>Python is an interpreted, high-level programming language known for its readability and simplicity. It supports multiple programming paradigms including procedural, object-oriented, and functional programming.</description><pubDate>Thu, 27 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Python&lt;/h1&gt;
&lt;p&gt;Python is an interpreted, high-level programming language known for its readability and simplicity. It supports multiple programming paradigms including procedural, object-oriented, and functional programming.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore Python syntax, functions, classes, and common patterns.&lt;/p&gt;
</content:encoded><category>Programming Language</category><category>Python</category><category>Scripting</category><category>Object-Oriented</category><category>Web Development</category><category>Data Science</category><author>Mohammad Abu Mattar</author></item><item><title>RegEx</title><link>https://mkabumattar.com/cheatsheets/regex/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/regex/</guid><description>Regular expressions (regex or regexp) are patterns used to match character combinations in strings. They are powerful tools for pattern matching, validation, and text processing across many programming languages.</description><pubDate>Thu, 27 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;RegEx&lt;/h1&gt;
&lt;p&gt;Regular expressions (regex or regexp) are powerful patterns used to match character combinations in strings. They enable sophisticated pattern matching, validation, and text processing across nearly all programming languages.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore regex syntax, patterns, and practical examples.&lt;/p&gt;
</content:encoded><category>Tools</category><category>Regular Expressions</category><category>Text Processing</category><category>Pattern Matching</category><category>Development</category><author>Mohammad Abu Mattar</author></item><item><title>Vim</title><link>https://mkabumattar.com/cheatsheets/vim/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/vim/</guid><description>Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as &quot;vi&quot; with most UNIX systems.</description><pubDate>Thu, 27 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Vim&lt;/h1&gt;
&lt;p&gt;Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as &amp;quot;vi&amp;quot; with most UNIX systems.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore Vim commands, shortcuts, and examples.&lt;/p&gt;
</content:encoded><category>Editor</category><category>Text Editor</category><category>Terminal</category><category>Command Line</category><category>Productivity</category><author>Mohammad Abu Mattar</author></item><item><title>YAML</title><link>https://mkabumattar.com/cheatsheets/yaml/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/yaml/</guid><description>YAML (YAML Ain&apos;t Markup Language) is a human-friendly data serialization language commonly used for configuration files, data exchange, and infrastructure-as-code. It emphasizes readability and uses indentation to structure data.</description><pubDate>Thu, 27 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;YAML&lt;/h1&gt;
&lt;p&gt;YAML (YAML Ain&amp;#39;t Markup Language) is a human-friendly data serialization language widely used for configuration files, data exchange, and infrastructure-as-code. It emphasizes readability and uses intuitive indentation to structure data.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore YAML syntax, data structures, and practical examples.&lt;/p&gt;
</content:encoded><category>Data Format</category><category>YAML</category><category>Configuration</category><category>Data Serialization</category><category>DevOps</category><category>Infrastructure</category><author>Mohammad Abu Mattar</author></item><item><title>Bash</title><link>https://mkabumattar.com/cheatsheets/bash/</link><guid isPermaLink="true">https://mkabumattar.com/cheatsheets/bash/</guid><description>Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell.</description><pubDate>Sun, 01 Jan 2023 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Bash&lt;/h1&gt;
&lt;p&gt;Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell.&lt;/p&gt;
&lt;p&gt;Browse the sections below to explore Bash commands, syntax, and examples.&lt;/p&gt;
</content:encoded><category>Scripting</category><category>Shell</category><category>Linux</category><category>Unix</category><category>Command Line</category><category>Automation</category><author>Mohammad Abu Mattar</author></item></channel></rss>