{"id":102,"date":"2020-05-25T23:38:42","date_gmt":"2020-05-25T15:38:42","guid":{"rendered":"http:\/\/cliffordjuan.com\/?page_id=102"},"modified":"2024-04-03T17:40:57","modified_gmt":"2024-04-03T09:40:57","slug":"wiki","status":"publish","type":"page","link":"https:\/\/cliffordjuan.com\/index.php\/wiki\/","title":{"rendered":"Wiki"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"102\" class=\"elementor elementor-102\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-528c3b5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"528c3b5\" data-element_type=\"section\" id=\"top\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-fbb2572\" data-id=\"fbb2572\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e865b1d elementor-widget elementor-widget-text-editor\" data-id=\"e865b1d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.5.5 - 03-02-2022 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#818a91;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#818a91;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p id=\"top\">\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><style>\ndiv.scrollmenu {\n  background-color: #333;\n  overflow: auto;\n  white-space: nowrap;\n}\n\ndiv.scrollmenu a {\n  display: inline-block;\n  color: white;\n  text-align: center;\n  padding: 14px;\n  text-decoration: none;\n}\n\ndiv.scrollmenu a:hover {\n  background-color: #777;\n}\n<\/style><\/p>\n<div class=\"scrollmenu\"><a href=\"#terraform\">Terraform<\/a> <a href=\"#ansible\">Ansible<\/a> <a href=\"#kubernetes\">Kubernetes<\/a> <a href=\"#docker\">Docker<\/a> <a href=\"#database\">Database<\/a> <a href=\"#scripting\">Scripting<\/a><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-91b6388 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"91b6388\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-347b525\" data-id=\"347b525\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f932a6b elementor-widget-divider--separator-type-pattern elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"f932a6b\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.5.5 - 03-02-2022 *\/\n.elementor-widget-divider{--divider-border-style:none;--divider-border-width:1px;--divider-color:#2c2c2c;--divider-icon-size:20px;--divider-element-spacing:10px;--divider-pattern-height:24px;--divider-pattern-size:20px;--divider-pattern-url:none;--divider-pattern-repeat:repeat-x}.elementor-widget-divider .elementor-divider{display:-webkit-box;display:-ms-flexbox;display:flex}.elementor-widget-divider .elementor-divider__text{font-size:15px;line-height:1;max-width:95%}.elementor-widget-divider .elementor-divider__element{margin:0 var(--divider-element-spacing);-ms-flex-negative:0;flex-shrink:0}.elementor-widget-divider .elementor-icon{font-size:var(--divider-icon-size)}.elementor-widget-divider .elementor-divider-separator{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0;direction:ltr}.elementor-widget-divider--view-line_icon .elementor-divider-separator,.elementor-widget-divider--view-line_text .elementor-divider-separator{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.elementor-widget-divider--view-line_icon .elementor-divider-separator:after,.elementor-widget-divider--view-line_icon .elementor-divider-separator:before,.elementor-widget-divider--view-line_text .elementor-divider-separator:after,.elementor-widget-divider--view-line_text .elementor-divider-separator:before{display:block;content:\"\";border-bottom:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;border-top:var(--divider-border-width) var(--divider-border-style) var(--divider-color)}.elementor-widget-divider--element-align-left .elementor-divider .elementor-divider-separator>.elementor-divider__svg:first-of-type{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:100;flex-shrink:100}.elementor-widget-divider--element-align-left .elementor-divider-separator:before{content:none}.elementor-widget-divider--element-align-left .elementor-divider__element{margin-left:0}.elementor-widget-divider--element-align-right .elementor-divider .elementor-divider-separator>.elementor-divider__svg:last-of-type{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:100;flex-shrink:100}.elementor-widget-divider--element-align-right .elementor-divider-separator:after{content:none}.elementor-widget-divider--element-align-right .elementor-divider__element{margin-right:0}.elementor-widget-divider:not(.elementor-widget-divider--view-line_text):not(.elementor-widget-divider--view-line_icon) .elementor-divider-separator{border-top:var(--divider-border-width) var(--divider-border-style) var(--divider-color)}.elementor-widget-divider--separator-type-pattern{--divider-border-style:none}.elementor-widget-divider--separator-type-pattern.elementor-widget-divider--view-line .elementor-divider-separator,.elementor-widget-divider--separator-type-pattern:not(.elementor-widget-divider--view-line) .elementor-divider-separator:after,.elementor-widget-divider--separator-type-pattern:not(.elementor-widget-divider--view-line) .elementor-divider-separator:before,.elementor-widget-divider--separator-type-pattern:not([class*=elementor-widget-divider--view]) .elementor-divider-separator{width:100%;min-height:var(--divider-pattern-height);-webkit-mask-size:var(--divider-pattern-size) 100%;mask-size:var(--divider-pattern-size) 100%;-webkit-mask-repeat:var(--divider-pattern-repeat);mask-repeat:var(--divider-pattern-repeat);background-color:var(--divider-color);-webkit-mask-image:var(--divider-pattern-url);mask-image:var(--divider-pattern-url)}.elementor-widget-divider--no-spacing{--divider-pattern-size:auto}.elementor-widget-divider--bg-round{--divider-pattern-repeat:round}.rtl .elementor-widget-divider .elementor-divider__text{direction:rtl}<\/style>\t\t<div class=\"elementor-divider\" style=\"--divider-pattern-url: url(&quot;data:image\/svg+xml,%3Csvg xmlns=&#039;http:\/\/www.w3.org\/2000\/svg&#039; preserveAspectRatio=&#039;none&#039; overflow=&#039;visible&#039; height=&#039;100%&#039; viewBox=&#039;0 0 20 16&#039; fill=&#039;none&#039; stroke=&#039;black&#039; stroke-width=&#039;1&#039; stroke-linecap=&#039;square&#039; stroke-miterlimit=&#039;10&#039;%3E%3Cg transform=&#039;translate(-12.000000, 0)&#039;%3E%3Cpath d=&#039;M28,0L10,18&#039;\/%3E%3Cpath d=&#039;M18,0L0,18&#039;\/%3E%3Cpath d=&#039;M48,0L30,18&#039;\/%3E%3Cpath d=&#039;M38,0L20,18&#039;\/%3E%3C\/g%3E%3C\/svg%3E&quot;);\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-732288c7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"732288c7\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2f00b8f8\" data-id=\"2f00b8f8\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-119cdd7f elementor-widget elementor-widget-text-editor\" data-id=\"119cdd7f\" data-element_type=\"widget\" id=\"terraform\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p id=\"terraform\"><\/p>\n<h1 style=\"text-align: center;\">Terraform Cheat Sheet<\/h1>\n<h2>Common Terraform Commands<\/h2>\n<pre>terraform init        \/\/ Initialize a new or existing Terraform working directory\nterraform plan        \/\/ Create an execution plan for changes to be applied\nterraform apply       \/\/ Apply changes to infrastructure\nterraform destroy     \/\/ Destroy Terraform-managed infrastructure\nterraform validate    \/\/ Check if the configuration is valid\nterraform fmt         \/\/ Format the configuration file\n<\/pre>\n<h2>AWS-Specific Commands<\/h2>\n<h3>Provider Configuration<\/h3>\n<pre>provider \"aws\" {\n  region     = \"us-west-2\"\n  access_key = \"YOUR_ACCESS_KEY\"\n  secret_key = \"YOUR_SECRET_KEY\"\n}\n<\/pre>\n<h3>Resources<\/h3>\n<h4>EC2 Instance<\/h4>\n<pre>resource \"aws_instance\" \"example\" {\n  ami           = \"ami-0c94855ba95c71c99\"\n  instance_type = \"t2.micro\"\n\n  tags = {\n    Name = \"example-instance\"\n  }\n}\n<\/pre>\n<h4>S3 Bucket<\/h4>\n<pre>resource \"aws_s3_bucket\" \"example\" {\n  bucket = \"example-bucket\"\n  acl    = \"private\"\n}\n<\/pre>\n<h2>Azure-Specific Commands<\/h2>\n<h3>Provider Configuration<\/h3>\n<pre>provider \"azurerm\" {\n  features {}\n  subscription_id = \"YOUR_SUBSCRIPTION_ID\"\n  client_id       = \"YOUR_CLIENT_ID\"\n  client_secret   = \"YOUR_CLIENT_SECRET\"\n  tenant_id       = \"YOUR_TENANT_ID\"\n}\n<\/pre>\n<h3>Resources<\/h3>\n<h4>Virtual Machine<\/h4>\n<pre>resource \"azurerm_virtual_machine\" \"example\" {\n  name                  = \"example-vm\"\n  location              = \"westus\"\n  resource_group_name   = \"example-resource-group\"\n  vm_size               = \"Standard_DS1_v2\"\n\n  storage_image_reference {\n    publisher = \"Canonical\"\n    offer     = \"UbuntuServer\"\n    sku       = \"16.04-LTS\"\n    version   = \"latest\"\n  }\n\n  storage_os_disk {\n    name              = \"example-os-disk\"\n    caching           = \"ReadWrite\"\n    create_option     = \"FromImage\"\n    managed_disk_type = \"Premium_LRS\"\n  }\n\n  os_profile {\n    computer_name  = \"example-vm\"\n    admin_username = \"adminuser\"\n    admin_password = \"P@ssw0rd1234!\"\n  }\n\n  os_profile_linux_config {\n    disable_password_authentication = false\n  }\n\n  tags = {\n    environment = \"production\"\n  }\n}\n<\/pre>\n<h4>Storage Account<\/h4>\n<pre>resource \"azurerm_storage_account\" \"example\" {\n  name                     = \"examplestorageaccount\"\n  resource_group_name      = \"example-resource-group\"\n  location                 = \"westus\"\n  account_tier             = \"Standard\"\n  account_replication_type = \"LRS\"\n}\n<\/pre>\n<p style=\"text-align: center;\"><a href=\"#top\">Top<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-21daace elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"21daace\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-75abc01\" data-id=\"75abc01\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-deb1983 elementor-widget-divider--separator-type-pattern elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"deb1983\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\" style=\"--divider-pattern-url: url(&quot;data:image\/svg+xml,%3Csvg xmlns=&#039;http:\/\/www.w3.org\/2000\/svg&#039; preserveAspectRatio=&#039;none&#039; overflow=&#039;visible&#039; height=&#039;100%&#039; viewBox=&#039;0 0 20 16&#039; fill=&#039;none&#039; stroke=&#039;black&#039; stroke-width=&#039;1&#039; stroke-linecap=&#039;square&#039; stroke-miterlimit=&#039;10&#039;%3E%3Cg transform=&#039;translate(-12.000000, 0)&#039;%3E%3Cpath d=&#039;M28,0L10,18&#039;\/%3E%3Cpath d=&#039;M18,0L0,18&#039;\/%3E%3Cpath d=&#039;M48,0L30,18&#039;\/%3E%3Cpath d=&#039;M38,0L20,18&#039;\/%3E%3C\/g%3E%3C\/svg%3E&quot;);\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4760238 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"4760238\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-df1aee0\" data-id=\"df1aee0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-44adc5f elementor-widget elementor-widget-text-editor\" data-id=\"44adc5f\" data-element_type=\"widget\" id=\"ansible\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p id=\"ansible\">\u00a0<\/p>\n<h1 style=\"text-align: center;\">Ansible Cheatsheet: AWS and Azure Resource Deployment<\/h1>\n<h2>AWS:<\/h2>\n<h3>1. Install AWS SDK for Python (Boto):<\/h3>\n<pre>    pip install boto boto3\n<\/pre>\n<h3>2. Configure AWS Credentials:<\/h3>\n<pre>    [default]\n    aws_access_key_id = YOUR_ACCESS_KEY\n    aws_secret_access_key = YOUR_SECRET_KEY\n<\/pre>\n<h3>3. Create an EC2 Instance:<\/h3>\n<pre>    - name: Create an EC2 instance\n      ec2_instance:\n        image: ami-0c94855ba95c71c99\n        instance_type: t2.micro\n        key_name: my_keypair\n        region: us-west-2\n        count: 1\n        tags:\n          Name: my_instance\n      register: ec2\n<\/pre>\n<h3>4. Create an S3 Bucket:<\/h3>\n<pre>    - name: Create an S3 bucket\n      s3:\n        bucket: my_bucket\n        region: us-west-2\n        mode: create\n<\/pre>\n<h3>5. Create an RDS Instance:<\/h3>\n<pre>    - name: Create an RDS instance\n      rds:\n        region: us-west-2\n        instance_name: my_instance\n        db_instance_identifier: my_db\n        allocated_storage: 20\n        engine: postgres\n        instance_class: db.t2.micro\n        master_username: admin\n        master_password: Password123\n        vpc_security_group_ids:\n          - sg-0123456789abcdef0\n<\/pre>\n<h2>Azure:<\/h2>\n<h3>1. Install Azure SDK for Python:<\/h3>\n<pre>    pip install azure\n<\/pre>\n<h3>2. Configure Azure Credentials:<\/h3>\n<pre>    export AZURE_CLIENT_ID=\"YOUR_CLIENT_ID\"\n    export AZURE_CLIENT_SECRET=\"YOUR_CLIENT_SECRET\"\n    export AZURE_TENANT_ID=\"YOUR_TENANT_ID\"\n<\/pre>\n<h3>3. Create a Resource Group:<\/h3>\n<pre>    - name: Create a resource group\n      azure_rm_resourcegroup:\n        name: my_resource_group\n        location: westus\n<\/pre>\n<h3>4. Create a Virtual Machine:<\/h3>\n<pre>    - name: Create a virtual machine\n      azure_rm_virtualmachine:\n        resource_group: my_resource_group\n        name: my_vm\n        vm_size: Standard_DS1_v2\n        admin_username: azureuser\n        admin_password: Password123!\n        image:\n          offer: UbuntuServer\n          publisher: Canonical\n          sku:\n<\/pre>\n<p>This cheatsheet provides a basic overview of Ansible tasks to deploy resources in AWS and Azure. Remember to adjust the parameters and values according to your specific requirements. For more advanced use cases and additional modules, consult the Ansible documentation and the respective cloud provider&#8217;s documentation. Please note that the commands and examples provided assume that you have Ansible installed and configured on your system.<\/p>\n<p style=\"text-align: center;\"><a href=\"#top\">Top<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9d9552d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9d9552d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2d2828d\" data-id=\"2d2828d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a9cb8e3 elementor-widget-divider--separator-type-pattern elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"a9cb8e3\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\" style=\"--divider-pattern-url: url(&quot;data:image\/svg+xml,%3Csvg xmlns=&#039;http:\/\/www.w3.org\/2000\/svg&#039; preserveAspectRatio=&#039;none&#039; overflow=&#039;visible&#039; height=&#039;100%&#039; viewBox=&#039;0 0 20 16&#039; fill=&#039;none&#039; stroke=&#039;black&#039; stroke-width=&#039;1&#039; stroke-linecap=&#039;square&#039; stroke-miterlimit=&#039;10&#039;%3E%3Cg transform=&#039;translate(-12.000000, 0)&#039;%3E%3Cpath d=&#039;M28,0L10,18&#039;\/%3E%3Cpath d=&#039;M18,0L0,18&#039;\/%3E%3Cpath d=&#039;M48,0L30,18&#039;\/%3E%3Cpath d=&#039;M38,0L20,18&#039;\/%3E%3C\/g%3E%3C\/svg%3E&quot;);\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-56ad5df elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"56ad5df\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d426843\" data-id=\"d426843\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-65d85d4 elementor-widget elementor-widget-text-editor\" data-id=\"65d85d4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p id=\"kubernetes\"><\/p>\n<h1 style=\"text-align: center;\">Kubernetes Cheatsheet<\/h1>\n<table>\n<tbody>\n<tr>\n<th>Category<\/th>\n<th>Command<\/th>\n<th>Description<\/th>\n<\/tr>\n<!-- Cluster Management -->\n<tr>\n<td rowspan=\"3\">Cluster Management<\/td>\n<td>kubectl cluster-info<\/td>\n<td>Display information about the Kubernetes cluster.<\/td>\n<\/tr>\n<tr>\n<td>kubectl get nodes<\/td>\n<td>List all the nodes in the cluster.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe node<\/td>\n<td>Get detailed information about a specific node.<\/td>\n<\/tr>\n<!-- Pods -->\n<tr>\n<td rowspan=\"4\">Pods<\/td>\n<td>kubectl get pods<\/td>\n<td>List all pods in the current namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl get pods &#8211;all-namespaces<\/td>\n<td>List all pods in all namespaces.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe pod<\/td>\n<td>Get detailed information about a specific pod.<\/td>\n<\/tr>\n<tr>\n<td>kubectl logs<\/td>\n<td>Retrieve the logs of a specific pod.<\/td>\n<\/tr>\n<!-- Deployments -->\n<tr>\n<td rowspan=\"4\">Deployments<\/td>\n<td>kubectl get deployments<\/td>\n<td>List all deployments in the current namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe deployment<\/td>\n<td>Get detailed information about a specific deployment.<\/td>\n<\/tr>\n<tr>\n<td>kubectl scale deployment &#8211;replicas=<\/td>\n<td>Scale the number of replicas for a deployment.<\/td>\n<\/tr>\n<tr>\n<td>kubectl rollout status deployment<\/td>\n<td>Check the status of a deployment rollout.<\/td>\n<\/tr>\n<!-- Services -->\n<tr>\n<td rowspan=\"4\">Services<\/td>\n<td>kubectl get services<\/td>\n<td>List all services in the current namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe service<\/td>\n<td>Get detailed information about a specific service.<\/td>\n<\/tr>\n<tr>\n<td>kubectl port-forward :<\/td>\n<td>Forward a local port to a port on a specific pod.<\/td>\n<\/tr>\n<tr>\n<td>kubectl expose deployment &#8211;type=LoadBalancer &#8211;port=<\/td>\n<td>Expose a deployment as a LoadBalancer service.<\/td>\n<\/tr>\n<!-- Namespaces -->\n<tr>\n<td rowspan=\"3\">Namespaces<\/td>\n<td>kubectl get namespaces<\/td>\n<td>List all namespaces in the cluster.<\/td>\n<\/tr>\n<tr>\n<td>kubectl create namespace<\/td>\n<td>Create a new namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl delete namespace<\/td>\n<td>Delete a namespace and all its resources.<\/td>\n<\/tr>\n<!-- Configmaps and Secrets -->\n<tr>\n<td rowspan=\"4\">Configmaps and Secrets<\/td>\n<td>kubectl get configmaps<\/td>\n<td>List all configmaps in the current namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl get secrets<\/td>\n<td>List all secrets in the current namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe configmap<\/td>\n<td>Get detailed information about a specific configmap.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe secret<\/td>\n<td>Get detailed information about a specific secret.<\/td>\n<\/tr>\n<!-- Persistent Volumes and Persistent Volume Claims -->\n<tr>\n<td rowspan=\"4\">Persistent Volumes and Persistent Volume Claims<\/td>\n<td>kubectl get pv<\/td>\n<td>List all persistent volumes in the cluster.<\/td>\n<\/tr>\n<tr>\n<td>kubectl get pvc<\/td>\n<td>List all persistent volume claims in the current namespace.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe pv<\/td>\n<td>Get detailed information about a specific persistent volume.<\/td>\n<\/tr>\n<tr>\n<td>kubectl describe pvc<\/td>\n<td>Get detailed information about a specific persistent volume claim.<\/td>\n<\/tr>\n<!-- Other Useful Commands -->\n<tr>\n<td rowspan=\"4\">Other Useful Commands<\/td>\n<td>kubectl apply -f<\/td>\n<td>Create or update resources in a Kubernetes cluster using a YAML or JSON file.<\/td>\n<\/tr>\n<tr>\n<td>kubectl delete<\/td>\n<td>Delete a specific resource.<\/td>\n<\/tr>\n<tr>\n<td>kubectl explain<\/td>\n<td>Get information about the fields in a specific resource type.<\/td>\n<\/tr>\n<tr>\n<td>kubectl create -f<\/td>\n<td>Create resources in a Kubernetes cluster using a YAML or JSON file.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\nRemember that this is a condensed cheatsheet, and Kubernetes offers a vast range of features and functionalities.\n\nFor more detailed information about specific commands or concepts, you can refer to the official Kubernetes documentation: <a href=\"https:\/\/kubernetes.io\/docs\/\">https:\/\/kubernetes.io\/docs\/<\/a>\n<p style=\"text-align: center;\"><a href=\"#top\">Top<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b843993 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b843993\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-831ee95\" data-id=\"831ee95\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2a98844 elementor-widget-divider--separator-type-pattern elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"2a98844\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\" style=\"--divider-pattern-url: url(&quot;data:image\/svg+xml,%3Csvg xmlns=&#039;http:\/\/www.w3.org\/2000\/svg&#039; preserveAspectRatio=&#039;none&#039; overflow=&#039;visible&#039; height=&#039;100%&#039; viewBox=&#039;0 0 20 16&#039; fill=&#039;none&#039; stroke=&#039;black&#039; stroke-width=&#039;1&#039; stroke-linecap=&#039;square&#039; stroke-miterlimit=&#039;10&#039;%3E%3Cg transform=&#039;translate(-12.000000, 0)&#039;%3E%3Cpath d=&#039;M28,0L10,18&#039;\/%3E%3Cpath d=&#039;M18,0L0,18&#039;\/%3E%3Cpath d=&#039;M48,0L30,18&#039;\/%3E%3Cpath d=&#039;M38,0L20,18&#039;\/%3E%3C\/g%3E%3C\/svg%3E&quot;);\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-05329b4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"05329b4\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-89be0b4\" data-id=\"89be0b4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d8823bf elementor-widget elementor-widget-text-editor\" data-id=\"d8823bf\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p id=\"docker\">\u00a0<\/p>\n<style>\n        body {<br \/>            font-family: Arial, sans-serif;<br \/>            margin: 20px;<br \/>        }<br \/>        h1 {<br \/>            text-align: center;<br \/>        }<br \/>        pre {<br \/>            background-color: #f4f4f4;<br \/>            padding: 10px;<br \/>            overflow-x: auto;<br \/>        }<br \/>    <\/style><\/p>\n<h1>Docker Cheatsheet<\/h1>\n<pre><code>\n            <strong>Docker Basics:<\/strong>\n\n            1. Images:\n               - docker images: List all available Docker images.\n               - docker pull : Download an image from a registry.\n               - docker build -t  : Build an image from a Dockerfile.\n               - docker rmi : Remove a Docker image.\n               - docker run : Run a Docker image.\n\n            2. Containers:\n               - docker ps: List all running containers.\n               - docker ps -a: List all containers (including stopped ones).\n               - docker start : Start a stopped container.\n               - docker stop : Stop a running container.\n               - docker restart : Restart a container.\n               - docker rm : Remove a container.\n               - docker exec -it  <command><\/command>: Run a command in a running container.\n\n            3. Registry and Repository:\n               - docker login: Log in to a Docker registry.\n               - docker logout: Log out from a Docker registry.\n               - docker push : Push an image to a registry.\n               - docker tag  : Tag an image with a new name.\n\n            4. Volumes:\n               - docker volume create : Create a named volume.\n               - docker volume ls: List all Docker volumes.\n               - docker volume rm : Remove a Docker volume.\n               - docker run -v : : Mount a host directory as a volume in the container.\n\n            5. Networking:\n               - docker network create : Create a Docker network.\n               - docker network ls: List all Docker networks.\n               - docker network inspect : Inspect a Docker network.\n               - docker network connect  : Connect a container to a network.\n               - docker network disconnect  : Disconnect a container from a network.\n\n            6. Docker Compose:\n               - docker-compose up: Start containers defined in a Docker Compose file.\n               - docker-compose down: Stop and remove containers defined in a Docker Compose file.\n               - docker-compose build: Build or rebuild services defined in a Docker Compose file.\n               - docker-compose logs: View output logs of containers defined in a Docker Compose file.\n\n            7. Docker Swarm:\n               - docker swarm init: Initialize a Docker swarm.\n               - docker swarm join --token  : Join a Docker swarm as a worker node.\n               - docker swarm join-token manager: Get the token to join a swarm as a manager.\n               - docker node ls: List all nodes in the swarm.\n               - docker service create --name  : Create a service in the swarm.\n               - docker service ls: List all services in the swarm.\n\n            <strong>Dockerfile Directives:<\/strong><command><\/command>\n\n            - FROM : Set the base image for subsequent instructions.\n            - RUN <command><\/command>: Execute a command in the image during build.\n            - COPY  : Copy files or directories from the host to the image.\n            - ADD  : Copy files or directories from the host to the image (supports URL and extraction).\n            - WORKDIR : Set the working directory for subsequent instructions.\n            - ENV =: Set an environment variable in the image.\n            - EXPOSE : Expose a port for the container at runtime.\n            - CMD <command><\/command>: Set the default command for the container.\n            - ENTRYPOINT <command><\/command>: Configure a container to run as an executable.\n        <\/code><\/pre>\n<p style=\"text-align: center;\"><a href=\"#top\">Top<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4a19caf elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4a19caf\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-03a57ec\" data-id=\"03a57ec\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-21d2621 elementor-widget-divider--separator-type-pattern elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"21d2621\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\" style=\"--divider-pattern-url: url(&quot;data:image\/svg+xml,%3Csvg xmlns=&#039;http:\/\/www.w3.org\/2000\/svg&#039; preserveAspectRatio=&#039;none&#039; overflow=&#039;visible&#039; height=&#039;100%&#039; viewBox=&#039;0 0 20 16&#039; fill=&#039;none&#039; stroke=&#039;black&#039; stroke-width=&#039;1&#039; stroke-linecap=&#039;square&#039; stroke-miterlimit=&#039;10&#039;%3E%3Cg transform=&#039;translate(-12.000000, 0)&#039;%3E%3Cpath d=&#039;M28,0L10,18&#039;\/%3E%3Cpath d=&#039;M18,0L0,18&#039;\/%3E%3Cpath d=&#039;M48,0L30,18&#039;\/%3E%3Cpath d=&#039;M38,0L20,18&#039;\/%3E%3C\/g%3E%3C\/svg%3E&quot;);\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3ca5c06 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3ca5c06\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ee8449e\" data-id=\"ee8449e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-17d5b32 elementor-widget elementor-widget-text-editor\" data-id=\"17d5b32\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p id=\"database\">\u00a0<span style=\"font-size: 1.875rem; color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif;\">Database Cheatsheet<\/span><\/p><h2>MySQL Cheatsheet:<\/h2><ul><li>Connect to MySQL Server:<\/li><\/ul><pre>        mysql -u username -p\n<\/pre><ul><li>Create a Database:<\/li><\/ul><pre>        CREATE DATABASE database_name;\n<\/pre><ul><li>Use a Database:<\/li><\/ul><pre>        USE database_name;\n<\/pre><ul><li>Create a Table:<\/li><\/ul><pre>        CREATE TABLE table_name (\n            column1 datatype,\n            column2 datatype,\n            ...\n        );\n<\/pre><ul><li>Insert Data into a Table:<\/li><\/ul><pre>        INSERT INTO table_name (column1, column2, ...)\n        VALUES (value1, value2, ...);\n<\/pre><ul><li>Select Data from a Table:<\/li><\/ul><pre>        SELECT column1, column2, ...\n        FROM table_name\n        WHERE condition;\n<\/pre><ul><li>Update Data in a Table:<\/li><\/ul><pre>        UPDATE table_name\n        SET column1 = value1, column2 = value2, ...\n        WHERE condition;\n<\/pre><ul><li>Delete Data from a Table:<\/li><\/ul><pre>        DELETE FROM table_name\n        WHERE condition;\n<\/pre><ul><li>Join Tables:<\/li><\/ul><pre>        SELECT columns\n        FROM table1\n        JOIN table2 ON condition;\n<\/pre><ul><li>Create an Index:<\/li><\/ul><pre>        CREATE INDEX index_name\n        ON table_name (column);\n<\/pre><ul><li>Backup and Restore a Database:<\/li><\/ul><pre>        mysqldump -u username -p database_name &gt; backup.sql\n        mysql -u username -p database_name &lt; backup.sql\n<\/pre><h2>PostgreSQL Cheatsheet:<\/h2><ul><li>Connect to PostgreSQL Server:<\/li><\/ul><pre>        psql -U username -d database_name\n<\/pre><ul><li>Create a Database:<\/li><\/ul><pre>        CREATE DATABASE database_name;\n<\/pre><ul><li>Use a Database:<\/li><\/ul><pre>        \\c database_name;\n<\/pre><ul><li>Create a Table:<\/li><\/ul><pre>        CREATE TABLE table_name (\n            column1 datatype,\n            column2 datatype,\n            ...\n        );\n<\/pre><ul><li>Insert Data into a Table:<\/li><\/ul><pre>        INSERT INTO table_name (column1, column2, ...)\n        VALUES (value1, value2, ...);\n<\/pre><ul><li>Select Data from a Table:<\/li><\/ul><pre>        SELECT column1, column2, ...\n        FROM table_name\n        WHERE condition;\n<\/pre><ul><li>Update Data in a Table:<\/li><\/ul><pre>        UPDATE table_name\n        SET column1 = value1, column2 = value2, ...\n        WHERE condition;\n<\/pre><ul><li>Delete Data from a Table:<\/li><\/ul><pre>        DELETE FROM table_name\n        WHERE condition;\n<\/pre><ul><li>Join Tables:<\/li><\/ul><pre>        SELECT columns\n        FROM table1\n        JOIN table2 ON condition;\n<\/pre><ul><li>Create an Index:<\/li><\/ul><pre>        CREATE INDEX index_name\n        ON table_name (column);\n<\/pre><ul><li>Backup and Restore a Database:<\/li><\/ul><pre>        pg_dump -U username -d database_name &gt; backup.sql\n        psql -U username -d database_name &lt; backup.sql\n<\/pre><h2>MongoDB Cheatsheet:<\/h2><ul><li>Connect to MongoDB Server:<\/li><\/ul><pre>        mongo --host hostname --port port_number --username username --password password\n<\/pre><ul><li>Create a Database:<\/li><\/ul><pre>        use database_name\n<\/pre><ul><li>Create a Collection:<\/li><\/ul><pre>        db.createCollection(\"collection_name\")\n<\/pre><ul><li>Insert a Document into a Collection:<\/li><\/ul><pre>        db.collection_name.insertOne({ key: value, ... })\n<\/pre><ul><li>Insert Multiple Documents into a Collection:<\/li><\/ul><pre>        db.collection_name.insertMany([{ key: value, ... }, { key: value, ... }])\n<\/pre><ul><li>Find Documents in a Collection:<\/li><\/ul><pre>        db.collection_name.find({ key: value, ... })\n<\/pre><ul><li>Update a Document in a Collection:<\/li><\/ul><pre>        db.collection_name.updateOne({ key: value, ... }, { $set: { key: value, ... } })\n<\/pre><ul><li>Update Multiple Documents in a Collection:<\/li><\/ul><pre>        db.collection_name.updateMany({ key: value, ... }, { $set: { key: value, ... } })\n<\/pre><ul><li>Delete a Document from a Collection:<\/li><\/ul><pre>        db.collection_name.deleteOne({ key: value, ... })\n<\/pre><ul><li>Delete Multiple Documents from a Collection:<\/li><\/ul><pre>        db.collection_name.deleteMany({ key: value, ... })\n<\/pre><ul><li>Aggregate Documents in a Collection:<\/li><\/ul><pre>        db.collection_name.aggregate([{ $group: { _id: \"$key\", count: { $sum: 1 } } }])\n<\/pre><ul><li>Create an Index:<\/li><\/ul><pre>        db.collection_name.createIndex({ key: 1 })\n<\/pre><h2>Microsoft SQL Cheatsheet:<\/h2><ul><li>Connect to SQL Server:<\/li><\/ul><pre>        sqlcmd -S server_name -U username -P password\n<\/pre><ul><li>Create a Database:<\/li><\/ul><pre>        CREATE DATABASE database_name;\n<\/pre><ul><li>Use a Database:<\/li><\/ul><pre>        USE database_name;\n<\/pre><ul><li>Create a Table:<\/li><\/ul><pre>        CREATE TABLE table_name (\n            column1 datatype,\n            column2 datatype,\n            ...\n        );\n<\/pre><ul><li>Insert Data into a Table:<\/li><\/ul><pre>        INSERT INTO table_name (column1, column2, ...)\n        VALUES (value1, value2, ...);\n<\/pre><ul><li>Select Data from a Table:<\/li><\/ul><pre>        SELECT column1, column2, ...\n        FROM table_name\n        WHERE condition;\n<\/pre><ul><li>Update Data in a Table:<\/li><\/ul><pre>        UPDATE table_name\n        SET column1 = value1, column2 = value2, ...\n        WHERE condition;\n<\/pre><ul><li>Delete Data from a Table:<\/li><\/ul><pre>        DELETE FROM table_name\n        WHERE condition;\n<\/pre><ul><li>Join Tables:<\/li><\/ul><pre>        SELECT columns\n        FROM table1\n        JOIN table2 ON condition;\n<\/pre><ul><li>Create an Index:<\/li><\/ul><pre>        CREATE INDEX index_name\n        ON table_name (column);\n<\/pre><ul><li>Backup and Restore a Database:<\/li><\/ul><pre>        BACKUP DATABASE database_name TO disk='backup_file_path';\n        RESTORE DATABASE database_name FROM disk='backup_file_path';\n<\/pre><p style=\"text-align: center;\"><a href=\"#top\">Top<\/a><\/p><p><style>\n    body {<br \/>      font-family: Arial, sans-serif;<br \/>      margin: 20px;<br \/>    }<\/p>\n<p>    h1 {<br \/>      text-align: center;<br \/>    }<\/p>\n<p>    h2 {<br \/>      margin-top: 30px;<br \/>    }<\/p>\n<p>    pre {<br \/>      background-color: #f4f4f4;<br \/>      padding: 10px;<br \/>      overflow-x: auto;<br \/>    }<br \/>  <\/style><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-be8196a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"be8196a\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d294597\" data-id=\"d294597\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2679869 elementor-widget-divider--separator-type-pattern elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"2679869\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\" style=\"--divider-pattern-url: url(&quot;data:image\/svg+xml,%3Csvg xmlns=&#039;http:\/\/www.w3.org\/2000\/svg&#039; preserveAspectRatio=&#039;none&#039; overflow=&#039;visible&#039; height=&#039;100%&#039; viewBox=&#039;0 0 20 16&#039; fill=&#039;none&#039; stroke=&#039;black&#039; stroke-width=&#039;1&#039; stroke-linecap=&#039;square&#039; stroke-miterlimit=&#039;10&#039;%3E%3Cg transform=&#039;translate(-12.000000, 0)&#039;%3E%3Cpath d=&#039;M28,0L10,18&#039;\/%3E%3Cpath d=&#039;M18,0L0,18&#039;\/%3E%3Cpath d=&#039;M48,0L30,18&#039;\/%3E%3Cpath d=&#039;M38,0L20,18&#039;\/%3E%3C\/g%3E%3C\/svg%3E&quot;);\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-bd902ff elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bd902ff\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4f64bd3\" data-id=\"4f64bd3\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4dbedb8 elementor-widget elementor-widget-text-editor\" data-id=\"4dbedb8\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p id=\"scripting\">\u00a0<span style=\"font-size: 1.875rem; color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif;\">Bash Scripting Cheatsheet<\/span><\/p><h2>1. Shebang (Interpreter Directive)<\/h2><pre>#!\/bin\/bash<\/pre><h2>2. Variables<\/h2><pre>variable_name=value<\/pre><h2>3. Comments<\/h2><pre># This is a comment<\/pre><h2>4. Command Execution<\/h2><pre>command_name arg1 arg2<\/pre><h2>5. I\/O Redirection<\/h2><pre>command &gt; output_file\ncommand &gt;&gt; output_file\ncommand &lt; input_file command 2&gt; error_file\ncommand1 | command2\n<\/pre><h2>6. Arithmetic Operations<\/h2><pre>result=$((num1 + num2))\nresult=$(expr $num1 + $num2)\nlet result=num1+num2<\/pre><h2>7. Conditional Statements<\/h2><pre>if condition\nthen\n    # code to execute if condition is true\nelse\n    # code to execute if condition is false\nfi<\/pre><h2>8. Loops<\/h2><h3>For Loop:<\/h3><pre>for variable in list\ndo\n    # code to execute\ndone<\/pre><h3>While Loop:<\/h3><pre>while condition\ndo\n    # code to execute\ndone<\/pre><h3>Until Loop:<\/h3><pre>until condition\ndo\n    # code to execute\ndone<\/pre><h2>9. Functions<\/h2><pre>function_name() {\n    # code to execute\n}<\/pre><h2>10. Command-Line Arguments<\/h2><pre>$0, $1, $2, ..., $9: Represents script name and command-line arguments.\n$#: Number of command-line arguments passed.\n$@: All command-line arguments as separate strings.\n$*: All command-line arguments as a single string.<\/pre><h2>11. Conditional Expressions<\/h2><h3>Comparison Operators:<\/h3><pre>-eq: Equal to\n-ne: Not equal to\n-gt: Greater than\n-lt: Less than\n-ge: Greater than or equal to\n-le: Less than or equal to<\/pre><h3>String Operators:<\/h3><pre>=: Equal to\n!=: Not equal to\n-z: Empty string\n-n: Non-empty string<\/pre><h2>12. String Manipulation<\/h2><h3>Concatenation:<\/h3><pre>result=$string1$string2\nresult=${string1}${string2}<\/pre><h3>Substring Extraction:<\/h3><pre>substring=${string:start:length}<\/pre><h3>String Length:<\/h3><pre>length=${#string}<\/pre><h3>String Replacement:<\/h3><pre>new_string=${string\/substring\/replacement}\nnew_string=${string\/\/substring\/replacement}<\/pre><h2>13. File Operations<\/h2><h3>File Existence:<\/h3><pre>if [ -e filename ]; then\n    # code to execute if the file exists\nfi<\/pre><h3>File Permissions:<\/h3><pre>chmod permission filename<\/pre><h2>14. Exit Status<\/h2><pre>$?: Represents the exit status of the last command executed.<\/pre><p style=\"text-align: center;\"><a href=\"#top\">Top<\/a><\/p><p><style>\n        body {<br \/>            font-family: Arial, sans-serif;<br \/>            line-height: 1.6;<br \/>            padding: 20px;<br \/>            max-width: 800px;<br \/>            margin: 0 auto;<br \/>        }<\/p>\n<p>        h1 {<br \/>            text-align: center;<br \/>        }<\/p>\n<p>        h2 {<br \/>            margin-top: 20px;<br \/>        }<\/p>\n<p>        code {<br \/>            background-color: #f4f4f4;<br \/>            padding: 2px 4px;<br \/>            border-radius: 4px;<br \/>        }<\/p>\n<p>        pre {<br \/>            background-color: #f4f4f4;<br \/>            padding: 10px;<br \/>            overflow: auto;<br \/>        }<br \/>    <\/style><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Terraform Ansible Kubernetes Docker Database Scripting Terraform Cheat Sheet Common Terraform Commands terraform init \/\/ Initialize a new or existing Terraform working directory terraform plan \/\/ Create an execution plan for changes to be applied terraform apply \/\/ Apply changes to infrastructure terraform destroy \/\/ Destroy Terraform-managed infrastructure terraform validate \/\/ Check if &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/cliffordjuan.com\/index.php\/wiki\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Wiki&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/pages\/102"}],"collection":[{"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":198,"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/pages\/102\/revisions"}],"predecessor-version":[{"id":420,"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/pages\/102\/revisions\/420"}],"wp:attachment":[{"href":"https:\/\/cliffordjuan.com\/index.php\/wp-json\/wp\/v2\/media?parent=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}