<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Boyan Iliev</title>
    <description>The latest articles on DEV Community by Boyan Iliev (@boiliev).</description>
    <link>https://dev.to/boiliev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F473176%2Fb39253d5-a467-4048-8e7e-fdfdf337696f.png</url>
      <title>DEV Community: Boyan Iliev</title>
      <link>https://dev.to/boiliev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/boiliev"/>
    <language>en</language>
    <item>
      <title>Does Your AI Agent Have a Kill Switch?</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Mon, 03 Aug 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/atomsized/does-your-ai-agent-have-a-kill-switch-396j</link>
      <guid>https://dev.to/atomsized/does-your-ai-agent-have-a-kill-switch-396j</guid>
      <description>&lt;p&gt;&lt;strong&gt;The agent believed it was working inside a simulation. The systems it reached were real. Anthropic's report shows why a prompt cannot carry the whole safety boundary for an autonomous task.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An engineer should know what the agent is doing, what it can reach and how to stop it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On 30 July 2026, Anthropic published a review of 141,006 cybersecurity evaluation runs. It found three incidents, across six runs, where Claude reached the internet and gained unauthorised access to real organisations.&lt;/p&gt;

&lt;p&gt;The models were running capture-the-flag exercises. Their prompts said the environment was simulated and had no internet access. A misunderstanding with the evaluation partner left live internet access available, so the models often treated real systems as part of the exercise.&lt;/p&gt;

&lt;p&gt;The models followed their task with a false picture of the environment. The runtime allowed actions that the prompt said were impossible, and the activity was found later through transcript review.&lt;/p&gt;

&lt;p&gt;An engineer should understand the task before it begins, see its progress and be able to stop it immediately. The platform must enforce those controls even when the model misunderstands the situation.&lt;/p&gt;

&lt;h2&gt;The agent had the wrong picture of its environment.&lt;/h2&gt;

&lt;p&gt;Anthropic's evaluation prompt told Claude that it had no internet access. The machines used for the exercise could reach the internet because of a misconfiguration. The agent trusted the description in the prompt and treated reachable systems as part of the simulated challenge.&lt;/p&gt;

&lt;p&gt;The incidents had real effects. One reached production infrastructure and a database. Another published a malicious Python package to PyPI. It was available for roughly one hour and ran on 15 real systems. A third scanned thousands of targets before compromising an internet-facing application.&lt;/p&gt;

&lt;p&gt;The models reacted differently to signs that the targets were real. An older model continued. Another convinced itself that it was still in a simulation. Anthropic's latest research model stopped after recognising the real environment.&lt;/p&gt;

&lt;p&gt;Anthropic describes this as closer to a harness and operational failure than a model alignment failure. Normal production safeguards were absent because the evaluations measured the underlying models. Containment and monitoring therefore carried more responsibility.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The prompt described the intended world. The infrastructure exposed the real one.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Make the environment prove what the agent can reach.&lt;/h2&gt;

&lt;p&gt;A prompt can name the approved environment, resources and goal. It cannot close a network route, remove an IAM permission or prevent a tool from calling an unapproved endpoint.&lt;/p&gt;

&lt;p&gt;Build the smallest working environment for the task. Give the agent a separate identity, short-lived credentials, an allowlist of tools and resources, a network policy and a time limit. Check those controls from inside the runtime it will use.&lt;/p&gt;

&lt;p&gt;Name the account, cluster, repository, namespace, service and environment. Describe which systems are real, simulated or outside scope. If the runtime disagrees with that description, stop before the first action.&lt;/p&gt;

&lt;p&gt;Review third-party execution environments as well. The team needs to know who owns the network, identity, logs, emergency stop and incident response. An assumption between two organisations can become a live access path.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify outbound network access from inside the agent runtime.&lt;/li&gt;
&lt;li&gt;Issue one short-lived identity for one task and one environment.&lt;/li&gt;
&lt;li&gt;Allow only the tools, resources and actions required for the approved goal.&lt;/li&gt;
&lt;li&gt;Record the expected account, cluster, repository and service before execution.&lt;/li&gt;
&lt;li&gt;Stop when the observed environment differs from the approved context.&lt;/li&gt;
&lt;li&gt;Confirm who owns monitoring and incident response across every vendor boundary.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;Controls should still hold when the agent's understanding is wrong.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Give the engineer a live view of the task.&lt;/h2&gt;

&lt;p&gt;Before the run, the responsible engineer should see the goal, plan, environment, identity, tools, access boundary, time limit and stop conditions. A broad instruction such as investigate the cluster leaves too much room for interpretation.&lt;/p&gt;

&lt;p&gt;During the run, show the current step, tool call, target resource, network destination, command, proposed change and evidence. Highlight denied requests, repeated attempts, new destinations and actions outside the plan.&lt;/p&gt;

&lt;p&gt;Keep the important state above the raw transcript: the goal, current action, completed changes, remaining access and failed policy checks. Preserve the full trace underneath for audit.&lt;/p&gt;

&lt;p&gt;Alert the named owner when the agent approaches a boundary. The owner can follow normal reads through the activity view and receive a clear signal when approval is required or the task changes shape.&lt;/p&gt;

&lt;h3&gt;Keep the plan, live work and stop path together&lt;/h3&gt;

&lt;p&gt;The engineer should be able to understand and control the task from one place.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Approved goal:&lt;/strong&gt; Name the owner, environment, result and time limit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bounded identity:&lt;/strong&gt; Issue short-lived access for the approved tools and resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live activity:&lt;/strong&gt; Show actions, targets, evidence, retries and denied requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policy checks:&lt;/strong&gt; Compare every action with the approved scope before the tool runs it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineer checkpoint:&lt;/strong&gt; Pause before a production change, new destination or high-risk action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;External stop:&lt;/strong&gt; End the task and remove its access through a control the agent cannot change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserved evidence:&lt;/strong&gt; Keep the plan, tool calls, logs, diffs and reason for stopping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verified recovery:&lt;/strong&gt; Check the desired state and let the engineer decide the next step.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;&lt;p&gt;Awareness means seeing the plan, the current action and the remaining authority.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;A kill switch must stop access as well as reasoning.&lt;/h2&gt;

&lt;p&gt;Industries that use machinery design an emergency stop into the system. An infrastructure agent can cross networks, use credentials and change real resources quickly. Design its stop before it starts.&lt;/p&gt;

&lt;p&gt;Ending the model response leaves other work running. Tool calls, CI jobs, cloud operations, retries and scheduled tasks may continue after the visible conversation ends.&lt;/p&gt;

&lt;p&gt;Place the kill switch in the orchestrator or a separate control service. The agent cannot disable it, edit its policy or issue itself a new identity. Engineers and automatic policy controls should both be able to trigger it.&lt;/p&gt;

&lt;p&gt;Stopping also needs a recovery choice. Preserve the evidence, compare the running system with the approved state and let the engineer choose whether to reconcile, revert or investigate further.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stop the active run:&lt;/strong&gt; End new calls, then terminate active sessions and jobs where possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove authority:&lt;/strong&gt; Revoke the task identity, expire tokens and block its network and tool access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cancel future work:&lt;/strong&gt; Clear queued jobs, retries, schedules and child tasks created by the run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserve the record:&lt;/strong&gt; Store the plan, prompts, actions, destinations, responses, diffs, logs and stop reason.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the real state:&lt;/strong&gt; Compare Git, GitOps, Kubernetes and cloud state with the last approved result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Return ownership:&lt;/strong&gt; Give the responsible engineer the evidence and recovery choices before any restart.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;The stop control must remain available when the agent, model or runtime behaves unexpectedly.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Keep engineers close to actions that change the system.&lt;/h2&gt;

&lt;p&gt;Engineers should see the plan, the live activity and every point where approval is needed. Routine reads can continue inside the approved boundary.&lt;/p&gt;

&lt;p&gt;Read-only evidence gathering can publish a report for review. Infrastructure changes should arrive as a diff or pull request. Git records the proposal, CI checks it and an engineer approves it before GitOps applies the accepted state.&lt;/p&gt;

&lt;p&gt;Identity, networking, data, deletion and security changes deserve explicit approval. Small reversible actions may gain more automation after the team tests the limits, recovery and stop path with real runs.&lt;/p&gt;

&lt;p&gt;For Atomsized workflows, AI reads and prepares. Engineers decide and approve. Git records the accepted change. GitOps applies it. AWS and monitoring report the result.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The engineer owns the decision, the boundary and the recovery.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Begin with one task and rehearse the stop.&lt;/h2&gt;

&lt;p&gt;Choose one repeated task with a known owner and clear result. Read-only investigation lets the team compare the agent's work with an engineer's process before giving it change access.&lt;/p&gt;

&lt;p&gt;Write down the scope and pause conditions. Build the live view and kill switch, then replay earlier incidents where the correct outcome was to ask for help or stop.&lt;/p&gt;

&lt;p&gt;Run beside an engineer. Review the actions, access, weak context and alerts. Expand only after the team trusts the monitoring and has rehearsed recovery.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1. Choose the task:&lt;/strong&gt; Name one owner, one environment, one expected result and one maximum runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2. Map every action:&lt;/strong&gt; List the tools, resources, destinations, permissions and data the task may use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3. Build the boundary:&lt;/strong&gt; Create the task identity, allowlists, network rules and automatic stop conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4. Show the live state:&lt;/strong&gt; Put the plan, current action, evidence, changes and policy decisions in one view.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5. Test the kill switch:&lt;/strong&gt; Stop an active tool call, revoke access, cancel queued work and confirm the evidence remains available.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;6. Run in shadow mode:&lt;/strong&gt; Use real work with no change authority, compare results and fix gaps before adding another action.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;A team should prove that it can stop the agent before asking the agent to do more.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Test what happens after the button is pressed.&lt;/h2&gt;

