<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aman singh on Medium]]></title>
        <description><![CDATA[Stories by Aman singh on Medium]]></description>
        <link>https://medium.com/@amey0x?source=rss-91ac3c32b538------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zCzASFB-p-IIt-d_M-Nobg.jpeg</url>
            <title>Stories by Aman singh on Medium</title>
            <link>https://medium.com/@amey0x?source=rss-91ac3c32b538------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:48:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amey0x/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Null Byte vs Null terminator vs Null character ‍]]></title>
            <link>https://medium.com/@amey0x/null-byte-vs-null-terminator-vs-null-character-f25fc0ebc3f6?source=rss-91ac3c32b538------2</link>
            <guid isPermaLink="false">https://medium.com/p/f25fc0ebc3f6</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Aman singh]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 11:40:49 GMT</pubDate>
            <atom:updated>2023-10-27T11:41:26.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7cagdGySVcadiW1SQh9zlw.jpeg" /><figcaption>image from computerhope.com</figcaption></figure><p>You can find me 😌 : <a href="https://twitter.com/Amansin65844373">Twitter</a></p><p>The terms “null character”, “null terminator”, and “null byte” all refer to the same thing: a byte with the value zero.</p><p><strong>Null character:</strong> The null character is a non-printing character that is used to represent the end of a string. It is also used to represent empty values in some data types.</p><p><strong>Null terminator:</strong> The null terminator is a byte with the value zero that is used to mark the end of a string in C and C++ programs.</p><p><strong>Null byte:</strong> The null byte is a byte with the value zero that is used to represent the end of a file or stream.</p><p>The null character is represented by the ASCII code 0 (NUL). It is also represented by the Unicode code point U+0000 (NULL).</p><h3>How the null character is used in computer programming</h3><p>The null character is used in a variety of ways in computer programming. For example, it is used:</p><ul><li>To terminate strings in C and C++ programs.</li><li>To represent empty values in some data types, such as integers and floats.</li><li>To mark the end of a file or stream.</li><li>To represent padding or unused space in memory.</li></ul><p>Here is a more comprehensive article on the terms “null character”, “null terminator”, and “null byte”:</p><h3>Null character, null terminator, and null byte</h3><p>The terms “null character”, “null terminator”, and “null byte” all refer to the same thing: a byte with the value zero.</p><p><strong>Null character:</strong> The null character is a non-printing character that is used to represent the end of a string. It is also used to represent empty values in some data types.</p><p><strong>Null terminator:</strong> The null terminator is a byte with the value zero that is used to mark the end of a string in C and C++ programs.</p><p><strong>Null byte:</strong> The null byte is a byte with the value zero that is used to represent the end of a file or stream.</p><p>The null character is represented by the ASCII code 0 (NUL). It is also represented by the Unicode code point U+0000 (NULL).</p><h3>How the null character is used in computer programming</h3><p>The null character is used in a variety of ways in computer programming. For example, it is used:</p><ul><li>To terminate strings in C and C++ programs.</li><li>To represent empty values in some data types, such as integers and floats.</li><li>To mark the end of a file or stream.</li><li>To represent padding or unused space in memory.</li></ul><p><strong>String termination</strong></p><p>In C and C++ programs, the null character is used to terminate strings. This means that the last byte of a string must be a null character. This allows the compiler to know where the string ends, even if the string contains variable-length data.</p><p><strong>Empty values</strong></p><p>The null character is also used to represent empty values in some data types. For example, in C, the integer data type int can be used to store either a valid integer value or the null character. This allows developers to represent the absence of a value in a variable.</p><p><strong>End of file or stream</strong></p><p>The null character is also used to mark the end of a file or stream. This is useful when reading and writing data to files, as it allows the program to know when it has reached the end of the data.</p><p><strong>Padding</strong></p><p>The null character is also used to represent padding or unused space in memory. This is useful when allocating memory for data structures, as it allows developers to ensure that the data structures are aligned properly.</p><h3>Examples of null character usage</h3><p>Here are some examples of how the null character is used in code:</p><pre># Python string<br>my_string = &quot;Hello, world!&quot;<br><br># Null character at the end of the string<br>print(my_string[-1])<br><br># Output: 0</pre><pre>// C string<br>char my_string[] = &quot;Hello, world!&quot;;<br><br>// Null terminator at the end of the string<br>printf(&quot;%c\n&quot;, my_string[strlen(my_string) - 1]);<br><br>// Output: \0</pre><pre>// C++ string<br>std::string my_string = &quot;Hello, world!&quot;;<br><br>// Null terminator at the end of the string<br>std::cout &lt;&lt; my_string[my_string.length() - 1] &lt;&lt; std::endl;<br><br>// Output: \0</pre><h3>Conclusion</h3><p>The null character is an important part of computer programming, and it is essential to understand how it is used. By understanding the different ways in which the null character is used, developers can write more efficient and effective code.</p><p>You can find me 😌 : <a href="https://twitter.com/Amansin65844373">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f25fc0ebc3f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The most common files for Apache configurations ]]></title>
            <link>https://medium.com/@amey0x/the-most-common-files-for-apache-configurations-23b6b4105f14?source=rss-91ac3c32b538------2</link>
            <guid isPermaLink="false">https://medium.com/p/23b6b4105f14</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Aman singh]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 09:43:27 GMT</pubDate>
            <atom:updated>2023-10-23T10:16:08.952Z</atom:updated>
            <content:encoded><![CDATA[<p>In Apache, configuration files that contain rules for mod_rewrite and other server configurations typically use the .htaccess file extension. However, the specific file name can vary depending on your server configuration. The main configuration file for Apache is often named httpd.conf or apache2.conf on Linux systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*2UPVFhzDuTGgWDkUVNQwDQ.png" /></figure><p>Here are the most common files for Apache configurations:</p><ol><li>htaccess<strong>:</strong></li></ol><p><strong>.</strong> The .htaccess file is a per-directory configuration file. It allows you to specify Apache configuration directives that apply to the directory where the file is located and all of its subdirectories. These configurations can include rules for mod_rewrite, authentication, and other settings.</p><ul><li>It’s a convenient way to apply directory-specific settings without altering the global server configuration. .htaccess files are often used when you don&#39;t have access to the main server configuration or when you want to allow users to customize their own directories.</li></ul><p>2. <strong>httpd.conf:</strong></p><p><strong>.</strong> httpd.conf is the primary configuration file for the Apache web server. It contains global server settings that apply to the entire server.</p><p>. You’ll find this file in the Apache configuration directory, which is typically located at /etc/httpd/ or /etc/apache2/ depending on the Linux distribution. In Windows, it&#39;s usually in the Apache installation directory.</p><p><strong>.</strong> httpd.conf includes settings like server-wide security settings, logging options, and module configurations.</p><p>3.<strong>apache2.conf:</strong></p><p><strong>.</strong>On some Debian-based Linux distributions, such as Ubuntu, the main Apache configuration file is named apache2.conf. It serves the same purpose as httpd.conf, but the file name differs to match the Debian conventions.</p><ul><li>It’s also located in the Apache configuration directory, typically at /etc/apache2</li></ul><p>4.<strong>000-default.conf and other </strong><strong>.conf files</strong>:</p><p>.Apache virtual hosts allow you to run multiple websites on the same server. Each virtual host configuration can be stored in separate .conf files.</p><ul><li>000-default.conf is an example of a virtual host configuration file. It&#39;s often used as the default virtual host for the server when no other host matches the requested domain.</li><li>These .conf files are typically stored in /etc/apache2/sites-available/ on Debian-based systems, and you can enable or disable them using the a2ensite and a2dissite commands.</li></ul><p>The choice of which configuration file to use depends on your specific needs and the server setup. The main httpd.conf or apache2.conf file is used for global server configuration, while .htaccess files are for directory-specific configurations. Virtual host configuration files like 000-default.conf are used to set up multiple websites on a single server.</p><p>You can find me 🤗: <a href="http://twitter.com/amansin65844373">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23b6b4105f14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Web Worker? Which type of Worker to use?]]></title>
            <link>https://medium.com/@amey0x/what-is-web-worker-which-type-of-worker-to-use-4026de8b3cfa?source=rss-91ac3c32b538------2</link>
            <guid isPermaLink="false">https://medium.com/p/4026de8b3cfa</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aman singh]]></dc:creator>
            <pubDate>Wed, 11 Oct 2023 14:14:14 GMT</pubDate>
            <atom:updated>2023-10-12T00:46:49.921Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong><em>Web Workers</em></strong><em> makes it possible to run a script operation in a background thread separate from the main execution thread of a web application. — </em><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API"><em>MDN Docs</em></a></blockquote><blockquote>Web Worker is widely supported in modern browsers. As of Sept 2022, Web Worker is supported by browsers used by over 98% of users.</blockquote><blockquote>The most important takeaway is that the execution context and private data remain isolated in a web worker. And we can execute a task in this background thread.</blockquote><h3>When working with web workers in JavaScript, there are two main types of workers to choose from:</h3><ol><li>Dedicated Wokers</li><li>Shared Workers</li><li>Service Workers</li></ol><blockquote><strong>1. Dedicated Workers:</strong></blockquote><ul><li>A dedicated worker runs in its own thread and is dedicated to a single script file.</li><li>It has a one-to-one relationship with the script that created it.</li><li>Dedicated workers are typically used for tasks that require a high degree of isolation and parallel processing, such as performing complex calculations or data manipulation.</li><li>They are ideal for tasks that don’t need to communicate frequently with the main thread.</li></ul><p>Example of creating a dedicated worker:</p><pre>const worker = new Worker(&#39;worker-script.js&#39;);</pre><p>2. <strong>Shared Workers:</strong></p><ul><li>A shared worker can be used by multiple scripts running in different windows or tabs of the same origin.</li><li>They are useful for scenarios where you want to share a single worker instance among multiple parts of your web application.</li><li>Shared workers allow for communication and data sharing between different scripts running in different contexts (e.g., different browser tabs or windows) within the same origin.</li></ul><p>Example of creating a shared worker:</p><pre>const worker = new SharedWorker(&#39;shared-worker-script.js&#39;);</pre><p><strong>Choosing between dedicated and shared workers depends on your specific use case:</strong></p><ul><li>Use <strong>dedicated workers</strong> when you have a single script that needs to perform background processing, and you want full isolation between the worker and the main thread.</li><li>Use <strong>shared workers</strong> when you need to share a worker among multiple parts of your application, such as different browser tabs or windows, and you need communication and data sharing between them.</li><li>It’s important to note that the choice between dedicated and shared workers depends on your application’s architecture and requirements. Both types of workers can be valuable tools for improving the performance and responsiveness of web applications, depending on how you need to structure your background processing and data sharing.</li></ul><p>3. Service Workers</p><p>Service Workers are a crucial component of modern web applications, primarily used to provide offline capabilities, caching, background tasks, and push notifications. They run in the background, separate from the main JavaScript thread, and have the ability to intercept and control network requests made by your web application.</p><p>Here are some key aspects of Service Workers:</p><ol><li><strong>Background Execution:</strong> Service Workers run in the background, independent of the main web page’s JavaScript thread. This allows them to perform tasks such as caching resources, handling push notifications, or fetching data from the network without affecting the user interface’s responsiveness.</li><li><strong>Network Request Control:</strong> Service Workers can intercept and control network requests made by your web application. This enables advanced caching strategies like serving cached content when the network is offline or using cached assets to improve performance.</li></ol><p>3. <strong>Offline Capabilities:</strong> Service Workers are commonly used to implement offline-first web applications. By caching resources like HTML, CSS, JavaScript, and data, a Service Worker can allow your web app to work even when the user is offline.</p><p>4. <strong>Push Notifications:</strong> Service Workers can receive push notifications from a server and display them to the user, even when the web app is not open. This feature is essential for building progressive web apps (PWAs) that can send notifications and engage users outside of the browser.</p><p>5. <strong>Background Sync:</strong> Service Workers can schedule background sync tasks to send data to a server when a network connection becomes available. This is useful for ensuring that user data is synchronized even if the device temporarily loses connectivity.</p><p>6. <strong>Lifecycle:</strong> Service Workers have a lifecycle that includes installation, activation, and termination phases. This allows you to manage and update the Service Worker code as needed.</p><p>Here’s a simplified example of how to register a Service Worker:</p><pre>if (&#39;serviceWorker&#39; in navigator) {<br>  navigator.serviceWorker.register(&#39;/service-worker.js&#39;)<br>    .then(function(registration) {<br>      console.log(&#39;Service Worker registered with scope:&#39;, registration.scope);<br>    })<br>    .catch(function(error) {<br>      console.error(&#39;Service Worker registration failed:&#39;, error);<br>    });<br>}</pre><p>Service Workers can be a powerful tool for enhancing the performance, reliability, and user experience of web applications, particularly when it comes to providing offline capabilities and background tasks. However, they require careful implementation to ensure that they don’t inadvertently interfere with your application’s functionality or introduce security vulnerabilities.</p><p>Thanks for reading</p><p>You can find me : <a href="https://twitter.com/Amansin65844373">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4026de8b3cfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>