<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://adhithiyan.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 08:51:38 GMT</lastBuildDate><atom:link href="https://adhithiyan.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Snowflake - AutoIncrement Column]]></title><description><![CDATA[Autoincrement, as the name suggest, is used to increment the value of a column automatically when a new row is inserted into the table. Usually, it is used for the primary key column of the table. The column should be of numberic data type.
In Snowfl...]]></description><link>https://adhithiyan.com/snowflake-autoincrement-column</link><guid isPermaLink="true">https://adhithiyan.com/snowflake-autoincrement-column</guid><category><![CDATA[snowflake]]></category><dc:creator><![CDATA[Adhithiyan Azhagudurai]]></dc:creator><pubDate>Sat, 21 Sep 2024 15:28:51 GMT</pubDate><content:encoded><![CDATA[<p>Autoincrement, as the name suggest, is used to increment the value of a column automatically when a new row is inserted into the table. Usually, it is used for the primary key column of the table. The column should be of numberic data type.</p>
<p>In Snowflake, the keyword identity is synonymous to autoincrement.</p>
<p>Syntax :</p>
<p>column_name numeric_datatype autoincrement start_num end_num ORDER|NOORDER</p>
<p>Example</p>
<p>employee_id integer autoincrement start 1 step 1 ORDER</p>
<p>Pitfall :</p>
<p>While recreating the table, we need to pay special attention to auto-increment column. Usually, We take a backup of the table and re-insert rows after recreation. After recreating the table, the autoincrement starts from the intial value again. It would lead to duplicate values in that column. Even having that column as primary key will not help, as primary key is not enforced in snowflake tables (except hybrid table), the inserts will not fail. While re-inserting the old rows without including the autoincrement column might help, we need to consider the possibility of new values getting assigned to different rows and the change of values might after FK relationship with other tables (if any). One possible solution to both scenario is chanege the start value to max+1 of the already existing values while recreating the table.</p>
]]></content:encoded></item><item><title><![CDATA[PDF Document]]></title><description><![CDATA[--work in progress--
A PDF Document is a series of 8-bit bytes that can be grouped into tokens. The PDF character set is divided into three classes.
white-space :
PDF treats any sequence of white-space characters as one character. It is mainly used t...]]></description><link>https://adhithiyan.com/pdf-document</link><guid isPermaLink="true">https://adhithiyan.com/pdf-document</guid><category><![CDATA[pdf]]></category><category><![CDATA[standards]]></category><dc:creator><![CDATA[Adhithiyan Azhagudurai]]></dc:creator><pubDate>Tue, 28 May 2024 06:37:12 GMT</pubDate><content:encoded><![CDATA[<p><strong>--work in progress--</strong></p>
<p>A PDF Document is a series of 8-bit bytes that can be grouped into tokens. The PDF character set is divided into three classes.</p>
<p><strong>white-space</strong> :</p>
<p>PDF treats any sequence of white-space characters as one character. It is mainly used to separate tokens(names and numbers) from each other.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Name</td><td>Decimal</td><td>Hex</td></tr>
</thead>
<tbody>
<tr>
<td>Null</td><td></td><td></td></tr>
<tr>
<td>Horizontal Tab</td><td></td><td></td></tr>
<tr>
<td>Line Feed</td><td></td><td></td></tr>
<tr>
<td>Form Feed</td><td></td><td></td></tr>
<tr>
<td>Carriage Return</td><td></td><td></td></tr>
<tr>
<td>Space</td><td></td></tr>
</tbody>
</table>
</div><p>The above characters are considered as white-line characters. Line Feed and Carriage Return are also considered as <em>end-of-line</em> markers. CR followed immediately by LF is conisdered as one EOL marker. It is mostly treated as other white-space characters except they are required to precede a token that must appear at the beginning of a line.</p>
<p><strong>delimiter :</strong></p>
<p>delimiters are used to separate entities within construct like array, names and comments.</p>
<p><strong>regular :</strong></p>
<p>All characters except white-space and delimiter characters are considered the regular characters. They include bytes outside the ASCII set. The sequence of consecuitve regular characters is considered a single token. PDF is case-sensitive.</p>
<p>PDF syntax can be thought of consisting of 4 parts.</p>
<p><strong>Objects :</strong></p>
<p>Eight basic types of objects - Boolean, integer and real numbers, String Names, Arrays, Dictionaries, Streams and the null object. Indirect objects are named objects that can be refrenced by other objects.</p>
<p>boolean -&gt; true, false.</p>
<p>number -&gt; integer, real numbers. the range and precision is limited by the computer in which the pdf processor is running.</p>
<p>Example : 0 , -34 , 87 , 63.5</p>
<p>string objects - can be written in two ways</p>
<p>string literals - Eg :(alex)</p>
<p>Blackslash is used to escape characters. the string literals can be multiline. Blackslash at the end of a line is used to indicate that the string continues in the next line.</p>
<p>The \ddd escape sequence is used to</p>
<p>hexadecimal string - &lt;901FA3&gt; Each pair of hexadecimal digit represent one byte of the string. If there are odd number of digits, the final digit is assumed to be 0.</p>
<p>Array:</p>
<p>Sequence of objects enclosed within square brackets. PDF Arrays are heterogeneous. PDF directly support only one-dimensional arrays. Arrays of higher dimensions can be constructed by using arrays as elements of arrays.</p>
<p>Name Objects:</p>
<p>Name may contain any character except NULL. When writing a name in PDF file, a SOLIDUS(/) should be used to start the name.</p>
<p>Any character that is not a regular character has to be written in hexadecimal format preceded by the NUMBER SIGN(#) Eg: #20 means space. Keywords are not preceded by the # sign.</p>
<p>Dictionary Objects:</p>
<p>It contains pairs of objects. The first element is the key and the second element is the value. The key shall be a name and they must be direct object. The value may be any kind of object (including another dictionary). A dictionary is written as a sequence of key-value pairs enclosed in double angle brackets.</p>
<p>Dictionary is the main buliding block and it is used to construct the attributes for complex objects. By convention, there are certain keys used for specific purpose.</p>
<p>Type - identifies the type of object the dictionary describes.</p>
<p>SubType(S) - identifies the specific type within the general category. Example : Type might be Font and the SubType will specify one of the fontfamily.</p>
<p>Stream Object :</p>
<p>Stream object is a sequence of bytes and can have unlimited length. They are used for objects with large amount of data like images and page descriptions.</p>
<p>A stream consists of a dictionary followed by zero or more bytes bracketed between the keywords stream ( followed by newline [CR and LF or LF alone] ) and endstream.</p>
<p>There should be EOL marker at the end of the stream and that should not be included in the stream length. The stream dictionary includes the length of the stream.</p>
<p>Length - indicates how many bytes of the PDF file are used for the stream's data.</p>
<p>From PDF 1.2, the bytes may be contained in the external file. The stream dictionary specifices the file and any bytes between the keywords are ignored.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Key</td><td>Type</td><td>Vaue</td></tr>
</thead>
<tbody>
<tr>
<td>Length</td><td></td><td></td></tr>
<tr>
<td>Filter</td><td></td></tr>
</tbody>
</table>
</div><p>NULL Object:</p>
<p>It refers to object of type null and is denoted by the keyword <strong>null</strong>.</p>
<p>Indirect Object:</p>
<p>any object can be labelled using a positive integer object number and a non negative integer generation number. both of them together helps in identifying an object. Here, the object value is bracketed between the keywords <strong>obj</strong> and <strong>endobj</strong>.</p>
<p>The indirect object can be used anywhere by indirect reference. The reference is done using the keyword R</p>
<p>File Structure.</p>
<p>Document Structure.</p>
<p>Content streams.</p>
]]></content:encoded></item><item><title><![CDATA[Executing shell script in EC2 using AWS Systems Manager]]></title><description><![CDATA[In this article, we will see how to execute a shell script in EC2 using AWS Systems Manager (SSM) and capture the logs in AWS CloudWatch.
AWS SSM cannot perform any actions on EC2 instances by default. For an EC2 Instance to be managed by SSM,

The I...]]></description><link>https://adhithiyan.com/executing-shell-script-in-ec2-using-aws-systems-manager</link><guid isPermaLink="true">https://adhithiyan.com/executing-shell-script-in-ec2-using-aws-systems-manager</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS SSM]]></category><dc:creator><![CDATA[Adhithiyan Azhagudurai]]></dc:creator><pubDate>Mon, 26 Jun 2023 17:12:13 GMT</pubDate><content:encoded><![CDATA[<p>In this article, we will see how to execute a shell script in EC2 using AWS Systems Manager (SSM) and capture the logs in AWS CloudWatch.</p>
<p>AWS SSM cannot perform any actions on EC2 instances by default. For an EC2 Instance to be managed by SSM,</p>
<ol>
<li><p>The IAM policy "<strong>AmazonSSMManagedInstanceCore"</strong> should be attached to the instance. It is done using the IAM role.</p>
</li>
<li><p>The SSM Agent should be installed and running in the EC2 instance. By default, the majority of the Linux flavor comes with SMM Agent preinstalled.</p>
</li>
</ol>
<p>Connect to the EC2 Instance and create a sample shell script as shown below.</p>
<pre><code class="lang-bash"><span class="hljs-meta">#!/bin/bash</span>
<span class="hljs-built_in">set</span> -e
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Script Started"</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Script Ended"</span>
<span class="hljs-built_in">exit</span> 0
</code></pre>
<p>Now, we will see how to run the script using AWS SSM using the management console.</p>
<ol>
<li><p>After logging into the console, navigate to AWS Systems Manager,</p>
</li>
<li><p>Select "Run Command" from the left-hand pane.</p>
</li>
<li><p>Select "AWS-RunShellScript" from the Command Document list. This command is used to run a shell script.</p>
</li>
<li><p>You can provide the "Commands" to run.</p>
<p> Note: AWS SSM will run the script or command as the root user. If you want to use any other user to run your script, use the below command.</p>
<pre><code class="lang-bash"> runuser -l &lt;username&gt; -c <span class="hljs-string">'&lt;command&gt;'</span>
</code></pre>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687788604246/f62ffad6-1a42-45e3-9ac9-8c5af5a64691.jpeg" alt class="image--center mx-auto" /></p>
</li>
<li><p>You can also set the "Working Directory".</p>
</li>
<li><p>In the Target Selection section, select "Choose instances manually" and select your instance from the list of managed instances. If your instance has been configured as explained above, it will get shown in the list.</p>
</li>
<li><p>After you submit the command, it should get completed successfully and you can see the output as shown in the image below.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687785274178/53f4bf08-8b17-4179-9793-cc4472722d3a.jpeg" alt class="image--center mx-auto" /></p>
</li>
<li><p>To capture the logs in CloudWatch Logs, simply enable the CloudWatch logs in the output options as shown below.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687785788033/4f561f02-1233-4c4f-b96c-e3c1435c5700.jpeg" alt class="image--center mx-auto" /></p>
</li>
<li><p>Now, the logs will be available under the "sampleproject" Log Group in AWS CloudWatch.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[AWS VPC - An Intro]]></title><description><![CDATA[VPC - Virtual Private Cloud. AWS VPC lets us create a logically isolated network within which we can deploy AWS Resources. By default, we can have 5 VPCs in an AWS Region. A VPC is available in each region by default.
Subnets - Refers to a range of I...]]></description><link>https://adhithiyan.com/aws-vpc-an-intro</link><guid isPermaLink="true">https://adhithiyan.com/aws-vpc-an-intro</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS VPC]]></category><dc:creator><![CDATA[Adhithiyan Azhagudurai]]></dc:creator><pubDate>Mon, 26 Jun 2023 09:59:52 GMT</pubDate><content:encoded><![CDATA[<p>VPC - Virtual Private Cloud. AWS VPC lets us create a logically isolated network within which we can deploy AWS Resources. By default, we can have 5 VPCs in an AWS Region. A VPC is available in each region by default.</p>
<p>Subnets - Refers to a range of IP addresses. A Subnet must reside within a single Availability Zone.</p>
<p>Gateway - A gateway connects VPC to another network. Example: Internet Gateway connects the VPC to the internet.</p>
<p>VPC Endpoint - This allows resources within VPC to connect to AWS Services privately.</p>
<p>Route Tables - The rules (called routes) that determine where the traffic from subnets should go are defined in route tables. Each subnet should be associated with one route table only. If a subnet is not explicitly associated with a route table, it will be associated with the main route table of the VPC. A single route table can be associated with multiple subnets. A route table is attached to a VPC at the time of its creation.</p>
<p>Route - A Route consists of a destination and a target. The destination is an IP address or IP range to which the subnet wants to send the traffic and the target refers to the gateway or endpoint to which the traffic will be sent so that the traffic will reach the final destination.</p>
<p>local route - A special route where the target is local and it enables communication within the VPC and is added to all route tabes, by default.</p>
<p>Sidebar :</p>
<p>CIDR blocks for IPv4 and IPv6 are treated separately.</p>
<p>0.0.0.0/0 represents all IPv4 addresses.</p>
<p>::/0 represents all IPv6 addresses.</p>
<p>Security Groups - A network security feature that operates at the EC2 instance level. We can define inbound and outbound allow rules within a security group. It is stateful and so it allows return traffic. We can define only allow rules but not deny rules.</p>
<p>Network ACL - A network security feature that operates at the subnet level and hence applies to all resources within that subnet. It is stateless. The allow rules as well as deny rules have to be explicitly defined.</p>
<p>Private Subnet - A private subnet can be created by restricting all inbound access to the subnet except from within the VPC using network ACL.</p>
]]></content:encoded></item><item><title><![CDATA[Overview of YAML]]></title><description><![CDATA[YAML stands for Yet Another Markup Language or YAML ain't Markup Language.
All valid JSON files are valid YAML files.
YAML consists of two data blocks.

Sequence, which is similar to a Python list. It begins with a dash("-") and a space.
 - orange
 -...]]></description><link>https://adhithiyan.com/overview-of-yaml</link><guid isPermaLink="true">https://adhithiyan.com/overview-of-yaml</guid><category><![CDATA[YAML]]></category><category><![CDATA[yml]]></category><dc:creator><![CDATA[Adhithiyan Azhagudurai]]></dc:creator><pubDate>Fri, 09 Jun 2023 10:53:57 GMT</pubDate><content:encoded><![CDATA[<p>YAML stands for Yet Another Markup Language or YAML ain't Markup Language.</p>