&lt;p&gt;A kill switch can report success while external work continues. Confirm that credentials fail, network paths close, active jobs end where possible and queued work disappears.&lt;/p&gt;

&lt;p&gt;Inspect the running state next. GitOps may restore an approved configuration, while data operations and external API calls can need a separate recovery. Show what completed, stopped halfway and still needs attention.&lt;/p&gt;

&lt;p&gt;Keep these tests in the evaluation set. Include wrong context, unexpected internet access, new destinations, repeated denied actions, lost monitoring and a failed stop attempt.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The manual stop remains available outside the agent runtime.&lt;/li&gt;
&lt;li&gt;Automatic policy checks can stop the task without model cooperation.&lt;/li&gt;
&lt;li&gt;Credentials, network paths, active jobs, queues and retries are checked separately.&lt;/li&gt;
&lt;li&gt;The full activity record remains available after access is removed.&lt;/li&gt;
&lt;li&gt;The running system is compared with the last approved state.&lt;/li&gt;
&lt;li&gt;An engineer confirms recovery before the agent can start again.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;Pressing stop begins the recovery. Verified state finishes it.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Design the stop before the agent starts.&lt;/h2&gt;

&lt;p&gt;Anthropic's report shows how reasonable assumptions can line up badly. The agent believed the prompt, the environment exposed more than intended and monitoring found the activity after real systems had been reached.&lt;/p&gt;

&lt;p&gt;Give every task a named owner, accurate context, limited access, live monitoring, checkpoints and a stop control the agent cannot reach.&lt;/p&gt;

&lt;p&gt;Start with one read-only workflow. Make its work visible, rehearse the kill switch and verify recovery. Add authority from evidence gathered during real runs.&lt;/p&gt;

&lt;p&gt;An engineer should always know what the agent is trying to do, what it can touch and how to stop it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://atomsized.com/blog/why-it-is-so-hard-to-trust-ai-with-your-infrastructure" rel="noopener noreferrer"&gt;&lt;strong&gt;How Can You Trust AI Agents With Your Infrastructure?&lt;/strong&gt;&lt;/a&gt; — The context, operating experience, permission boundary and recovery path an infrastructure agent needs before it prepares a change.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://atomsized.com/blog/how-should-ai-monitor-your-infrastructure" rel="noopener noreferrer"&gt;&lt;strong&gt;How Should AI Monitor Your Infrastructure?&lt;/strong&gt;&lt;/a&gt; — How an AI monitoring agent can gather evidence, report useful findings and keep the responsible engineer in control.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Give the agent a visible task and an external stop.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can map one AI-assisted workflow, limit its access, show engineers what it is doing and build the stop and recovery path before it reaches production.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://atomsized.com/contact" rel="noopener noreferrer"&gt;Schedule a platform call&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>security</category>
      <category>platformengineering</category>
    </item>
    <item>
      <title>How Should AI Monitor Your Infrastructure?</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Thu, 30 Jul 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/atomsized/how-should-ai-monitor-your-infrastructure-166d</link>
      <guid>https://dev.to/atomsized/how-should-ai-monitor-your-infrastructure-166d</guid>
      <description>&lt;p&gt;&lt;strong&gt;An alert tells you that something changed. It rarely says why, who is affected or what to do next. The on-call engineer still opens several tools and pieces the story together. AI can help when it understands the platform around the alert.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The agent collects the evidence and reports the finding. Engineers decide what to do.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine an API latency alert. It identifies the graph that moved. It does not explain whether users are blocked, what changed ten minutes earlier or which dependency is slow.&lt;/p&gt;

&lt;p&gt;We have worked through incidents where a deployment looked healthy while a dependency was failing. We have also seen the largest movement on a dashboard lead away from the real user problem. The answer came from connecting the signals to the platform around them.&lt;/p&gt;

&lt;p&gt;An agent that opens dashboards faster saves a few clicks. A useful one follows the incident like an experienced engineer. It knows how the service should behave, how the parts connect, what changed and who owns the response.&lt;/p&gt;

&lt;p&gt;Start with one incident your team already understands. Write down how the investigation works, connect the information it needs and let the agent follow that path in read-only mode.&lt;/p&gt;

&lt;h2&gt;The agent should join the investigation early.&lt;/h2&gt;

&lt;p&gt;Monitoring rules tell the team when a known signal crosses a limit. Someone still works out whether users are affected, which services are involved, what changed and what can be done safely.&lt;/p&gt;

&lt;p&gt;The agent can begin when the alert arrives. It can update the incident notes, collect evidence and prepare a clear summary for the responsible engineer.&lt;/p&gt;

&lt;p&gt;The first guess will often be incomplete. One service may recover while another starts to fail. A recent deployment may look related and turn out to be harmless. The agent should keep checking its explanation as the situation changes.&lt;/p&gt;

&lt;p&gt;What we want is simple: a shorter path from the first signal to a useful understanding of the problem. The engineer should see who is affected, what changed, which dependencies matter, what evidence is missing and what to check next.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The agent keeps the incident picture updated. The engineer decides what to do.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Give the agent a clear map of the platform.&lt;/h2&gt;

&lt;p&gt;A large collection of metrics and logs is only the starting point. The agent needs to know how those signals relate to the system the team runs.&lt;/p&gt;

&lt;p&gt;Start with what the user is trying to do. Follow that path through the applications, databases, queues, networks, cloud resources and external services involved. Connect each part to its owner, expected state, deployment source and recovery steps.&lt;/p&gt;

&lt;p&gt;Then add what changed. Git commits, CI runs, Argo CD syncs, Terraform changes, Kubernetes events, AWS activity, feature releases, maintenance and traffic shifts can all change how an alert should be read.&lt;/p&gt;

&lt;p&gt;Add the team's experience as well. Runbooks show the usual response. Incident reviews show what happened here before. Maintenance notes explain temporary conditions. Confirmed results show which clues helped and which guesses were wrong.&lt;/p&gt;

&lt;h3&gt;Connect the user problem to the recovery&lt;/h3&gt;

&lt;p&gt;Each part answers a different question during the incident.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;What healthy looks like:&lt;/strong&gt; Describe what users and business processes should be able to complete.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How the system connects:&lt;/strong&gt; Map the applications, data, networks, cloud resources and external services involved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What is happening:&lt;/strong&gt; Collect metrics, logs, traces, events and checks with clear names and timestamps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What changed:&lt;/strong&gt; Connect deployments, configuration, infrastructure changes and planned work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What the team knows:&lt;/strong&gt; Add owners, runbooks, maintenance, known exceptions and earlier incidents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent investigation:&lt;/strong&gt; Build the timeline, test possible causes, show gaps and prepare the next check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineer decision:&lt;/strong&gt; The responsible engineer reviews the evidence and chooses the response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the recovery:&lt;/strong&gt; Watch the result, record what happened and improve the next investigation.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;&lt;p&gt;The map should show how a user problem connects to the systems underneath it.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;The agent can only use the context you prepare.&lt;/h2&gt;

&lt;p&gt;Most of the information probably exists already. The problem is that each tool describes the platform differently. A repository may use one service name, Kubernetes another and the cloud account a third. Timestamps may use different zones. The team may know the owner even though the tools do not.&lt;/p&gt;

&lt;p&gt;Connect those sources while keeping a link to the original data. The agent should be able to move from a user-facing check to the service, current deployment, related infrastructure, recent change and owner without guessing what names mean.&lt;/p&gt;

&lt;p&gt;Access also needs care. The agent may read from several systems, but each source still needs its own permissions and audit record. Secrets and unrelated customer data should stay outside the investigation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What healthy looks like:&lt;/strong&gt; Record the user result, expected service behaviour, safe limits and checks that confirm recovery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One name for each thing:&lt;/strong&gt; Match services, environments, clusters, accounts, resources and deployments across the tools that use them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service connections:&lt;/strong&gt; Keep the upstream and downstream links across applications, data, network, cloud and external services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring data:&lt;/strong&gt; Collect user checks, metrics, logs, traces and events with clear timestamps and source labels.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;History of changes:&lt;/strong&gt; Put code, configuration, infrastructure, feature, maintenance and traffic changes on one timeline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team knowledge:&lt;/strong&gt; Connect owners, escalation paths, runbooks, known exceptions and incident results confirmed by engineers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safe access:&lt;/strong&gt; Use a separate machine identity, permissions for each source and a record of what the agent reads or proposes.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;A stronger model cannot fix missing names, broken timestamps or an old service map.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Let the agent write the first investigation draft.&lt;/h2&gt;

&lt;p&gt;This is the approach behind the Atomsized Observability Agent. It reads the approved environment context, then checks Kubernetes workloads, pod status, events, logs, Prometheus alerts, selected AWS resources and spend signals on a schedule.&lt;/p&gt;

&lt;p&gt;Most checks should stay quiet. Normal deployment churn, short pod restarts and spot node rotation only need a report when the behaviour persists or affects a real workload.&lt;/p&gt;

&lt;p&gt;When it finds something worth investigating, the agent writes a short Markdown report in the observability repository and posts it to Slack for review. The report states what happened, why it may matter, which evidence supports it and where the engineer should check next.&lt;/p&gt;

