<?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 Dhanushpk on Medium]]></title>
        <description><![CDATA[Stories by Dhanushpk on Medium]]></description>
        <link>https://medium.com/@dhanushpk50?source=rss-e5994bf28219------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*m3qY76GULTqJGZe9</url>
            <title>Stories by Dhanushpk on Medium</title>
            <link>https://medium.com/@dhanushpk50?source=rss-e5994bf28219------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:27:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dhanushpk50/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[Commands I Actually Reach For as a Backend Engineer]]></title>
            <link>https://medium.com/@dhanushpk50/commands-i-actually-reach-for-as-a-backend-engineer-9a9c67e83df7?source=rss-e5994bf28219------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a9c67e83df7</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Dhanushpk]]></dc:creator>
            <pubDate>Sun, 05 Jul 2026 04:36:00 GMT</pubDate>
            <atom:updated>2026-07-05T04:36:00.811Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0NRJBhR4Q-H6GIoqN-ZPOg.jpeg" /></figure><p>Every “Linux cheat sheet” post ends up being a man-page dump nobody asked for. I wanted to write down the stuff that actually shows up in muscle memory — the commands I type without thinking when a service is down, a cert has silently expired, or port 8080 is serving something that makes no sense. If you run services on Ubuntu boxes, and increasingly on AWS on top of that, this is more or less my toolkit.</p><h3>What’s even running right now</h3><p>First thing in any incident is figuring out what’s alive and what’s actually listening on the port you think it is.</p><pre>ps aux | grep my-service        # find your app workers<br>ss -tulpn | grep :8080         # what&#39;s listening on 8080<br>lsof -i :8080                  # which process owns that port</pre><p>netstat still shows up in old runbooks but ss has basically replaced it. Honestly lsof -i :PORT is the one I use the most — it&#39;s saved me from restarting the wrong service more than once, which is embarrassing to admit but true.</p><p>Before reaching for kill -9, try -15 first so the process gets a chance to shut down cleanly instead of dropping connections mid-request.</p><pre>kill -15 12345<br>pkill -f &quot;my-service&quot;         # kill by pattern instead of hunting for a PID<br>htop                          # good for spotting a runaway worker eating CPU</pre><h3>Logs are where the actual story lives</h3><p>Nobody believes a dashboard until the logs back it up.</p><pre>tail -f -n 200 /var/log/app/service.log<br>journalctl -u my-service -f --since &quot;10 min ago&quot;<br>journalctl -u my-service -p err --since today</pre><p>I think journalctl is underused by a lot of people. If your service runs under systemd you get filtering by priority, time window, unit — no need to grep through five rotated files to find the one that matters. When you do need to dig into a specific failure window though:</p><pre>grep -A 5 &quot;idle_in_transaction&quot; /var/log/postgresql/postgresql.log<br>sed -n &#39;100,150p&#39; error.log        # jump to a line range<br>zgrep &quot;502&quot; app.log.1.gz           # grep inside gzipped/rotated logs</pre><p>And for traffic patterns, awk + sort + uniq -c still gets the job done:</p><pre>awk &#39;{print $1}&#39; access.log | sort | uniq -c | sort -rn | head   # top IPs hitting an endpoint</pre><h3>Systemd basics</h3><pre>systemctl status my-service -l<br>sudo systemctl restart my-service<br>sudo systemctl reload nginx              # reload config without dropping connections<br>sudo systemctl daemon-reload             # after editing a unit file<br>sudo systemctl enable --now my-service   # start now, and on boot<br>systemctl list-units --state=failed      # what&#39;s broken right now</pre><p>daemon-reload is the one everyone forgets after touching a .service file. You edit the config, restart, nothing changes, and you spend ten minutes confused before remembering.</p><h3>Networking and firewall</h3><pre>curl -kI https://api.example.com          # headers only, skip TLS verify<br>curl -v --resolve host:443:127.0.0.1 https://host   # test a vhost/SNI mapping locally<br>dig +short api.example.com<br>sudo ufw allow 8081/tcp<br>sudo iptables -L -n -v --line-numbers</pre><p>And if you’re running a VPN between machines — I set one up between a Mac and a Linux box recently — this is what you check when peers stop talking to each other:</p><pre>sudo wg show wg0        # check handshake / peer traffic<br>sudo wg-quick up wg0</pre><h3>SSL/TLS, or: why is this cert only broken on one port</h3><p>This one earns its own section because certificate problems are deceptively annoying. They work fine on one port and silently fail on another, and the error message basically never tells you why.</p><pre># Check a live cert&#39;s expiry and chain over the wire<br>echo | openssl s_client -connect host:8080 -servername host 2&gt;/dev/null | openssl x509 -noout -dates</pre><pre># Pull the serial number to cross-check against a revocation list<br>openssl x509 -in cert.pem -noout -serial</pre><pre># Full readable dump — issuer, SANs, validity<br>openssl x509 -in cert.pem -noout -text | grep -A1 &quot;Subject Alternative&quot;</pre><pre># Verify against a CA bundle<br>openssl verify -CAfile ca-bundle.crt cert.pem</pre><p>I hit exactly this a while back: two ports on the same Apache box, one serving a valid cert and the other still pointing at a revoked GoDaddy cert — status “Superseded,” of all things. Running openssl s_client -connect host:PORT against each port separately is the fastest way to catch that. Don&#39;t assume both ports are configured the same way just because they&#39;re sitting on the same vhost — apparently they very much aren&#39;t.</p><h3>Postgres, or: why is my API hanging</h3><pre>psql -h localhost -U app_user -d app_prod</pre><pre>-- who&#39;s connected and what are they doing right now<br>SELECT pid, usename, state, query, now()-query_start AS duration<br>FROM pg_stat_activity<br>WHERE state &lt;&gt; &#39;idle&#39;;</pre><pre>-- anything stuck waiting on a lock<br>SELECT * FROM pg_locks WHERE NOT granted;</pre><pre>-- kill a backend that&#39;s been sitting idle-in-transaction past your timeout<br>SELECT pg_terminate_backend(12345);</pre><p>This is the exact query pattern you want when a slow downstream call — a third-party KYC API, a payment gateway, whatever — hangs a worker while holding a transaction open. The connection eventually gets reaped by idle_in_transaction_session_timeout, and you get a wave of 502s that look completely unrelated to the actual cause until you check pg_stat_activity during the failure window itself. Learned that one the hard way debugging a third-party verification call that was taking almost five minutes to time out.</p><h3>Disk stuff</h3><pre>df -h                                    # is a filesystem about to fill up?<br>du -sh /var/log/* | sort -rh | head      # biggest log offenders<br>find /var/log -name &quot;*.log&quot; -mtime +14 -exec rm {} \;   # clean up old logs</pre><h3>The AWS side of things</h3><p>Once a service moves onto AWS, part of this workflow shifts to the CLI, but the mental model doesn’t really change: build, ship, watch the logs, check what’s running.</p><p><strong>Pushing a container to ECR → App Runner:</strong></p><pre># authenticate docker to ECR<br>aws ecr get-login-password --region ap-south-1 \<br>  | docker login --username AWS --password-stdin &lt;account-id&gt;.dkr.ecr.ap-south-1.amazonaws.com</pre><pre># build, tag, push<br>docker build -t my-service .<br>docker tag my-service:latest &lt;account-id&gt;.dkr.ecr.ap-south-1.amazonaws.com/my-service:latest<br>docker push &lt;account-id&gt;.dkr.ecr.ap-south-1.amazonaws.com/my-service:latest</pre><pre># trigger a new deployment<br>aws apprunner start-deployment --service-arn &lt;service-arn&gt;</pre><pre># check rollout status<br>aws apprunner describe-service --service-arn &lt;service-arn&gt; --query &#39;Service.Status&#39;</pre><p>If auto-deploy is turned on for the ECR trigger, that start-deployment call isn&#39;t even necessary — App Runner just picks up the new tag on push. Worth checking describe-service for that setting before you go hunting for why a push didn&#39;t roll out on its own.</p><p><strong>Monitoring and logs:</strong></p><pre># tail App Runner logs live<br>aws logs tail /aws/apprunner/my-service/&lt;service-id&gt;/application --follow</pre><pre># tail from any CloudWatch log group<br>aws logs tail /ecs/my-service --since 10m --follow</pre><pre># search a time range for a pattern<br>aws logs filter-log-events \<br>  --log-group-name /aws/apprunner/my-service/&lt;service-id&gt;/application \<br>  --filter-pattern &quot;ERROR&quot; \<br>  --start-time $(date -d &#39;30 minutes ago&#39; +%s000)</pre><pre># recent service events<br>aws apprunner list-operations --service-arn &lt;service-arn&gt;</pre><p><strong>Hosting basics:</strong></p><pre>aws s3 sync ./build s3://my-static-site-bucket --delete<br>aws cloudfront create-invalidation --distribution-id &lt;id&gt; --paths &quot;/*&quot;<br>aws route53 list-resource-record-sets --hosted-zone-id &lt;zone-id&gt;<br>aws ec2 describe-instances --filters &quot;Name=instance-state-name,Values=running&quot;</pre><h3>If I had to keep only two</h3><pre>sudo lsof -i :PORT<br>journalctl -u SERVICE -f --since &quot;10 min ago&quot;</pre><p>Find out who’s actually serving a port before you touch anything, then watch what’s happening in real time instead of five minutes ago. Everything else on this list is just answering the follow-up question once those two point you somewhere.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a9c67e83df7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating an On-Premises Oracle Database to AWS RDS Using S3]]></title>
            <link>https://medium.com/@dhanushpk50/migrating-an-on-premises-oracle-database-to-aws-rds-using-s3-b7e149ced7ee?source=rss-e5994bf28219------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7e149ced7ee</guid>
            <dc:creator><![CDATA[Dhanushpk]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 10:33:59 GMT</pubDate>
            <atom:updated>2026-06-28T10:33:59.605Z</atom:updated>
            <content:encoded><![CDATA[<p>Moving your Oracle database to the cloud doesn’t have to be complex. Using <strong>Oracle Data Pump</strong> and <strong>Amazon S3</strong> as a staging layer, you can migrate your entire database to AWS RDS for Oracle without any proprietary tools or third-party agents.</p><p>This guide walks you through the full process in three steps: export, upload, and import.</p><h3>Prerequisites</h3><p>Before you begin, make sure you have the following in place:</p><ul><li>An on-premises Oracle Database with admin access</li><li>An AWS account with IAM permissions for S3 and RDS</li><li>An Amazon S3 bucket (or permission to create one)</li><li>An AWS RDS for Oracle instance already provisioned</li><li>AWS CLI installed and configured on your on-premises server</li><li>SQL Developer or an equivalent Oracle client tool</li></ul><h3>Step 1: Export the On-Premises Database Using Data Pump</h3><p>Oracle Data Pump (expdp / impdp) is Oracle&#39;s high-speed utility for exporting and importing database objects. It&#39;s the recommended method for large migrations because it supports parallelism, compression, and granular filtering.</p><h4>Grant the required privileges</h4><p>Your Oracle user needs the DATAPUMP_EXP_FULL_DATABASE role to run a full export. If you only need to export specific schemas, the user just needs ownership of those schemas or the standard EXP_FULL_DATABASE privilege.</p><pre>GRANT DATAPUMP_EXP_FULL_DATABASE TO your_user;</pre><h4>Create a directory object</h4><p>Data Pump doesn’t write directly to filesystem paths — it uses <strong>directory objects</strong>, which are named aliases mapped to physical paths on your server. The Oracle process must have read and write access to the mapped path.</p><pre>CREATE OR REPLACE DIRECTORY dpump_dir AS &#39;/path/to/directory&#39;;<br>GRANT READ, WRITE ON DIRECTORY dpump_dir TO your_user;</pre><blockquote><strong><em>Note:</em></strong><em> Verify that </em><em>/path/to/directory is accessible by the OS user running the Oracle database process (typically </em><em>oracle).</em></blockquote><h4>Run the Data Pump export</h4><p>The command below performs a full database export with four parallel workers and splits output into 10 GB chunks — well suited for large databases.</p><pre>expdp your_user/your_password \<br>  FULL=Y \<br>  DIRECTORY=dpump_dir \<br>  DUMPFILE=database_dump_%U.dmp \<br>  LOGFILE=export.log \<br>  FILESIZE=10G \<br>  PARALLEL=4</pre><p><strong>Parameter breakdown:</strong></p><p>Parameter What it doesFULL=YExports the entire database, including all schemas and objectsDUMPFILE=%UThe %U placeholder generates sequentially numbered files, allowing parallel workers to write concurrentlyFILESIZE=10GSplits output into 10 GB chunks — easier to transfer and retry individually if neededPARALLEL=4Runs four worker processes simultaneously; increase this on multi-core serversLOGFILERecords progress and errors — always review before proceeding</p><h4>Verify the export</h4><pre>cat /path/to/directory/export.log</pre><p>Confirm all .dmp files are present and the log shows no errors before moving to the next step.</p><h3>Step 2: Upload the Dump Files to Amazon S3</h3><p>Amazon S3 acts as the bridge between your on-premises server and your RDS instance. RDS cannot reach your local filesystem directly, so staging the dump files in S3 is a required step.</p><h4>Install the AWS CLI</h4><p>Skip this if the CLI is already installed. For Linux:</p><pre>curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;<br>unzip awscliv2.zip<br>sudo ./aws/install</pre><h4>Configure your credentials</h4><pre>aws configure</pre><p>You’ll be prompted for your <strong>AWS Access Key ID</strong>, <strong>Secret Access Key</strong>, <strong>default region</strong> (e.g. ap-south-1), and output format (e.g. json).</p><h4>Create an S3 bucket (if needed)</h4><pre>aws s3 mb s3://your-s3-bucket-name</pre><h4>Upload the dump files</h4><p>Use the --recursive flag to upload the entire directory at once:</p><pre>aws s3 cp /path/to/dump/files s3://your-s3-bucket-name/exports/ --recursive</pre><h4>Verify the upload</h4><pre>aws s3 ls s3://your-s3-bucket-name/exports/</pre><p>Cross-check the file count and sizes against your local export directory before proceeding.</p><blockquote><strong><em>Security tip:</em></strong><em> Dump files contain your full database. Enable S3 server-side encryption (SSE-S3 or SSE-KMS), restrict bucket access with a tightly scoped IAM policy, and avoid making the bucket public under any circumstances.</em></blockquote><h3>Step 3: Import Data into RDS Oracle Using Data Pump</h3><p>With your dump files staged in S3, the final step is importing them into your RDS for Oracle instance. RDS handles this through the rdsadmin package, which lets the instance download files from S3 into its internal Data Pump directory.</p><h4>Set up an IAM role for S3 access</h4><p>Your RDS instance needs permission to read from your S3 bucket. Create an IAM role with the following trust policy and attach it to your RDS instance.</p><p><strong>Trust policy</strong> (allows RDS to assume the role):</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: { &quot;Service&quot;: &quot;rds.amazonaws.com&quot; },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}</pre><p><strong>Permissions policy</strong> (grants read access to your bucket):</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [&quot;s3:GetObject&quot;, &quot;s3:ListBucket&quot;],<br>      &quot;Resource&quot;: [<br>        &quot;arn:aws:s3:::your-s3-bucket-name&quot;,<br>        &quot;arn:aws:s3:::your-s3-bucket-name/*&quot;<br>      ]<br>    }<br>  ]<br>}</pre><p>Once the role is created, attach it to your RDS instance:</p><ol><li>Open the <strong>AWS RDS Console</strong></li><li>Select your Oracle instance → <strong>Modify</strong></li><li>Under <strong>IAM roles</strong>, add the role you just created with the feature set to S3_INTEGRATION</li><li>Apply and reboot the instance if prompted</li></ol><h4>Download dump files from S3 to RDS</h4><p>RDS for Oracle uses the rdsadmin.rdsadmin_s3_tasks.download_from_s3 procedure to pull files from S3 into the instance&#39;s internal Data Pump directory (DATA_PUMP_DIR).</p><p>Run the following for each dump file</p><pre>SELECT rdsadmin.rdsadmin_s3_tasks.download_from_s3(<br>  p_bucket_name =&gt; &#39;your-s3-bucket-name&#39;,<br>  p_s3_prefix   =&gt; &#39;exports/&#39;,<br>  p_directory_name =&gt; &#39;DATA_PUMP_DIR&#39;<br>) AS TASK_ID<br>FROM DUAL;</pre><p>This returns a task_id. Monitor the download progress using:</p><pre>SELECT text FROM TABLE(rdsadmin.rds_file_util.read_text_file(<br>  p_directory =&gt; &#39;BDUMP&#39;,<br>  p_filename  =&gt; &#39;dbtask-&lt;task_id&gt;.log&#39;<br>));</pre><p>Replace &lt;task_id&gt; with the value returned above. Wait until the log shows the download is complete before running the import.</p><h4>Run the Data Pump import</h4><p>Once all dump files are in DATA_PUMP_DIR, connect to your RDS instance and run impdp:</p><pre>impdp your_user/your_password@your_rds_endpoint:1521/your_db_service \<br>  FULL=Y \<br>  DIRECTORY=DATA_PUMP_DIR \<br>  DUMPFILE=database_dump_%U.dmp \<br>  LOGFILE=import.log \<br>  PARALLEL=4</pre><p><strong>A few things to keep in mind:</strong></p><ul><li>Use the same PARALLEL value you used during export for consistent file numbering</li><li>If you’re importing specific schemas only, replace FULL=Y with SCHEMAS=schema1,schema2</li><li>If object names or tablespaces differ between source and target, use the REMAP_SCHEMA or REMAP_TABLESPACE parameters</li></ul><pre># Example: remap schema and tablespace<br>impdp your_user/your_password@your_rds_endpoint:1521/your_db_service \<br>  SCHEMAS=source_schema \<br>  REMAP_SCHEMA=source_schema:target_schema \<br>  REMAP_TABLESPACE=old_tbs:new_tbs \<br>  DIRECTORY=DATA_PUMP_DIR \<br>  DUMPFILE=database_dump_%U.dmp \<br>  LOGFILE=import.log</pre><h4>Monitor the import</h4><pre>cat import.log</pre><p>Watch for ORA- errors. Common ones to handle:</p><p>ErrorCauseFixORA-31684Object already existsAdd TABLE_EXISTS_ACTION=REPLACE to overwriteORA-39083Object type failed to createUsually a privilege issue on the target — check grantsORA-01950No privileges on tablespaceGrant quota to the importing user on the target tablespace</p><h4>Post-import validation</h4><p>Once the import completes, run a few quick checks to confirm data integrity.</p><p><strong>Row count comparison</strong> — run this on both source and target:</p><pre>SELECT table_name, num_rows<br>FROM user_tables<br>ORDER BY table_name;</pre><p><strong>Invalid objects check</strong> — run on the RDS instance:</p><pre>SELECT object_name, object_type, status<br>FROM user_objects<br>WHERE status = &#39;INVALID&#39;;</pre><p>Recompile any invalid objects with:</p><pre>EXEC DBMS_UTILITY.COMPILE_SCHEMA(schema =&gt; &#39;YOUR_SCHEMA&#39;, compile_all =&gt; FALSE);</pre><p><strong>Constraint and index check:</strong></p><pre>SELECT constraint_name, constraint_type, status<br>FROM user_constraints<br>WHERE status = &#39;DISABLED&#39;;</pre><p>Re-enable any disabled constraints before switching traffic to the new instance.</p><blockquote><strong><em>Final tip:</em></strong><em> Before cutting over production traffic, run your application’s test suite against the RDS endpoint. Row counts and object counts match on paper, but application-level queries will surface any subtle data or permission issues that SQL-level checks miss.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7e149ced7ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MySQL Master–Slave Replication with Docker: Step-by-Step Setup Guide]]></title>
            <link>https://medium.com/@dhanushpk50/mysql-master-slave-replication-with-docker-step-by-step-setup-guide-4333b5ebd02f?source=rss-e5994bf28219------2</link>
            <guid isPermaLink="false">https://medium.com/p/4333b5ebd02f</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[database-replication]]></category>
            <dc:creator><![CDATA[Dhanushpk]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 05:06:00 GMT</pubDate>
            <atom:updated>2025-10-07T05:06:00.988Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Is MySQL Replication?</h3><p>In simple terms, <strong>MySQL replication</strong> means one database (called the <em>slave</em> or <em>replica</em>) continuously maintains an up-to-date copy of another database (the <em>master</em>).<br> Whenever data changes on the master, those changes are logged and replayed on the replica.</p><p>Replication is a key building block for scalability, backups, and disaster recovery — it helps distribute the load and ensures data safety when things go wrong.</p><h3>Environment Setup</h3><p>For this guide, we’ll create:</p><ul><li><strong>One master MySQL instance</strong> — running locally or in a Docker container</li><li><strong>One slave MySQL container</strong> — connected to the master</li><li><em>(Optional)</em> <strong>phpMyAdmin</strong> — to visually verify that replication works</li></ul><h3>Step 1: Create the Master MySQL Container</h3><p>Let’s start by spinning up the <strong>master instance</strong>.</p><pre>sudo docker run -d --name masterdb \<br>  -e MYSQL_ROOT_PASSWORD=rootpass \<br>  -p 3306:3306 mysql:latest</pre><p>This command launches a container named masterdb, exposes it on port 3306, and sets the root password.</p><p>Once it’s running, connect to MySQL with:</p><pre>docker exec -it masterdb mysql -u root -p</pre><h3>Step 2: Configure the Master Instance</h3><p>Open the MySQL configuration file inside the container:</p><pre>sudo docker exec -it masterdb bash<br>nano /etc/mysql/my.cnf</pre><p>Add the following under [mysqld]:</p><pre>[mysqld]<br>server-id = 1<br>log_bin = /var/log/mysql/mysql-bin.log<br>binlog_do_db = mydb     # Replace &#39;mydb&#39; with your actual database name</pre><p>Then create the log directory and restart MySQL:</p><pre>mkdir -p /var/log/mysql<br>chown mysql:mysql /var/log/mysql<br>service mysql restart</pre><h3>Step 3: Create a Replication User on the Master</h3><p>Inside the MySQL shell, create a user dedicated to replication:</p><pre>CREATE USER &#39;replica&#39;@&#39;%&#39; IDENTIFIED BY &#39;password&#39;;<br>GRANT REPLICATION SLAVE ON *.* TO &#39;replica&#39;@&#39;%&#39;;<br>FLUSH PRIVILEGES;</pre><p>Next, lock the tables and note down the binlog position:</p><pre>FLUSH TABLES WITH READ LOCK;<br>SHOW MASTER STATUS;</pre><blockquote><strong><em>Important:</em></strong><em> Save the </em><em>File and </em><em>Position values — you’ll need them when setting up the slave.</em></blockquote><h3>Step 4: Export Existing Data from the Master</h3><p>Before the slave starts syncing, we need to copy the master’s current data snapshot.</p><p>Run this <strong>while the master is still locked</strong>:</p><pre>mysqldump -u root -p --all-databases --master-data &gt; master_dump.sql</pre><p>Then unlock the tables:</p><pre>UNLOCK TABLES;</pre><p>Copy the master_dump.sql file to your host or directly into the slave container.</p><h3>Step 5: Create the Slave Container</h3><p>Launch a new container for the slave:</p><pre>sudo docker run -d --name slave1 \<br>  -e MYSQL_ROOT_PASSWORD=slavepass \<br>  -p 3307:3306 mysql:latest</pre><p>Now import the master’s data dump into the slave:</p><pre>docker cp master_dump.sql slave1:/master_dump.sql<br>docker exec -it slave1 bash<br>mysql -u root -p &lt; /master_dump.sql</pre><p>This ensures both databases start from the same state.</p><h3>Step 6: Connect the Slave to the Master</h3><p>Inside the slave’s MySQL shell:</p><pre>CHANGE MASTER TO<br>  MASTER_HOST=&#39;master_ip&#39;,<br>  MASTER_USER=&#39;replica&#39;,<br>  MASTER_PASSWORD=&#39;password&#39;,<br>  MASTER_LOG_FILE=&#39;mysql-bin.000001&#39;,<br>  MASTER_LOG_POS=1234;<br>  </pre><pre>START SLAVE;</pre><p>Replace the values master_ip,MASTER_LOG_POS with the <strong>file</strong> and <strong>position</strong> details you noted earlier in <strong>Step 3</strong>.</p><h3>Step 7: Verify Replication</h3><p>Check replication status:</p><pre>SHOW SLAVE STATUS\G</pre><p>Look for:</p><pre>Slave_IO_Running: Yes<br>Slave_SQL_Running: Yes</pre><p>If both say “Yes,” your replication is working correctly.<br> Try inserting a record on the master — it should appear on the slave shortly after.</p><h3>Optional: Connect via phpMyAdmin</h3><p>If you’re using phpMyAdmin for monitoring:</p><pre>sudo docker exec -it myadmin sh<br>cat /etc/phpmyadmin/config.user.inc.php<br>sudo docker restart myadmin</pre><p>You can now manage both master and slave databases through the UI.</p><h3>Final Thoughts</h3><p>MySQL also supports <strong>channels</strong>, which let a single slave connect to more than one master at the same time, keeping each stream of updates separate. This is useful if you ever need to bring data together from multiple sources.</p><p>In production, replication is usually combined with:</p><ul><li><strong>Monitoring</strong>—keeping an eye on replication lag so queries don’t read stale data.</li><li><strong>Failover tools</strong> like Orchestrator or MHA to promote a slave if the master goes down.</li><li><strong>Semi-synchronous replication</strong> to ensure data safety (avoiding loss if the master crashes before a change is copied).</li><li><strong>Read/write splitting</strong> at the application level, where writes go to the master and heavy reads go to replicas.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4333b5ebd02f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing Your Name on GitHub: An Adventure in Commit Mapping]]></title>
            <link>https://medium.com/@dhanushpk50/unleashing-your-name-on-github-an-adventure-in-commit-mapping-40fe98923ab5?source=rss-e5994bf28219------2</link>
            <guid isPermaLink="false">https://medium.com/p/40fe98923ab5</guid>
            <category><![CDATA[github-contribution-graph]]></category>
            <dc:creator><![CDATA[Dhanushpk]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 16:17:51 GMT</pubDate>
            <atom:updated>2024-01-03T16:17:51.834Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered if your name could make an appearance on the GitHub contribution map? Imagine a digital tapestry woven with your commits forming the shape of your name across the GitHub landscape. That’s precisely what the <a href="https://github.com/dhanush788/GitHub-Name-Mapper">GitHub Name Mapper</a> script is all about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*-bsBXK-35gJlSDtBfbzyMg.png" /></figure><h3>Embarking on a Digital Journey</h3><p>Have you ever felt the urge to leave a unique mark on your GitHub profile, beyond the lines of code? The <a href="https://github.com/dhanush788/GitHub-Name-Mapper">GitHub Name Mapper</a> script opens a door to this possibility. But before diving into this exhilarating experience, let’s embark on the journey step by step.</p><h3>The Call to Adventure</h3><p>Picture this: You’ve cloned the <a href="https://github.com/dhanush788/GitHub-Name-Mapper">GitHub Name Mapper</a> repository, installed the necessary dependencies, and opened your terminal. A single command, node index.js, sets the wheels in motion.</p><h3>Your Name in Commits</h3><p>Upon completion, head over to your GitHub profile’s contribution map for the year 2018. There it is, your name elegantly etched across the days, manifested through commit activity.</p><h3>The Customization Power</h3><p>The <a href="https://github.com/dhanush788/GitHub-Name-Mapper">GitHub Name Mapper</a> isn’t just about names; it’s a canvas awaiting your creativity.</p><h3>Contribute to GitHub Name Mapper</h3><p>We welcome contributions from the community to enhance and expand the GitHub Name Mapper project. Whether you have ideas for new features, improvements, or bug fixes, your contributions are valuable in making this tool more versatile and user-friendly.</p><h4>How to Contribute</h4><ol><li>Fork the repository: Start by forking the GitHub Name Mapper repository to your GitHub account.</li><li>Make changes: Make necessary changes or additions to the codebase in your forked repository.</li><li>Create a Pull Request (PR): Once you’re satisfied with your changes, submit a Pull Request to the main repository. Ensure that you provide a clear description of the changes you’ve made and any relevant details.</li><li>Collaborate: Engage in discussions with maintainers and other contributors about your Pull Request to address feedback and refine your contribution.</li><li>Adhere to guidelines: Please follow the project’s guidelines, coding standards, and best practices while contributing.</li></ol><p>Your contributions, whether they involve code improvements, documentation enhancements, or feature suggestions, are greatly appreciated and help in evolving the GitHub Name Mapper for the community. Thank you for considering contributing to this project!</p><h3>Share Your Experience</h3><p>We love hearing about your experiences using the GitHub Name Mapper! Whether you’ve successfully mapped your name on the contribution map or experimented with creating unique designs, your stories and achievements are inspiring to us and the community.</p><h4>How to Share</h4><ol><li>Write about it: Share your GitHub Name Mapper journey, tips, or any unique designs you’ve created on your blog, social media, or GitHub repository README.</li><li>Tag us: If you post about your experience on social media platforms, tag us or use the project’s official link!</li><li>Feedback and suggestions: If you have feedback, suggestions for improvement, or ideas for future enhancements, feel free to reach out to us through GitHub discussions or by opening an issue in the repository.</li></ol><p>We’re excited to hear about your adventures with the GitHub Name Mapper. Your stories and feedback inspire us to continue developing and improving this project for the community. Thank you for being a part of this journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40fe98923ab5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>