<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahmudul Haque</title>
    <description>The latest articles on DEV Community by Mahmudul Haque (@mahmudulhaque).</description>
    <link>https://dev.to/mahmudulhaque</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F402821%2F642085db-e83c-494c-ab26-d60734abbd3e.jpg</url>
      <title>DEV Community: Mahmudul Haque</title>
      <link>https://dev.to/mahmudulhaque</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahmudulhaque"/>
    <language>en</language>
    <item>
      <title>Apache Airflow on EC2 with RDS</title>
      <dc:creator>Mahmudul Haque</dc:creator>
      <pubDate>Thu, 17 Aug 2023 21:13:40 +0000</pubDate>
      <link>https://dev.to/mahmudulhaque/apache-airflow-on-ec2-with-rds-4lg2</link>
      <guid>https://dev.to/mahmudulhaque/apache-airflow-on-ec2-with-rds-4lg2</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;python3-pip python3-psycopg2 default-libmysqlclient-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--upgrade&lt;/span&gt; pip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--user&lt;/span&gt; apache-airflow[amazon] apache-airflow[postgres] apache-airflow[celery] psycopg2-binary apache-airflow-providers-mysql Redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"export AIRFLOW_HOME=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/airflow"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;airflow db init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;airflow.cfg&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[core]
executor = CeleryExecutor
load_examples = False

[database]
sql_alchemy_conn = postgresql://myuser:mypassword@my-rds-instance.abc123.us-west-2.rds.amazonaws.com:5432/mydatabase`

[celery]
broker_url = redis://localhost:6379/0
result_backend = redis://localhost:6379/1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Celery Executor: &lt;a href="https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/executor/celery.html"&gt;https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/executor/celery.html&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;airflow db init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;airflow &lt;span class="nb"&gt;users &lt;/span&gt;create &lt;span class="nt"&gt;--username&lt;/span&gt; admin &lt;span class="nt"&gt;--firstname&lt;/span&gt; FirstName &lt;span class="nt"&gt;--lastname&lt;/span&gt; LastName &lt;span class="nt"&gt;--role&lt;/span&gt; Admin &lt;span class="nt"&gt;--email&lt;/span&gt; email@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;/etc/systemd/system&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;airflow-webserver.service

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;airflow-scheduler.service

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;airflow-celery-flower.service

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;airflow-celery-worker.service

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start airflow-webserver

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start airflow-scheduler

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start airflow-celery-flower

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start airflow-celery-worker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Global gitignore</title>
      <dc:creator>Mahmudul Haque</dc:creator>
      <pubDate>Mon, 15 Nov 2021 10:23:02 +0000</pubDate>
      <link>https://dev.to/mahmudulhaque/global-gitignore-cbi</link>
      <guid>https://dev.to/mahmudulhaque/global-gitignore-cbi</guid>
      <description>&lt;p&gt;The .gitignore file is a powerful tool in Git for excluding certain files and directories from being tracked. However, it's essential to use it correctly and avoid including environment-specific exclusions in project-specific .gitignore files. In this article, we will discuss the proper usage of .gitignore files, distinguishing between project-specific and global exclusions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project-specific .gitignore&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The primary purpose of a project-specific .gitignore file is to exclude files and directories that are specific to the project itself. It helps in keeping the repository clean and prevents accidental commits of unnecessary or sensitive information.&lt;/p&gt;

&lt;p&gt;A good practice is to include only project-related files and directories in the project-specific .gitignore. This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build artifacts and compiled binaries&lt;/li&gt;
&lt;li&gt;Dependency directories (e.g., node_modules, venv, etc.)&lt;/li&gt;
&lt;li&gt;Generated files (e.g., log files, cache files, etc.)&lt;/li&gt;
&lt;li&gt;Sensitive information (e.g., credentials, API keys, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Build artifacts
build/
dist/

# Dependency directories
node_modules/
vendor/

# Generated files
*.log
*.cache

# Sensitive information
credentials.txt
secrets/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By focusing on project-specific exclusions, you ensure that anyone cloning or working on the project doesn't inadvertently commit or track unnecessary files. It keeps the repository clean and focused on the project itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global .gitignore&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While project-specific .gitignore files handle exclusions specific to a particular project, there may be files and directories that are not project-specific but should still be ignored across all Git repositories. Examples include IDE-specific files, operating system artifacts, and common build artifacts.&lt;/p&gt;

&lt;p&gt;To handle such global exclusions, Git provides the concept of a global .gitignore file. This file resides outside any project and defines exclusions that apply to all repositories on your local machine.&lt;/p&gt;

&lt;p&gt;To create a global .gitignore file, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the .gitignore file in your home directory or any other preferred location:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; ~/.gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure Git to use the global .gitignore file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.excludesfile ~/.gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the global .gitignore file is set up, you can include exclusion patterns that apply globally. One convenient way to obtain these patterns is by referencing the GitHub Gitignore repository, specifically the "Global" directory:&lt;/p&gt;

&lt;p&gt;Global .gitignore templates: &lt;a href="https://github.com/github/gitignore/tree/master/Global"&gt;https://github.com/github/gitignore/tree/master/Global&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the global .gitignore file, copy and paste the necessary exclusion patterns from the repository, depending on your specific requirements.&lt;/p&gt;

&lt;p&gt;By separating global exclusions from project-specific ones, you maintain a clean and focused .gitignore file for each project while ensuring that common exclusions are applied consistently across all repositories on your machine.&lt;/p&gt;

&lt;p&gt;Improved by: ChatGPT&lt;/p&gt;

</description>
      <category>git</category>
      <category>macos</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