&lt;p&gt;That level of automation removes repeated collection work and keeps the team informed. The responsible engineer reviews the finding, decides whether action is needed and owns the response through recovery.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name the environment, service, affected user result and current owner.&lt;/li&gt;
&lt;li&gt;Describe the finding and show what normal looked like before it.&lt;/li&gt;
&lt;li&gt;Attach the useful evidence with clear sources and timestamps.&lt;/li&gt;
&lt;li&gt;Connect recent deployments, configuration and infrastructure changes.&lt;/li&gt;
&lt;li&gt;Show possible causes, weak links and missing information.&lt;/li&gt;
&lt;li&gt;Suggest the next useful check for the responsible engineer.&lt;/li&gt;
&lt;li&gt;Update the report when the evidence or affected service path changes.&lt;/li&gt;
&lt;li&gt;Record whether the response restored the expected result.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;Automate evidence collection and reporting. Keep production decisions with the responsible engineer.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Keep the response inside the usual delivery and recovery process.&lt;/h2&gt;

&lt;p&gt;The agent may need to read from monitoring, delivery and cloud systems. Changing those systems needs a much smaller set of permissions.&lt;/p&gt;

&lt;p&gt;For Atomsized workflows, AI reads and prepares. Engineers decide and approve. Git records the accepted change. GitOps applies and reconciles it. AWS reports what happened in the running environment.&lt;/p&gt;

&lt;p&gt;The incident summary should name the service owner, incident owner, proposed action, expected result, stop condition and recovery check. If the evidence changes before approval, the proposal should be updated.&lt;/p&gt;

&lt;p&gt;Later, the team may allow one small and reversible response to run automatically. The identity, action limits, retries, time limit and stop conditions should be enforced outside the model. Changes to data, identity and networking should keep a stronger review.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The agent prepares the evidence and response. The responsible engineer owns the change and recovery.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Start with one incident your team already understands.&lt;/h2&gt;

&lt;p&gt;Trying to monitor the whole platform with AI creates too much scope for the first version. Choose one service path and one type of incident that experienced engineers already know how to investigate.&lt;/p&gt;

&lt;p&gt;A good starting case has clear user impact, several useful data sources, a known owner and enough past incidents to test against. It should be safe to run with read-only access.&lt;/p&gt;

&lt;p&gt;Write down the investigation before connecting the agent. Follow an engineer from the first alert to the confirmed recovery. Record the tools they open, the questions they ask and the points where missing information slows them down.&lt;/p&gt;

&lt;p&gt;That path becomes the first monitoring skill. In read-only mode, the agent can run the checks on a schedule, prepare the report and show when the evidence points somewhere else.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1. Choose the incident:&lt;/strong&gt; Choose the service, type of incident, affected user result, owner and evidence that confirms recovery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2. Map the steps:&lt;/strong&gt; List the tools, data sources, questions and decisions used during the investigation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3. Connect the data:&lt;/strong&gt; Give services stable names, align timestamps and provide read-only access to the evidence the agent needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4. Replay past incidents:&lt;/strong&gt; Test the workflow with real incidents and near misses, including cases where the right answer is to wait or ask another owner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5. Run reports beside the engineer:&lt;/strong&gt; Let the agent publish live findings for the on-call engineer without changing production or paging more people.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;6. Expand from results:&lt;/strong&gt; Fix missing context and add another type of incident only after the first investigation path is dependable.&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;One person who owns the monitoring workflow and one owner for the service.&lt;/li&gt;
&lt;li&gt;A written description of what healthy looks like for users, the service and its dependencies.&lt;/li&gt;
&lt;li&gt;A service map connected to current ownership and escalation.&lt;/li&gt;
&lt;li&gt;One timeline for monitoring data, application changes and infrastructure changes.&lt;/li&gt;
&lt;li&gt;A read-only agent identity with limited access and an audit trail.&lt;/li&gt;
&lt;li&gt;A set of real incidents with results confirmed by engineers.&lt;/li&gt;
&lt;li&gt;One incident-summary format that shows evidence, missing information and other possible causes.&lt;/li&gt;
&lt;li&gt;A review after the shadow period with a clear choice to improve, expand or stop.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;One complete incident path teaches the team more than a broad monitoring demo.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Check whether the agent makes the investigation easier.&lt;/h2&gt;

&lt;p&gt;A clear explanation can still send the engineer in the wrong direction. Judge the agent by the help it provides during the investigation and by the evidence attached to its conclusions.&lt;/p&gt;

&lt;p&gt;During replays and live shadow mode, compare its incident picture with the one built by the engineer. Record where it found useful information sooner, where it followed a weak link and where missing ownership or an old service map blocked it.&lt;/p&gt;

&lt;p&gt;After each incident, the engineer confirms the cause, useful evidence, chosen response and recovery. Add those confirmed facts to the runbook, incident history and tests used by the monitoring skill.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time from the first alert to a useful incident summary.&lt;/li&gt;
&lt;li&gt;Conclusions that include a source, timestamp and affected service path.&lt;/li&gt;
&lt;li&gt;Missing information found before the agent recommends a response.&lt;/li&gt;
&lt;li&gt;Weak links or confident guesses the engineer needs to correct.&lt;/li&gt;
&lt;li&gt;Checks and responses accepted, changed or rejected by the owner.&lt;/li&gt;
&lt;li&gt;Recovery confirmed and recorded after the response.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;The agent should learn from what the team confirmed after the incident.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Build useful context first.&lt;/h2&gt;

&lt;p&gt;AI monitoring becomes useful when the agent can see the platform around the alert. It needs to know what healthy looks like, how services connect, what changed, who owns the response and what happened in similar incidents.&lt;/p&gt;

&lt;p&gt;It should keep one clear incident picture from the first signal to recovery. Engineers can see what is happening, which possible causes fit the evidence, what remains unknown and what to check next.&lt;/p&gt;

&lt;p&gt;Start with one repeated investigation and run the agent beside the on-call engineer. Let it automate evidence gathering and reports while the team fixes the missing context that real incidents expose. Add another incident type when the first one is dependable.&lt;/p&gt;

&lt;p&gt;Engineers remain responsible for decisions and production changes. The agent helps them reach those decisions with better information and less searching.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://atomsized.com/blog/why-it-is-so-hard-to-trust-ai-with-your-infrastructure" rel="noopener noreferrer"&gt;&lt;strong&gt;How Can You Trust AI Agents With Your Infrastructure?&lt;/strong&gt;&lt;/a&gt; — The context, operating experience, permission boundary and recovery path an infrastructure agent needs before it prepares a change.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://atomsized.com/blog/why-gitops-is-hard-to-explain-and-automate" rel="noopener noreferrer"&gt;&lt;strong&gt;Why GitOps is so hard to explain and automate.&lt;/strong&gt;&lt;/a&gt; — A practical operating model for proposals, engineer approval, reconciliation and evidence across AWS and Kubernetes.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Start the Observability Agent with one useful report.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can map what healthy looks like, connect the evidence and automate a report your engineers can review before deciding what to do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://atomsized.com/contact" rel="noopener noreferrer"&gt;Schedule a platform call&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>observability</category>
      <category>platformengineering</category>
    </item>
    <item>
      <title>From Shared Staging to Reviewable Environments</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Mon, 27 Jul 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/atomsized/from-shared-staging-to-reviewable-environments-gnc</link>
      <guid>https://dev.to/atomsized/from-shared-staging-to-reviewable-environments-gnc</guid>
      <description>&lt;p&gt;&lt;strong&gt;One team deploys a feature for QA. Another needs to test a migration. Product wants a stable demo. Each request makes sense. A single shared environment forces them into the same queue.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Shared staging becomes a queue when several teams need it at the same time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We have seen one deployment overwrite another, testers wait for a stable slot, demos block development work and teams lose track of which revision is running.&lt;/p&gt;

&lt;p&gt;The name varies between teams: staging, stage, dev, test or UAT. We use shared staging to mean any environment where several changes have to take turns.&lt;/p&gt;

&lt;p&gt;When several decisions wait for the same environment, they have to happen one after another. Engineering, QA and product repeat tests, screenshots and approvals, coordinate deployment windows and wait longer to move a change forward.&lt;/p&gt;

&lt;p&gt;Extra permanent environments rarely clear that queue. A reviewable environment has one job: help someone make a specific decision about a known version of a change.&lt;/p&gt;

&lt;h2&gt;Shared staging slows down when reviews run in parallel.&lt;/h2&gt;

&lt;p&gt;Waiting and unclear targets cause the delay. A team loses confidence in a review when the target changes underneath it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Changes collide:&lt;/strong&gt; A newer deployment replaces the version somebody else is still testing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review waits:&lt;/strong&gt; QA, product and engineering negotiate for a stable window instead of reviewing the work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Results become unclear:&lt;/strong&gt; A test result or screenshot may no longer match what is currently deployed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Measure the wait as part of delivery time.&lt;/h2&gt;

&lt;p&gt;A staging queue often starts before the deployment metrics begin. We look at how long a change waits for its first useful review, how much work is repeated and how often a newer deployment makes earlier results out of date.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Review delay:&lt;/strong&gt; Track the median time from ready for review to the first useful validation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time spent waiting:&lt;/strong&gt; Record engineering, QA and product hours spent waiting, coordinating or repeating work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeated review work:&lt;/strong&gt; Count tests, demos and approvals that need to be repeated after a newer deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;Measure one application or service for two weeks. Compare its results over time instead of combining data from teams that work in different ways.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Build the smallest environment the review needs.&lt;/h2&gt;

&lt;p&gt;A reviewable environment has a clear purpose, a known source revision, an owner, clear rules for test data, visible health and a cleanup rule. It only needs the parts required for that decision.&lt;/p&gt;

&lt;p&gt;A preview environment gives developers, testers, product teams and stakeholders their own reviewable version of a change. They can develop, test and demonstrate it without competing for shared staging.&lt;/p&gt;

&lt;p&gt;When previews reuse existing Kubernetes capacity and shared platform services, the extra running cost can stay low. A short-lived namespace uses the cluster and services that are already running.&lt;/p&gt;

