<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Suraj Nath</title>
    <description>Writings on software engineering, and other things</description>
    <link>https://suraj.dev/</link>
    <atom:link href="https://suraj.dev/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 10 Oct 2025 19:54:20 +0000</pubDate>
    <lastBuildDate>Fri, 10 Oct 2025 19:54:20 +0000</lastBuildDate>
    <generator>Jekyll v4.0.1</generator>
    
      <item>
        <title>My 4G setup for working remotely from anywhere</title>
        <description>&lt;p&gt;In this post, I will share details of my 4G setup and show how you can build a similar setup for working from remote locations.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h2 id=&quot;intro&quot;&gt;Intro&lt;/h2&gt;

&lt;p&gt;After getting locked in for almost 2 years due to COVID-19, I wanted to spend time with nature, away from busy city life, and breath fresh air. My parents own a farm, so it felt like a perfect place to spend a few weeks. The only issue is that I don’t have wired internet connectivity in the Farm (&lt;em&gt;kinda obvious when we think about it&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;The only way to access the internet is over 4G. We get good signal from Airtel &amp;amp; Jio. On mobile phone we were getting around 10-15 Mbps speed but it was not stable (&lt;em&gt;had high ping (&amp;gt;100ms), and jitter(&amp;gt;50ms) which is not good for video calls&lt;/em&gt;). Another issue was that speed would sometimes drop down to 1-3 Mbps.&lt;/p&gt;

&lt;p&gt;Good enough for basic browsing but NOT good enough to make video calls, share screen and present something to folks on the other side of the world.&lt;/p&gt;

&lt;h2 id=&quot;initial-research&quot;&gt;Initial research&lt;/h2&gt;

&lt;p&gt;I started looking into options and found out about microwave Internet (&lt;em&gt;wireless broadband connection delivered by high capacity microwave radio link&lt;/em&gt;). Had a chat with a microwave internet company in the area, and abandoned the plan right after looking at the quote. I needed a microwave tower and expensive radios for this setup.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/tiger_king.jpg&quot; alt=&quot;I Am Never Gonna Financially Recover From This&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This was too much money for me, I was not ready to spend this much money to work from a farm a few days a year. I wanted a cheap setup that can provide stable 4G internet for a few weeks.&lt;/p&gt;

&lt;p&gt;I started reading up and researching ways to get better signals and stabilize the existing 4G connection. I was look for setup that can provide stable connection with decent ping, and jitter and hopefully better and stable network speeds.&lt;/p&gt;

&lt;p&gt;I started looking into how the whole telecom infrastructure works. I came across signal boosting products (&lt;em&gt;which are not legal in India unless installed by network providor for you&lt;/em&gt;) for remote areas, I saw videos of folks using external antennas with 4G pocket routers to get better internet in RVs.&lt;/p&gt;

&lt;p&gt;Around the same time, someone in the &lt;a href=&quot;https://remoteindian.com/&quot;&gt;Remote Indian&lt;/a&gt; community posted about how they are using a 4G router with a cheap external dipole antenna to work from hills.&lt;/p&gt;

&lt;p&gt;That post gave me a direction to research, and I started looking into using a 4G router with external antennas.&lt;/p&gt;

&lt;p&gt;I started looking into different antenna types, what they do, how they work, and what different units and abbreviations mean. To be honest, half of the things were hard to understand, I was frantically googling while watching the videos and reading blog posts to understand things.&lt;/p&gt;

&lt;p&gt;I am trying to explain things in easy to understand words in this blog post, check out &lt;a href=&quot;https://www.youtube.com/playlist?list=PLBRCbvKb0aULwVeuIfgpQW1vTIcj1yyK-&quot;&gt;this playlist&lt;/a&gt; to go down the rabbit hole&lt;/p&gt;

&lt;h2 id=&quot;telecom-and-communication-basics&quot;&gt;Telecom and Communication Basics&lt;/h2&gt;

&lt;p&gt;Let’s take a little detour into telecom infrastructure to get an idea of how it all works. Feel free to skip this section, this section is for those who want to know details.&lt;/p&gt;

&lt;p&gt;I will keep things short, so please refer to the attached sources for more details&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Cellular_network&quot;&gt;Cellular networks&lt;/a&gt; have cell towers (&lt;em&gt;also known as cell-site or telecom base station&lt;/em&gt;) that host antennas, mostly mounted at high places.&lt;/p&gt;

&lt;p&gt;To find these towers/base stations around you, checkout &lt;a href=&quot;https://www.cellmapper.net/map&quot;&gt;cellmapper.net&lt;/a&gt; or &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.wilysis.cellinfolite&amp;amp;hl=en_IN&amp;amp;gl=US&quot;&gt;Network Cell Info Lite&lt;/a&gt; app.&lt;/p&gt;

&lt;p&gt;Later we will use the &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.wilysis.cellinfolite&amp;amp;hl=en_IN&amp;amp;gl=US&quot;&gt;Network Cell Info Lite&lt;/a&gt; app to do the site survey, so install and play around with the app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bands and Frequency Range&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1, 3, 5, 8, 40 are some of the bands used by networks in India, See &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_LTE_networks_in_Asia#Commercial_deployments_(old_table_format)&quot;&gt;this table&lt;/a&gt; for more details about cell Network Bands and frequency ranges.&lt;/p&gt;

&lt;p&gt;For Indian spectrum allocations, I found &lt;a href=&quot;https://onlytech.com/india-telecom-spectrum-chart/&quot;&gt;https://onlytech.com/india-telecom-spectrum-chart/&lt;/a&gt; helpful and easy to understand.&lt;/p&gt;

&lt;p&gt;Low Band number means Lower frequency ranges (850MHz range), and it increases as we go up the band number. Band 40 usually operates in the 2100MHz / 2300MHz range in India.&lt;/p&gt;

&lt;p&gt;The actual frequency range depends on the network provider, and the spectrum ranges they are allowed to operate by regulatory bodies.&lt;/p&gt;

&lt;p&gt;The only thing we need to know about bands is that lower bands can travel far distances and cover a lot more area but the bandwidth is low.&lt;/p&gt;

&lt;p&gt;High band numbers can NOT travel very far compared to low bands but they have high bandwidth.&lt;/p&gt;

&lt;p&gt;You can think of bandwidth as pipe, so low bands are narrow pipes that can go to kilometers, and higher bands are wide pipes that don’t go as far compared to narrow pipes.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; availability of bands and frequency ranges will vary based on your location, and cell service provider. Check details of bands and frequency ranges in your country and area.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Terms and Units of Measurements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will see some 3 letter abbreviations in mobile network literature and the &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.wilysis.cellinfolite&amp;amp;hl=en_IN&amp;amp;gl=US&quot;&gt;Network Cell Info Lite&lt;/a&gt; app. 
Don’t worry about understanding what they are, and what they mean, we just need to take readings and don’t need to know the details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cell Identifiers:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;MCC:&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Mobile_country_code&quot;&gt;Mobile country code&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;MNC:&lt;/strong&gt; &lt;a href=&quot;https://www.simbase.com/iot-glossary-dictionary/mobile-network-code&quot;&gt;Mobile Network Code&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Band:&lt;/strong&gt; Frequency range, &lt;a href=&quot;https://en.wikipedia.org/wiki/Cellular_frequencies&quot;&gt;see more&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;TAC:&lt;/strong&gt; Tracking Area Code&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ECI:&lt;/strong&gt; E-UTRAN Cell Identity&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PCI:&lt;/strong&gt; Physical Cell Identifiers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See more: &lt;a href=&quot;https://www.tutorialspoint.com/lte/lte_numbering_addressing.htm&quot;&gt;LTE Numbering &amp;amp; Addressing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Signal Quality:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;RSRP&lt;/strong&gt;: &lt;a href=&quot;https://en.wikipedia.org/wiki/RSRP&quot;&gt;Reference Signal Received Power&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RSRQ:&lt;/strong&gt; Reference Signal Received Quality&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RSSNR:&lt;/strong&gt; Reference Signal &lt;a href=&quot;https://en.wikipedia.org/wiki/Signal-to-noise_ratio&quot;&gt;Signal to Noise&lt;/a&gt; Ratio&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ASU:&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Mobile_phone_signal#ASU&quot;&gt;Arbitrary Strength Unit&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Power:&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Signal#Energy_and_power&quot;&gt;Power of the signal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Units:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;dB:&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Decibel#Antenna_measurements&quot;&gt;decibel&lt;/a&gt;, used to measure the power of the signal&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;dBm:&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/DBm&quot;&gt;decibel-milliwatts&lt;/a&gt;, same as dB but a smaller unit&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;MHz:&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Hertz#SI_multiples&quot;&gt;megahertz&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;fW:&lt;/strong&gt; femtowatt, like Watt but way smaller (&lt;em&gt;1 Watt = 1.0E+15 fW&lt;/em&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;dBi:&lt;/strong&gt; dB(isotropic), The forward gain of an antenna, measured in decibels (dBi)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How do we know if we have good signal?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A good signal will have a low Signal to Noise Ratio (RSSNR/ SINR), and High Power (RSRP / RSRQ)&lt;/p&gt;

&lt;p&gt;We can use this table to check if we have a quality signal:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/signal_table.png&quot; alt=&quot;Signal Table&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;site-survey&quot;&gt;Site Survey&lt;/h2&gt;

&lt;p&gt;Before selecting antenna and other equipment we need to know the signal quality in our target installation area.
We need this data to spec out the antenna, and find the best location/direction to mount our antenna.&lt;/p&gt;

&lt;p&gt;To collect data about the quality of signal in target area, we will do a Site Survey.&lt;/p&gt;

&lt;p&gt;Don’t worry, it’s quite easy. If I can do this, anyone can do this. 
Site Survey is just a fancy way of saying “Install an app and roam around to find the spot with the best signal”&lt;/p&gt;

&lt;p&gt;Go and download the &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.wilysis.cellinfolite&amp;amp;hl=en_IN&amp;amp;gl=US&quot;&gt;Network Cell Info Lite&lt;/a&gt; app on an Android Phone. 
This app is free on the Play Store, I don’t own an iOS device so you are on your own if you don’t have an Android device.&lt;/p&gt;

&lt;p&gt;After Installing, Open, and give it required permissions.&lt;/p&gt;

&lt;p&gt;To start the Site Survey, Open the &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.wilysis.cellinfolite&amp;amp;hl=en_IN&amp;amp;gl=US&quot;&gt;Network Cell Info Lite&lt;/a&gt; app, and go to the target location (the area where you want to mount your antenna).&lt;/p&gt;

&lt;p&gt;Move around and take note of signal quality metrics like RSRP, RSRQ, RSSNR, and Bands available.&lt;/p&gt;

&lt;p&gt;You can switch to RAW tab in app to see all the cell towers around you, and more details about them.&lt;/p&gt;

&lt;p&gt;In the RAW tab, “&lt;em&gt;Serving&lt;/em&gt;” indicates the cell tower you are connected to and being served by right now. 
The serving cell tower will show Cell Identifiers along with signal metrics. Below the Serving cell, you will see other cell towers in the area and their signal strength.&lt;/p&gt;

&lt;p&gt;Switch back to the Home tab, try moving around, changing direction, going at height, and finding a spot with the best signal. The place with best signal is the ideal location for mounting your antennas.&lt;/p&gt;

&lt;p&gt;Note down signal quality metrics like RSRP, RSRQ, RSSNR, and Bands available at that spot.
We will use these values to spec our antenna.&lt;/p&gt;

&lt;p&gt;If you have SIM cards from different network providers, repeat the site survey with all the SIM cards to find and select the best network provider for your location.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are some screenshots from a site survey:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/home_page.jpeg&quot; alt=&quot;Home Page&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/raw_page.jpeg&quot; alt=&quot;Raw Page&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You want to mount your antenna in the areas that have high RSRP (&lt;strong&gt;more than -80 dBm is great&lt;/strong&gt;), High RSRQ (more than &lt;em&gt;-10 is good&lt;/em&gt;), and High RSSNR, a positive value of SNR is considered good, and anything above 10 is great. higher SNR means the signal has low noise, and you have a stable signal.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: SNR can change with the weather or due to noise from other signal sources nearby. Mount your antenna in a place that’s isolated from noise. High voltage power lines, electric motors, or generators can be the source of the noise.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;finalizing-equipment&quot;&gt;Finalizing Equipment&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;4G Router / Modem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will need a 4G router/modem that supports two external antennas and has &lt;a href=&quot;https://en.wikipedia.org/wiki/MIMO#Multi-antenna_types&quot;&gt;MIMO (&lt;em&gt;Multiple Input Multiple Output&lt;/em&gt;)&lt;/a&gt; support.
Routers with MIMO can use two separate antennas at once to deliver fast speeds.&lt;/p&gt;

&lt;p&gt;I used &lt;a href=&quot;https://www.tp-link.com/in/home-networking/3g-4g-router/archer-mr600/&quot;&gt;TP-Link Archer MR600 AC1200&lt;/a&gt; in my setup because you can connect two external antennas, and it has MIMO capability.
I got it from &lt;a href=&quot;https://www.amazon.in/Archer-MR600-Unlocked-Compatible-Configuration/dp/B07TW8RZV8&quot;&gt;Amazon India&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;TP-Link MR600 has &lt;a href=&quot;https://en.wikipedia.org/wiki/Multi-user_MIMO&quot;&gt;MU-MIMO&lt;/a&gt; support, and &lt;a href=&quot;https://en.wikipedia.org/wiki/Carrier_aggregation&quot;&gt;Carrier Aggregation&lt;/a&gt; support.&lt;/p&gt;

&lt;p&gt;Make sure your router that has an ethernet port, you want to go wired for a better experience, For low latency applications like video calls, wired connections are better than using wifi.&lt;/p&gt;

&lt;p&gt;My router has full gigabit ethernet ports, and I connect my laptop using an ethernet cable.&lt;/p&gt;

&lt;p&gt;Any router that has these features will work fine, just make sure to get the right type of connectors and cables for your router.&lt;/p&gt;

&lt;p&gt;Here are &lt;a href=&quot;../img/blog/4g-setup/Archer_MR600_spec_India.pdf&quot;&gt;the full specifications (pdf)&lt;/a&gt; of my TP-Link MR600 Router.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/router_page.png&quot; alt=&quot;MR600 Details&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Antennas&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two types of antenna can be used as the external antenna in a 4G Router. Omni-directional or directional antenna. You need to pick a type based on your use case.&lt;/p&gt;

&lt;p&gt;rule of thumb is:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If your setup is movable and you don’t want to adjust the antenna, you can use an Omnidirectional antenna.&lt;/li&gt;
  &lt;li&gt;If your setup is fixed, then it’s better to use a directional antenna, they will give better results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=rmFzEXHecSU&quot;&gt;weBoost has a great explanation of these types of antenna&lt;/a&gt;, also folks from WilsonPro have another good video on &lt;a href=&quot;https://www.youtube.com/watch?v=YajyPBKLMnc&quot;&gt;Yagi vs Omni Antennas&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My setup was fixed so I used two directional LPDA Antennas with 12dbi gain, and frequency range for my anteena is 698-960Mhz and 1710-2700 Mhz.&lt;/p&gt;

&lt;p&gt;This frequency range is used by LTE networks in India.&lt;/p&gt;

&lt;p&gt;The gain was calculated based on the readings in our Site Survey, as per my calculations 12dbi gain antenna was enough for me.&lt;/p&gt;

&lt;p&gt;To find gain for your antenna, you need the RSRP value from the location where you will mount your antenna and subtract it from your desired RSRP value and then the difference is the gain you need in your antenna.&lt;/p&gt;

&lt;p&gt;(-80) dBm RSRP is considered a great value for RSRP so we can take that as desired RSRP value.&lt;/p&gt;

&lt;p&gt;For example, If the site survey shows -94 dBm RSRP, you will need an antenna with 14dBi gain to have -80dBm after using that antenna. &lt;strong&gt;(-80) - (-94) = 14 dBi&lt;/strong&gt; gain antenna is required&lt;/p&gt;

&lt;p&gt;In real life, the actual gain might be slightly less than the rated gain due to signal loss in cables.&lt;/p&gt;

&lt;p&gt;Here is the &lt;a href=&quot;../img/blog/4g-setup/antenna_details.pdf&quot;&gt;spec sheet (pdf)&lt;/a&gt; for my LPDA antennas:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/antenna_details.jpeg&quot; alt=&quot;antenna details image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I bought two antennas and two 15 meter cables from a supplier (&lt;a href=&quot;https://signityrfsolutions.com/&quot;&gt;signityrfsolutions&lt;/a&gt;) on indiamart.com.&lt;/p&gt;

&lt;p&gt;You can find these antennas and cables on Amazon India as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cables and Connectors&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used low-loss LMR 400 Cables to connect my antenna with the router, Low loss cables are desired in this setup to reduce signal loss.&lt;/p&gt;

&lt;p&gt;LMR 400 cable is used for low-loss communications (&lt;em&gt;rated: loss of 0.223 dB/meter @ 2.4 GHz&lt;/em&gt;). Any low-loss cable is fine for this setup, KMR 400 cable also works fine for this setup.&lt;/p&gt;

&lt;p&gt;My antennas have an N-female connector, my cables had N-male on one side, and SMA-male connectors.&lt;/p&gt;

&lt;p&gt;My 4G router has SMA-female connections for external antennas.&lt;/p&gt;

&lt;p&gt;My cables were already crimped, and connectors were attached. I suggest buying cables with connectors installed.&lt;/p&gt;

&lt;h2 id=&quot;setting-things-up--mounting-and-connection&quot;&gt;Setting things up / Mounting and connection&lt;/h2&gt;

&lt;p&gt;You need to mount the antenna at 90-degree polarity OR you can mount them with a good distance between them (if mounted with the same polarity).&lt;/p&gt;

&lt;p&gt;Here is how I mounted my antennas:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/mounted.jpeg&quot; alt=&quot;antenna mounted&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;testing&quot;&gt;Testing&lt;/h2&gt;

&lt;p&gt;After Mounting, I adjusted the antenna while monitoring signal strength metrics (&lt;em&gt;my router has a WebUI that shows these values&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;I rotated the antennas in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Aircraft_principal_axes#Vertical_axis_(yaw)&quot;&gt;yaw axis&lt;/a&gt; to find a good direction.&lt;/p&gt;

&lt;p&gt;After that I adjusted it in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Aircraft_principal_axes#Transverse_axis_(pitch)&quot;&gt;pitch axis&lt;/a&gt; to align better with the cell tower radios.&lt;/p&gt;

&lt;p&gt;Once you find a good signal, you can permanently fix the antenna at that location.&lt;/p&gt;

&lt;p&gt;After fixing antennas, do speed tests to check internet speed, jitter and ping. You should see a difference in speed, jitter, and ping with external antennas connected.&lt;/p&gt;

&lt;p&gt;If your speeds are the same with and without an external antenna, look at the stability of speeds. With this setup, you should see low ping, low jitter, and consistent speeds.&lt;/p&gt;

&lt;p&gt;I used &lt;a href=&quot;https://speed.cloudflare.com/&quot;&gt;speed.cloudflare.com&lt;/a&gt; to run the tests, It shows the distribution of measurements instead of a single number.&lt;/p&gt;

&lt;p&gt;In a stable connection, the measurement values will be close to each other.&lt;/p&gt;

&lt;h2 id=&quot;cost-breakdown&quot;&gt;Cost Breakdown&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Router:&lt;/strong&gt; &lt;a href=&quot;https://www.amazon.in/gp/product/B07TW8RZV8/&quot;&gt;TP-Link MR600&lt;/a&gt;, Paid 9000 INR (~118 USD)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Antennas:&lt;/strong&gt; LPDA 12dBi Gain Directional Antenna (2 units), Paid 2000 INR (~27 USD)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cable:&lt;/strong&gt; LMR 400 Cable (2 units, 15 meters), Paid 1800 INR (~24 USD)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Antenna Mounts (optional):&lt;/strong&gt; I used an old bed frame to mount my antenna for my setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can weld two pipes in T share to dish tv antenna base for a cheap mount. Designing an antenna mount is an exercise for the reader, if you end up designing one, tweet it to me @electron0zero&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My total cost for the setup was around 13000 INR (~170 USD)&lt;/p&gt;

&lt;h2 id=&quot;final-results-and-speed-tests&quot;&gt;Final Results and Speed Tests&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;NOTE: I am connecting my laptop via ethernet cable for a stable connection between laptop and router.
go wired for a better experience during video calls.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Internet Speeds - 4G on Phone&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/speed_test_phone.png&quot; alt=&quot;phone&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internet Speeds - With 4G Router and Extenral Anteenas&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/speed_test_router.png&quot; alt=&quot;router&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internet Speeds Tests - Different times&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/speed_list_0.png&quot; alt=&quot;speed list&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/speed_list_1.png&quot; alt=&quot;speed list&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/speed_list_2.png&quot; alt=&quot;speed list&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/speed_list_3.png&quot; alt=&quot;speed list&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Signal Quality at different times - Router UI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/router_4g_band_40.png&quot; alt=&quot;router_4g_band_40&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/router_4g_plus.png&quot; alt=&quot;router_4g_plus&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/router_4g_plus_dual_band.png&quot; alt=&quot;router_4g_plus_dual_band&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/4g-setup/router_low_signal.png&quot; alt=&quot;router_low_signal&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update (Jul 28, 2022)&lt;/strong&gt;: &lt;a href=&quot;https://pahem.de&quot;&gt;Patrick Hemmen&lt;/a&gt; emailed me about configuring route to I can recommend to configure the router to reduce &lt;a href=&quot;https://www.bufferbloat.net/projects/&quot;&gt;Bufferbloat&lt;/a&gt; and recommened testing Bufferbloat with &lt;a href=&quot;https://www.waveform.com/tools/bufferbloat&quot;&gt;this tool&lt;/a&gt;. if you are following this post, I recommened looking into Bufferbloat as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Updatte(July 28, 2022)&lt;/strong&gt;: folks in lobste.rs linked to this &lt;a href=&quot;https://ghuntley.com/internet/&quot;&gt;amazing and detailed post&lt;/a&gt; from Geoffrey Huntley on how he works remotly from his van, check it out.&lt;/p&gt;

&lt;h2 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h2&gt;

&lt;p&gt;This setup has been working fine for me, I have used this setup to work 2-3 weeks from remote location.&lt;/p&gt;

&lt;p&gt;If you end up building a similar setup, would love to see details and photos of your setup (&lt;em&gt;email me&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Hope this was helpful, and you learned something new today 👋&lt;/p&gt;

&lt;p&gt;See discussion on &lt;a href=&quot;https://news.ycombinator.com/item?id=32268194&quot;&gt;Hacker News&lt;/a&gt; and &lt;a href=&quot;https://lobste.rs/s/qtt4uu/my_4g_setup_for_working_remotely_from&quot;&gt;lobste.rs&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sun, 27 Mar 2022 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/my-4g-setup-for-working-remotely-from-anywhere</link>
        <guid isPermaLink="true">https://suraj.dev/blog/my-4g-setup-for-working-remotely-from-anywhere</guid>
        
        
        <category>4G-Setup</category>
        
        <category>Remote-Work</category>
        
        <category>LTE</category>
        
      </item>
    
      <item>
        <title>Protect your domain from spammers and Improve email deliverability</title>
        <description>&lt;p&gt;In this post, we will talk about how to protect your domain against email spoofing, and how you can configure your domain to keep your emails out of your user’s spam folder.&lt;/p&gt;

&lt;p&gt;We will also learn about BIMI Record and how to create BIMI records to show you brand logo in inboxes.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Imagine this, your customers reach out to you saying that they are not getting password reset emails. After some investigation, you find that you sent the email from your end but they are ending up spam folder.&lt;/p&gt;

&lt;p&gt;You scratch your head, thinking about why your emails are going spam? you never spammed your customers.&lt;/p&gt;

&lt;p&gt;This can happen to you due to missing SPF and DKIM configuration on your domain. Maybe you are a victim of domain spoofing and that’s why your emails are ending up in spam.&lt;/p&gt;

&lt;p&gt;Maybe your emails are not landing in spam yet, but if you don’t have SPF and DKIM configured. it’s possible that they will land in your user’s spam folder.&lt;/p&gt;

&lt;p&gt;Other than keeping emails out of spam, you also need to stay in the good books of your mail service providers. mail service providers will lock you out if they think you are spamming people.&lt;/p&gt;

&lt;p&gt;Configuring SPF, DKIM and DMARC protects your domain against abuse, secures your emails, and improves email deliverability.&lt;/p&gt;

&lt;p&gt;Gmail and other public email service provider uses these records are signals for spam classification. A domain with valid records is less likely to end up in spam because google and other email service provider can use SPF, and DKIM to verify the authenticity of the email.&lt;/p&gt;

&lt;p&gt;Let’s talk about all the acronyms, what they are and how they can help you.&lt;/p&gt;

&lt;h2 id=&quot;what-is-spf&quot;&gt;What is SPF?&lt;/h2&gt;

&lt;p&gt;SPF stands for &lt;strong&gt;Sender Policy Framework&lt;/strong&gt;. In simple words, you use SPF to tell everyone the mail servers that are allowed to send an email for your domain.&lt;/p&gt;

&lt;p&gt;SPF record is used by receiving mail servers to verify that emails for your domain are coming from a mail server that is allowed to send an email for your domain.&lt;/p&gt;

&lt;p&gt;SPF records are defined as a TXT record on your domain&lt;/p&gt;

&lt;p&gt;Here we are looking at SPF record for google.com and github.com using dig&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dig google.com &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; TXT +short | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; spf
&lt;span class=&quot;s2&quot;&gt;&quot;v=spf1 include:_spf.google.com ~all&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dig github.com &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; TXT +short | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; spf
&lt;span class=&quot;s2&quot;&gt;&quot;v=spf1 ip4:192.30.252.0/22 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com include:spf.protection.outlook.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net ip4:166.78.69.169 ip4:1&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;66.78.69.170 ip4:166.78.71.131 ip4:167.89.101.2 ip4:167.89.101.192/28 ip4:192.254.112.60 ip4:192.254.112.98/31 ip4:192.254.113.10 ip4:192.254.113.101 ip4:192.254.114.176 ~all&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;why-do-you-need-spf&quot;&gt;Why do you need SPF?&lt;/h2&gt;

&lt;p&gt;With an SPF record in place, spammers can’t spoof your domain and send emails pretending to be you because the mail server used by spammers is not an allowed mail server.&lt;/p&gt;

&lt;p&gt;SPF protects you against spammers spoofing your domain and ruining the reputation of your domain.&lt;/p&gt;

&lt;h2 id=&quot;what-is-dkim&quot;&gt;What is DKIM?&lt;/h2&gt;

&lt;p&gt;DKIM stands for &lt;strong&gt;DomainKeys Identified Mail&lt;/strong&gt;. It’s a way to sign your emails and protect against spoofing after an email leaves the sender’s server.&lt;/p&gt;

&lt;p&gt;DKIM allows you to sign your email with a private key as it leaves sending mail server, and then recipient mail servers can use a public key to verify that the email was not changed in transit.&lt;/p&gt;

&lt;p&gt;DKIM is also defined as a DNS record on your domain.&lt;/p&gt;

&lt;p&gt;Let’s look at the DKIM record for google.&lt;/p&gt;

&lt;p&gt;To see the DKIM record we need to find &lt;strong&gt;selector&lt;/strong&gt; and &lt;strong&gt;domain&lt;/strong&gt; in DKIM-Signature in an email we got from google. To find DKIM-Signature we need to look at raw email (in Gmail, &lt;em&gt;click 3 dots, and then click&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Show Original&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;in Gmail).&lt;/em&gt; In the Original email, look for the &lt;code class=&quot;highlighter-rouge&quot;&gt;DKIM-Signature&lt;/code&gt; header.&lt;/p&gt;

&lt;p&gt;Here is the DKIM Signature I found in an email I got from Google.&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
    d=accounts.google.com; s=20210112;
    h=mime-version:date:feedback-id:message-id:subject:from:to;
    bh=&amp;lt;omitted&amp;gt;;
    b=&amp;lt;omitted&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this header, we see &lt;code class=&quot;highlighter-rouge&quot;&gt;d=&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;s=&lt;/code&gt; tags along with few other tags like  &lt;code class=&quot;highlighter-rouge&quot;&gt;b&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;v&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;a&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;d&lt;/code&gt; tag is for the &lt;strong&gt;domain&lt;/strong&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;s&lt;/code&gt; tag is for the &lt;strong&gt;selector&lt;/strong&gt;, so our full DNS record that contains DKIM public key would be &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;s&amp;gt;._domainkey.&amp;lt;d&amp;gt;&lt;/code&gt;. In our case, It will be  &lt;code class=&quot;highlighter-rouge&quot;&gt;20210112._domainkey.accounts.google.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let’s look at it using dig&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dig 20210112._domainkey.accounts.google.com &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; TXT +short
&lt;span class=&quot;s2&quot;&gt;&quot;v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5jwZiY255HTBgFdh5lrINkcbwuymEytz4kkP1h5KojAVBwyxU42zN6FUwTAI+pq8H6zt77jUrPqh0IUN7m948pHEP0o6xGzKkhOrKuirrtvAKAm/JuRTfVMkrYzHdGbM6X&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;hXJ1BFU79vDlNTAsResvhybbUM8FQz1/trnCdhQRka45ZhUpVi1RWdctnhajNwWMBf/FQ4qBVYNWXVaoZnRZp/AtGuwTVkFLQbGPaSmvLELa644g7yo/eCfCUtZpDEKHsDqcHFFg1VUzlnSChnmdyn4Nh61XVP35G18Szt6YT5iUddMPXX5kSKmZ26HSIs/vFHJe0zDDNLkRF3KSLGewIDAQAB&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;why-do-you-need-dkim&quot;&gt;Why do you need DKIM?&lt;/h2&gt;

&lt;p&gt;With SPF you can define which email servers can send emails for you but you are still vulnerable to someone modifying messages in between sender and receiver.&lt;/p&gt;

&lt;p&gt;DKIM comes into play when you want to protect your emails during transit and protect against man-in-the-middle attacks on your emails.&lt;/p&gt;

&lt;h2 id=&quot;what-is-dmarc&quot;&gt;What is DMARC?&lt;/h2&gt;

&lt;p&gt;DMARC stands for &lt;strong&gt;Domain-based Message Authentication, Reporting, and Conformance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now you must be asking, why do you need DMARC when you have SPF and DKIM.&lt;/p&gt;

&lt;p&gt;As the full form suggests,  it allows a domain owner to define what to do with emails that fail SPF or DKIM checks.&lt;/p&gt;

&lt;p&gt;in your DMARC record, you can define an email address to get DMARC reports. DMARC reports are sent by receiving email servers and give you visibility into emails that are failing SPF or DKIM checks. you can use DMARC reports to see who is trying to spoof emails for your domain.&lt;/p&gt;

&lt;p&gt;Let’s look at DMARC records for google.com and github.com using dig&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dig _dmarc.google.com &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; TXT +short
&lt;span class=&quot;s2&quot;&gt;&quot;v=DMARC1; p=reject; rua=mailto:mailauth-reports@google.com&quot;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dig _dmarc.github.com &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; TXT +short
&lt;span class=&quot;s2&quot;&gt;&quot;v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@github.com,mailto:d@rua.agari.com&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-is-bimi&quot;&gt;What is BIMI?&lt;/h2&gt;

&lt;p&gt;BIMI (&lt;em&gt;pronounced: Bih-mee&lt;/em&gt;) stands for &lt;strong&gt;Brand Indicators for Message Identification&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://bimigroup.org/&quot;&gt;https://bimigroup.org/&lt;/a&gt; website says that:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;For the brand’s logo to be displayed, the email must pass DMARC authentication checks, ensuring that the organization’s domain has not been impersonated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;BIMI is another tool for you to tell your users that email is coming from the real you, and it’s not spoofed. also, having a logo helps you stand out.&lt;/p&gt;

&lt;p&gt;Branding ftw!&lt;/p&gt;

&lt;p&gt;Let’s look at BIMI record for bimigroup.org using dig&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dig default._bimi.bimigroup.org &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; TXT +short
&lt;span class=&quot;s2&quot;&gt;&quot;v=BIMI1; l=https://bimigroup.org/bimi-sq.svg; a=&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can also use &lt;a href=&quot;https://bimigroup.org/bimi-generator/&quot;&gt;https://bimigroup.org/bimi-generator/&lt;/a&gt; to look and generate BIMI records.&lt;/p&gt;

&lt;p&gt;BIMI is relatively new and is only supported by Yahoo, Google, and Fastmail so far. It’s still being adopted by more companies.&lt;/p&gt;

&lt;p&gt;This means that If you have a valid BIMI record on your domain, your users will only see the Brand Image if they use Yahoo, Google, or Fastmail products to view your emails.&lt;/p&gt;

&lt;h2 id=&quot;tools&quot;&gt;Tools&lt;/h2&gt;

&lt;p&gt;Now that we have learned acronyms of the email world, let’s discuss some tools.
You can use these tools to test your domain’s configuration, identify and fix issues.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.dmarcanalyzer.com/&quot;&gt;dmarcanalyzer.com/&lt;/a&gt; - they have tools to test SPF, DKIM, DMRC, and BIMI records&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://toolbox.googleapps.com/apps/checkmx/&quot;&gt;toolbox.googleapps.com/apps/checkmx/&lt;/a&gt; - tool to check your email configuration.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bimigroup.org/bimi-generator/&quot;&gt;bimigroup.org/bimi-generator/&lt;/a&gt; - tool to check MX, SPF, DMARC, and BIMI record. this tool can also be used to generate BIMI record.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h2&gt;

&lt;p&gt;Now you know why you need SPF, DKIM, and DMARC records or maybe a BIMI record if you want to be fancy and show your brand image. You can consult your mail server provider’s documentation on how to add these records for your mail server and domain.&lt;/p&gt;

&lt;p&gt;In most cases, adding an SPF record is easy, compared to setting up DKIM, and DMARC records.&lt;/p&gt;

&lt;p&gt;Some DNS or CDN providers have wizards to add these records. for example, Cloudflare (image attached) shows you an alert with a wizard when your domain is missing these records.
&lt;img src=&quot;../img/blog/email-deliverability/mail_records_cf.png&quot; alt=&quot;Cloudflare Alert&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Those were technical things to improve your deliverability.&lt;/p&gt;

&lt;p&gt;Let’s discuss some non-technical things to improve your email deliverability.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Only send essential emails, and don’t spam your users, spamming quickly lands you into spam filters and ruins your reputations, it is very tempting to bombard users, but please don’t. if you spam your users, SPF and DKIM will not save you from ending up in the spam folder.&lt;/li&gt;
  &lt;li&gt;Always provide an unsubscribe button, and make sure it works. users will mark your emails spam if your unsubscribe button doesn’t work&lt;/li&gt;
  &lt;li&gt;Don’t resort to dark patterns, stay honest, and don’t use clickbait in email subjects. respect your user’s inbox.&lt;/li&gt;
  &lt;li&gt;Don’t focus on shallow metrics, define and focus on core actions that you want your users to do.&lt;/li&gt;
  &lt;li&gt;Sometimes a good old text email is better than the HTML email that doesn’t render properly on your user’s device.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this was helpful and helped you secure your domains.&lt;/p&gt;

&lt;p&gt;That’s all folks, have a good day and stay safe 👋&lt;/p&gt;
</description>
        <pubDate>Sun, 17 Oct 2021 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/protect-your-domain-from-spammers-and-improve-email-deliverability</link>
        <guid isPermaLink="true">https://suraj.dev/blog/protect-your-domain-from-spammers-and-improve-email-deliverability</guid>
        
        
        <category>emails</category>
        
        <category>security</category>
        
        <category>SPF</category>
        
        <category>DKIM</category>
        
        <category>DMARC</category>
        
        <category>BIMI</category>
        
      </item>
    
      <item>
        <title>Notes on Hardware and Silicon Industry</title>
        <description>&lt;p&gt;In this post, I will be talking about rapid changes in the silicon and hardware industry and the reasons why I think we will see the next wave of innovation in this space.&lt;/p&gt;

&lt;!--more--&gt;

&lt;blockquote&gt;
  &lt;p&gt;These predictions are based on discussions and what I have been reading past few months. see sources at the end of the post for details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A few months ago (June 2020), I was talking to my friend &lt;a href=&quot;https://twitter.com/vthakkar_&quot;&gt;Vaishali&lt;/a&gt; about
what is going in the Linux kernel world. She works with the Linux kernel closely and we started talking
about &lt;a href=&quot;https://www.youtube.com/watch?v=t9MjGziRw-c&quot;&gt;excitement for ARM&lt;/a&gt; in kernel maintainers and contributors.&lt;/p&gt;

&lt;p&gt;Discussion took an interesting turn and we started talking about &lt;strong&gt;chiplets&lt;/strong&gt;, &lt;strong&gt;co-located accelerators&lt;/strong&gt;
and future SOC, chips, and startups working in this space.&lt;/p&gt;

&lt;p&gt;Discussions mostly revolved around:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://nuviainc.com/&quot;&gt;&lt;strong&gt;NUVIA&lt;/strong&gt;&lt;/a&gt;, also called “&lt;a href=&quot;https://www.youtube.com/watch?v=A-ANE1Vx5Lo&quot;&gt;&lt;strong&gt;Tesla of Silicon&lt;/strong&gt;&lt;/a&gt;”,&lt;/li&gt;
  &lt;li&gt;Rise of new rack-scale computer companies like Oxide Computer Company,&lt;/li&gt;
  &lt;li&gt;Rise of accelerators, and use of GPUs as general-purpose accelerators,&lt;/li&gt;
  &lt;li&gt;GPU companies expanding into purpose-built accelerators,&lt;/li&gt;
  &lt;li&gt;Hyperscalers making their own chips.&lt;/li&gt;
  &lt;li&gt;How Apple is going all-in on ARM, along with Microsoft and Amazon (maybe Google as well, nothing public yet)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apologies for the buzzword soup, I will try to explain things in details in the coming paragraphs 🙂&lt;/p&gt;

&lt;p&gt;I am trying to break it down into sections, and explain all the changes we are seeing in this space, we
can think of these sections as big moves that are inter-dependent, but essential for the growth of emerging
silicon ecosystem.&lt;/p&gt;

&lt;h3 id=&quot;rise-of-arm&quot;&gt;Rise of ARM&lt;/h3&gt;

&lt;p&gt;Big players like Apple, Microsoft, Amazon, and Google are investing heavily in the ARM ecosystem.
NVIDIA Acquiring ARM for $40 Billion is the big move that indicates the direction of the industry.&lt;/p&gt;

&lt;p&gt;Along with that, big Hyperscalers are betting big on ARM. AWS made its public move by acquiring Annapurna Labs(Israeli startup working on chips) for an estimated $350-$400 million in 2015-16. Annapurna Labs was acquired to bring silicon design capabilities in AWS.&lt;/p&gt;

&lt;p&gt;As a result, AWS now offers Graviton, and Graviton2 chips which are ARM-based, and available to AWS customers at cheaper rates compared to Intel chips.&lt;/p&gt;

&lt;p&gt;I am sure Azure and Google Cloud are also planning to release ARM-based chips, probably designed by in-house teams, few acquisitions, and some industry collaboration.&lt;/p&gt;

&lt;p&gt;Abode is investing heavily in porting software to ARM (Lightroom 4.1 runs natively on Apple M1), and we all know about Apple Silicon-based M1 laptops, and how fast they are.&lt;/p&gt;

&lt;p&gt;ARM dominates the mobile and IoT market, and now we are seeing that an ARM takeover is happening in Hyperscaler, and PC market.&lt;/p&gt;

&lt;p&gt;Windows is getting support for ARM, and Microsoft is joining forces with Qualcomm, and PC makers to ARM-based computers in the market.&lt;/p&gt;

&lt;h3 id=&quot;rise-of-accelerators&quot;&gt;Rise of Accelerators&lt;/h3&gt;

&lt;p&gt;We are seeing a rise of dedicated accelerators and a new breed of workload-specific SOCs.&lt;/p&gt;

&lt;p&gt;Chip designers are trying to get around the performance bottlenecks by co-locating data and compute.
See more on &lt;a href=&quot;https://queue.acm.org/detail.cfm?id=3388515&quot;&gt;chiplets in ACM, March Issue.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are seeing companies like Tesla building in-house chips to power the self-driving capabilities,
and benchmarks show that these chips are &lt;a href=&quot;https://www.cnet.com/news/meet-tesla-self-driving-car-computer-and-its-two-ai-brains/&quot;&gt;extremely good at the job.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google and NVIDIA have built accelerators for machine learning workloads, and we are seeing the rise of ML processors in mobile SoCs&lt;/p&gt;

&lt;h3 id=&quot;the-more-the-merrier&quot;&gt;The more the merrier&lt;/h3&gt;

&lt;p&gt;When you pack warehouses full of computers, you care about things that normal people
don’t even think about. Along with raw per-core performance, heat emission,
and power consumption are important for hyperscalers.&lt;/p&gt;

&lt;p&gt;Hyperscalers used to be the customers of chipmakers, but they realized that having more control over things like heat and power consumption is important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When you have a warehouse full of computers, lower power consumption, and less heat can save millions in the power bill.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because of these, and many other reasons we are seeing hyperscalers investing in their own chips.&lt;/p&gt;

&lt;p&gt;AWS, Apple Silicon, Google Silicon, and Tesla making their own chips.
We see startups like Nuvia (got acquired by Qualcomm), also working on it.&lt;/p&gt;

&lt;p&gt;We are seeing the rise of new Chip Makers, and as the saying goes “the more the merrier”.
I am certain this will result in innovation in the space.&lt;/p&gt;

&lt;h3 id=&quot;the-hardware-software-interface--rise-of-open-hardware-and-firmware&quot;&gt;The Hardware Software Interface &amp;amp; Rise of Open Hardware, and Firmware&lt;/h3&gt;
&lt;p&gt;We are seeing a new wave of hardware-based exploits. &lt;a href=&quot;https://meltdownattack.com&quot;&gt;Meltdown and Spectre&lt;/a&gt;
opened the pandora’s box, and now we are seeing that x86 optimization techniques like speculative execution are being exploited.&lt;/p&gt;

&lt;p&gt;Now hardware will be the place where folks have started looking for optimizations, and security issues.
We are seeing the financial industry building their own hardware, and publicly talking about it.&lt;/p&gt;

&lt;p&gt;Startups like Oxide computer company are planning to de-blot and modernize servers, projects like Open Compute, and the rise of open firmware means that now it’s possible to design your own hardware and get it built. The barrier to entry is lowered, and now you have a choice.&lt;/p&gt;

&lt;h3 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h3&gt;

&lt;p&gt;We are seeing a surge in open source tools, open firmware, and open hardware. The market is ripe for disruption, and we are seeing lots of changes in this space. We are seeing a new wave where x86 is being left behind and big market players are betting billions on ARM.&lt;/p&gt;

&lt;h3 id=&quot;my-predictions&quot;&gt;My Predictions&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;ARM going to be big in the coming years (US Govt is testing the waters)&lt;/li&gt;
  &lt;li&gt;RISC-V and open firmware will shake up silicon space&lt;/li&gt;
  &lt;li&gt;Commoditization of fabrication will happen&lt;/li&gt;
  &lt;li&gt;Many-Core, Low Power, Purpose-built chips will show up.&lt;/li&gt;
  &lt;li&gt;Programmable Hardware will make a comeback for those performance critical cases (&lt;a href=&quot;https://www.youtube.com/watch?v=GJX5VbKvh90&quot;&gt;HFT folks are already doing it&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Rise of Open Firmware &amp;amp; Open tooling to design your own SoC (System on a Chip)&lt;/li&gt;
  &lt;li&gt;Rise of Security Issues in closed hardware and firmware will drive open firmware adoption&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;sources&quot;&gt;Sources&lt;/h4&gt;
&lt;p&gt;Read them, verify them, and if you find any errors let me know on Twitter :)&lt;/p&gt;

&lt;h6 id=&quot;press--publications&quot;&gt;Press &amp;amp; Publications&lt;/h6&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://stratechery.com/2020/apple-arm-and-intel/&quot;&gt;Apple, ARM, and Intel - Stratechery by Ben Thompson&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.anandtech.com/show/15846/jim-keller-resigns-from-intel-effective-immediately&quot;&gt;Jim Keller Resigns from Intel, Effective Immediately&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.extremetech.com/computing/198140-amazon-buys-secretive-chip-maker-annapurna-labs-for-350-million&quot;&gt;Amazon buys secretive chip maker Annapurna Labs for $350 million - ExtremeTech&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.theregister.com/AMP/2020/07/03/open_chip_hardware/&quot;&gt;If you wanna make your own open-source chip, just Google it. Literally. Web giant says it’ll fab them for free • The Register&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.skywatertechnology.com/press-releases/google-partners-with-skywater-and-efabless-to-enable-open-source-manufacturing-of-custom-asics/&quot;&gt;Google Partners with SkyWater and Efabless to Enable Open Source Manufacturing of Custom ASICs - Skywater Technology&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.forbes.com/sites/ewanspence/2020/07/04/apple-macbook-pro-macos-bigsur-arm-intel-microsoft-windows-10/&quot;&gt;Apple’s Courage With MacOS On ARM Will Lift The Industry&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.wired.com/story/opinon-the-future-of-american-industry-depends-on-open-source-tech/&quot;&gt;The Future of American Industry Depends on Open Source Tech - WIRED&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://nvidianews.nvidia.com/news/nvidia-to-acquire-arm-for-40-billion-creating-worlds-premier-computing-company-for-the-age-of-ai&quot;&gt;NVIDIA to Acquire Arm for $40 Billion, Creating World’s Premier Computing Company for the Age of AI - NVIDIA Newsroom&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.infoq.com/presentations/risc-v-future/&quot;&gt;The Future of Operating Systems on RISC-V&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://stevecheney.com/on-the-future-of-ambient-computing/&quot;&gt;Why Semiconductor Development Matters - steve cheney, technology, business &amp;amp; strategy&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://om.co/2020/11/17/is-it-time-to-soc-the-cpu/&quot;&gt;Is it time to SoC the CPU?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.forbes.com/sites/patrickmoorhead/2021/01/13/qualcomm-acquires-nuvia-to-accelerate-its-future-cpus-with-support-from-18-partners/&quot;&gt;Qualcomm Acquires NUVIA To Accelerate Its Future CPUs With Support From 18 Partners&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://elidourado.com/blog/notes-on-technology-2020s/&quot;&gt;Notes on technology in the 2020s - Eli Dourado&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://mondaynote.com/apple-silicon-the-passing-of-wintel-79a5ef66ad2b&quot;&gt;Apple Silicon: The Passing of Wintel - by Jean-Louis Gassée - Monday Note&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://eclypsium.com/2019/09/03/usbanywhere-bmc-vulnerability-opens-servers-to-remote-attack/&quot;&gt;Virtual Media Vulnerability in BMC Opens Servers to Remote Attack - Eclypsium&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://hothardware.com/news/qualcomm-apple-m1-just-further-validates-windows-on-arm&quot;&gt;Qualcomm Execs Say Apple M1 Further Validates Windows On Arm, And They’re Right - HotHardware&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://stratechery.com/2021/intel-problems&quot;&gt;Intel Problem’s - Stratechery by Ben Thompson&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://stratechery.com/2013/intels-missed-opportunity&quot;&gt;Intel’s Missed Opportunity - Stratechery by Ben Thompson&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/&quot;&gt;Meet Raspberry Silicon: Raspberry Pi Pico now on sale at $4 - Raspberry Pi&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6 id=&quot;youtube&quot;&gt;YouTube&lt;/h6&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://youtu.be/Ucp0TTmvqOE?t=4263&quot;&gt;Tesla Autonomy Day - YouTube&lt;/a&gt; - Tesla building it’s own chips with lots of co-processors&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=6tneOq5M9m4&quot;&gt;Astra and Sandia’s 725E Data Center - YouTube&lt;/a&gt; - US Govt investing big into ARM&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=IfHG7bj-CEI&quot;&gt;Intel is in serious trouble. ARM is the Future. - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=67KW4t42SZk&quot;&gt;Goodbye x86. The FUTURE is RISC-V - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=hzKb_fV7UB8&quot;&gt;The SQ1 is just the beginning. ARM is coming for the PC - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=NNgdcn4Ux1k&quot;&gt;RISC vs CISC Computer Architectures (David Patterson) - AI Podcast Clips with Lex Fridman - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=UHVPU2x3Rjk&quot;&gt;How Machine Learning Changed Computer Architecture Design (David Patterson) - AI Clips with Lex - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=qFgcC29mSs8&quot;&gt;New Golden Age for Computer Architectures - Dave Patterson (UC Berkeley) - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=GJX5VbKvh90&quot;&gt;Programmable Hardware with Andy Ray - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://youtu.be/lXdx0X2WHfY&quot;&gt;RISC-V is the future of computing - Chris Lattner and Lex Fridman - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=5syd5HmDdGU&quot;&gt;Forget x86; OpenPower is it! Talos II Secure Workstation! - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=QrcdHHsfaKQ&quot;&gt;OSFC 2019 - Common BMC vulnerabilities and how to avoid repeating them - YouTube&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=JH2nXMv6yZI&quot;&gt;Intel - From Inventors of the CPU to Laughing Stock [Part 1]&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6 id=&quot;tooling--tech&quot;&gt;Tooling &amp;amp; Tech&lt;/h6&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.chisel-lang.org/&quot;&gt;Chisel/FIRRTL: Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://opentitan.org/&quot;&gt;OpenTitan&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://openpowerfoundation.org/&quot;&gt;OpenPOWER Foundation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://libre-soc.org/&quot;&gt;libreriscv&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/openbmc/openbmc&quot;&gt;OpenBMC&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.skywatertechnology.com/&quot;&gt;The Innovator’s Edge - SkyWater Technology&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://optimyze.cloud/about/&quot;&gt;About - Optimyze.cloud&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6 id=&quot;tweets&quot;&gt;Tweets&lt;/h6&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://twitter.com/copyconstruct/status/1318614001534685189&quot;&gt;AWS Graviton2 &amp;amp; “ARM in the data center”&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://twitter.com/Suhail/status/1340067123729629184&quot;&gt;Everyone is building chips&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://twitter.com/JeffDean/status/1288535441977745408&quot;&gt;MLPerf on Google TPUs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 14 Jan 2021 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/notes-on-hardware-and-silicon-industry</link>
        <guid isPermaLink="true">https://suraj.dev/blog/notes-on-hardware-and-silicon-industry</guid>
        
        
        <category>Notes</category>
        
        <category>Hardware</category>
        
        <category>Silicon</category>
        
      </item>
    
      <item>
        <title>Learning Git: Basics and Internals</title>
        <description>&lt;p&gt;In this post, I am sharing learning resources that I used for getting started
with git, and learning more about git internals.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;These resources are organized under the basics and Internals sections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basics&lt;/strong&gt; section is for folks who are getting started with git and learn
how to use, and why they should use git.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internals&lt;/strong&gt; section is for folks who have used git and want to learn how
git works, it’s advance usage, architecture, and internals of git.&lt;/p&gt;

&lt;p&gt;Each section contains links to blog posts, videos, books, and documentation.
There is an overlap between resources, so pick what you like, and
learn from a resource that fits your learning style 🙌&lt;/p&gt;

&lt;p&gt;Since we are talking about git, it would a crime not to share &lt;a href=&quot;https://xkcd.com/1597/&quot;&gt;xkcd on git&lt;/a&gt;.
Legend has it that is there is a relevant XKCD for almost everything&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/learning-git/git.png&quot; alt=&quot;Git XKCD&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;git-basics&quot;&gt;Git Basics&lt;/h3&gt;

&lt;p&gt;Follow this section if you are new to git, and just getting started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is git?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Git is a &lt;a href=&quot;https://git-scm.com/about/free-and-open-source&quot;&gt;free and open source&lt;/a&gt; distributed version control system designed to handle everything from small to very large projects with speed and efficiency.&lt;/p&gt;

  &lt;p&gt;– &lt;a href=&quot;https://git-scm.com/&quot;&gt;Git Homepage&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To put it in simple words, It’s a tool that’s used in software development
to keep track of the history of changes, tho it’s mainly used for text
files but it works for most file types.&lt;/p&gt;

&lt;p&gt;This allows software developers to collaboratively work on projects,
and allows them to time travel(history of changes) and see what, when,
and who changed something.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is GitHub/GitLab/Bitbucket, and how they are different from git?&lt;/strong&gt;
They are online hosting services for git, with other tools that
allow software developers to collaborate on software projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are looking for a quick getting started guide then &lt;a href=&quot;https://gitimmersion.com/&quot;&gt;gitimmersion.com&lt;/a&gt;
has a great guided tour of git.&lt;/p&gt;

&lt;p&gt;If you have a short attention span like me and like to learn from video,
watch this highly compressed &lt;a href=&quot;https://www.youtube.com/watch?v=hwP7WQkmECE&quot;&gt;Git Explained in 100 Seconds&lt;/a&gt; video&lt;/p&gt;

&lt;p&gt;If you are looking to learn how to use GitHub, then follow
&lt;a href=&quot;https://lab.github.com/githubtraining/introduction-to-github&quot;&gt;Introduction To GitHub&lt;/a&gt; lab from folks at GitHub&lt;/p&gt;

&lt;p&gt;There is another set of tutorials from Atlassian (makers of Bitbucket) on &lt;a href=&quot;https://www.atlassian.com/git/tutorials/what-is-version-control&quot;&gt;What is version control&lt;/a&gt;, and another git topics&lt;/p&gt;

&lt;p&gt;If you prefer classroom-style lecture with a bit more then basic commands then see this Lecture on
&lt;a href=&quot;https://www.youtube.com/watch?v=2sjqTHE0zok&quot;&gt;Version Control (git)&lt;/a&gt; from
&lt;a href=&quot;https://missing.csail.mit.edu/2020/version-control/&quot;&gt;Missing Semester&lt;/a&gt; course by MIT&lt;/p&gt;

&lt;h2 id=&quot;git-internals&quot;&gt;Git Internals&lt;/h2&gt;

&lt;p&gt;This section contains resources on how git works&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://maryrosecook.com/blog/post/git-from-the-inside-out&quot;&gt;Git from the inside out&lt;/a&gt; by &lt;a href=&quot;https://maryrosecook.com/&quot;&gt;Mary Rose Cook&lt;/a&gt;.
If you like to learn from videos then here is same &lt;a href=&quot;https://www.youtube.com/watch?v=fCtZWGhQBvo&quot;&gt;content in video form&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to learn about System Design, History, and Architecture, then
&lt;a href=&quot;https://www.aosabook.org/en/git.html&quot;&gt;checkout this chapter&lt;/a&gt; on Git in
&lt;a href=&quot;http://aosabook.org/en/index.html&quot;&gt;The Architecture of Open Source Applications&lt;/a&gt; Book.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sidenote:&lt;/strong&gt; The Architecture of Open Source Applications is a great read and
gives us a peek inside (&lt;em&gt;well you guessed it&lt;/em&gt;) Architecture of Open Source Applications&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=lG90LZotrpo&quot;&gt;Git Internals by John Britton of GitHub - CS50 Tech Talk&lt;/a&gt;
is a great watch if you want a demo/walk-through style guided tour of Git&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=dBSHLb1B8sw&quot;&gt;GOTO 2015 • Deep Dive into Git • Edward Thomson&lt;/a&gt;
is another great talk that dives deep into git.&lt;/p&gt;

&lt;p&gt;If you are looking for a book on git internals then check out
&lt;a href=&quot;https://git-scm.com/book/&quot;&gt;Pro Git book&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other than these resources, the official git website also maintains a
&lt;a href=&quot;https://git-scm.com/doc/ext&quot;&gt;list of resources&lt;/a&gt; on git. check out that if you
are still looking for more resources 🧐&lt;/p&gt;

&lt;h2 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h2&gt;

&lt;p&gt;I hope these resources were helpful and will help you learn more about git.&lt;/p&gt;

&lt;p&gt;If there is something that you think should be included here,
tweet me @electron0zero and let me know 🙂&lt;/p&gt;

&lt;p&gt;Happy Learning 👋&lt;/p&gt;

</description>
        <pubDate>Sat, 20 Jun 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/learning-git-basics-and-internals</link>
        <guid isPermaLink="true">https://suraj.dev/blog/learning-git-basics-and-internals</guid>
        
        
        <category>git</category>
        
        <category>learning</category>
        
      </item>
    
      <item>
        <title>LGTM: Writing good enough code</title>
        <description>&lt;p&gt;This post is a written version of the internal talk I gave on writing good enough code&lt;/p&gt;

&lt;!--more--&gt;
&lt;p&gt;It is aimed at folks who are writing production code&lt;sup id=&quot;fnref:production_code&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:production_code&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; for the first time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you have been writing software for a while then you probably know these things,
and you are not the target audience for this post 🙂&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While doing code reviews with folks writing production code for the first
time I observed few common suggestions, and later I gave an internal talk on the
subject. This post is to written version of the talk.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Please keep in mind that these are some of the guidelines(not rules) one can keep
in mind to write &lt;strong&gt;good enough code&lt;/strong&gt;, and these are not complete in any way&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do I mean by good enough code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Code which is easy to understand and gets the job done is &lt;strong&gt;good enough&lt;/strong&gt;, code
that meets the requirements is &lt;strong&gt;good enough&lt;/strong&gt;, code that we can ship is &lt;strong&gt;good enough&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I believe mindful &lt;a href=&quot;https://bjk5.com/post/60760280107/shipping-beats-perfection-explained&quot;&gt;shipping beats perfection&lt;/a&gt;,
and we can always iterate to make it better in future.&lt;/p&gt;

&lt;p&gt;Our goal should be shipping as fast as we can while trying not to accumulate tech or product debt.&lt;/p&gt;

&lt;h3 id=&quot;no-code&quot;&gt;No Code&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Best code is code you don’t have, code that we don’t write will not have bugs, will not crash or fail, this is the reason why &lt;a href=&quot;https://twitter.com/electron0zero/status/1265964515461455873&quot;&gt;I love PRs that delete more code then they add&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Every line of code you write is &lt;strong&gt;time debt&lt;/strong&gt;: it is another line that has to be debugged,
another line that has to be supported, another line that may require a rewrite
later, another line that might cause an interaction with a later feature”&lt;/p&gt;

  &lt;p&gt;– @patio11, &lt;a href=&quot;https://kalzumeus.com/2010/03/20/running-a-software-business-on-5-hours-a-week/&quot;&gt;source&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;PS: Not to be confused with no-code movement&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;dry&quot;&gt;DRY&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;“&lt;a href=&quot;https://en.wikipedia.org/wiki/Don%27t_repeat_yourself&quot;&gt;Do not Repeat Yourself&lt;/a&gt;” (DRY) with some WET code is considered a good practice&lt;/li&gt;
  &lt;li&gt;Keep things DRY, but don’t DRY too much because then it starts getting hard to read and reason about it.&lt;/li&gt;
  &lt;li&gt;DRY but don’t compromise readability to DRY something, readability takes precedence over DRYing in my books&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://dzone.com/articles/is-your-code-dry-or-wet&quot;&gt;Is Your Code DRY or WET?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;yagni&quot;&gt;YAGNI&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://martinfowler.com/bliki/Yagni.html&quot;&gt;YAGNI&lt;/a&gt; - “&lt;em&gt;You aren’t gonna need it&lt;/em&gt;”&lt;/li&gt;
  &lt;li&gt;Don’t assume you will need it (&lt;em&gt;unless you are sure, and is part is requirements&lt;/em&gt;)&lt;/li&gt;
  &lt;li&gt;Don’t speculate how It would be used in far future and just write code that gets the job done for the current use-case&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;single-responsibility&quot;&gt;Single Responsibility&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Single_responsibility_principle&quot;&gt;Single Responsibility Principle&lt;/a&gt; (SRP)
states that every class or module in a program should have &lt;strong&gt;responsibility&lt;/strong&gt;
for a &lt;strong&gt;single&lt;/strong&gt; piece of that program’s functionality.&lt;/p&gt;

&lt;p&gt;It means don’t write a method that does multiple unrelated things, for example,
logging modules have a method to format dates, and that formatting feature
is used all over the place.&lt;/p&gt;

&lt;p&gt;And the same goes for methods, don’t write something that does more than two things.
If you need to add some feature in method and when you feel it’s doing two things, refactor it&lt;/p&gt;

&lt;h3 id=&quot;write-for-readability&quot;&gt;Write for Readability&lt;/h3&gt;

&lt;p&gt;If you only want to follow one thing, make it this, because &lt;strong&gt;readability matters&lt;/strong&gt;,
and the simple reason is that code is read more then it’s modified, and
readable code will be easy to reason about, change, or replace when required.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Programs should be written for people to read, and only incidentally for machines to execute.”&lt;/p&gt;

  &lt;p&gt;— &lt;a href=&quot;https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs&quot;&gt;Structure and Interpretation of Computer Programs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;More time will be spent reading the code you write, you and your co-workers
will be reading more code then you will write&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live.&lt;/p&gt;

  &lt;p&gt;— &lt;a href=&quot;https://stackoverflow.com/a/878436&quot;&gt;John Woods&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://programmingisterrible.com/post/173883533613/code-to-debug&quot;&gt;Write code that’s easy to delete, and easy to debug too.&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://software.ac.uk/resources/guides/writing-readable-source-code&quot;&gt;Writing readable source code&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://jasonmccreary.me/articles/practices-write-readable-code-less-complex/&quot;&gt;10 practices for readable code&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/peterhurford/3ad9f48071bd2665a8af&quot;&gt;How do you write readable code?: 13 Principles&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;no-deep-nesting&quot;&gt;No Deep Nesting&lt;/h3&gt;

&lt;p&gt;Deeply nested code is hard to read and hard to understand, it becomes very hard when you
have to reason about it or debug it (extra hard when you are in middle of an outage),
and as we mentioned readability matters, that’s why deep nesting is considered
a &lt;a href=&quot;https://blog.jetbrains.com/idea/2017/08/code-smells-deeply-nested-code/&quot;&gt;code smell&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A method with multiple nested if condition quickly becomes hard to comprehend,
so try to keep nesting under control.&lt;/p&gt;

&lt;p&gt;Use &lt;a href=&quot;https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html&quot;&gt;Guard Clauses&lt;/a&gt; to
get rid of nested conditionals, and keep the branching factor low&lt;/p&gt;

&lt;h3 id=&quot;happy-path&quot;&gt;Happy Path&lt;/h3&gt;

&lt;p&gt;The happy path is the optimistic path, It’s the path your code will take
under normal conditions, It’s scenario featuring no exceptions or error conditions.&lt;/p&gt;

&lt;p&gt;For example, validating input in the start and failing fast will allow you to write code which can
work with the assumption that data (down the line) it has it valid since it was validated at the start.&lt;/p&gt;

&lt;p&gt;It makes code more readable and easy to debug, also less branching because
now you don’t need to handle invalid data&lt;/p&gt;

&lt;h3 id=&quot;fail-fast-fail-early-and-fail-with-noise&quot;&gt;Fail Fast, Fail Early and Fail With Noise&lt;/h3&gt;

&lt;p&gt;Write your software such that, when there is a problem, it should fail as
soon as it detects the problem and knows it can’t recover from it.&lt;/p&gt;

&lt;p&gt;Failure should be visible to operator, and failing early is better than trying
to proceed in a possibly unstable state where bad state trickles down.&lt;/p&gt;

&lt;p&gt;Silent failures are one of the hardest kind of failure to debug, trace and fix,
these failures leave no traces for operators, and leave people banging
their heads against the wall&lt;/p&gt;

&lt;p&gt;You should always leave a visible trace of your failure, raising an exception or
logging based on the type of failures&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.martinfowler.com/ieeeSoftware/failFast.pdf&quot;&gt;Fail Fast&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://dzone.com/articles/fail-fast-principle-in-software-development&quot;&gt;The Fail-Fast Principle in Software Development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Shameless plug&lt;/strong&gt;: I curate &lt;a href=&quot;https://failuremodes.dev&quot;&gt;failuremodes.dev&lt;/a&gt; and
&lt;a href=&quot;https://failuremodes.substack.com/&quot;&gt;failure modes newsletter&lt;/a&gt;, do check it out
if you interested in how and why software systems fail&lt;/p&gt;

&lt;h3 id=&quot;return-single-type&quot;&gt;Return Single Type&lt;/h3&gt;

&lt;p&gt;One function should return only one type, eg. only string, hash, or floats. not float for one set of input and
string for another set of input&lt;/p&gt;

&lt;p&gt;If your function is returning different data types for different inputs then
you might want to break it down into multiple functions or unify the returned data type.&lt;/p&gt;

&lt;p&gt;Having multiple return types make it hard to test, and it can mean that we are not
following single responsibility principle.&lt;/p&gt;

&lt;p&gt;Multiple return type is considered a code smell, and should be avoided&lt;/p&gt;

&lt;h3 id=&quot;refactoring&quot;&gt;Refactoring&lt;/h3&gt;

&lt;p&gt;It should not be left for later, refactor whenever you can,
and when it feels the right thing to do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refactoring in small dosages keeps tech debt in check.&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h3&gt;

&lt;p&gt;You want to ship faster but ship mindfully, and to ship faster you want to get
your changes merged without lots of back and forth.
You can do that by thinking and reasoning about how and why you are
writing something before you start writing something.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://increment.com/teams/code-less-engineer-more/&quot;&gt;Code less, engineer more&lt;/a&gt; by &lt;a href=&quot;https://twitter.com/lizthegrey&quot;&gt;Liz Fong-Jones&lt;/a&gt;
explains this very well, and It’s a must-read, this is something that I follow,
and I try to not start coding till I understand the &lt;strong&gt;Why, What and How&lt;/strong&gt; for the change&lt;/p&gt;

&lt;p&gt;I suggest doing one round of code review yourself before the code review.
I call this &lt;strong&gt;self-review&lt;/strong&gt;, and I do it for all of my pull requests, docs,
or anything that I share, and I always find things to improve, and
I am sure you will also find things to improve too.&lt;/p&gt;

&lt;p&gt;We should keep in mind that, these are guidelines, and they should not be taken to the extreme,
our goal is to find a good balance, instead of bike-shading over these things guidelines,
and &lt;a href=&quot;https://blog.theboringtech.io/2020/04/16/time_is_the_real_currency.html&quot;&gt;we should focus on things that matter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our goal is to solve problems and create value. our users don’t care if
we are serving them using PHP, and jQuery or the hot new magical framework,
as long as these things are not hindering user experience, your users don’t care.&lt;/p&gt;

&lt;h3 id=&quot;further-reading&quot;&gt;Further Reading:&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.intenthq.com/blog/what-is-good-code-a-scientific-definition&quot;&gt;What is good code? A scientific definition&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://turbofuture.com/computers/7-Tips-on-Writing-Better-Code&quot;&gt;7 Tips on Writing Better and More Readable Code&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/google/eng-practices&quot;&gt;Google Engineering Practices Documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://google.github.io/eng-practices/review/reviewer/&quot;&gt;How to do a code review&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://testing.googleblog.com/2019/11/code-health-respectful-reviews-useful.html&quot;&gt;Code Health: Respectful Reviews == Useful Reviews&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://lanraccoon.com/2020/youre-not-writing-code-youre-solving-problems/&quot;&gt;You’re not writing code, you’re solving problems&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://seths.blog/2005/03/dont_shave_that/&quot;&gt;Don’t Shave That Yak!&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=8bZh5LMaSmE&quot;&gt;All the Little Things by Sandi Metz&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=f84n5oFoZBc&quot;&gt;Hammock Driven Development - Rich Hickey&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;footnotes&quot;&gt;footnotes:&lt;/h5&gt;
&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:production_code&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;any code that’s serving customers in any way (directly or indirectly) is production code in my books &lt;a href=&quot;#fnref:production_code&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Thu, 18 Jun 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/lgtm-writing-good-enough-code</link>
        <guid isPermaLink="true">https://suraj.dev/blog/lgtm-writing-good-enough-code</guid>
        
        
        <category>lgtm</category>
        
        <category>code</category>
        
      </item>
    
      <item>
        <title>CPU steal time and other caveats of virtualization</title>
        <description>&lt;p&gt;In this post, we will talk about downsides of virtualization in the context
of cloud environments.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Cloud is great, we make an API call, and pay as we go, what’s not to like&lt;/p&gt;

&lt;p&gt;Well, few things, which are obviously not mentioned in marketing materials,
and are not commonly talked about on the web as much.&lt;/p&gt;

&lt;p&gt;We will talk about CPU Steal Time and it’s partners in crime in virtualization&lt;/p&gt;

&lt;h3 id=&quot;cpu-steal-time&quot;&gt;CPU Steal Time&lt;/h3&gt;
&lt;p&gt;Understand that your hardware is not real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wait, so they lied to me that I have 16 core machine?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not really, to be correct you have 16 &lt;strong&gt;Virtual&lt;/strong&gt; cores, the same physical machines
have way more the 16 cores and it is shared with other VMs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do I care, I have the cores that I paid for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, as I said they are virtual cores so other workload running on it can impact you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Allow me to introduce CPU steal time, the hypervisor can steal your CPU when
it needs to do other important stuff.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Steal time is the percentage of time a virtual CPU waits for a real CPU while
the hypervisor is servicing another virtual processor.&lt;/p&gt;

  &lt;p&gt;– &lt;a href=&quot;http://www.ibm.com/developerworks/linux/linux390/perf/tuning_rec_CPUtimes_virtual.html&quot;&gt;ibm.com&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://opensource.com/article/20/1/cpu-steal-time&quot;&gt;Detecting CPU steal time in guest virtual machines&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://scoutapm.com/blog/understanding-cpu-steal-time-when-should-you-be-worried&quot;&gt;Understanding CPU Steal Time - when should you be worried?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://iamondemand.com/blog/who-stole-my-cpu/&quot;&gt;Who Stole my CPU? Few Basics on CPU Steal Time&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.datadoghq.com/blog/understanding-aws-stolen-cpu-and-how-it-affects-your-apps/&quot;&gt;Understanding AWS stolen CPU and how it affects your apps&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-noisy-neighbor-problem&quot;&gt;The Noisy Neighbor Problem&lt;/h3&gt;

&lt;p&gt;Other misbehaving workloads running on the same physical hardware can impact things
that hypervisors can’t set constraints on, like cache, network links, etc.&lt;/p&gt;

&lt;p&gt;This is something to keep in mind when running on cloud environments&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.dynatrace.com/resources/ebooks/javabook/why-virtualization-has-impact-on-performance-management/&quot;&gt;Virtualization’s Impact on Performance Management&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;security-implications&quot;&gt;Security Implications&lt;/h3&gt;

&lt;p&gt;Side-channel attacks are a real threat when running in the cloud, research shows that it’s very much real.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://meltdownattack.com/&quot;&gt;Meltdown and Spectre&lt;/a&gt; showed us that speculative execution based attacks are real, and new research in this direction shows that this threat is very real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Hello from the Other Side: SSH over Robust Cache Covert Channels in the Cloud:  &lt;a href=&quot;https://cmaurice.fr/pdf/ndss17_maurice.pdf&quot;&gt;Paper&lt;/a&gt;, &lt;a href=&quot;https://www.youtube.com/watch?v=E91qcwDPk8U&quot;&gt;Talk&lt;/a&gt;, and &lt;a href=&quot;https://www.theregister.co.uk/2017/03/31/researchers_steal_data_from_shared_cache_of_two_cloud_vms/&quot;&gt;Media Coverage&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://kinvolk.io/blog/2019/03/hardware-vulnerabilities-in-cloud-native-environments/&quot;&gt;Hardware vulnerabilities in cloud-native environments&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://downloads.hindawi.com/journals/scn/2018/4216240.pdf&quot;&gt;Leveraging KVM Events to Detect Cache-Based Side Channel Attacks in a Virtualization Environment&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-varadarajan.pdf&quot;&gt;A Placement Vulnerability Study in Multi-Tenant Public Clouds&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;dedicated-vms&quot;&gt;Dedicated VMs&lt;/h3&gt;

&lt;p&gt;All cloud providers have a way to provision dedicated VMs(GCP calls then sole-tenant nodes)
where physical machine runs only your workload.&lt;/p&gt;

&lt;p&gt;They are expensive, but this is an option you have when you want extra security
when running on cloud environments.&lt;/p&gt;

&lt;h3 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h3&gt;

&lt;p&gt;Cloud has more upsides than downsides but we should be aware of downsides and
our options when we have to make a call where we can’t live with one of the downsides&lt;/p&gt;

&lt;p&gt;Send your questions and corrections on twitter @electron0zero&lt;/p&gt;

&lt;p&gt;Hopefully, it was helpful. Stay in and Stay Safe 👋&lt;/p&gt;
</description>
        <pubDate>Thu, 11 Jun 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/cpu-steal-time-and-other-caveats-of-virtualization</link>
        <guid isPermaLink="true">https://suraj.dev/blog/cpu-steal-time-and-other-caveats-of-virtualization</guid>
        
        
        <category>cloud</category>
        
        <category>virtualization</category>
        
      </item>
    
      <item>
        <title>A Dash of Entertainment in Education</title>
        <description>&lt;p&gt;In this post, we will talk about how the educators are taking a page out of
films production studies, and why it’s a good thing&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;I ran into Webflow tutorial and noticed that it is way better than most tutorials, so
&lt;a href=&quot;https://twitter.com/electron0zero/status/1259154580434116610&quot;&gt;as promised&lt;/a&gt; here is my analysis.&lt;/p&gt;

&lt;p&gt;We see that most tutorials are direct and pretty boring but they get the job done.&lt;/p&gt;

&lt;p&gt;Few online educators are focused more on pure content&lt;sup id=&quot;fnref:pure_content&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:pure_content&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, and the material, they don’t
really pay attention to how it’s presented&lt;sup id=&quot;fnref:no_applications&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:no_applications&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;If we look at educators admired by Internet, David J Malon, and Andrew Ng comes to mind. On close
observation we see that along with good material, they focus on keeping students engaged, try to keep it
casual and entertaining by sharing relevant insights, and that changes the mood and turns the dreadful
lecture into more engaging and enjoyable.&lt;/p&gt;

&lt;p&gt;As a result, we see that students love these classes, and it can be seen in online communities,
In ML community Andrew Ng memes are a thing 🙂&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/entertainment-in-education/ng_meme.png&quot; alt=&quot;Andrew Ng meme&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We see this new trend where educators are combining education and entertainment to engage users, but
this is a tight rope because overdoing can feel forced and will lose the humor and then goes on the
cringe side.&lt;/p&gt;

&lt;p&gt;Webflow is using these techniques and looks like it’s working because it had me engaged. I watched
multiple Webflow tutorials, and they are well designed, engaging, and hits the nice
balance of education and entertainment&lt;/p&gt;

&lt;p&gt;See this short tutorial on “&lt;a href=&quot;https://www.youtube.com/watch?v=ZOdt89eV9jk&quot;&gt;Introducing scheduled publishing for Webflow CMS items&lt;/a&gt;” to better understand what I am talking about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anatomy of a Webflow tutorial&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Set expectation of viewers by stating what the tutorial will teach, shows steps&lt;/li&gt;
  &lt;li&gt;Shows the parts/subparts, and reads them out loud to enforce it (add effect, don’t just read it out)&lt;/li&gt;
  &lt;li&gt;After each step, shows that the next step is happening by saying that step out loud and also showing it on screen&lt;/li&gt;
  &lt;li&gt;End with a punchline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure is good because it respects users, and provides good user experience&lt;sup id=&quot;fnref:ux&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:ux&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;It sets the expectation at the start, and it allows you can click away if you landed on the wrong tutorial.&lt;/li&gt;
  &lt;li&gt;Each step is clearly marked with visual and auditory indicators to ensure that users are aware of where they are&lt;/li&gt;
  &lt;li&gt;A dash of humor that acts like glue in those otherwise dry steps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Other Observations&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Good writing is the key here, these tutorials are written like company sketch/ movies with focus on teaching and engagement&lt;/li&gt;
  &lt;li&gt;Music and sound design is another important thing&lt;sup id=&quot;fnref:sound_design&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:sound_design&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; that is done well
    &lt;ul&gt;
      &lt;li&gt;No boring ukulele song, there are proper sound effects with good background music&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Edits are done well, they incorporate visual gags, and have focus/zoom and other effects to keep it interesting&lt;/li&gt;
  &lt;li&gt;Tutorial opens up with the logo and sets the expectation, and then get to the point with few subtle gags to keep it interesting, and then end with a call to action of a punchline, and final screen is linked with a short call to action.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;closing-note&quot;&gt;Closing Note:&lt;/h3&gt;

&lt;p&gt;Maybe, I over-analyzed the things but I seem to enjoy this new trend, and looks like others are liking it too, these are YouTube comments from one of Webflow video&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/entertainment-in-education/yt_comment.png&quot; alt=&quot;YouTube comments from one of Webflow video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;https://twitter.com/david_perell/status/1261849798031798272&quot;&gt;this thread&lt;/a&gt;, David Perell goes on more details, recommended reading 🙂&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../img/blog/entertainment-in-education/tweet.png&quot; alt=&quot;David Perell Tweet&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Update: Looks Netlify has entered the chat, see &lt;a href=&quot;https://twitter.com/Netlify/status/1260980738901639175&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://twitter.com/Netlify/status/1263517446465519619&quot;&gt;this&lt;/a&gt; tweet&lt;/p&gt;

&lt;p&gt;That’s all, Stay In and Stay Safe 👋&lt;/p&gt;

&lt;h5 id=&quot;footnotes&quot;&gt;footnotes:&lt;/h5&gt;
&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:pure_content&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;they are still great and valuable, and I understand that not everyone has the budget for all the fancy things &lt;a href=&quot;#fnref:pure_content&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:no_applications&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;It depends on the nature of material and subject as well &lt;a href=&quot;#fnref:no_applications&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:ux&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Videos have two dimensions of UX because they are experienced with eyes and ears, so if they are designed with both eyes and ears in mind, I consider it good UX &lt;a href=&quot;#fnref:ux&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:sound_design&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;Sound design can make and break a movie, and the same is true here &lt;a href=&quot;#fnref:sound_design&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Fri, 22 May 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/a-dash-of-entertainment-in-education</link>
        <guid isPermaLink="true">https://suraj.dev/blog/a-dash-of-entertainment-in-education</guid>
        
        
        <category>learning</category>
        
        <category>education</category>
        
      </item>
    
      <item>
        <title>Why do I use Dropbox Paper?</title>
        <description>&lt;p&gt;Twitter asked for &lt;a href=&quot;https://twitter.com/ProfADK/status/1260894030008729600&quot;&gt;details on&lt;/a&gt; why
I use Dropbox Paper, I was writing the reply but ran out words so
decided to turn it into a blog post 🙂&lt;/p&gt;

&lt;!--more--&gt;

&lt;blockquote&gt;
  &lt;p&gt;Why? Simple question but I am hoping for an insight here.
–&lt;a href=&quot;https://twitter.com/ProfADK/status/1260894030008729600&quot;&gt;ProfADK&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;tldr&quot;&gt;TL;DR:&lt;/h3&gt;

&lt;p&gt;It’s simple and has all the basic things I need, It has lots of small things that it got right, and it fits nicely with my workflow, and on top of that, it’s free 🤑&lt;/p&gt;

&lt;h3 id=&quot;long-answer-&quot;&gt;Long Answer 👇&lt;/h3&gt;

&lt;p&gt;In the past, I have tried using Notion, Google Docs, &lt;a href=&quot;https://typora.io/&quot;&gt;Typora&lt;/a&gt;, and all of them had something or another thing that I didn’t like, each one had few paper-cuts that annoyed me.&lt;/p&gt;

&lt;p&gt;Tools are built for a use-case and user in mind, and those tools didn’t fit my use-case.&lt;/p&gt;

&lt;h5 id=&quot;reasons-i-like-it&quot;&gt;Reasons I like it:&lt;/h5&gt;
&lt;ul&gt;
  &lt;li&gt;Markdown support for writing, this is the biggest reason I like it because I am used to writing markdown&lt;/li&gt;
  &lt;li&gt;Can export Markdown, for me this makes publishing very easy on my Jekyll based blog&lt;/li&gt;
  &lt;li&gt;Have good support for rich media, GIFs, videos, and tweets have inline preview support&lt;/li&gt;
  &lt;li&gt;Slack style emojis, including custom emojis and I, prefer not using emoji picker (&lt;em&gt;looking at you twitter&lt;/em&gt; 👀 )&lt;/li&gt;
  &lt;li&gt;Best writing experience for desktop, and mobile, I take lots of rough notes on my phone and then edit and refine it on desktop&lt;/li&gt;
  &lt;li&gt;Has small built-in tools like to-do’s(with the owner, due date and email reminders for missed to-do’s), timeline and tables&lt;/li&gt;
  &lt;li&gt;Decent support for code blocks&lt;/li&gt;
  &lt;li&gt;Can turn a post into a presentation with a button, saves time during internal talks where I turn my bullet points into a nice looking presentation&lt;/li&gt;
  &lt;li&gt;Best collaboration experience, I just share my drafts with a link of and people can review/comment on it on mobile&lt;/li&gt;
  &lt;li&gt;Folder-based document organization&lt;/li&gt;
  &lt;li&gt;Document template support (I don’t use them but it’s nice to have)&lt;/li&gt;
  &lt;li&gt;Search is very good and fast&lt;/li&gt;
  &lt;li&gt;Can link docs (just + and suggestions shows up) in other docs&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;not-so-good-things&quot;&gt;Not So Good Things:&lt;/h5&gt;
&lt;ul&gt;
  &lt;li&gt;No advanced grammar and spell check, as a workaround, I do grammar fixes during edit stage using Grammarly&lt;/li&gt;
  &lt;li&gt;Document organization is basic but I can live with nested folders :)&lt;/li&gt;
  &lt;li&gt;It doesn’t work offline in the browser(on phone app it’s fine), when disconnected you can’t write/edit which is annoying&lt;/li&gt;
  &lt;li&gt;No themes :)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;workflow&quot;&gt;Workflow&lt;/h3&gt;

&lt;p&gt;Usual flow for a post goes like this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Note down things, I call it brain dump (mostly bullet points)&lt;/li&gt;
  &lt;li&gt;Keep adding things, and It’s moved to drafts folder when I want to publish it someday&lt;/li&gt;
  &lt;li&gt;Expand it, put it into a structure&lt;/li&gt;
  &lt;li&gt;Do the first round of edits for grammar and spelling fixes&lt;/li&gt;
  &lt;li&gt;Send drafts(post links) to friends for review&lt;/li&gt;
  &lt;li&gt;Edit, and accommodate feedback&lt;/li&gt;
  &lt;li&gt;Download markdown file, move it to blog and add Jekyll front matter&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;git push&lt;/code&gt; and it’s live on the web 🎉&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h3&gt;

&lt;p&gt;It’s free, syncs with my phone and has overall good experience, and fits nicely in my simple and minimal workflow.&lt;/p&gt;

&lt;p&gt;In my books, Dropbox Paper is a well-designed product, and again, did I mention it’s free  🤑&lt;/p&gt;

&lt;p&gt;That’s all, Stay in and Stay Safe 👋&lt;/p&gt;
</description>
        <pubDate>Thu, 14 May 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/why-do-i-use-dropbox-paper</link>
        <guid isPermaLink="true">https://suraj.dev/blog/why-do-i-use-dropbox-paper</guid>
        
        
        <category>tools</category>
        
      </item>
    
      <item>
        <title>Story of mysterious weekend restarts</title>
        <description>&lt;p&gt;In the early days of Clarisights(mid-2018), we had this problem where our &lt;a href=&quot;https://github.com/mperham/sidekiq&quot;&gt;Sidekiq&lt;/a&gt; VM used to restart on &lt;strong&gt;some weekends&lt;/strong&gt;&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;We used to use &lt;a href=&quot;https://github.com/mperham/sidekiq&quot;&gt;Sidekiq&lt;/a&gt; to process and ingest user-uploaded CSV files into our data warehouse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User flow goes like this&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Users will upload big CSV files or we pull these daily from their servers(&lt;a href=&quot;https://github.com/metabase/metabase/&quot;&gt;metabase&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;We start a Sidekiq job to process to these in background&lt;/li&gt;
  &lt;li&gt;Sidekiq was configured to retry in case we had transient failures&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;It looks simple, right?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On one fine Monday, we got the issue from a customer that their data for Sunday was not processed. After some digging, we found that our Sidekiq VM restarted on Sunday, and it came back online automatically&lt;/p&gt;

&lt;p&gt;We saw it restarted because it was out of memory, we attributed it to a bunch of retries(due to some bad CSVs) we saw around the same time and moved on&lt;/p&gt;

&lt;p&gt;Next weekend it was fine, and then after a few more weeks, it happened again. we tried debugging but no luck, we added more instrumentation and moved on.&lt;/p&gt;

&lt;p&gt;Fast forward to next week, while I was optimizing CSV processing code, I found a memory leak. CSV processing code used to leak memory, but it was a slow leak.  Now all of sudden it all adds up on why it only happened one some weekends.&lt;/p&gt;

&lt;p&gt;We used to deploy multiple times in a day, and during deploy, we restart Sidekiq to load new code.&lt;/p&gt;

&lt;p&gt;Because of these multiple deploys, the leak was hidden and never showed up in monitoring. It was clear when we looked at restarts, memory growth, and deploys. , these restarts happened on weekends with zero deploys.&lt;/p&gt;

&lt;p&gt;We ran an isolated test to verify it, and sure enough, it was the reason. So, that was my mysterious weekend restarts story, a &lt;strong&gt;slow memory leak, hiding behind deploys&lt;/strong&gt; 🙂&lt;/p&gt;

&lt;p&gt;For me, this was a perfect reminder of &lt;strong&gt;correlation can lead to causation but, correlation is not causation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s all folks, Stay In, Stay Safe 👋&lt;/p&gt;

</description>
        <pubDate>Tue, 12 May 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/story-of-mysterious-weekend-restarts</link>
        <guid isPermaLink="true">https://suraj.dev/blog/story-of-mysterious-weekend-restarts</guid>
        
        
        <category>sidekiq</category>
        
        <category>story-time</category>
        
      </item>
    
      <item>
        <title>Sending Kubernetes events to Sentry</title>
        <description>&lt;p&gt;In this post, we will talk about how to collect events from multiple Kubernetes
clusters and ship it to sentry&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;At Clarisights, we run multiple Kubernetes clusters (GKE) for our production
and staging workloads.&lt;/p&gt;

&lt;p&gt;Events from Kubernetes objects get &lt;a href=&quot;https://github.com/kubernetes/kubernetes/issues/52521&quot;&gt;garbage collected&lt;/a&gt; to avoid putting extra load on etcd&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;em&gt;events are stored in etcd with objects, and looks like it will &lt;a href=&quot;https://github.com/kubernetes/kubernetes/issues/4432&quot;&gt;stay that way for a while&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When things blow up (like they do), we need those events to debug and fix the issues, so
we wanted to put those events somewhere more permanent so we can come and look at it.&lt;/p&gt;

&lt;p&gt;While searching for ways, we ran into &lt;a href=&quot;https://github.com/getsentry/sentry-kubernetes&quot;&gt;sentry-kubernetes&lt;/a&gt;
project, which collects and sends cluster events to sentry.&lt;/p&gt;

&lt;p&gt;We already had self-hosted Sentry installation running, so this is just perfect, but upon
looking closer we found that it sends events from a single cluster into a sentry project.&lt;/p&gt;

&lt;p&gt;We wanted to send events from multiple clusters to a single project because we run multiple
clusters and new clusters are spawned and moved around for various operational reasons.&lt;/p&gt;

&lt;p&gt;Since code is open, we decided to add support for multiple clusters, we forked and
&lt;a href=&quot;https://github.com/getsentry/sentry-kubernetes/pull/24&quot;&gt;sent a patch&lt;/a&gt;, yay open source 🙌&lt;/p&gt;

&lt;p&gt;Now, let’s put it in production 🙌&lt;/p&gt;

&lt;h4 id=&quot;create-a-sentry-project&quot;&gt;Create a Sentry Project&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Create a new sentry project, select  &lt;code class=&quot;highlighter-rouge&quot;&gt;Other&lt;/code&gt; under language/framework&lt;/li&gt;
  &lt;li&gt;Copy DSN, we will need it later&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;setup-access&quot;&gt;Setup Access&lt;/h4&gt;
&lt;p&gt;To collect these events we need permissions to watch these events, we need to setup access so
our collector and watch, collect and send these events to sentry&lt;/p&gt;

&lt;p&gt;For access we will create a &lt;code class=&quot;highlighter-rouge&quot;&gt;ServiceAccount&lt;/code&gt;, a &lt;code class=&quot;highlighter-rouge&quot;&gt;ClusterRole&lt;/code&gt; with permissions to watch events,
and bind that role with &lt;code class=&quot;highlighter-rouge&quot;&gt;ServiceAccount&lt;/code&gt; using a &lt;code class=&quot;highlighter-rouge&quot;&gt;ClusterRoleBinding&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you are new to Kubernetes RBAC, see &lt;a href=&quot;https://suraj.dev/blog/access-control-RBAC-in-kubernetes&quot;&gt;my post&lt;/a&gt; on it to learn more,
and see &lt;a href=&quot;https://gist.github.com/electron0zero/2d3ff3cacad6ad07f7937e326e5a4215#file-setup-access-yaml&quot;&gt;this gist&lt;/a&gt;  for yaml file&lt;/p&gt;

&lt;p&gt;We will use this service account in our deployment&lt;/p&gt;

&lt;h4 id=&quot;deployment&quot;&gt;Deployment&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Build docker image
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;docker build -t sentry-kubernetes:latest https://github.com/getsentry/sentry-kubernetes.git&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Create and apply &lt;code class=&quot;highlighter-rouge&quot;&gt;Deployment&lt;/code&gt; with &lt;code class=&quot;highlighter-rouge&quot;&gt;sentry-kubernetes&lt;/code&gt; image and service account we created, and if all goes well we should see events in sentry project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;closing-note&quot;&gt;Closing Note&lt;/h4&gt;

&lt;p&gt;Cluster name, namespace and other Kubernetes object attributes will show up as labels, and
you should be able to filter events based on these.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://gist.github.com/electron0zero/2d3ff3cacad6ad07f7937e326e5a4215&quot;&gt;this gist&lt;/a&gt; for more scripts and yaml files.&lt;/p&gt;

&lt;p&gt;I hope it was helpful :)&lt;/p&gt;

&lt;p&gt;Stay in and Stay Safe 👋&lt;/p&gt;
</description>
        <pubDate>Sun, 10 May 2020 00:00:00 +0000</pubDate>
        <link>https://suraj.dev/blog/sending-kubernetes-events-to-sentry</link>
        <guid isPermaLink="true">https://suraj.dev/blog/sending-kubernetes-events-to-sentry</guid>
        
        
        <category>Kubernetes</category>
        
        <category>Sentry</category>
        
      </item>
    
  </channel>
</rss>