<p>All valid JSON files are valid YAML files.</p>
<p>YAML consists of two data blocks.</p>
<ol>
<li><p>Sequence, which is similar to a Python list. It begins with a dash("-") and a space.</p>
<pre><code class="lang-yaml"> <span class="hljs-bullet">-</span> <span class="hljs-string">orange</span>
 <span class="hljs-bullet">-</span> <span class="hljs-string">apple</span>
 <span class="hljs-bullet">-</span> <span class="hljs-string">banana</span>
</code></pre>
</li>
<li><p>Mapping, which is similar to a Python dictionary. It is a key-value pair.</p>
<pre><code class="lang-yaml"> <span class="hljs-attr">name:</span> <span class="hljs-string">john</span>
 <span class="hljs-attr">age:</span> <span class="hljs-number">40</span>
</code></pre>
</li>
</ol>
<p>YAML also supports simple datatypes like number, strings, and boolean.</p>
<p>We can create lists of dictionaries, dictionaries containing lists and more.</p>
<ol>
<li><p>List of Dictionaries:</p>
<pre><code class="lang-yaml"> <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">John</span>
   <span class="hljs-attr">age:</span> <span class="hljs-number">30</span>
 <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Cena</span>
   <span class="hljs-attr">age:</span> <span class="hljs-number">40</span>