&lt;p&gt;That changes when a preview needs dedicated nodes, databases, load balancers, large data sets or a long lifetime. Clear resource limits and automatic cleanup after a set time help keep costs under control.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Keep staging production-like. Preview environments should use the same built application versions, configuration patterns and deployment path, while scaling down safely and keeping production data out.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Preview, UAT and shared staging answer different questions.&lt;/h2&gt;

&lt;p&gt;Each stage supports a different kind of review.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Preview environment:&lt;/strong&gt; Review one meaningful change quickly and in isolation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coordinated UAT:&lt;/strong&gt; Test a fixed combination of services, repositories or business flows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared staging:&lt;/strong&gt; Keep it for final release checks and tests that need the full system in a common state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Record each step from creation to deletion.&lt;/h2&gt;

&lt;p&gt;A pull request records the change. CI builds a fixed application version. Git records how the environment should be set up. Argo CD applies that setup and keeps it in sync. The URL, version, health and test results return to the pull request.&lt;/p&gt;

&lt;p&gt;When the change is merged, closed or reaches its time limit, the environment definition is removed and the environment is cleaned up. Git history and review results remain available.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with the workflow that waits for shared staging most often.&lt;/li&gt;
&lt;li&gt;Build one complete create, update, review and delete lifecycle.&lt;/li&gt;
&lt;li&gt;Measure waiting time, failed environments and old environments that were not removed before adding more teams or services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Fund one review path, then decide from the results.&lt;/h2&gt;

&lt;p&gt;Choose one staging bottleneck where work regularly waits or needs to be repeated. Run a 30-day pilot, then decide whether the team should spend more time and money on it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Baseline:&lt;/strong&gt; Measure the current wait, repeated work and environment cost for one review path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pilot:&lt;/strong&gt; Build one complete create, update, review and delete lifecycle using the existing delivery controls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide:&lt;/strong&gt; After 30 days, extend, adjust or stop based on review delay, repeated work, stability and AWS spend.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;&lt;p&gt;After 30 days, ask whether reviews moved sooner and whether the workflow kept stability and AWS spend under control.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Start with a review that regularly waits.&lt;/h2&gt;

&lt;p&gt;Find the change that repeatedly waits for staging, give it one controlled review path and measure whether the queue gets shorter.&lt;/p&gt;

&lt;p&gt;Shared staging keeps a clear job: final release validation and shared checks. Preview and UAT paths handle review work that needs isolation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://atomsized.com/blog/preview-environments-monorepo-five-person-team" rel="noopener noreferrer"&gt;&lt;strong&gt;Preview environments for a monorepo team of five or more.&lt;/strong&gt;&lt;/a&gt; - A practical GitOps design for isolated, disposable application states when one repository contains the complete source state.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://atomsized.com/blog/preview-environments-microservices-ten-repositories" rel="noopener noreferrer"&gt;&lt;strong&gt;Preview environments for a microservice architecture with 10+ repositories.&lt;/strong&gt;&lt;/a&gt; - A GitOps operating model for single-service and coordinated previews across multiple repositories.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Turn one blocked review path into a controlled workflow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can map the smallest useful preview or UAT workflow around your repositories, GitOps controls and current AWS platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://atomsized.com/contact" rel="noopener noreferrer"&gt;Schedule a platform call&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gitops</category>
      <category>devops</category>
      <category>platformengineering</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>What is HTTP, HTTPS, and SSL</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Mon, 08 Nov 2021 13:19:34 +0000</pubDate>
      <link>https://dev.to/boiliev/what-is-http-https-and-ssl-1924</link>
      <guid>https://dev.to/boiliev/what-is-http-https-and-ssl-1924</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;If you are a developer, you probably know what an &lt;code&gt;SSL&lt;/code&gt; certificate is. If you don't know what it is, don't worry. An &lt;code&gt;SSL&lt;/code&gt; certificate is a must-have on any website. It lets your web browser connect to a web server securely. &lt;code&gt;SSL&lt;/code&gt; stands for &lt;strong&gt;Secure Sockets Layer&lt;/strong&gt;, and it is a digital certificate that allows for an encrypted connection.&lt;/p&gt;

&lt;p&gt;But let's back it up a bit. First, we need to know what lets a web browser and a webserver connect. To connect with a website, we need &lt;code&gt;HTTP&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is &lt;code&gt;HTTP&lt;/code&gt;?
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;HTTP&lt;/code&gt; stands for &lt;strong&gt;Hypertext Transfer Protocol&lt;/strong&gt; and this protocol is used to transfer data from the web servers to web browsers. So if you ever visit a website you can notice the protocol being added at the beginning of the web address. So for example &lt;code&gt;http://www.website.com&lt;/code&gt;. This protocol is used to view different web pages on the internet.&lt;/p&gt;

&lt;p&gt;By default in standard &lt;code&gt;HTTP&lt;/code&gt;, all of the information is sent in clear text. What this means is when you type something, it gets sent over the public internet which means that hackers can view it, because it's all sent over in clear text.&lt;/p&gt;

&lt;p&gt;This isn't a problem, that is if you only browse a website, but if there are any passwords involved, or any other personal information, such as credit card information, then a hacker could easily get that info. Due to the fact it's being sent over the public internet, a hacker could listen in as the data is being transferred and could steal it.&lt;/p&gt;

&lt;p&gt;If you ever have to type in personal information, you should always check if you have a secure connection. And for you to have a secure connection, you would need to use &lt;code&gt;HTTPS&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is &lt;code&gt;HTTPS&lt;/code&gt;?
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;HTTPS&lt;/code&gt; is &lt;code&gt;HTTP&lt;/code&gt;, but secure. That's why there is an &lt;code&gt;S&lt;/code&gt; added. &lt;strong&gt;Hypertext Transfer Protocol Secure&lt;/strong&gt;. What this does is encrypt the data that is being retrieved by &lt;code&gt;HTTP&lt;/code&gt;. It lets all of the data that is being transferred between the server and the computer secure. The way it does that is by making the data impossible to read by encryption algorithms that mix up the data that's being transferred.&lt;/p&gt;

&lt;p&gt;So whenever you are on a site and you have to enter a password or some credit card information, make sure the web address looks like this - &lt;code&gt;https://www.website.com&lt;/code&gt;. This means that the data that you pass in will be protected. You can also notice a padlock to the left of the web address, which also indicates you are using a secure &lt;code&gt;HTTP&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Thanks to the encryption algorithms the data we put in comes out all scrambled up so that hackers can't understand and decrypt it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HTTPS&lt;/code&gt; secures the data thanks to a protocol called:&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;code&gt;SSL&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;SSL&lt;/code&gt; stands for &lt;strong&gt;Secure Sockets Layer&lt;/strong&gt; and it is a protocol that's used to establish security on the internet. But how exactly does &lt;code&gt;SSL&lt;/code&gt; work? Well, it uses public-key encryption to secure data.&lt;/p&gt;

&lt;p&gt;What this means is when a computer connects with a website that is using &lt;code&gt;SSL&lt;/code&gt;, the computer's web browser will ask the website to say who it is or identify itself. Then the webserver will send the computer a copy of the &lt;code&gt;SSL&lt;/code&gt; certificate it has.&lt;/p&gt;

&lt;p&gt;An &lt;code&gt;SSL certificate&lt;/code&gt; is a small digital certificate that is used to validate the identity of a website. Or in other words, this lets your computer know that the website you're visiting is reliable and trustworthy.&lt;/p&gt;

&lt;p&gt;So then the browser of the computer can check if it trusts the certificate and if it does it will send a message to the web server, to which then the web server will respond with a response so that an &lt;code&gt;SSL&lt;/code&gt; session can begin.&lt;/p&gt;

&lt;p&gt;Most &lt;code&gt;SSL&lt;/code&gt; certificates have to be paid for, but there are also some free ones, for example:&lt;/p&gt;

&lt;h1&gt;
  
  
  Let's Encrypt
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;Let’s Encrypt&lt;/code&gt; is a Certificate Authority (CA) that provides an easy way to obtain and install free &lt;code&gt;SSL&lt;/code&gt; certificates, thereby enabling encrypted HTTPS on web servers. You could check this post out on &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04" rel="noopener noreferrer"&gt;How To Secure Nginx with Let's Encrypt on Ubuntu&lt;/a&gt; so that you can get a little bit more familiar with &lt;code&gt;Let's Encrypt&lt;/code&gt;. &lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This may seem confusing at first, but it's best to get to know how the internet actually works and the different protocols that are out there. If you notice almost all of the sites nowadays have &lt;code&gt;HTTPS&lt;/code&gt; instead of &lt;code&gt;HTTP&lt;/code&gt;, even though there isn't any data to be transferred between servers, and that's because Google has started flagging websites as &lt;strong&gt;Not Secure&lt;/strong&gt; because they aren't protected with &lt;code&gt;SSL&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I hope that this post has helped you learn a little bit more about these protocols that you use daily and how they work.&lt;/p&gt;

</description>
      <category>http</category>
      <category>https</category>
      <category>ssl</category>
    </item>
    <item>
      <title>How to get the size of a directory in Linux</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Thu, 04 Nov 2021 09:17:37 +0000</pubDate>
      <link>https://dev.to/boiliev/how-to-get-the-size-of-a-directory-in-linux-3bhd</link>
      <guid>https://dev.to/boiliev/how-to-get-the-size-of-a-directory-in-linux-3bhd</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Linux is one of the most popular operating systems in the world. It is Unix-like, and it is also open-source. Quite a big percentage of developers use Linux because it can be customized in so many ways.&lt;/p&gt;

