Sunday, December 21, 2025

Differences in connecting to MySQL from Bash Console and from MySQL Console (At PythonAnywhere)

To See All Articles About Technology: Index of Lessons in Technology
#1 MySQL Console

#2 Bash Console (With Error Message)

Can you tell me what's the issue with my bash

Yes — this is a very common PythonAnywhere confusion, and your setup is actually fine 👍
The issue is not your bash. It’s where MySQL exists on PythonAnywhere.


What you’re seeing (and why)

✅ Image 1 (MySQL console works)

You opened PythonAnywhere’s MySQL console:

pgsql
MySQL: ashishjain1545$default Server version: 8.0.40 Source distribution

✔ This is PythonAnywhere’s managed MySQL server
✔ It lives on PythonAnywhere infrastructure, not inside your bash VM
✔ PythonAnywhere connects you using TCP, not a local socket

So this works ✅


❌ Image 2 (Bash → mysql fails)

In the Bash console you ran:

bash
mysql

And got:

vbnet
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

This happens because:

There is NO local MySQL server running inside your bash container
/var/run/mysqld/mysqld.sock does not exist
❌ PythonAnywhere does not allow you to run MySQL locally

So Bash is doing exactly what it should — it’s just looking in the wrong place.


🔑 Key Concept (Important)

On PythonAnywhere:

ThingExists?
Local MySQL server in bash❌ No
/var/run/mysqld/mysqld.sock❌ No
PythonAnywhere MySQL service✅ Yes
Access via TCP host✅ Yes

✅ Correct way to use MySQL from Bash on PythonAnywhere

You must specify host, user, and database:

bash
mysql \ -u ashishjain1545 \ -h ashishjain1545.mysql.pythonanywhere-services.com \ -p

OR (short form):

bash
mysql -u ashishjain1545 -h ashishjain1545.mysql.pythonanywhere-services.com -p

Then enter your MySQL password (from the Databases tab).


❌ What NOT to do on PythonAnywhere

bash
mysql mysql -u root mysql -u ashish mysql --socket=/var/run/mysqld/mysqld.sock

These only work on machines where MySQL is installed locally, which PythonAnywhere does not allow.


✅ Correct mental model

Think of PythonAnywhere like this:

arduino
[ Your Bash Console ] | | TCP v [ PythonAnywhere MySQL Server ]

Not:

css
[ Bash ][ Local MySQL ]

✅ Summary (TL;DR)

  • ✔ Your MySQL is working

  • ✔ Your bash is working

  • ❌ There is no local MySQL daemon

  • ✅ Always connect using -h <username>.mysql.pythonanywhere-services.com

  • ✅ Or use the MySQL console tab (which you already did)


Query: $ mysql -u ashishjain1545 -h ashishjain1545.mysql.pythonanywhere-services.com -p
Tags: Technology,Database,Cloud,

Saturday, December 20, 2025

Project Setup For "Reading App Using React Native" (Dec 2025)

To See All React Native Articles: Index of Lessons in Technology

1. Clone the repository.

https://github.com/ashishjain1547/pvt_reading_mobile_app_using_react_native

2. Create a local working copy.

/home/jain/Desktop/ws/react_native_apps/Reading_App_For_Bright_Orange

3. Connect test device (phone/tablet) with the laptop

How I enabled "Wireless Debugging" on my Samsung phone

4. Trial launch of the app on the test device (phone/tablet)

5. Check whether the backend API is operational.

https://ashishjain1545.pythonanywhere.com/

6. Setup the local database (MySQL) DB Details (local and remote) can be found here: /home/jain/Desktop/ws/react_native_apps/Reading_App_For_Bright_Orange/design_documents/flask_app.py db_details = { "host": "localhost", "user": "ashish", "password": "pass", "database": "reading_app_v2" } Testing in MySQL Workbench (local)
Checking if remote DB also has this one table: reading_artifacts
Query: show tables; Well: the mobile app on the device won't be able to connect to local DB so we would need to work with the hosted (remote) DB.

