Monday, March 9, 2026

How to run your LLM locally on your laptop/PC/Mac?? #LMStudio

Interact with the locally deployed LLM using the below Python SDK using LM Studio.

Click here for LM Studio Python SDK documentation -  https://lmstudio.ai/docs/python 

Ollama by Meta is another option for you to run your LLMs locally on your laptop/PC/Mac.

Visit https://ollama.com/ for more details.

Post your questions if any & I shall try to answer.

Follow me on my social media accounts here -  https://linktr.ee/krmadhukar 

Thursday, February 26, 2026

How to run a command or script at regular intervals in Linux. Any alternative for crontab?

 To run a Linux command every 5 seconds, you have a few reliable options depending on what you prefer: watch, a while loop, or using cron (though cron can only go as low as 1 minute).

Here are the best methods 👇


✅ 1. Using watch (simplest method)

watch -n 5 <your-command>

Example:

watch -n 5 ls -l

➡️ Runs ls -l every 5 seconds and shows the output updating on screen.


✅ 2. Using an infinite while loop

This gives more control, supports complex commands, and works in any shell.

while true; do
    <your-command>
    sleep 5
done

Example:

while true; do
    date
    sleep 5
done


✅ 3. Using a one-liner while loop

while true; do <your-command>; sleep 5; done

Example:

while true; do curl -I https://example.com; sleep 5; done


🚫 Cron? Not suitable

Cron runs at minimum 1-minute intervals, so it cannot run every 5 seconds.


To run a cron job every 1 minute, you can use the * * * * * syntax in your crontab.

Here’s how to set it up 👇


✅ Step 1: Open the crontab

crontab -e


✅ Step 2: Add a cron entry with 1‑minute interval

Use this format:

* * * * * <your-command>

Example: run a script every minute:

* * * * * /home/user/myscript.sh

Example: append timestamp to a log every minute:

* * * * * echo "$(date)" >> /home/user/time.log


✅ Step 3: Save and exit

  • If using nanoCTRL + O, then CTRL + X
  • If using vim:wq

📝 Tips and Best Practices

1️⃣ Redirect output to avoid cron emails

* * * * * <your-command> >/dev/null 2>&1

2️⃣ Ensure the script is executable

chmod +x /home/user/myscript.sh

3️⃣ Use full paths in cron

Cron runs in a limited environment, so:

❌ Avoid:

python3 script.py

✔️ Use:

/usr/bin/python3 /home/user/script.py



Wednesday, November 26, 2025

Termius or macOS Terminal keyboard shortcuts

 Termius on Mac uses standard macOS shortcuts along with some specific commands for its unique features like the Command Palette and split view. 

General Actions
Action Shortcut
Command Palette (access tabs/hosts)Command-K
Jump between tabsCommand-J
New connection/tabCommand-T
Open local terminalCommand-L
Open side panel (snippets/history)Command-S
Split window into two panesCommand-D
Close split paneShift-Command-D
Close tabCommand-W
Terminal Navigation & Text Editing (Standard Unix/Mac)
These shortcuts are standard for most command-line interfaces on macOS and work in Termius: 
  • Go to beginning of lineControl-A
  • Go to end of lineControl-E
  • Delete from cursor to beginning of lineControl-U
  • Delete from cursor to end of lineControl-K
  • Navigate by wordOption-Left Arrow or Option-Right Arrow
  • Reverse search command historyControl-R
  • Autocomplete directory/file nameTab (type characters, then press Tab once or twice)
  • Send break (equivalent to Ctrl-C in shell)Command-. (period) 
Copy/Paste 
  • CopyCommand-C
  • PasteCommand-V
  • Paste selectionShift-Command-V 

Sunday, November 23, 2025

AI Agents Learning resources

 📹 Videos:

1. LLM Introduction: https://www.youtube.com/watch?v=zjkBMFhNj_g

2. LLMs from Scratch: https://www.youtube.com/watch?v=9vM4p9NN0Ts

3. Agentic AI Overview (Stanford): https://www.youtube.com/watch?v=kJLiOGle3Lw

4. Building and Evaluating Agents: https://www.youtube.com/watch?v=d5EltXhbcfA

5. Building Effective Agents: https://www.youtube.com/watch?v=D7_ipDqhtwk

6. Building Agents with MCP: https://www.youtube.com/watch?v=kQmXtrmQ5Zg

7. Building an Agent from Scratch: https://www.youtube.com/watch?v=xzXdLRUyjUg

8. Philo Agents: https://www.youtube.com/playlist?list=PLacQJwuclt_sV-tfZmpT1Ov6jldHl30NR


🗂️ Repos

1. GenAI Agents: https://github.com/nirdiamant/GenAI_Agents

2. Microsoft's AI Agents for Beginners: https://github.com/microsoft/ai-agents-for-beginners

3. Prompt Engineering Guide: https://lnkd.in/gJjGbxQr

4. Hands-On Large Language Models: https://lnkd.in/dxaVF86w

5. AI Agents for Beginners: https://github.com/microsoft/ai-agents-for-beginners

6. GenAI Agentshttps://lnkd.in/dEt72MEy

7. Made with ML: https://lnkd.in/d2dMACMj

8. Hands-On AI Engineering:https://github.com/Sumanth077/Hands-On-AI-Engineering

9. Awesome Generative AI Guide: https://lnkd.in/dJ8gxp3a

10. Designing Machine Learning Systems: https://lnkd.in/dEx8sQJK

11. Machine Learning for Beginners from Microsoft: https://lnkd.in/dBj3BAEY

12. LLM Course: https://github.com/mlabonne/llm-course


🗺️ Guides

1. Google's Agent Whitepaper: https://lnkd.in/gFvCfbSN

2. Google's Agent Companion: https://lnkd.in/gfmCrgAH

3. Building Effective Agents by Anthropic: https://lnkd.in/gRWKANS4.

4. Claude Code Best Agentic Coding practices: https://lnkd.in/gs99zyCf

5. OpenAI's Practical Guide to Building Agents: https://lnkd.in/guRfXsFK


📚Books:

1. Understanding Deep Learning: https://udlbook.github.io/udlbook/

2. Building an LLM from Scratch: https://lnkd.in/g2YGbnWS

3. The LLM Engineering Handbook: https://lnkd.in/gWUT2EXe

4. AI Agents: The Definitive Guide - Nicole Koenigstein:  https://lnkd.in/dJ9wFNMD

5. Building Applications with AI Agents - Michael Albada: https://lnkd.in/dSs8srk5

6. AI Agents with MCP - Kyle Stratis: https://lnkd.in/dR22bEiZ

7. AI Engineering: https://www.oreilly.com/library/view/ai-engineering/9781098166298/


📜 Papers

1. ReAct: https://lnkd.in/gRBH3ZRq

Credit : Rakesh Gohel on LinkedIn

Featured

TechBytes on Linux

This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...

Popular Posts