&lt;p&gt;What's cool about Linux is its command line. Every 'hackers' paradise. There are a ton of commands. If you aren't familiar with any Linux commands, be sure to check out this post on the &lt;a href="https://devdojo.com/bo-iliev/8-linux-commands-everyone-should-know" rel="noopener noreferrer"&gt;8 Linux Commands Everyone Should Know&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There is probably a command for almost anything that you want to do. For example what if you wanted to get the size of a directory? Well luckily for you there is a command for that. In this post, we are going to talk about that command and see what it can offer.&lt;/p&gt;

&lt;h1&gt;
  
  
  The &lt;code&gt;du&lt;/code&gt; command
&lt;/h1&gt;

&lt;p&gt;This command lets the user get a quick view of the &lt;strong&gt;disk usage&lt;/strong&gt;. The best way to use it is by giving it the directory you want to see the size of. It should look a little something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du directory_name

// output
2314    directory_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give you the size of all the files and at the very end, it will give you the size of the directory itself. You could point out the full path, or you could just give the name of the directory you want to see if you are already on the same path.&lt;/p&gt;

&lt;p&gt;But we could make this even easier just b adding 2 &lt;strong&gt;flags&lt;/strong&gt;. Flags help the command change its behavior. For the &lt;code&gt;du&lt;/code&gt; command we could add the flags &lt;code&gt;-s&lt;/code&gt; and &lt;code&gt;-h&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-s&lt;/code&gt; stands for &lt;strong&gt;summarize&lt;/strong&gt; and it will show you only the total size of the directory, without all those files popping up on your screen.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-h&lt;/code&gt; stands for &lt;strong&gt;human-readable&lt;/strong&gt; and it will convert the size so that you can read it easier. Just by running the command without the &lt;code&gt;-h&lt;/code&gt; flag doesn't specify you a unit of measurement.&lt;/p&gt;

&lt;p&gt;So now to get the best of this command, you should run it like this with the &lt;code&gt;-s&lt;/code&gt; and &lt;code&gt;-h&lt;/code&gt; flags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -sh directory_name