7: Getting 'create' statement for a table

Query: SHOW CREATE TABLE reading_artifacts; CREATE TABLE `reading_artifacts` ( `id` int NOT NULL AUTO_INCREMENT, `book_title` varchar(255) DEFAULT NULL, `sequence_number_as_per_book` int DEFAULT NULL, `reading_artifact_type` varchar(150) NOT NULL, `reading_artifact_title` varchar(4000) DEFAULT NULL, `reading_artifact_text` varchar(4000) DEFAULT NULL, `reading_artifact_metadata` longtext, `image_base64` mediumtext, `description_hindi` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `soft_delete_flag` tinyint(1) NOT NULL DEFAULT '0', `date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb3;

8: Basic Report From 'reading_artifacts'

select id, book_title, sequence_number_as_per_book, reading_artifact_type, reading_artifact_title from reading_artifacts order by book_title, reading_artifact_type, sequence_number_as_per_book;

9: How to launch the app

$ pwd /home/jain/Desktop/ws/private/pvt_reading_mobile_app_using_react_native TO START THE METRO SERVER: $ npx react-native start TO CHECK IF YOUR DEVICE IS CONNECTED: (base) jain@jain-ThinkPad-T440s:~/Desktop/ws/private/pvt_reading_mobile_app_using_react_native$ adb devices List of devices attached adb-R9ZY3098GYX-8MEOzx._adb-tls-connect._tcp device TO RUN THE APP ON THE DEVICE: $ npx react-native run-android Addendum Repository for design documents / supporting code / meeting notes and presentations related to this app: https://github.com/ashishjain1547/reading_app_design_docs_for_bright_orange_school
Tags: Technology,React Native,

How I enabled "Wireless Debugging" on my Samsung phone

To See All React Native Articles: Index of Lessons in Technology

1 - Settings

2 - About Phone

3 - Software Information

Tap 'Build Number' 7 times to enable 'Developer Options'

4 - Settings with Developer Options Enabled

5 - Wireless Debugging Settings in Developer Options

6 - Wireless Debugging Settings

7 - Pairing Development Laptop and Test Device (Phone)

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps/Reading_App_For_Bright_Orange$ adb version Android Debug Bridge version 1.0.41 Version 36.0.0-13206524 Installed as /home/jain/Android/Sdk/platform-tools/adb Running on Linux 6.14.0-37-generic (x86_64) 'Pair Device With Pairing Code' Screen on my phone
(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps/Reading_App_For_Bright_Orange$ adb pair 192.168.1.3:38407 Enter pairing code: 698705 Successfully paired to 192.168.1.3:38407 [guid=adb-R9ZY3098GYX-8MEOzx]

One Cause For Connection Refused Error With "adb connect" Command...

  • adb pair 192.168.1.3:39931SUCCESS

  • adb connect 192.168.1.3:46419Connection refused

This happens because pairing port ≠ connection port.

Get the correct IP:PORT Re-open Wireless Debugging info on phone On your Android phone: Settings → Developer options → Wireless debugging You will see two things: IP address & Port (this is the port you must use with adb connect) Pair with pairing code (you already did this) 👉 Note the IP:PORT shown under “Wireless debugging”, NOT the pairing dialog. Code (base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps/Reading_App_For_Bright_Orange$ adb connect 192.168.1.3:46419 (base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps/Reading_App_For_Bright_Orange$ adb devices List of devices attached adb-R9ZY3098GYX-8MEOzx._adb-tls-connect._tcp device
Tags: Technology,React Native,

When 5 + 5 + 5 = 550


See All: Motivation For Interview Preparation


A small riddle about big thinking

At first glance, it sounds like a bad joke or a trick meant to waste time.

5 + 5 + 5 = 550
Using just one line, validate this statement.

Anyone with basic arithmetic will immediately object.
It’s wrong. Plainly, obviously, mathematically wrong.

And that’s exactly where most people stop.

But this question isn’t about arithmetic. It never was.


The candidate’s first reaction: resistance

The candidate in the interview reacts the way most of us would:

  • “This isn’t a mathematical statement.”

  • “It’s not a computer-generated expression either.”

  • “It’s literally impossible to solve.”

All of those statements are correct.
And yet, they miss the point.

The interviewer isn’t testing math.
They’re testing how you think when the rules aren’t clear.


A subtle shift: from solving to validating

Pressed to try anyway, the candidate does something interesting.

Instead of trying to force a solution, they reframe the problem.

They add a single line — not to make the equation true, but to make the logic valid:

5 + 5 + 5 ≠ 550

With one small stroke, the statement is now correct.

Is this what the panel originally had in mind?
Probably not.

Is it still a valid solution?
Absolutely.

This is the moment where reasoning matters more than correctness.


Why this answer is actually brilliant

From an interviewer's perspective, the candidate demonstrated something crucial:

  • They questioned the assumptions of the problem

  • They didn’t panic under ambiguity

  • They reframed the objective instead of rejecting it outright

That’s lateral thinking in action.

In real-world work—engineering, data science, product design—the hardest problems rarely come with clean constraints. The ability to say “maybe we’re interpreting this wrong” is often more valuable than knowing the formula.


The “expected” solution (and the hidden trick)

After the discussion, the interviewer reveals another way to solve it.

Look closely at the symbols.

If you draw a slanted line through the first plus sign, it turns into a 4:

545 + 5 = 550

Suddenly, the equation works.

Most people are trained to see:

  • standing lines

  • sleeping lines

But slanted lines often escape perception.

That’s the trick.


The deeper lesson

This question isn’t about cleverness for its own sake. It highlights a fundamental idea:

Constraints are often softer than they appear.

Some people try to solve problems strictly inside the box.
Others step back and ask whether the box itself can move.

Competitive interviews, research problems, and real-life decision-making all reward the second group.


Final thought

When you encounter a problem that feels impossible, pause before rejecting it.

Ask yourself:

  • Am I solving the problem, or just reacting to its presentation?

  • What assumptions am I treating as fixed?

  • Is there another way to interpret “one line”?

Sometimes, the smartest move isn’t to calculate faster —
it’s to see differently.

As always, think laterally.
And good luck.

Is the AI Bubble About to Burst?


See All Articles on AI

Bitcoin, Bubbles, and the Madness of Crowds

There’s a dangerous idea quietly circulating in modern culture: don’t think you’re special; don’t think you know better than the crowd. It sounds humble, even virtuous. But history tells us something very different.

When independent thinking is dismissed, when skepticism is framed as ignorance, societies don’t become wiser—they become fragile. And nowhere is this more visible than in financial bubbles.

Today, I want to talk about Bitcoin, crypto, and speculative manias—not with hype, and not with hatred, but with history.


When the Greatest Investors Call It “Rat Poison”

“Bitcoin is rat poison squared.”

Those are not my words. They belong to Charlie Munger, echoed repeatedly by Warren Buffett—two of the most successful investors in human history. Together, their investment track record runs into millions of percent over decades.

When people like that speak, it’s worth listening.

To be clear: Bitcoin’s price performance has been extraordinary. Anyone who bought early and held deserves recognition for the returns they achieved. I’ve felt that pull myself.

In 2016, I was close to buying roughly $150,000 worth of Bitcoin. At today’s prices, that stake would have been worth somewhere between $20–25 million. I didn’t do it—not because I lacked conviction, but because transferring money into crypto at the time was operationally difficult.

A friend of mine did take the plunge. He bought Ethereum at around 50 cents and sold near $1,400—a roughly 2,800× return. Stories like his aren’t rare. We’ve all heard about people who jumped into something absurd-sounding and walked away rich.

And that’s exactly the problem.


FOMO: An Ancient Survival Instinct in Modern Markets

FOMO—fear of missing out—is not a personality flaw. It’s evolutionary.

For most of human history, survival depended on belonging to the group. Being excluded meant danger: no food, no protection, no mating opportunities. That wiring never left us.

So when everyone around us seems to be getting rich, when dissent is mocked and skepticism labeled ignorance, our instincts scream: get in or be left behind.

Even the greatest minds are not immune.

In the 1700s, Isaac Newton invested in the South Sea Company. He made money, exited wisely—then watched others grow richer. He re-entered at the peak. The bubble collapsed, and Newton lost a fortune.

Afterward, he famously remarked:

“I can calculate the movement of heavenly bodies, but not the madness of men.”


How Crowds Rewrite Reality

Psychology reinforces this lesson.

In the famous Smoke-Filled Room experiment (1968), participants sat in a room completing paperwork when smoke began pouring in. When alone, most people immediately reported the danger. But when surrounded by others who calmly ignored it, nearly 90% did nothing.

The presence of a crowd didn’t make people safer—it made them blind.

Financial bubbles work the same way.


A Short History of Financial Madness

Every major bubble follows a familiar script:

  1. A real innovation appears

  2. Speculation overtakes utility

  3. Prices rise because prices are rising

  4. Dissent is ridiculed

  5. Collapse follows

Tulip bulbs in the 1630s traded for the price of houses.
Railways in the 1840s promised a new world—and delivered bankruptcies.
The Roaring Twenties had cars, electricity, and radios—followed by the Great Depression.
The dot-com era had the internet—Wall Street, media hype, and “new economy” logic—then an 85% Nasdaq crash.

The technology was always real.
The pricing never was.


The Emperor’s New Clothes, Revisited

In Denmark, we grow up with Hans Christian Andersen’s The Emperor’s New Clothes. Two fraudsters convince an emperor they’ve made magical garments invisible only to the unworthy. No one admits they see nothing—until a child speaks the obvious truth.

Financial bubbles depend on the same social pressure.

Nobody wants to be the “stupid one” who doesn’t get it.


Bitcoin and the Largest Bubble Yet

Let’s look at scale.

Buffett and Munger often reference market capitalization to GDP as a broad measure of financial excess:

  • 1929: ~89%

  • 2000 (dot-com peak): ~136%

  • 2007 (pre-financial crisis): ~107%

  • Today: ~226%

This is not normal.

Bitcoin alone is up over 1.2 million percent since 2012. The Nasdaq and crypto markets now move in near-lockstep. In the dot-com crash, the Nasdaq fell 85%—and that bubble was far smaller than today’s AI-and-crypto-fueled exuberance.

Bitcoin historically falls more than the Nasdaq in downturns.

If we enter a recession—and rising unemployment has always preceded recessions—what happens when the broader market cracks?

A 95% drawdown in Bitcoin is not unthinkable. It is historically consistent.


Technology ≠ Guaranteed Returns

None of this denies the reality of blockchain technology—just as railways, electricity, and the internet were real. But innovation does not protect investors from overpaying.

Markets don’t crash because technology fails.
They crash because expectations detach from reality.


The Hardest Truth

Bitcoin may survive. Crypto may survive. Some companies will emerge stronger.

But bubbles do not deflate gently. They burst.

And when they do, the crowd that once mocked skepticism will insist no one could have seen it coming.

History says otherwise.

Sometimes, it takes the courage to be the child in the crowd—the one willing to say: the emperor isn’t wearing any clothes.

Warren Buffett and Charlie Munger did.
So did Isaac Newton—after it was too late.

The rest of us still have time to listen.

Friday, December 19, 2025

Dream Job Webinar - By Vikram Anand



Apply For 3-Hour Webinar
Apply For 3-Day Workshop in Jan 2026

3 Hour - Dream Job Webinar

These screenshots are taken from the webinar



Apply For 3-Hour Webinar
Apply For 3-Day Workshop in Jan 2026 Tags: Interview Preparation,