</code></pre>
<p> In the above code snippet, we have a sequence with two items. Each item contains two mappings.</p>
</li>
<li><p>Dictionary of lists:</p>
<pre><code class="lang-yaml"> <span class="hljs-attr">name:</span>
   <span class="hljs-bullet">-</span> <span class="hljs-string">John</span>
   <span class="hljs-bullet">-</span> <span class="hljs-string">Cena</span>
   <span class="hljs-bullet">-</span> <span class="hljs-string">Carter</span>
</code></pre>
<p> Here, we have a single mapping with the key "name" and the value is a sequence containing three items.</p>
</li>
</ol>
<p>Important Note:</p>
<ol>
<li><p>If the YAML document starts with a mapping, it can contain only a series of mappings.</p>
<pre><code class="lang-yaml"> <span class="hljs-attr">name:</span> <span class="hljs-string">John</span>
 <span class="hljs-bullet">-</span> <span class="hljs-number">30</span> <span class="hljs-comment">## Invalid</span>
</code></pre>
</li>
<li><p>The same holds for the sequence as well.</p>
</li>
</ol>
<p>We could nest them and create more complex documents.</p>
<pre><code class="lang-yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">John :</span>
    <span class="hljs-attr">age:</span> <span class="hljs-number">50</span>
    <span class="hljs-attr">sex:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">Male</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">Female</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">Cena</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">Carte</span>
</code></pre>
<pre><code class="lang-json">[
    {
        <span class="hljs-attr">"John"</span>: {
            <span class="hljs-attr">"age"</span>: <span class="hljs-number">50</span>,
            <span class="hljs-attr">"sex"</span>: [
                <span class="hljs-string">"Male"</span>,
                <span class="hljs-string">"Female"</span>
            ]
        }
    },
    <span class="hljs-string">"Cena"</span>,
    <span class="hljs-string">"Carte"</span>
]
</code></pre>
]]></content:encoded></item></channel></rss>