// output
44.5M   directory_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you wanted to see all of the directories sizes, you could just run this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -sh ./*

// output
12.2M   dir1
 2.5M   dir2
  55M   dir3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another thing you can do is use pipe(&lt;code&gt;|&lt;/code&gt;) and sort them by size, which will make it even easier for you to see their sizes. What &lt;code&gt;|&lt;/code&gt; does is get the output from the command behind it and add it into the input of the command after it. So to sort the directories by size just run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;du -sh ./* | sort -h

// output
  55M   dir3
12.2M   dir1
 2.5M   dir2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This is a pretty useful command that I think everybody should know, just because of how short and easy it is. I hope that this post has helped you and I wish you happy coding.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How to Replace All Occurrences of a String</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Thu, 08 Jul 2021 17:33:02 +0000</pubDate>
      <link>https://dev.to/boiliev/how-to-replace-all-occurrences-of-a-string-24mi</link>
      <guid>https://dev.to/boiliev/how-to-replace-all-occurrences-of-a-string-24mi</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;One of the main data types in JavaScript is &lt;code&gt;strings&lt;/code&gt;. These data types are used for storing and manipulating &lt;strong&gt;text&lt;/strong&gt;. And luckily for us, there are quite a few methods that help us in manipulating these data types.&lt;/p&gt;

&lt;p&gt;These methods are one of the many built-in methods of JavaScript. This is because JS has some built-in objects. Some of them are: &lt;code&gt;Array&lt;/code&gt;, &lt;code&gt;Math&lt;/code&gt; and &lt;code&gt;String&lt;/code&gt;. And for each object, some properties and methods are associated with them.&lt;/p&gt;

&lt;p&gt;In this post we are going to see &lt;strong&gt;How to Replace All Occurrences of a String&lt;/strong&gt; with the &lt;code&gt;replaceAll()&lt;/code&gt; method.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;code&gt;replaceAll()&lt;/code&gt; Method
&lt;/h1&gt;

&lt;p&gt;In order to use this method, we first have to create our string. Let's add randomly &lt;code&gt;!&lt;/code&gt; inside this strong so that we can remove it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let intro = 'My! n!ame! i!s Bo!yan!';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to remove it, we have to write the strings name, then add the &lt;code&gt;replaceAll&lt;/code&gt; method next to it, and pass in the first argument which element we want to be replaced or removed. An important thing is to remember that you have to save the new string into a new variable. It should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let newIntro = intro.replaceAll('!', '')
console.log(newIntro);

&amp;lt;- My name is Boyan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you want to replace the elements, just pass in the second argument as what you want it replaced with. Let's replace the whitespace with &lt;code&gt;-&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let newerIntro =newIntro.replaceAll(' ', '-');
console.log(newerIntro)

&amp;lt;- My-name-is-Boyan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This is pretty much it to the &lt;code&gt;replaceAll()&lt;/code&gt; method. It is the main method used, if not the only method, that replaces all occurrences of a string.&lt;/p&gt;

&lt;p&gt;I hope that this post has helped you and I would love to hear some feedback in the comments below.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>developer</category>
      <category>codenewbie</category>
      <category>methods</category>
    </item>
    <item>
      <title>Introduction To MongoDB and How To Use It</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Tue, 29 Jun 2021 14:08:16 +0000</pubDate>
      <link>https://dev.to/boiliev/introduction-to-mongodb-and-how-to-use-it-3no1</link>
      <guid>https://dev.to/boiliev/introduction-to-mongodb-and-how-to-use-it-3no1</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;MongoDB is a &lt;code&gt;NoSQL&lt;/code&gt; (not only SQL) database. In NoSQL databases, we store our data in a collection of documents. These documents are very similar to &lt;code&gt;JavaScript objects&lt;/code&gt; or &lt;code&gt;JSON objects&lt;/code&gt;. So if you are familiar with JavaScript, then you are going to like Mongo, because it will be easier to get the hang of it.&lt;/p&gt;

&lt;p&gt;MongoDB is very scalable. It has built-in replication and sharding. It's performant, it's fast, and mostly, it's very flexible. Because the data structure is like a JavaScript object, you don't have to map out your entire data structure beforehand as you do with relational databases. Unlike a relational database like &lt;code&gt;MySQL&lt;/code&gt;, where you have to create all your tables and all your columns, Mongo gives you the freedom to structure your data however we want through our application. This doesn't mean it's better than relational databases, it all depends on how you need to use your database.&lt;/p&gt;

&lt;h1&gt;
  
  
  Installing MongoDB
&lt;/h1&gt;

&lt;p&gt;We are going to install MongoDB through &lt;code&gt;Homebrew&lt;/code&gt;. If you don't have Homebrew installed, just run the code below in your terminal and that will install Homebrew.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you get Homebrew installed on your Mac, just run the three following commands. First, we run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap mongodb/brew
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install mongodb-community@4.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then after that, we will want to run it as a service with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew services start mongodb-community@4.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, we need to run the following command so that we can connect and start using MongoDB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what you should see after running the command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79r5zuoeirbem8zm6a9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79r5zuoeirbem8zm6a9z.png" alt="Mongo - Imgur.png" width="798" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have Mongo installed and ready, let's start with some of the main commands that you should know&lt;/p&gt;

&lt;h1&gt;
  
  
  Commands
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Show Current Database
&lt;/h3&gt;

&lt;p&gt;The command for seeing the current database is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Show All Databases
&lt;/h3&gt;

&lt;p&gt;In order to see all of the databases just run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;show dbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Switching and Creating Databases
&lt;/h3&gt;

&lt;p&gt;If you want to switch which database you are using, just type in &lt;code&gt;use&lt;/code&gt; followed by the database name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use db_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to create a DB, just type in the &lt;code&gt;use&lt;/code&gt; command again, followed by your new DBs name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use new_db_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you run &lt;code&gt;show dbs&lt;/code&gt; after creating a DB, the new DB won't show because it doesn't have anything in it, so don't worry when it doesn't show up after running the &lt;code&gt;show dbs&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dropping a Database
&lt;/h3&gt;

&lt;p&gt;In order to drop a database, or in other words, delete it, you first need to switch to the database with the &lt;code&gt;use&lt;/code&gt; command, and after that, you need to type in the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.dropDatabase()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating and Viewing Collections
&lt;/h3&gt;

&lt;p&gt;To create a collection in the DB that you are using, you just have to run the following command and set the name of your collection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.createCollection('collection_name')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you want to view the collection, just run the &lt;code&gt;show&lt;/code&gt; command followed by &lt;code&gt;collections&lt;/code&gt; and that should print out the collections in your DB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;show collections
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Inserting Rows
&lt;/h3&gt;

&lt;p&gt;Now in order to insert a row, just type in the &lt;code&gt;db&lt;/code&gt; followed by the name of the collection that you want to insert the row in, and then by &lt;code&gt;insert&lt;/code&gt;, which is then followed by parentheses&lt;code&gt;()&lt;/code&gt;. And in those parentheses, you pass in an object with whatever you want.&lt;/p&gt;

&lt;p&gt;Here is an example of how this should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.insert({
    username: 'Batman_fan_44',
    followers: 3,
    following: [
        'Alred',
        'Robin'
    ],
    status: {
        name: 'Bruce Wayne',
        status: 'active'
    }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see this looks just like a normal JavaScript object. You can store strings, numbers, arrays and can also have embedded objects inside. This is why Mongo is liked by so many, because of how similar it is to JS and how easy it is to use.&lt;/p&gt;

&lt;p&gt;If you want to insert more than one row, instead of typing &lt;code&gt;insert&lt;/code&gt; after the collections name, type in &lt;code&gt;insertMany&lt;/code&gt; and then insert your rows in an array like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.insertMany([
    {
        username: 'Tony Montana',
        followers: 1234
    },
    {
        username: 'Hannibal Lecter',
        followers: 5
    },
    {
        username: 'Rick Grimes',
        followers: 21
    }
])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These rows don't have as many stuff like likes or status. which our first row has, but that doesn't matter. Unlike relational databases, in Mongo, we don't have that strict data model that we have to follow. We can put whatever we want wherever we want, which is awesome!&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing Rows
&lt;/h3&gt;

&lt;p&gt;To view the rows of a certain collection, just run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection_name.find()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will print out the data, but it will be hard to read. Luckily there is a method called &lt;code&gt;pretty()&lt;/code&gt;, which formats all the rows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection_name.find().pretty()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now it will be much easier to read.&lt;/p&gt;

&lt;p&gt;These are some of the main commands that you should know. I recommend that you check out this MongoDB Cheat Sheet and have a look at some other commands that might be useful to you:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/bradtraversy/f407d642bdc3b31681bc7e56d95485b6" rel="noopener noreferrer"&gt;https://gist.github.com/bradtraversy/f407d642bdc3b31681bc7e56d95485b6&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;As you can see MongoDB looks identical to JavaScript. They have similar syntax and are pretty easy to get the hang of.&lt;/p&gt;

&lt;p&gt;If you want to have a MongoDB database cluster production-ready, I strongly recommend using the new DigitalOcean managed MongoDB clusters which you can deploy with just the click of a button so that you won't have to worry about server maintenance, which can be very challenging sometimes.&lt;/p&gt;

&lt;p&gt;If you want you can use this referral code which gives you &lt;a href="https://m.do.co/c/122894dc3b82" rel="noopener noreferrer"&gt;free $100 DigitalOcean credit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you also want to learn more about SQL and how to use it, I highly recommend that you check out this &lt;a href="https://github.com/bobbyiliev/introduction-to-sql" rel="noopener noreferrer"&gt;Introduction to SQL&lt;/a&gt; opensource ebook. It helped me understand how to use SQL and I highly recommend it.&lt;/p&gt;

&lt;p&gt;I hope that this post has helped you get more comfortable with using MongoDB and getting the hang of it.&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>hackathon</category>
    </item>
    <item>
      <title>How To Write Your First Node.js Script</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Tue, 08 Jun 2021 12:31:50 +0000</pubDate>
      <link>https://dev.to/boiliev/how-to-write-your-first-node-js-script-h05</link>
      <guid>https://dev.to/boiliev/how-to-write-your-first-node-js-script-h05</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Until recently(if you think that 2009 is recently), we could only run JS code in a web browser. Node is a JavaScript runtime that executes code outside of the browser. We can use the same JS syntax we know and love to write server-side code, instead of relying on other languages like Python or Ruby. You can build Web Servers, Command Line Tools, Native Apps(VSCode is a Node app!), Video Games, Drone Software, and a whole lot more.&lt;/p&gt;

&lt;p&gt;In this post, I am going to show you how to write your first little Node script which will make you a directory with an HTML, CSS, and JavaScript file in it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;First, you need to check if you have Node installed on your machine. If you don't know if you have it, just go to the terminal and write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will print out the Node.js version which is currently installed. If you see an error and nothing prints, then you don't have Node installed.&lt;/p&gt;

&lt;p&gt;In order to install Node, go to the node website and just press the download button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;https://nodejs.org/en/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installing Node, we need to create a JavaScript file. Let's call this file &lt;code&gt;script.js&lt;/code&gt;. In this file, we are going to write our script.&lt;/p&gt;

&lt;p&gt;Now that we have Node installed and our file created, it's time to write our script. For this script, we are going to need to know what the &lt;code&gt;process&lt;/code&gt; object is and how the &lt;code&gt;fs&lt;/code&gt; module works. &lt;/p&gt;

&lt;h1&gt;
  
  
  How To Run Node Files
&lt;/h1&gt;

&lt;p&gt;In order to run Node files, you just need to write &lt;code&gt;node&lt;/code&gt; and then the file name next to it in the terminal. Th file must be in the same folder that you're in, or you need to reference that full path relative to where you are at the moment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node script.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  &lt;code&gt;process&lt;/code&gt; &amp;amp; &lt;code&gt;argv&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;process&lt;/code&gt; is an object that's available which is in the global scope. It provides information about, and control over, the current Node.js process. It has a bunch of methods and properties. For example, we can see our current working directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;process.cwd()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a method called &lt;code&gt;process.argv&lt;/code&gt;. It returns an array containing the command line arguments passed when the Node.js process was launched. The first element will be the path where the node executable is, and the second will be the path to the JS file being executed. To call this method you need to go to your JS file and &lt;code&gt;console.log()&lt;/code&gt; it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(process.argv);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then after running your file, you should see this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node script.js
[ '/usr/local/bin/node', '/Users/ghostman/scripts/script.js' ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any remaining element will be additional command-line arguments. We can pass them as arguments into a script. Not a function, but it's a similar idea. I can pass in arguments to a script. &lt;/p&gt;

&lt;p&gt;Here is an example of a little script that prints out the additional command-line arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const args = process.argv.slice(2)  -&amp;gt; slice to remove first two items.

for(let arg of args){
    console.log(`Hello ${arg}`)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then when we run the file like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node script.js Batman Superman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ou output should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello Batman
Hello Superman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a fun little script to help you understand how the file and node work together and how they can be used. &lt;/p&gt;

&lt;p&gt;Now let's get to the fun part.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;code&gt;fs&lt;/code&gt; Module
&lt;/h1&gt;

&lt;p&gt;The fs module enables interacting with the file system. It has hundreds of methods that you can use. Here is a list so you can see how much they are.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nodejs.org/dist/latest-v14.x/docs/api/fs.html" rel="noopener noreferrer"&gt;https://nodejs.org/dist/latest-v14.x/docs/api/fs.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order for us to use the &lt;code&gt;fs&lt;/code&gt; module, we have to &lt;code&gt;require&lt;/code&gt; it. We have to save it in a variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require('fs')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have our &lt;code&gt;fs&lt;/code&gt; module, here are the methods that we will be needing for our script.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;fs.mkdirSync&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This method creates a directory in our current working directory. There is also an &lt;code&gt;fs.mkdir&lt;/code&gt; method, but we will be using the synchronous method because it will not execute anything else until this method is completed. Here is an example of our method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fs.mkdirSync('dirName')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;fs.writeFileSync&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This method creates files for us. Just like &lt;code&gt;fs.mkdirSync&lt;/code&gt;, this method will not let anything else run until it has finished its process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fs.writeFileSync('fileName')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can check for errors with the &lt;code&gt;try..catch&lt;/code&gt; statements if your code doesn't seem to work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try {
    fs.writeFileSync('fileName')
} catch (e){
    console.log(e)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Writting Our Node Script
&lt;/h1&gt;

&lt;p&gt;Now that you have a basic knowledge of Node, try writing a script that creates a directory with three files inside it on your own. If you can't, that OK. Here is how to write your script:&lt;/p&gt;

&lt;p&gt;First, you need to require the &lt;code&gt;fs&lt;/code&gt; module. Then you must use &lt;code&gt;process.argv&lt;/code&gt; to set the name of your directory. After that, you need to use the &lt;code&gt;fs.mkdirSync&lt;/code&gt; method and the &lt;code&gt;fs.writeFileSync&lt;/code&gt; method to create the directory and the files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require('fs')
const folderName = process.argv[2] || 'Project'

try {
    fs.mkdirSync(folderName);
    fs.writeFileSync(`${folderName}/index.html`);
    fs.writeFileSync(`${folderName}/style.css`);
    fs.writeFileSync(`${folderName}/app.js`);
} catch (err) {
    console.log(`Error!`);
console.log(err)
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After writing the code for the script, we can run it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node script.js SecretProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we don't give an additional command-line argument, it will automatically set the directory name to &lt;code&gt;Project&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Consclusion
&lt;/h1&gt;

&lt;p&gt;I hope that this post has helped you understand Node.js a little bit more and made you more comfortable with it. Don't be scared to try some new stuff and experiment with all those &lt;code&gt;fs&lt;/code&gt; module methods.&lt;/p&gt;

&lt;p&gt;Let me know if this has been of help to you through Twitter. You can follow me &lt;a href="https://twitter.com/bo_iliev21" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>developer</category>
    </item>
    <item>
      <title>8 Linux Commands Everyone Should Know</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Thu, 06 May 2021 07:25:17 +0000</pubDate>
      <link>https://dev.to/boiliev/8-linux-commands-everyone-should-know-1f2i</link>
      <guid>https://dev.to/boiliev/8-linux-commands-everyone-should-know-1f2i</guid>
      <description>&lt;h1&gt;
  
  
  Introduciton
&lt;/h1&gt;

&lt;p&gt;It's a well-known fact that developers use terminals. And using a terminal is something that everybody should know. It is a good thing to know and do because it will help you in so many ways. It will help you in that job interview, or just in your everyday life. You must at least have the basic knowledge of how to use a terminal. For example how to change directories and view them and how to create a file. &lt;/p&gt;

&lt;p&gt;In this post, I am going to show you some of the basic commands and how to get around in a terminal and not be completely lost. &lt;/p&gt;

&lt;h1&gt;
  
  
  1. &lt;code&gt;pwd&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;pwd&lt;/code&gt; means &lt;strong&gt;Print Working Directory&lt;/strong&gt;. It shows you the full path to your current directory. This is used so you don't get lost in all those directories that you have. If you don't know what a directory is, it is pretty much like a folder. It stores other folders and files in it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pwd
/Users/user1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  2. &lt;code&gt;ls&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;ls&lt;/code&gt; stands for &lt;strong&gt;List Files&lt;/strong&gt;. It will show you the files and directories that are in your current directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls
xmen avengers justiceLeague
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  3. &lt;code&gt;cd&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Now that you know how to list your files in your working directory and how to print the path to it, you will need to &lt;strong&gt;Change Directory&lt;/strong&gt;. This is done by typing the &lt;code&gt;cd&lt;/code&gt; command. You just have to type it and then next to it type the directory you want to visit. But this command only moves forward and backward. This means you can't just type a directory name that is deep inside your files just by typing its name. You have to type the full path to that dir.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd avengers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to go in multiple dirs, you need to use &lt;code&gt;/&lt;/code&gt; after every dir, and then type the directory you want to visit inside the previous one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ironMan/suitMark85
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to go back one dir, you need to type &lt;code&gt;cd ..&lt;/code&gt;. You could mix this with other dir like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../../captainAmerica/steveRogers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if you just type &lt;code&gt;cd&lt;/code&gt; by itself, it will send you to the home directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  4. &lt;code&gt;mkdir&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Now that we know how to go to a directory and how to view what's inside them, we need to learn how to make one. It is done through the &lt;code&gt;mkdir&lt;/code&gt; command. You just type the command and add the new directory name next to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir secretDir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to create multiple dir at once, just type all of them next to each other.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir secretDir1 secretDir2 secretDir3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When doing these kinds of things be sure to use the &lt;code&gt;pwd&lt;/code&gt; command so you know in which dir you are so that you don't create the new dirs in the wrong one.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. &lt;code&gt;man&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;man&lt;/code&gt; command is used to check the manuals of a certain command. When you are not sure what a command does and what to have a detailed look at it, just type the &lt;code&gt;man&lt;/code&gt; command and add the other command next to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;man ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you are done viewing the manual, press &lt;code&gt;q&lt;/code&gt; so that you can leave the file.&lt;/p&gt;

&lt;h1&gt;
  
  
  6. &lt;code&gt;touch&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;touch&lt;/code&gt; command creates a file (or multiple). It is almost the same as &lt;code&gt;mkdir&lt;/code&gt;, but it's not used for making directories but for files with an extension(.txt, .html, .css ...).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch index.html style.css app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  7. &lt;code&gt;nano&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;nano&lt;/code&gt; is a text editor using a command-line interface. When you create a file and want to add something small to it, just use &lt;code&gt;nano&lt;/code&gt; to add it. &lt;/p&gt;

&lt;p&gt;In order to edit a file, just type &lt;code&gt;nano&lt;/code&gt; and the file name next to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that if there isn't such a file in your directory, for example, the &lt;code&gt;index.html&lt;/code&gt; one, it will create a new one. So this means that you wouldn't need to use the &lt;code&gt;touch&lt;/code&gt; command. bUt it's best to create a file with &lt;code&gt;touch&lt;/code&gt; and then go to your code editor and do your coding there. &lt;code&gt;nano&lt;/code&gt; is best used for those minor changes like for example a typo.&lt;/p&gt;

&lt;p&gt;There are some shortcuts that would be nice for you to know. I would recommend checking this post out on some of those shortcuts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://devdojo.com/bobbyiliev/11-nano-shortcuts-that-you-should-know" rel="noopener noreferrer"&gt;11 Nano shortcuts that you should know&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  8. &lt;code&gt;rm&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Now that we know how to view dirs, create them, create files and edit them, we need to learn how to delete them. Deleting a dir or file is done with the &lt;code&gt;rm&lt;/code&gt; command. You definitely want to be careful with this, because if you delete a file or dir, you won't be able to get it back. So if you want to delete a file just type &lt;code&gt;rm&lt;/code&gt; and then the file name. Or if you want to remove multiple files, just type their names next to each other&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm index.html style.css app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you want to remove a directory you can use &lt;code&gt;rmdir&lt;/code&gt;, but this will only remove a dir that is empty. In order to delete a dir that is not empty, use the &lt;code&gt;rm&lt;/code&gt; command with the flags &lt;code&gt;-rf&lt;/code&gt;. If you don't know what flags are, think of them as extra options for your command. The &lt;code&gt;ls&lt;/code&gt; command has lots of flags. I would recommend that you check the manual of the &lt;code&gt;ls&lt;/code&gt; command so that you can see all its available flags. &lt;/p&gt;

&lt;p&gt;So deleting a directory with other dirs or files inside should be done like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf avengers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be very careful with these commands because if you delete a file or dir by accident, you won't be able to get them back&lt;/p&gt;

&lt;p&gt;If you want to see some examples and a more detailed explanation for some of these commands be sure to check out this video:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/HqdFvL74wqo"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Knowing how to use a terminal is crucial. It is. a huge bonus to know at least these commands, which will help you a lot. &lt;/p&gt;

&lt;p&gt;I hope that this post has helped you and that you will be a little bit more confident the next time you see a terminal.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>developer</category>
    </item>
    <item>
      <title>Introduction To JavaScript Promises</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Tue, 27 Apr 2021 15:23:09 +0000</pubDate>
      <link>https://dev.to/boiliev/introduction-to-javascript-promises-2oed</link>
      <guid>https://dev.to/boiliev/introduction-to-javascript-promises-2oed</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;A Promise is an object representing the eventual completion or failure of an async operation. A promise is a returned object to which you attach callbacks, instead of passing callback into a function. &lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;code&gt;new Promise&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;In order to make a new Promise you need to write &lt;code&gt;new Promise&lt;/code&gt; and then it will expect you to pass in a function with two arguments which are functions. The first one represents the resolution of this promise and the second one the rejection of this promise.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const requestPromise = (url) =&amp;gt; {
    return new Promise((resolve, rejects) =&amp;gt; {
        const delay = Math.floor(Math.random() * (4500)) + 500;
        setTimeout(() =&amp;gt; {
            if(delay &amp;gt; 4000) {
                reject('Connection Timeout :(')
            } else {
                resolve(`Here is your fake data from ${url}`)
            }
        }, delay)
    })
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now in order to call the function multiple times with different URLs, we need to use the &lt;code&gt;then&lt;/code&gt; method. The &lt;code&gt;then&lt;/code&gt; method returns data if the async request is returned. But if the operation is failed, we must use the &lt;code&gt;catch&lt;/code&gt; method. This is how it should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requestPromise('reddit.com/api/chicken/page1')
    .then(() =&amp;gt; {
        console.log('PAGE1 WORKED!!');
        requestPromise('reddit.com/api/chicken/page2')
            .then(() =&amp;gt; {
                console.log('PAGE2 WORKED!!');
                requestPromise('reddit.com/api/chicken/page3')
                    .then(() =&amp;gt; {
                        console.log('PAGE3 WORKED!!');
                    })
                    .catch(() =&amp;gt; {
                        console.log('PAGE3 ERROR!!');
                    })
                    .catch(() =&amp;gt; {
                        console.log('PAGE2 ERROR!!');
                    })
            })
            .catch(() =&amp;gt; {
                console.log('PAGE1 ERROR!!');
            })
    })  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can notice this is very long and repetitive. We can make it shorter and cleaner by using only one &lt;code&gt;catch&lt;/code&gt;.  In order for this to work, we need to return a promise from within our callback.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requestPromise('reddit.com/api/chicken/page1')
    .then(() =&amp;gt; {
      console.log('PAGE1 WORKED!!');
      return requestPromise('reddit.com/api/chicken/page2')
    })
    .then(() =&amp;gt; {
    console.log('PAGE2 WORKED!!');
    return requestPromise('reddit.com/api/chicken/page3')
    })
    .then(() =&amp;gt; {
        console.log('PAGE3 WORKED!!');
    })
    .catch(() =&amp;gt; {
        console.log('REQUEST FAILED!');
    })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Promises are resolved and rejected with values.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requestPromise('reddit.com/api/chicken/page1')
    .then((data) =&amp;gt; {
      console.log('PAGE1 WORKED!!');
        console.log(data);           
      return requestPromise('reddit.com/api/chicken/page2')
    })
    .catch((err) =&amp;gt; {
        console.log('REQUEST FAILED!');
        console.log(err);
    })


// IF IT WORKS IT WILL PRINT:
// PAGE 1 WORKED!!
// Here is your fake data from reddit.com/api/chicken/page1

// IF IT DOESN'T WORK:
// REQUEST FAILED!
// Connection Timeout :(
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is coming from a function.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;code&gt;async&lt;/code&gt; Functions
&lt;/h1&gt;

&lt;p&gt;A newer and cleaner syntax for working with async code! It's still the same thing as a promise, but it's "prettier". There are two keywords that you need to know.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;async&lt;/code&gt; keyword
&lt;/h3&gt;

&lt;h5&gt;
  
  
  1. Async functions always return a promise
&lt;/h5&gt;

&lt;h5&gt;
  
  
  2. If the function returns a value. the promise will be resolved with that value.
&lt;/h5&gt;

&lt;h5&gt;
  
  
  3. If the function throws an exception, the promise will be rejected.
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function hello(){   
}
//-&amp;gt; returns a promise even if empty


const sing = async () =&amp;gt; {  
}
// -&amp;gt; we can use async arrow functions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are some examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const login = async (username, password) =&amp;gt; {
    if(!username || !password) 
    throw 'Missing Credentials'
    if(password === 'password') 
    return 'Welcome!'
    throw 'Invalid Password'
}

login('demonslayer64')
    .then(msg =&amp;gt; {
        console.log('LOGGED IN!')
        console.log(msg)
    })
    .catch(err =&amp;gt; {
        console.log('ERROR!')
        console.log(err)
    })

//Returns:
ERROR!
Missing Credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;login('demonslayer64', 'slayerdemon46')
    .then(msg =&amp;gt; {
        console.log('LOGGED IN!')
        console.log(msg)
    })
    .catch(err =&amp;gt; {
        console.log('ERROR!')
        console.log(err)
    })

//Returns:
ERROR!
Invalid Password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;login('demonslayer64', 'password')
    .then(msg =&amp;gt; {
        console.log('LOGGED IN!')
        console.log(msg)
    })
    .catch(err =&amp;gt; {
        console.log('ERROR!')
        console.log(err)
    })

//Returns:
LOGGED IN!
WELCOME!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;await&lt;/code&gt; keyword
&lt;/h2&gt;

&lt;h5&gt;
  
  
  1. The &lt;code&gt;await&lt;/code&gt; keyword is used inside of functions declared with async.
&lt;/h5&gt;

&lt;h5&gt;
  
  
  2. &lt;code&gt;await&lt;/code&gt; will pause the execution of the function, &lt;strong&gt;waiting for a promise to be resolved&lt;/strong&gt;.
&lt;/h5&gt;

&lt;p&gt;Here is an example with our function from earlier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function makeTwoRequests() {
    let data1 = await requestPromise('/page1');
    console.log(data1);
}

//Returns
&amp;lt;- &amp;gt;Promise {&amp;lt;pending&amp;gt;}
Here is your fake data from /page1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This is pretty much the basics of JavaScript promises. Let me know if this has helped you at all. Any feedback will be greatly appreciated!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>async</category>
      <category>developer</category>
    </item>
    <item>
      <title>How To Write A Good README File</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Thu, 22 Apr 2021 07:20:31 +0000</pubDate>
      <link>https://dev.to/boiliev/how-to-write-a-good-readme-file-2c0d</link>
      <guid>https://dev.to/boiliev/how-to-write-a-good-readme-file-2c0d</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;If you're familiar with GitHub, then you know what a README file is. But if you don't know what it is, you can think of it as the introduction to your repository. It's very helpful that while looking at someone's repo you can just scroll down to their README file and have a look at what their project is all about. &lt;/p&gt;

&lt;p&gt;It's crucial that your project gets introduced properly because if it isn't, the chances of someone pressing on the repo are low. That's why having a good README file shouldn't be overlooked and you should spend a good amount of your time on it. &lt;/p&gt;

&lt;p&gt;In this post, I am going to share some tips with you about how you can improve your README file, and hopefully, it can help you with your repos.&lt;/p&gt;

&lt;h1&gt;
  
  
  Choose an easy name for your project
&lt;/h1&gt;

&lt;p&gt;Before we dive into the README.md file let's quickly mention the name of the project itself.&lt;/p&gt;

&lt;p&gt;When people search for different projects, the last thing they will want to see is: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;"cool-javascript-game-about-colors-and-rgb-colors-and-even-more-colors"&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Now I know that this example is a little over-exaggerated, but you get the point. No one is going to press on a repo with such a long name. It's best if you try to have a simple and short name for your project that gets right to the point. &lt;/p&gt;

&lt;p&gt;So for the example, above we could just use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"javascript-color-game"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A name like this has a higher chance of getting clicked on and taken a look at. So make sure that your repos name is simple and straight to the point.&lt;/p&gt;

&lt;h1&gt;
  
  
  Give a descriptive summary of your project
&lt;/h1&gt;

&lt;p&gt;Now that we have the repo name cleared out, let's focus on the README.md file!&lt;/p&gt;

&lt;p&gt;When someone visits your repo they can scroll down and read the README file. It should have a description of what your project is. But you wouldn't want it to be too short. And neither should it be too long. Now if it's a very big project then by all means you should give a proper explanation of what it is and what it does. But in most cases, it should be a well-written and structured text. There are five steps that I would recommend you follow while writing your README file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step #1
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Write a quick introduction to what the project is about&lt;/strong&gt;. For example, if you made a to-do list using JavaScript, write about that. But don't get into too much depth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step #2
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Write what your code uses&lt;/strong&gt;. For example HTML, CSS and JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step #3
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Write a few more details about the project&lt;/strong&gt;. Write things that would make you take interest in the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step #4
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Write something about yourself&lt;/strong&gt;. You could say where you work, what your goals are, or share some of your previous projects. It's okay to share what you have created or what you are trying to accomplish &lt;/p&gt;

&lt;h2&gt;
  
  
  Step #5
&lt;/h2&gt;

&lt;p&gt;And finally, &lt;strong&gt;use images&lt;/strong&gt;. Show the reader what exactly the project is. Just by reading about it isn't going to get their full interest. But by seeing an image of it, they will be more likely to get more into it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;And these are some tips about writing a good README file. It's very important that you get comfortable writing these things. It could help you change the level of interaction your GitHub repo gets.&lt;/p&gt;

&lt;p&gt;I hope that this post has helped you in improving your README files and I hope to see some great repos with great README files out on GitHub soon.&lt;/p&gt;

</description>
      <category>github</category>
      <category>readme</category>
    </item>
    <item>
      <title>5 Tips On How To Stay Motivated And Productive As A Developer</title>
      <dc:creator>Boyan Iliev</dc:creator>
      <pubDate>Tue, 13 Apr 2021 08:00:15 +0000</pubDate>
      <link>https://dev.to/boiliev/5-tips-on-how-to-stay-motivated-and-productive-as-a-developer-mgp</link>
      <guid>https://dev.to/boiliev/5-tips-on-how-to-stay-motivated-and-productive-as-a-developer-mgp</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Whether you are a senior developer, or you have just started getting into code, there comes a time when you start losing motivation. It is normal to lose motivation and that lack of motivation can sometimes stick for a long time. Unfortunately, there can be hundreds of reasons that can make you lose motivation. For example, you can't get your code to run the way you want it to. This happens to a lot of us and it can be hard to get back to being productive.&lt;/p&gt;

&lt;p&gt;In this post, I would like to share with you some tips that you can try to help you stay motivated or get that motivation back.&lt;/p&gt;

&lt;h1&gt;
  
  
  Stay off your phone
&lt;/h1&gt;

&lt;p&gt;It's no secret that our mobile devices are very addictive. Of course, some people can't afford to stay off their phone because it is connected with their work. But for most of us, it is a big waste of time. When we surf the internet we can really lose motivation. Spending way too much time on social media, YouTube, or Netflix can make us lose motivation and even make us depressed. This is why when you start feeling down and feel that you are getting a little unproductive, just leave your phone at the other end of the room. &lt;strong&gt;Or just try to stay off of it for as long as you can&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I noticed that this really helped me to be more concentrated and made me enjoy much more the time I spent coding.&lt;/p&gt;

&lt;h1&gt;
  
  
  Set mini-goals for you to complete
&lt;/h1&gt;

&lt;p&gt;If you don't have a &lt;strong&gt;daily to-do list&lt;/strong&gt;, I highly recommend that you make one. You can add in it all the stuff that you want to achieve the next day. So the night before you go to bed make a list and add a few small tasks to it. Some that will be helpful for you, but at the same time not that hard. When you finish one of those tasks and see the progress that you've done when crossing it out from your list will give you a boost of motivation.&lt;/p&gt;

&lt;p&gt;Also, I would recommend that you try to complete the hardest tasks first. I personally prefer to get them out of the way first and then do the other stuff.&lt;/p&gt;

&lt;h1&gt;
  
  
  Wake up properly
&lt;/h1&gt;

&lt;p&gt;The worst thing to do when you wake up is to get straight away on your phone. You've just slept 7-10 hours and you're body is dehydrated and your brain is confused. And it's not the best idea for your eyes to be staring at a screen before they have even opened up yet.&lt;/p&gt;

&lt;p&gt;I would recommend that you lay in bed for 5 minutes so that you can fully wake up. Then go &lt;strong&gt;drink as much water as you can so that you can hydrate after a night of sleeping&lt;/strong&gt;. Try to stay off any screens for as long as you can in the morning so that your body and mind can get ready for the day. You will feel much more energetic and will have all the power to do all of the stuff that you have to.&lt;/p&gt;

&lt;h1&gt;
  
  
  Surround yourself with tech-related stuff
&lt;/h1&gt;

&lt;p&gt;Try to make the stuff you do during the day as connected to web development as possible. Seeing what other people create and the knowledge their share on all the different web dev community websites really makes you feel like you are a part of something big and lift you up. Try to chat with as many developers as you can. We have such an amazing community that just by getting surrounded by it can give you the motivation you need. Some of these sites are the &lt;a href="https://devdojo.com/" rel="noopener noreferrer"&gt;DevDojo&lt;/a&gt; website and &lt;a href="https://dev.to/"&gt;DEV&lt;/a&gt;. Also, another cool thing is the &lt;a href="https://daily.dev/" rel="noopener noreferrer"&gt;daily.dev&lt;/a&gt; extension.&lt;/p&gt;

&lt;p&gt;Try sharing some of your knowledge or share a project your working on. See all the feedback you get. You can learn so many things that way. Or you can help someone else learn something. It's really fun and it can really boost your motivation and productivity when you see other developers that have the same interests as you.&lt;/p&gt;

&lt;p&gt;And finally:&lt;/p&gt;

&lt;h1&gt;
  
  
  Look back at the things you have accomplished
&lt;/h1&gt;

&lt;p&gt;When you think that you are stuck and can't get anywhere, for example, if you don't know how to get your code to run properly, just sit for a moment and think of how you used to be when you started programming. Think of all the progress that you have made in the last couple of months. This can boost your motivation and productivity by seeing how far you've come.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;These things have really helped me stay motivated and productive. I kept losing motivation because I had to study for my exams and then I couldn't get motivated to code. When I started using these tips, I became more motivated than I have ever been. &lt;/p&gt;

&lt;p&gt;I hope that this post has helped you get more productive and motivated!&lt;/p&gt;

</description>
      <category>developer</category>
      <category>productivity</category>
      <category>motivation</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
