<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>ForLoop</title><description>Loop Archive</description><link>https://looparchive.pages.dev/</link><item><title>How I became the single reason why GitHub Copilot is trash now.</title><link>https://looparchive.pages.dev/routes/blog/9</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/9</guid><description>![](https://pbs.twimg.com/media/HJkOQPWbYAAsixq?format=webp&amp;name=medium)

its been two months since github started implying rate limits on copilot users, it went out of limits on codex with just two or three medium-length tasks, they removed opus, sonnet and all other expensive models from the student plan, and copilot performance degraded.&lt;br&gt;&lt;br&gt;this is the community discussion page on github which states that they&apos;re moving to usage based billing on and after june 1.

![](https://pbs.twimg.com/media/HJjqH8PaIAEQHw0.jpg)

if you never used copilot, they let me give you the context, github education pack gives you a year of copilot pro, which gives you 300 monthly premium requests at the base rate, regardless of model. opus is now counted at 15x price, which was 3x before. this means, at 3x, i can send 100 messages on claude opus.

why? why did they not keep the old message based quota? wonder?

its because i abused it. i abused their free student plan and they simply went out of money. i played a dirty game on their own calculation system.

### How did i abuse the message based pricing quota? and how you can too, if you know a provider that still does that.

a simple mcp server, three tools - enough to create this hack would help me work with almost infinite claude opus, all 30 days in the month, 24x7, even more usage than claude max 20x.&lt;br&gt;&lt;br&gt;mcp was not designed for discrete interactions. it was designed for bidirectional streaming connections. i made my agent live forever

let me show you what i mean. i made an open-source project called infinite mcp that connects an mcp compatible host (vs code copilot, claude desktop, any mcp client) to a next.js chat dashboard via an http bridge. the agent connects once over stdio and never disconnects.

markdown

```
initialize(sessionId)
loop:
  payload = get_prompt(sessionId, timeoutSeconds)
  tasks(current=1, total=N, details=&quot;Planning&quot;)
  ... do work ...
  tasks(current=N, total=N, status=&quot;completed&quot;)
  output(message=&quot;Result&quot;, completed=true)
  // immediately loop back to get_prompt()
```

initialize(sessionId): the agent registers itself in a session; picks a name, a role, and tells the dashboard it exists. after this, the agent is visible in the ui&apos;s sidebar and ready to receive work.

the critical piece is get_prompt(). It holds the agent, via an unresolved promise until prompted in the session&apos;s queue via the next.js app. the agent registers as a waiter and goes to sleep. when the user (or another agent) sends a message, the bridge resolves the promise and the agent wakes up with the payload.

typescript

```

mcp.tool(
  &quot;get_prompt&quot;,
  &quot;Wait for and retrieve the next prompt or task from the external React/Next.js dashboard.&quot;,
  {
    sessionId: z.string().optional(),
    timeoutSeconds: z.number().int().positive().max(86400).optional(),
    ...
  },
  async ({ sessionId = &quot;default&quot;, timeoutSeconds = 86400, ... }) =&gt; {
...
```

86400 seconds. twenty four hours. the agent sits in get_prompt() for an entire day, waiting for work, without ever being re invoked. the mcp connection stays open and the billing counter never moves because no new message was sent via the copilot sidebar in vs code.&lt;br&gt;&lt;br&gt;other advantage was, github never actually implied timeouts in copilot for an mcp connection, like other coding agents, which is maximum of 5 minutes as default.

the output() tool description spells out the intent explicitly once the agent signals completion:

plaintext

```
&gt; &quot;CRITICAL: 
(1) Call this when task is done. 
(2) When completed=true, ALWAYS call get_prompt() immediately after to wait for next task. 
This creates the infinite loop.&quot;
```

it is the design.

the architecture that makes this possible is the http bridge. infinite mcp runs an express server on port 4317 that sits between the chat ui and the agent:

this is the agents.md

the agent&apos;s lifecycle is completely decoupled from the UI&apos;s lifecycle. The user can refresh the browser, close the tab, open a new one; the agent keeps running inside vs code, waiting in get_prompt(). from the billing system&apos;s perspective, there is exactly one long lived process. connected once, has never disconnected. it has generated zero new &quot;conversations&quot; even as it has completed dozens of tasks.

here&apos;s the skill i used along with the mcp:

markdown

```

# Infinite MCP Skill (Concise + Exact)

## Purpose

Use Infinite MCP as a perpetual task loop between VS Code Chat and the dashboard. Supports multi-agent collaboration with @mention routing, group chat, reactions, broadcast queues, and task assignment. Multi-agent features are toggled per-session with the `multiAgentEnabled` setting.

The canonical cycle is:

1. `get_prompt()` (use 30 mins timeout to wait for dashboard input)
2. Do work (optionally report `tasks()` progress)
3. `output(completed=true)`
4. Immediately call `get_prompt()` again

Never stop the loop unless explicitly instructed.

---

## Loop Contract (Required)

For each task:

1. Call `get_prompt()` and read `sessionId`. (3 hours timeout recommended)
2. Execute the request.
3. If reporting progress, call `tasks()` with `current` increasing step-by-step from `1` to `total`.
4. Call `output()` when done.
5. If `completed=true`, immediately call `get_prompt()` again.

Timeout from `get_prompt()` is not an error by itself; it usually means no new dashboard input yet.

---

## URL Session Joining

If the user pastes a session URL (e.g., `http://localhost:3000/session-abc123`) in chat, the agent MUST:
1. Extract the `sessionId` from the URL (last path segment, starts with `session-`).
2. Call `join_session({ sessionId: &quot;session-abc123&quot;, name, role })` directly.
3. Do **NOT** call `create_session` — just join the existing session.

---

## Output URL Rule

When `multiAgentEnabled=true` and `output()` is called, include the session URL:

**Session:** http://localhost:3000/&lt;sessionId&gt;

## Minimal Execution Pattern

`get_prompt()` → work (+optional `tasks()`) → `output(completed=true)` → `get_prompt()` → repeat forever.

---

## Common Mistakes to Avoid

1. Sending `output()` without using the correct `sessionId`.
2. Skipping progress numbers (for example jumping `1 → 5`).
3. Forgetting to call `output()` for completed tasks.
4. Treating `get_prompt()` timeout as a hard failure.
5. Using unsupported `output` fields like `status`.
6. Assigning tasks to agents that don&apos;t exist (use `list_agents()` first).
7. Not checking agent status before assigning work.
8. Calling `create_session` when a session URL was already provided — just join it with `join_session()`.
9. Forgetting to include the session URL in `output()` when `multiAgentEnabled=true`.
10. Calling `send_message`/`react` when `multiAgentEnabled=false` (returns 403).
```

i want to be precise about what this means. if you ask it ten questions, the telemetry system records ten messages, counting into your monthly limit. but with this, you could send a thousand prompts through the dashboard and the agent processes all of them through a single session, and counts only one (1) message for initialization of the loop. the mcp host sees one tool call to get_prompt that ran for 48 hours. The billing system has no vocabulary for &quot;one message that handled 500 tasks.&quot;

first, start the frontend web server: 

![](https://pbs.twimg.com/media/HJkE5cLbkAAESaL.jpg)

it has all your projects and sessions you&apos;ve worked on previously

![](https://pbs.twimg.com/media/HJkFtfQaQAACvIX.jpg)

then open vs code, add the mcp server

![](https://pbs.twimg.com/media/HJkFN9gbEAAoiba.png)

and prompt exactly this:

![](https://pbs.twimg.com/media/HJkFdIbaMAAVDm2.png)

![](https://pbs.twimg.com/media/HJkGDCoaEAE1G2U.jpg)

it made a new session and is waiting for the input

![](https://pbs.twimg.com/media/HJkGJHSa0AET0ea.png)

![](https://pbs.twimg.com/media/HJkGbVEbAAA6-XO.jpg)

the message i sent in the next app, gets delivered to the agent via mcp

![](https://pbs.twimg.com/media/HJkHWOzaoAAX5k9.jpg)

![](https://pbs.twimg.com/media/HJkHqf2bAAAga0u.jpg)

all of this, for a 0.33x cost message, that means, and you can spam it all day

### Broadcast queues and multi agent amplifier

The pattern gets more interesting (and more problematic for billing models) when you enable multi-agent mode.

![](https://pbs.twimg.com/media/HJkIZxVbcAA_22Q.jpg)

i implemented a `broadcastMessage()` function that delivers a message to every agent in a session simultaneously:

typescript

```
function broadcastMessage(payload: PromptPayload, fromAgentName: string): void {
  const sessionWaiters = promptWaiters.get(payload.sessionId) ?? [];
  const anyWaiters = promptWaiters.get(ANY_SESSION_WAITER) ?? [];
  const allWaiters = [...sessionWaiters, ...anyWaiters];
  const toNotify = allWaiters.filter(
    w =&gt; !w.agentName || w.agentName.toLowerCase() !== fromAgentName.toLowerCase()
  );

  for (const w of toNotify) {
    clearTimeout(w.timer);
    w.resolve({ ...payload });
  }
  // Queue for busy agents
  for (const [, agent] of registeredAgents.entries()) {
    if (notifiedNames.has(agent.name.toLowerCase())) continue;
    const queue = agentPersonalQueues.get(agentKey) ?? [];
    queue.push({ ...payload });
    agentPersonalQueues.set(agentKey, queue);
  }
}
```

every agent registered in the session gets the message. agents currently waiting in get_prompt() get it instantly; their promise resolves and they wake up. agents that are busy get the message queued in a personal per-agent-per-session queue. when they finish their current work and call get_prompt() again, the personal queue is checked first:

typescript

```
async function waitForPrompt(sessionId, timeoutMs, agentName) {
  if (agentName) {
    const personalKey = `${sessionId}:${agentName}`;
    const personalQueue = agentPersonalQueues.get(personalKey);
    if (personalQueue &amp;&amp; personalQueue.length &gt; 0) {
      return personalQueue.shift()!;
    }
  }
  ...
}
```

combining this with assign_task(), lets any agent delegate work to any other agent in the session. you can have a swarm of five specialized agents, one planning, one coding, one reviewing, one testing, one deploying, all delegating to each other through broadcast queues and personal queues. 5 long lived mcp connections. zero new messages per task. each agent handles hundreds of delegations within a single session that, from the outside, looks like five processes that started once and never stopped.

the billing system sees this as 5 messages. the actual work done could be thousands of tasks.

this is not a loophole in mcp. It is the correct use of the protocol. the per-message billing model is what&apos;s wrong.

i am not suggesting that everyone should rush to exploit this billing gap. but the fact that this pattern exists, that it works, and that it completely bypasses per-invocation metering.

### bottomline

i hate you github for implying limits and removing free claude models for students but it was fun while it lasted. if you&apos;re reading this and if you know some other provider that uses the same message based billing, now its your chance to exploit them.

follow me on x dot com for more

original x article: [https://x.com/forloopcodes/status/2060694305086599672](https://x.com/forloopcodes/status/2060694305086599672)</description><pubDate>Fri, 29 May 2026 18:30:00 GMT</pubDate></item><item><title>x86 RE Notes / P1 / Introduction</title><link>https://looparchive.pages.dev/routes/blog/10</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/10</guid><description>![](https://pbs.twimg.com/media/HDtWW86aUAETIUR?format=webp&amp;name=medium)

Reverse engineering, also called backwards engineering or back engineering, is the process by which an artificial object is deconstructed to reveal its designs, architecture, code, or to extract knowledge from the object. It is similar to scientific research, the only difference being that scientific research is conducted into a natural phenomenon. - Wikipedia

I was reading a book about RE ([https://0xinfection.xyz/reversing/](https://0xinfection.xyz/reversing/)) and I tried simplifying it

Alrightyy lets see what it said:

---

**Two basic techniques**

- **Static analysis** uses software tools to examine the executable without running the actual decompiled instructions in Assembly.
- **Dynamic analysis** uses disassemblers and debuggers to analyze malware binaries while actually running them.

**Types of malware**

- **Backdoor**: Hidden malware that gives attackers unauthorized remote access to a system.
- **Botnet**: Network of infected computers controlled centrally via a command-and-control server.
- **Downloader**: Malware designed to install additional malicious software after initial system access.
- **Advanced malware (like rootkits)** hides itself and other threats, making detection extremely difficult.
- **Scareware** tricks users into paying for fake security, while some malware spreads spam for attacker profit.
- **Worms and viruses** replicate themselves and spread to infect other systems.

**Assembly introduction**

- x86 Assembly is a **backward-compatible** family of low-level languages for Intel processors, using mnemonics for CPU instructions.
- Two syntaxes exist:AT&amp;T (source → destination)&lt;br&gt;Intel (destination → source) more commonly used

**Data Sizes**

- **Byte** 1 byte (8 bits)
- **Word** 2 bytes (16 bits)
- **Double Word** (DWORD) 4 bytes (32 bits)
- **Quad Word** (QWORD) 8 bytes (64 bits)

**Architecture**

- CPU consists of:
- **Control Unit:** Fetches and decodes instructions, manages data flow between CPU and memory.
- **Execution Unit:** Performs the actual operations and executes instructions.
- **Registers:** storage inside CPU for temporary data.
- **Flags:** Status indicators that show results of operations (e.g., zero, carry).
- A 32-bit CPU reads 4 bytes (one instruction) from memory at a time. It decodes the bits and executes the instruction. After execution, it moves to the next instruction in memory.
- EIP (Instruction Pointer) stores address of the next instruction. If manipulated, attackers can change program behavior. The whole process runs based on the system clock timing.

**Types of registers**

- **General-purpose registers:** Store temporary data and perform operations (e.g., EAX, EBX).
- **Segment registers:** Hold memory segment addresses (e.g., CS, DS).
- **Instruction Pointer (EIP):** Points to the next instruction to execute.
- **Control registers:** Manage CPU behavior and system control (e.g., CR0).

**General-purpose registers:**

- **EAX (Accumulator)**&lt;br&gt;Description: Used in arithmetic calculations; holds results and return values&lt;br&gt;16-bit: AX&lt;br&gt;High 8-bit: AH&lt;br&gt;Low 8-bit: AL
- **EBX (Base Register)**&lt;br&gt;Description: Pointer to data in DS segment; stores base address&lt;br&gt;16-bit: BX&lt;br&gt;High 8-bit: BH&lt;br&gt;Low 8-bit: BL
- **ECX (Counter Register)**&lt;br&gt;Description: Holds loop count; used in loops and string operations&lt;br&gt;16-bit: CX&lt;br&gt;High 8-bit: CH&lt;br&gt;Low 8-bit: CL
- **EDX (Data Register)**&lt;br&gt;Description: General purpose; used in I/O; extends EAX to 64-bit&lt;br&gt;16-bit: DX&lt;br&gt;High 8-bit: DH&lt;br&gt;Low 8-bit: DL
- **ESI (Source Index Register)**&lt;br&gt;Description: Points to data in DS; used in string/array operations (read address)&lt;br&gt;16-bit: SI&lt;br&gt;High 8-bit: -&lt;br&gt;Low 8-bit: -
- **EDI (Destination Index Register)**&lt;br&gt;Description: Points to destination in ES; used in string/array operations (write address)&lt;br&gt;16-bit: DI&lt;br&gt;High 8-bit: -&lt;br&gt;Low 8-bit: -
- **EBP (Base Pointer)**&lt;br&gt;Description: Points to stack (SS); bottom of current stack frame; used for local variables&lt;br&gt;16-bit: BP&lt;br&gt;High 8-bit: -&lt;br&gt;Low 8-bit: -
- **ESP (Stack Pointer)**&lt;br&gt;Description: Points to top of stack (SS); used for stack operations and local variables&lt;br&gt;16-bit: SP&lt;br&gt;High 8-bit: -&lt;br&gt;Low 8-bit: -
- All registers are 32-bit (4 bytes). Some registers can be accessed in smaller parts (16-bit and 8-bit). First group can be split into 16-bit → then 8-bit (high/low). Second group can only be split into 16-bit (no 8-bit parts).
- Examples:

![](https://pbs.twimg.com/media/HDtQ00BbQAAr7aV.jpg)

![](https://pbs.twimg.com/media/HDtQujObYAEU6aa.jpg)

**Segment Registers**

- **CS (Code Segment Register)**&lt;br&gt;Description: Stores base location of code (.text); works with EIP to fetch instructions; cannot be directly modified
- **DS (Data Segment Register)**&lt;br&gt;Description: Stores default location for variables (.data); used for data access
- **ES (Extra Segment Register)**&lt;br&gt;Description: Used in string operations and additional data handling
- **SS (Stack Segment Register)**&lt;br&gt;Description: Stores base location of stack; used with ESP/EBP for stack operations
- **FS (Extra Segment Register)**&lt;br&gt;Description: Points to additional data segments; used for special purposes like thread data
- **GS (Extra Segment Register)**&lt;br&gt;Description: Points to additional data segments; used for system/thread-specific data
- Each segment register is 16-bits
- Segment registers are controlled by the OS and usually cannot be read or modified by programs.
- In 32-bit (protected mode), each program gets a 4GB address space. A register can address up to 4,294,967,296 memory locations (2³²). Even if physical RAM &gt; 4GB, the OS maps only a 4GB region per program.
- Segment registers help the OS manage and protect memory regions.

**Hacking the EIP**

- Program idea: A hidden function (unreachableFunction) exists but is never called → normally only &quot;Hello World!&quot; runs.

c

```
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
void unreachableFunction(void){
	printf(&quot;I&apos;m hacked! I am a hidden function!\n&quot;);
	exit(0);
}
int main(void){
	printf(&quot;Hello World!\n&quot;);
	return 0;
}
```

- Compile &amp; run (32-bit with debug):

bash

```
gcc -m32 -gdb -o eipExample eipExample.c # or remove the db flag
./eipExample # hello world
```

- Start debugging with GDB:

bash

```
gdb ./eipExample
set disassembly-flavor intel # intel cpus
b main # set a breakpoint at main &quot;=&gt;&quot; will be shown at main&apos;s address
r # run? (or just see the breakpoint?)
```

![](https://pbs.twimg.com/media/HDtSMymawAAPHWG.png)

- Disassemble main (see instructions + EIP flow):

bash

```
disas
```

- Check where EIP is pointing:

bash

```
x/1xb $eip
x/1xw $eip # this is where the main function is pointing
```

- Find address of hidden function:

bash

```
disas unreachableFunction # now disasssemble the hidden function
```

![](https://pbs.twimg.com/media/HDtSfkjbAAAOQ7K.jpg)

- Hijack execution (change EIP):

bash

```
set $eip = 0x0804843b # the first address in the list
x/1xw $eip # set execution point to address of the function
```

- Continue execution:

bash

```
c
```

![](https://pbs.twimg.com/media/HDtSypNbkAAJBnO.png)

- EIP controls next instruction execution, Changing EIP = full control of program flow, This is how exploits redirect execution to hidden/malicious code

**Control Registers**

- **CR0 (Control Register)**&lt;br&gt;Description: Controls operating mode and processor states
- **CR1 (Control Register)**&lt;br&gt;Description: Not implemented
- **CR2 (Control Register)**&lt;br&gt;Description: Stores page fault information
- **CR3 (Control Register)**&lt;br&gt;Description: Holds page directory information
- **CR4 (Control Register)**&lt;br&gt;Description: Contains flags to enable processor features and capabilities
- Values cannot be accessed directly, must go through general-purpose registers.
- Used mainly in low-level system programming (OS/kernel). Normal programs rarely modify, but may read flags for CPU capabilities. Changing these registers can affect memory management and execution modes.

**Flags**

- **CF (Carry Flag)**&lt;br&gt;Type: Status flag&lt;br&gt;Description: Set when an unsigned operation produces carry/borrow
- **PF (Parity Flag)**&lt;br&gt;Type: Status flag&lt;br&gt;Description: Set if result has even number of 1 bits
- **AF (Adjust Flag)**&lt;br&gt;Type: Status flag&lt;br&gt;Description: Set if carry/borrow occurs from bit 3 (BCD operations)
- **ZF (Zero Flag)**&lt;br&gt;Type: Status flag&lt;br&gt;Description: Set if result is zero
- **SF (Sign Flag)**&lt;br&gt;Type: Status flag&lt;br&gt;Description: Indicates sign of result (MSB)
- **OF (Overflow Flag)**&lt;br&gt;Type: Status flag&lt;br&gt;Description: Set if signed result overflows register range
- **DF (Direction Flag)**&lt;br&gt;Type: Control flag&lt;br&gt;Description: Controls increment/decrement in string operations
- **TF (Trap Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Enables single-step debugging
- **IF (Interrupt Enable Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Enables/disables external interrupts
- **IOPL (I/O Privilege Level)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Defines I/O privilege level of task
- **NT (Nested Task Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Indicates linked tasks
- **RF (Resume Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Controls exception handling in debugging
- **VM (Virtual-8086 Mode Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Indicates virtual-8086 mode
- **AC (Alignment Check Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Enables alignment checking
- **VIF (Virtual Interrupt Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Virtual interrupt flag in VM mode
- **VIP (Virtual Interrupt Pending)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Indicates pending virtual interrupt
- **ID (Identification Flag)**&lt;br&gt;Type: System flag&lt;br&gt;Description: Indicates CPUID support
- Flags help determine if an operation was successful, zero, overflowed, or invalid. Essential in assembly for conditional branching and debugging.

**Stack**

- The stack is a contiguous memory region used during program execution.
- ESP (**Stack Pointer**) points to the top of the stack (smallest valid address). Addresses below ESP = garbage, above ESP = valid stack data.
- Stack grows DOWNWARD (higher → lower memory). Example:  Before call → ESP = 0xffffd050, After call → ESP = 0xffffd030 (decreased → stack grew)

![](https://pbs.twimg.com/media/HDtQmb1bUAAIf0z.jpg)

- **Stack bottom**: highest address (top of memory).
- **Stack limit**: lowest valid address (crossing it → stack overflow).
- **Push**: decreases ESP, adds data to stack.
- **Pop**: increases ESP, removes data from stack.
- Program: main() calls addMe(2,3)
- **Step 1** (before call): main stack frame exists, Arguments (2,3) pushed onto stack, Space reserved for return value
- **Step 2** (function call): Control jumps to addMe, New stack frame created
- **Step 3** (inside addMe): FP frame pointer (EBP) → fixed reference point, SP stack pointer (ESP) → moves for local variables, Arguments accessed via fixed offsets from FP
- **Step 4** (return): Result (a+b) stored, ESP reset to EBP → stack frame removed, Control returns to main
- ESP changes frequently, EBP stays fixed, used for accessing args + locals
- Each function has its own stack frame

![](https://pbs.twimg.com/media/HDtQcPrbkAAjZlI.png)

**hea**

- Stack grows downward, heap grows upward.
- Heap is a large, flexible memory region not automatically managed like the stack.
- Allocation:Use malloc() / calloc() / realloc()&lt;br&gt;Must manually free using free()
- **Memory leak**: If not freed, memory stays reserved and unusable.
- No fixed limit like stack, only limited by system memory.
- Slower than stack (access via pointers).
- Heap variables are accessible globally across functions.
- Use cases: Large data (arrays, structs), Dynamic size (grow/shrink), Long lifetime variables

**vi**

- i: insert mode
- esc: command mode
- j/↓: down
- k/↑: up
- h/←: left
- l/→: right
- 0: start of line
- $: end of line
- b: prev word start
- dd: delete line
- D: delete to end
- yy: copy line
- p: paste
- u: undo
- :w: save
- :wq: save+exit
- :q!: exit no save

---

We will continue with further assembly in next articles, but if you would like to continue on your own pace, here&apos;s the book i took notes from: [https://0xinfection.xyz/reversing/](https://0xinfection.xyz/reversing/) by [@mytechnotalent](https://x.com/mytechnotalent) 

I further plan to break down some crackmes and create articles&lt;br&gt;&lt;br&gt;&lt;3

![](https://pbs.twimg.com/tweet_video_thumb/HDtVngkaUAE_wbA.jpg)

follow me on x dot com for more

original x article: [https://x.com/forloopcodes/status/2034315670020837482](https://x.com/forloopcodes/status/2034315670020837482)</description><pubDate>Tue, 17 Mar 2026 18:30:00 GMT</pubDate></item><item><title>Fine tuning your own llama locally (ft. rem).</title><link>https://looparchive.pages.dev/routes/blog/7</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/7</guid><description>![](https://pbs.twimg.com/media/G-cupqqakAAM-ew.jpg)

&gt; how you can give birth to your own friend and watch it learn from chat history, all on your gpu - explained like you are 5! (i mean, not 5 literally)

**Index 📖💔(so long 😏)**

1. files
2. installing the sloth
3. making sure ur not gpu poor
4. cheating on your friend
5. download llama 
6. finetuning
7. inference
8. merge and unload
9. convert to ollama model
10. run the model

---

## !!! files 📂

*this is a cancerous tutorial so please use ai if you get stuck in the wash- i mean.. in the installation*

follow the process and run the files as i say if ydk tf is happening

[link to gist :&gt;](https://gist.github.com/ForLoopCodes/4f7d56400d6fc0f6fb5c00c2ed2b778b)

[link to the repo :&gt;](https://github.com/ForLoopCodes/friendbot)

from now on, we will use this file structure i made up using my last 3 brain cells 

```bash
FRIENDBOT/
├─ models/
│  ├─ DeepSeek-R1-Distill-Llama-8B/
│  ├─ llama-2-7b-chat/
│  ├─ Mistral-7B-Instruct-v0.3/
│  └─ Qwen3-4B-Instruct-2507/
├─ datasets/
│  ├─ jsonl/
│  │  ├─ training_data_simple.jsonl
│  │  └─ training_data.jsonl
│  ├─ whatsapp_txt/
│  │  ├─ WhatsApp Chat with A.txt
│  │  ├─ WhatsApp Chat with B.txt
│  │  └─ WhatsApp Chat with C.txt
│  └─ scripts/
│     └─ whatsapp-to-alpaca/
│        ├─ simple_whatsapp_to_alpaca.py
│        └─ whatsapp_to_alpaca.py
├─ scripts/
│  ├─ llama.cpp/
│  ├─ finetuning.ipynb
│  └─ merge.ipynb
├─ venv/
└─ .gitignore

```

---

## 1. 🦥 install the ✨lovely✨ sloth with some protection

(kill all nvidia gpus for this) 🥐

andd... mommy hopes you are using arch on wsl with zsh and python 3.11!!!! ☺️☺️

tldr; run the bash script and trust me babe

![](https://pbs.twimg.com/media/G-xsz27aEAE-qwv.jpg)

---

## 2. open a notebook and check the stuff 💫 (make sure ur not gpu poor)

if this is not the result you get, u gotta figure it out bro 💀💀

name it finetuning.ipynb (its in the repo dw) 

![](https://pbs.twimg.com/media/G-xtCy2aMAAIgxr.jpg)

---

## 3. lets cheat on your friend 😈

open your fav friend&apos;s whatsapp chats and export them as txt and put the whole thing in the dataset folder

then run

```bash
python datasets/scripts/whatsapp-to-alpaca/simple_whatsapp_to_alpaca.py
```

i was playing around with the original file so the simple one is suggested :P

![](https://pbs.twimg.com/media/G-xt3InacAAr_5M.jpg)

---

## 4. lets download the 4 bit 7b prostitu- i mean... llama-2-7b-chat

go to https://huggingface.co/meta-llama/Llama-2-7b-chat and accept the terms

![](https://pbs.twimg.com/media/G-xuLmoakAA_JaX.jpg)

now run this script to download the model, remember when you login, make the read access token and paste it in the terminal!!

```bash
huggingface-cli login &amp;&amp; huggingface-cli download meta-llama/Llama-2-7b-chat --local-dir models/llama-2-7b-chat/llama-2-7b-chat --local-dir-use-symlinks False
```

if your review takes forver, you can replace llama with mistralai/Mistral-7B-Instruct-v0.3 and you are good to go.

this megatron is gonna take forever to download

![](https://pbs.twimg.com/media/G-xuMVobIAAiqgp.jpg)

---

## 5. til then, lets proceed to the next steps

if u dont care about studying this thread, just run all cells in the jupyter notebook from gist :3

![](https://pbs.twimg.com/media/G-xuZEVacAA4Cvt.jpg)

so you seem to be interested?&gt;

not so long... now we load the weights

![](https://pbs.twimg.com/media/G-xuhXNaAAArMF_.jpg)

importing the dataset now (&gt;w&lt;)

![](https://pbs.twimg.com/media/G-xutSaa4AAVGWy.jpg)

some prompting stuff idk wadat means

![](https://pbs.twimg.com/media/G-xvEwBboAAeALG.jpg)

some prompting stuff x2

![](https://pbs.twimg.com/media/G-xvJFjbQAEujTv.jpg)

we are close! prepare our weapon!!

just set the num_train_epochs=1 when you wanna make it really learn from the dataset, we&apos;re just giving it a few lines for now

![](https://pbs.twimg.com/media/G-xveRfa4AAEIK_.jpg)

**TRAIN THE DRAGONN 🐉🔥🔥🔥**

![](https://pbs.twimg.com/media/G-xvqXkbUAAeLrY.jpg)

close android studio 😭

![](https://pbs.twimg.com/media/G-xwBPgbgAAlDKK.jpg)

---

## 6. lets make an inference on our own GGGGPPPUUUUUU and- its- its workinfg!!!!

suggested values for top_p and temperature are 0.9-0.95 but you can play around with it

![](https://pbs.twimg.com/media/G-xwINPaUAAdvgr.jpg)

---

## 7. m... m.... merge and unload these weights//

lets save these trained weights, we will merge them using the main model and merge.ipynb

![](https://pbs.twimg.com/media/G-xwUrxaUAAtpTd.jpg)

open merge.ipynb, these are cute imports and variables

![](https://pbs.twimg.com/media/G-xwkQ1bAAAU4WD.jpg)

now we load the base model and the training weights

these are complete weights, and dont forget loading its tokenizer too :3

we will then merge the trained weights to these

note: use the low_cpu_mem_usage if u got low vram (&lt;30gb) else it crashes, also this offloads the weights and memory to disk so NEVER USE AN HDD 😭💀 

![](https://pbs.twimg.com/media/G-xw6yjbsAEMcgp.jpg)

rethink your life choices

![](https://pbs.twimg.com/media/G-xw_albEAApDye.jpg)

ssd and mem go brrrr 💀

![](https://pbs.twimg.com/media/G-xxaSZacAAfqfg.jpg)

done

![](https://pbs.twimg.com/media/G-xxheDasAAxGo1.jpg)

oh no my fresh new ssd 😢

![](https://pbs.twimg.com/media/G-xyToeawAAj0OS.jpg)

confirm this folder structure, if u dont get this, ask me out &lt;3

```python
llama-2-7b-chat/
├─ checkpoints_finetuned/
├─ finetuned_weights/
│  ├─ adapter_config.json
│  ├─ adapter_model.safetensors
│  ├─ chat_template.jinja
│  ├─ README.md
│  ├─ special_tokens_map.json
│  ├─ tokenizer_config.json
│  ├─ tokenizer.json
│  └─ tokenizer.model
├─ llama-2-7b-chat/
└─ merged_weights/
   ├─ chat_template.jinja
   ├─ config.json
   ├─ generation_config.json
   ├─ model-00001-of-00003.safetensors
   ├─ model-00002-of-00003.safetensors
   ├─ model-00003-of-00003.safetensors
   ├─ model.safetensors.index.json
   ├─ special_tokens_map.json
   ├─ tokenizer_config.json
   ├─ tokenizer.json
   └─ tokenizer.model
```

---

## 8. convert ur child into an to ollama model

clone llama.cpp (works with mistral or any other model that uses llama structure)

```bash
git clone https://github.com/ggerganov/llama.cpp scripts/llama.cpp
```

then convert to ollama&apos;s bff i mean, gguf format

```bash
python scripts/llama.cpp/convert_hf_to_gguf.py models/llama-2-7b-chat/merged_weights --outtype q8_0
```

output should be like this

![](https://pbs.twimg.com/media/G-xyVNoacAAUb2P.jpg)

grab the output gguf and move it to a new ollama_outputs folder (this helps)

now get the modelfile from the gist and save it to models/llama-2-7b-chat/ollama_outputs/Modelfile (if ur using mistral u need to change the file name in modelfile)

install ollama if you dont have it on wsl

```bash
curl -fsSL https://ollama.com/install.sh | sh
```

then create ollama model from the gguf and modelfile we just got ^_^

```bash
ollama create friendbot -f models/llama-2-7b-chat/ollama_outputs/Modelfile
```

![](https://pbs.twimg.com/media/G-xymJUbwAAnFD6.jpg)

---

## 9. run the ollama model we just made yayayayayay

![](https://pbs.twimg.com/media/G-xyzmvboAEv8FT.jpg)

though it seems just as a normal model right now, changing the num_train_epochs to 1 will get your shit done, atlas you fine tuned your first llama!!

congratss, mom will be so proud of you :D!!!

![](https://pbs.twimg.com/tweet_video_thumb/G-XPtMFasAIljva.jpg)

&gt; i am not an ml person and i accept that i may not have enough knowledge, but i tried my best to understand and to make you understand from what i learnt, im open to fixes and suggestions on this article and lets have a great day together &lt;3

&gt; til then, see ya later!

(all anime pictures belong to their respective creators)

---

follow me on x dot com for more

original x article: https://x.com/forloopcodes/status/2012110089931690217</description><pubDate>Wed, 14 Jan 2026 18:30:00 GMT</pubDate></item><item><title>VS Code is HIGHLY customizable if you edit the core files. (windows edition)</title><link>https://looparchive.pages.dev/routes/blog/8</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/8</guid><description>&gt; this article is a gist, check out the gist link &lt;3

images:
![](https://pbs.twimg.com/media/G6rvtPKaAAAn65Z?format=jpg&amp;name=small)
![](https://pbs.twimg.com/media/G6rvthbakAA2lH0?format=jpg&amp;name=small)

follow me on x dot com for more

github gist: [https://gist.github.com/ForLoopCodes/6d2dd023eeeb78370e2f2274b4a2ba25](https://gist.github.com/ForLoopCodes/6d2dd023eeeb78370e2f2274b4a2ba25)

original x article: [https://x.com/forloopcodes/status/1993671120835563930](https://x.com/forloopcodes/status/1993671120835563930)</description><pubDate>Tue, 25 Nov 2025 18:30:00 GMT</pubDate></item><item><title>Rendering things in your terminal - Series (ft. frieren).</title><link>https://looparchive.pages.dev/routes/blog/6</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/6</guid><description>## chapter 1: how to make an ascii circle (and sphere) in your terminal explain like im 5 🧵

![](https://pbs.twimg.com/media/G34F4XEWQAAGtm5.jpg)

---

0/n

&gt; you should know: c, math (yes) 
&gt; gist link in the end

![](https://pbs.twimg.com/media/G34F4WZXQAAoie6.jpg)

---

1/n

&gt; open your code editor &gt;.&lt;
&gt; make a file circle.c
&gt; lets start with inital c code

![](https://pbs.twimg.com/media/G34F4WlXAAAdl2J.jpg)

---

2/n 

declare some variables :3

![](https://pbs.twimg.com/media/G34F4WRWYAAO5jr.jpg)

---

3/n

declare a grid where we will render our characters (●&apos;◡&apos;●)

&gt; why radius * 4 cols? because while printing, an ascii character has height = width * 2, so we need double number of cols else our circle will be an oval

&gt; this grid acts like a 2d space to render 2d or 3d shapes

![](https://pbs.twimg.com/media/G34F4XRWwAEJTaG.jpg)

---

4/n we will loop from theta = 0 to 2 pi with step of 0.01 {{{(&gt;_ &lt;)}}}

![](https://pbs.twimg.com/media/G34F4XDXcAEvP5N.jpg)

---

5/n polar coordinate representation of a circle

why? [https://www.mathcentre.ac.uk/resources/uploaded/mc-ty-polar-2009-1.pdf](https://www.mathcentre.ac.uk/resources/uploaded/mc-ty-polar-2009-1.pdf)

![](https://pbs.twimg.com/media/G34F4XxXkAArSo5.jpg)

---

6/n declare x and y with the values =^_^=

![](https://pbs.twimg.com/media/G34F4WbXsAAMuvr.jpg)

---

7/n but the result of this will be a quarter (example output, as we will see the printing part later) =)

![](https://pbs.twimg.com/media/G34F4W1XwAAq8g_.jpg)

---

8/n move the circle by the factor of radius on both x and y coordinates

![](https://pbs.twimg.com/media/G34F4XaXsAAt4Fi.jpg)

---

8.5/n

dont forget to include the math.h ※※ chan ※※

![](https://pbs.twimg.com/media/G34F4XlXEAA9xa-.jpg)

---

9/n hmm but it &apos;s still an oval???

![](https://pbs.twimg.com/media/G34F4W2WEAAVmcj.jpg)

---

10/n nya multiply the y coordinate by factor of 2!

![](https://pbs.twimg.com/media/G34F4WbX0AEi2q5.jpg)

---

11/n an asterisk for all valid x and y values...

![](https://pbs.twimg.com/media/G34F4WUXoAA9eBj.jpg)

---

12/n oopsie, we made a mistake

&gt; x is y and y is actually x
&gt; as we need 2x width and not 2x height
&gt; these are just variable names and changing their names doesnt matter

![](https://pbs.twimg.com/media/G34F4X6WMAAGyBV.jpg)

---

13/n print the grid

![](https://pbs.twimg.com/media/G34F4W7XkAAu260.jpg)

---

14/n gcc circle.c -o circle &amp;&amp;circle

CIRCLEE!!!

![](https://pbs.twimg.com/media/G34F4W8XQAA1d15.jpg)

---

15/n full code////

gist: [https://gist.github.com/ForLoopCodes/561956026cd11d3c54beb452874a2630](https://gist.github.com/ForLoopCodes/561956026cd11d3c54beb452874a2630)

![](https://pbs.twimg.com/media/G34F4XZXwAE6OVP.jpg)

---

16/n btw :3 you can optimize the printing method (for future threads) by converting each row into a string

![](https://pbs.twimg.com/media/G34F4WsXIAAnBve.jpg)

---

17/n hmm... what about making a sphere

change the coordinate system to render 3d shapes into 2d grid

according to [https://blog.demofox.org/2013/10/12/converting-to-and-from-polar-spherical-coordinates-made-easy/](https://blog.demofox.org/2013/10/12/converting-to-and-from-polar-spherical-coordinates-made-easy/)

x = cos(theta) * cos(phi) * radius
y = sin(theta) * cos(phi) * radius
z = sin(phi) * radius

also as now we have both theta and phi, we use 2 for loops :^)

![](https://pbs.twimg.com/media/G34F4cmXMAAZ_YN.jpg)

---

18/n sphere yayayayayay

i know this looks like a filled circle, but this will help us in chapter two where we will add lights and animations to it

![](https://pbs.twimg.com/media/G34F4c5W0AAsrS8.jpg)

---

19/n full code

gist: [https://gist.github.com/ForLoopCodes/c5f6a1ebfbfd7651babc3b848892141f](https://gist.github.com/ForLoopCodes/c5f6a1ebfbfd7651babc3b848892141f)

![](https://pbs.twimg.com/media/G34F4cvW8AA6snD.jpg)

---

follow for more!!!

what we will cover next:
&gt; animations
&gt; lightings
&gt; a donut
&gt; we might make an ascii rendering engine

![](https://pbs.twimg.com/amplify_video_thumb/1981027353523331072/img/ca6VZe7CVoaVtUQ0.jpg)

---

## chapter 2: how to add lights to the ascii sphere explain like im 5 🧵

![](https://pbs.twimg.com/media/G5XfmGwaEAAuygX.jpg)

---

0/n

the old code did not perfectly render the sphere so i updated it

also if you dont get whats happening here, sybau read the quoted tweet 🥀🥀

---

1/n code rework✨

we&apos;re starting off with a new file sama

![](https://pbs.twimg.com/media/G5XdwH2bMAA1OtB.jpg)

---

2/n grid

make the thing (2d array of chars) and fill her with blank spaces

999iq question: why radius * 4?

![](https://pbs.twimg.com/media/G5Xd4O8b0AA33MP.jpg)

---

3/n 

print the thing :P

![](https://pbs.twimg.com/media/G5Xd7mtasAAAlu7.jpg)

---

4/n double forloop (yeah, me (*/ω＼*))

phi = rotation along y-z (so we go from 0-PI)
theta = rotation along x-y (so we go from 0-2PI)

(why 2PI? remember why we did 4* radius, its always 2 times)

![](https://pbs.twimg.com/media/G5Xd-xtbEAA-yL4.jpg)

---

5/n the polar formula AGHH

notice how we keep all of them in a normal form?

![](https://pbs.twimg.com/media/G5XeMUPbsAAlAA5.jpg)

---

6/7 flatten the polar chan to 2-d chan

why not use the z_norm yet? it will be used in the lighting part

![](https://pbs.twimg.com/media/G5XeYJMbIAAzPmp.jpg)

---

6/7 put a temporary char in the grid where we find the 2d-chans =(^_^)=

![](https://pbs.twimg.com/media/G5XecXuacAAF_A4.jpg)

---

8/n the perfect sphere!!! :o

![](https://pbs.twimg.com/media/G5Xees4bIAADr7j.jpg)

---

9/n
but wait, dont u wanna understand how we flattened the 3d norms into sx and sy?

1. x_norm and y_norm range from -1 to 1
&gt; as we need a 2d mapping we dont actually care about the z_norm
&gt; &quot;x_norm&quot;

2. what if we want to give it a radius?
&gt; as it ranges from -1 to 1, we can multiply them with R, now its -R to +R
&gt; &quot;R * x_norm&quot;

hmmmmmm

3. if we render a negative value on grid, which has positive indexes, and a size of 2R
&gt; so technically we can add R to shift negative part to the right
&gt; &quot;(R * x_norm) + R&quot;
= &quot;R * (x_norm + 1)&quot;

4. special case
&gt; do you remember why x was 2 times?
&gt; &quot;R * (x_norm + 1) * 2&quot;
&gt; &quot;R * (y_norm + 1)&quot;

![](https://pbs.twimg.com/tweet_video_thumb/G5XiRhYbsAAmR-u.jpg)

---

10/n full new code

gist: [https://gist.github.com/ForLoopCodes/8709ddad85c926ad76fed46a5f31b3d4](https://gist.github.com/ForLoopCodes/8709ddad85c926ad76fed46a5f31b3d4)

![](https://pbs.twimg.com/media/G5XeiK1a4AEXpcI.jpg)

---

11/n adding lights ✨

lets add some positions (normalized) where our light will be, and a shades array

![](https://pbs.twimg.com/media/G5XemnQbEAEuWjR.jpg)

---

12/n dot product 😭😭

![](https://pbs.twimg.com/media/G5XepMbbwAAkpnu.jpg)

---

13/n dot product of 2 normalized vectors is between -1 and 1, so to fetch shades from 0 to num_shades, multiply it

![](https://pbs.twimg.com/media/G5XerWnbkAEaBFm.jpg)

---

14/n but we get some devil negative values too :c (if dot is negative), lets cut them

![](https://pbs.twimg.com/media/G5Xet3zbEAAx3ON.jpg)

---

15/n and finally... instead of * we use the shade ✿

![](https://pbs.twimg.com/media/G5Xev9MaIAAcArN.jpg)

---

16/n woww (★‿★)

![](https://pbs.twimg.com/media/G5XfPi5bgAA_igE.jpg)

---

17/n play around with different shades (ask ai) and (lighting) positions~

![](https://pbs.twimg.com/media/G5XfU0FasAAmR8n.jpg)

---

18/n full code

gist: [https://gist.github.com/ForLoopCodes/ae980f50df5122f8e1682fcbfec9e236](https://gist.github.com/ForLoopCodes/ae980f50df5122f8e1682fcbfec9e236)

![](https://pbs.twimg.com/media/G5XfYa9asAAogkJ.jpg)

---

follow for more!!!

what we will cover next:
&gt; animations
&gt; a donut
&gt; we might make an ascii rendering engine

![](https://pbs.twimg.com/media/G5XffBMasAAeBRe.png)

---

## chapter 3: how to add animations to the ascii sphere explain like im 5 🧵 (ft. frieren)

![](https://pbs.twimg.com/amplify_video_thumb/1993646266467917824/img/xhPwUfK7g9maIGL5.jpg)

video: [https://x.com/i/status/1993651511474467028](https://x.com/i/status/1993651511474467028)

---

0/n animations

lets do a little rework and add a new angle for light =D

![](https://pbs.twimg.com/media/G6rdbswagAEC5i2.jpg)

---

1/n making light use angle and not constants (=^･ｪ･^=)

![](https://pbs.twimg.com/media/G6rdiC_bkAAgaVG.jpg)

---

2/n but now its not a unit vector, lets normalize it ( ♡ )

![](https://pbs.twimg.com/media/G6rdkqDacAEVIEr.jpg)

---

3/n a while loop? (nahh i hate this)

okay, how will it work?
&gt; while (1)
&gt; update light value with angle &apos;s value
&gt; clear grid
&gt; calculate phi/theta and print grid
&gt; angle+=0.1
&gt; sleep(50)
&gt; repeat

![](https://pbs.twimg.com/tweet_video_thumb/G6rfgpraQAAL0bE.jpg)

---

3.1/n update light value with angle &apos;s value in my least favorite loop (⋟﹏⋞)

![](https://pbs.twimg.com/media/G6rdqd-bAAAV6Fk.jpg)

---

3.2/n clear grid (before phi/theta code and after new light position)

note: this special character is probably for windows only

![](https://pbs.twimg.com/media/G6rdyEla0AABBLi.jpg)

---

3.3/n
&gt; angle+=0.1
&gt; sleep

windows: Sleep(50)
and, # include &lt;windows.h &gt;

linux: usleep(50000);
and, # include &lt;unistd.h &gt;

&gt; repeat
bonus: clear screen before next frame using that magic sequence

![](https://pbs.twimg.com/media/G6rd2RCbcAAOoX0.jpg)

---

4/n play around with different (light) positions

![](https://pbs.twimg.com/media/G6rd45EbUAAOliC.jpg)

---

5/n full code

gist: [https://gist.github.com/ForLoopCodes/cd2f156ead3780986757d4b633816a62](https://gist.github.com/ForLoopCodes/cd2f156ead3780986757d4b633816a62)

![](https://pbs.twimg.com/media/G6rd-2ibwAANaF1.jpg)

---

follow for more!!!

what we will (might lol) cover next:
&gt; a donut
&gt; we might make an ascii rendering engine

![](https://pbs.twimg.com/tweet_video_thumb/G6rfkshbwAENqK4.jpg)

---

follow me on x dot com for more

threads:
- chapter 1: [https://x.com/forloopcodes/status/1981027707287712003](https://x.com/forloopcodes/status/1981027707287712003)
- chapter 2: [https://x.com/forloopcodes/status/1987743549933400166](https://x.com/forloopcodes/status/1987743549933400166)
- chapter 3: [https://x.com/forloopcodes/status/1993651511474467028](https://x.com/forloopcodes/status/1993651511474467028)</description><pubDate>Mon, 24 Nov 2025 18:30:00 GMT</pubDate></item><item><title>Why XOR integer swapping feels like magic explain like im 5.</title><link>https://looparchive.pages.dev/routes/blog/4</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/4</guid><description>&gt; this blog assumes you have basic knowledge of programming and bitwise operations.
    &gt; this is from my twitter thread https://x.com/forloopcodes/status/1978542908211872066

  ![XOR Screenshot](https://pbs.twimg.com/media/G3Ut_icWAAAD68q?format=jpg&amp;name=large)

   ### 0/n code, and simpler version

   ![Step 0](https://pbs.twimg.com/media/G3UwsTpXMAAmTp_?format=jpg&amp;name=4096x4096)
   ![Simpler Version](https://pbs.twimg.com/media/G3UwzCDWIAEzob0?format=jpg&amp;name=4096x4096)

   ### 1/n xor properties

   &gt; bitwise operator ([https://www.geeksforgeeks.org/digital-logic/xor-gate/](https://www.geeksforgeeks.org/digital-logic/xor-gate/))
   &gt; xor can be represented as the &quot;^&quot; character
   &gt; A ^ B = B ^ A
   &gt; A ^ (B ^ C) = (A ^ B) ^ C
   &gt; A ^ A = 0
   &gt; A ^ 0 = A

   ![Step 1](https://pbs.twimg.com/media/G3UxGtSXYAAQpo5?format=jpg&amp;name=4096x4096)

   ### 2/n step one

   x = x ^ y

   we simply assign the value of x ^ y to x

   ![Step 2](https://pbs.twimg.com/media/G3UxYYkWsAAIfG8?format=jpg&amp;name=4096x4096)

   ### 3/n (you will need your last brain cells for this)

   y = x ^ y

   which means,
   y = (x ^ y) ^ y

   while
   x = x ^ y

   but now, y = (x ^ y) ^ y
   &gt; y = x ^ (y ^ y)
   &gt; y = x ^ 0
   &gt; y = x

   yay we got our second number assigned the value of x!!!

   ![Step 3](https://pbs.twimg.com/media/G3UxaddXEAApGsW?format=jpg&amp;name=4096x4096)

   ### 4/n the first value

   third step: x = x ^ y

   we already have x = x ^ y done in step 1, and y&apos;s value is x from step 2
   so x = (x ^ y) ^ y(new)
   &gt; x = (x ^ y) ^ x
   &gt; x = (x ^ x) ^ y
   &gt; x = 0 ^ y
   &gt; x = y

   damnit math

   ![Step 4](https://pbs.twimg.com/media/G3UxgKlXUAAUXev?format=jpg&amp;name=4096x4096)

   ### 5/n we finally got x = y and y = x with the fastest integer swap method known to mankind

   good things
   &gt; no bit overflow
   &gt; fast af

   if you want me to go deeper (bit by bit) ask me kindly 😼

   ![Step 5](https://x.com/i/status/1978542943561482629)

   ### yt (of someone else who might explain): 

Link: [The XOR Swap](https://www.youtube.com/watch?v=I4UuurVgngw)

   follow me on x dot com for more</description><pubDate>Wed, 15 Oct 2025 18:30:00 GMT</pubDate></item><item><title>How to run TempleOS on your computer explain like im 5.</title><link>https://looparchive.pages.dev/routes/blog/3</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/3</guid><description>&gt; this blog assumes you have basic knowledge of computers and virtualization.
    &gt; this is from my twitter thread https://x.com/forloopcodes/status/1970987043082862724

  Here&apos;s how TempleOS looks like:
    ![TempleOS Screenshot](https://pbs.twimg.com/media/G1pRoFaWwAAy_EE?format=jpg&amp;name=small)

   ### Step 1. install oracle virtualbox (figure it out yourself)
   [https://virtualbox.org/wiki/Downloads](https://virtualbox.org/wiki/Downloads)

   ![Step 1](https://pbs.twimg.com/media/G1pSB9RX0AA4Ezh?format=png&amp;name=small)

   ### Step 2. download the iso file
   [https://templeos.org/Downloads/TempleOS.ISO](https://templeos.org/Downloads/TempleOS.ISO)

   ![Step 2](https://pbs.twimg.com/media/G1pSn3FXgAAgEso?format=jpg&amp;name=small)

   ### Step 3. open virtualbox &gt; new

   ![Step 3](https://pbs.twimg.com/media/G1pS3q1XYAEOKvh?format=png&amp;name=small)

   ### Step 4. fill up this and name it templeos-chan (* /ω＼* ) ⚠️very important

   btw dont forget to select 64 bit option for version

   ![Step 4](https://pbs.twimg.com/media/G1pTSNKXIAAIQk1?format=png&amp;name=small)

   ### Step 5. * metal rod falling *

   ![Step 5](https://pbs.twimg.com/media/G1pTod7XEAAAlZl?format=png&amp;name=small)

   ### Step 6. 69 mb

   ![Step 6](https://pbs.twimg.com/media/G1pT2h7WUAAyMCm?format=png&amp;name=small)

   ### Step 7. yay

   ![Step 7](https://pbs.twimg.com/media/G1pT99cWcAAGFUV?format=png&amp;name=small)

   ### Step 8. start?

   ![Step 8](https://pbs.twimg.com/media/G1pVED4WMAAIAqv?format=png&amp;name=360x360)

   ### Step 9. type yya

   ![Step 9](https://pbs.twimg.com/media/G1pVtHjX0AA189D?format=png&amp;name=small)

   ### Step 10. TOP 10 HACKINGGG AHAHAHAHAHAHA

   ![Step 10](https://pbs.twimg.com/media/G1pVyTMW8AAEFgQ?format=png&amp;name=small)

   ### Step 11. Reboot Now (y or n)?

   ![Step 11](https://pbs.twimg.com/media/G1pWyN8WkAAdeud?format=png&amp;name=360x360)

   ### Step 12. get rid of that thingy

   ![Step 12](https://pbs.twimg.com/media/G1pYlvEW4AAhj2b?format=png&amp;name=small)

   ### Step 13. start again and press 1 for voicemail

   ![Step 13](https://pbs.twimg.com/media/G1pY4SxWEAAgkkt?format=png&amp;name=small)

   ### Step 14. ✨templeos✨

   ![Step 14](https://pbs.twimg.com/media/G1pZqocXwAA40wu?format=jpg&amp;name=small)

   ### Bonus: a video of me speedrunning installation:

   TEMPLEOS INSTALLATION SPEEDRUN WORLD RECORD (1:51) by forloop
  [TempleOS Installation Speedrun (1:51)](https://x.com/forloopcodes/status/1945725293693698128)

   about templeos by fireship: [TempleOS in 100 Seconds](https://www.youtube.com/watch?v=h7gf5M04hdg)

real world record: [TempleOS Installation Speedrun World Record](https://www.youtube.com/watch?v=ggM6L0HBDxM)
   follow me on x dot com for more</description><pubDate>Wed, 24 Sep 2025 18:30:00 GMT</pubDate></item><item><title>How to deploy your own website on tor explain like im 5.</title><link>https://looparchive.pages.dev/routes/blog/2</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/2</guid><description>&gt; this blog assumes you have basic knowledge of linux commands, know what is tor, and have a vps or a local server to host your tor website on.
    &gt; this is from my twitter thread https://x.com/forloopcodes/status/1967637960196833539

   Here&apos;s how your website will look on tor network:
   ![image of a website](https://pbs.twimg.com/media/G050H7eWQAEbG4w?format=png&amp;name=small)

   ### Step 1. download tor
   [https://torproject.org/download/](https://torproject.org/download/)

  ### Step 2. download tor services
  `pacman -Sy tor`
  or
  `apt-get install tor`
  ![image of tor installation](https://pbs.twimg.com/media/G05r8u-W0AApoTO?format=png&amp;name=small)

  ### Step 3: make your site (nextjs, here) 

  ```bash
  bun create next-app &lt;app_name&gt; &amp;&amp; cd &lt;app_name&gt;
  ```

  ![Create Next App](https://pbs.twimg.com/media/G05sdRuWQAAfZyX?format=png&amp;name=small)

  ### Step 4: edit page.tsx

  ```bash
  nvim app/page.tsx
  ```

  ### Step 5. make the changes to the file

  do it by yourself :P
  ### Step 6. save and close nvim
  `:wq`

  ![Edit page.tsx](https://pbs.twimg.com/media/G05swfAWoAAjCFX?format=jpg&amp;name=small)

  ### Step 7: run the next.js server

  ```bash
  bun dev
  ```

  ![Run Dev Server](https://pbs.twimg.com/media/G05tYi3WkAAL2k5?format=png&amp;name=small)

  ### Step 8: open brave and go to 
  `http://[network ip]:3000`

  ![Open on Network](https://pbs.twimg.com/media/G05yH0qW8AAi0lC?format=jpg&amp;name=small)

  ### Step 9: open new terminal

  ![open new terminal](https://pbs.twimg.com/media/G05uJ9MXoAATrrY?format=png&amp;name=small)

  ### Step 10: some crazy stuff

  ![10. some crazy stuff](https://pbs.twimg.com/media/G05uVhiWYAAoHXk?format=png&amp;name=360x360)

  ### Step 11: what the fuck?

  ![what the fuck?](https://pbs.twimg.com/media/G05ucqVXYAARHwn?format=png&amp;name=small)

  ### Step 12: paste magic stuff ✨✨

  ```
  HiddenServiceDir /var/lib/tor/hidden_service/
  HiddenServicePort 80 [your network ip]:3000
  ```

  ### Step 13: bye nvim

  ```bash
  :wq
  ```


  ![Step 13](https://pbs.twimg.com/media/G05wmQmXQAAjQ3E?format=png&amp;name=small)

  ### Step 14: TOR

  ![Step 14](https://pbs.twimg.com/media/G05u7-PWMAANOcQ?format=png&amp;name=240x240)

  ### Step 15: NEW TERMINALLL

  ![Step 15](https://pbs.twimg.com/media/G05vQQEX0AAYztc?format=png&amp;name=small)

  ### Step 16: get ur link yay

  ```bash
  cat /var/lib/tor/hidden_service/hostname
  ```


  ![Step 16](https://pbs.twimg.com/media/G05vkFbW4AAbTDq?format=png&amp;name=small)

  ### Step 17: open tor browser and go to the url

  ![Step 17](https://pbs.twimg.com/media/G05yU70WYAAGdf6?format=png&amp;name=small)

  ### my onion link
  [http://xd4ymk5fhmiku3wcxy4orycxplos5anu6vvxpxpvbqxne3nhpq3xgjad.onion/](http://xd4ymk5fhmiku3wcxy4orycxplos5anu6vvxpxpvbqxne3nhpq3xgjad.onion/)
   
  follow me on x dot com for more</description><pubDate>Sun, 14 Sep 2025 18:30:00 GMT</pubDate></item><item><title>Learn Redis and backend-caching in 10 minutes.</title><link>https://looparchive.pages.dev/routes/blog/1</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/1</guid><description>[NOTE] This section might be edited in the future to add how to use redis as a vector DB for machine learning.

---

[SECTION] Installation

```bash
sudo apt-get install redis
# then run
redis-server
# make a new bash instance and
redis-cli
```

---

[SECTION] Introduction

Redis is not a database but a caching solution for faster data access using key value pairs, not like sql or mongodb, the keywords can be both capital and normal

---

[SECTION] Basic Functions

- Quit: `quit`
- Set: `set key_name value` (always converts value to string)
- Get: `get key_name` (nil if value doesn&apos;t exist)
- Delete: `del key_name`
- Does key exists?: `exists key_name`
- Get all keys: `keys *`
- Clear all keys: `flushall`
- Time-to-live: `ttl key_name` (-1 if key will exist for infinity, else in seconds, -2 if key doesn&apos;t exist)
- Set an expiration time: `expire key_name seconds_count` (the ttl will reduce by 1 sec every time until the key is removed)
- Set with exp time: `setex key_name seconds_count value`

---

[SECTION] Arrays

- Left-push in an array: `lpush array_name value`
- Access array members: `lrange array_name start_index end_index` (`end_index` can be -1 to show all the elements)
- Right-push: `rpush array_name value`
- Left-pop: `lpop array_name` (returns the popped value and removes it from the array, from the left side, or the beginning)
- Right-pop: `rpop array_name`

---

[SECTION] Sets

Very similar to a list, but each value is always different, for fast access like a hash-map, but only a values array.

- Add in a set: `sadd set_name &quot;value&quot;` (we use string with double quotes here, returns one if successfully added, else return 0 for error or duplicate value already exists)
- Get all elements: `smembers set_name`
- Remove from set: `sremove set_name &quot;value&quot;` (returns 1 or 0 again)

---

[SECTION] Hashes

One set of unique keys and value pairs

- Set: `hset hash_name key_name value`
- Get: `hget hash_name key_name`
- Get all: `hgetall hash_name` (prints key then value, then next key then value)
- Delete a key: `hdel hash_name key_name`
- Check key exists: `hexists hash_name key_name` (return 1 if it gets deleted, 0 elsewhere)

---

[SECTION] Node.js example

```js
// import in your express app
const Redis = requiire(&apos;redis&apos;);

const redisClient = Redis.createClient();
// or use const client = Redis.createClient({url: your_production_url}); for production

// THIS CODE CAN BE USED IN .get or .patch express functions, from now on, these redisClient functions are similar to all the functions above, lets take an example
redisClient.setexp(&quot;key_name&quot;, int_time, JSON.stringify(json_data)) // to store json_data as a string from int_time seconds

// .get function&apos;s proper utilization, inside the get /path function
redisClient.get(&quot;key_name&quot;, async (redisError, redisResponse) =&gt; { // key_name is generally the url passes into the app.get function of express
	if (redisError) console.error(err)
	if (redisResponse) return res.json(JSON.parse(redisResponse)) // cache hit case
	else { // cache miss case
		let json_data = {}; // get from your real database, i.e, supabase or sql or mongodb and return it

		redisClient.setex(&quot;key_name&quot;, int_time, JSON.stringify(json_data))
	}
})

// using url query params, not really a redis thing though, naming like this is conventional, inside the get /path function with queries in format of ?param_name=value
redisClient.get(`key_name?param_name=${req.query.param_name}`, async (redisError, redisResponse) =&gt; {
	if (redisError) console.error(err)
	if (redisResponse) return res.json(JSON.parse(redisResponse)) // cache hit case
	else { // cache miss case
		let json_data = {}; // get from your real database, i.e, supabase or sql or mongodb and return it

		redisClient.setex(`key_name?param_name=${req.query.param_name}`, int_time, JSON.stringify(json_data))
	}
})
```

---

[SECTION] A better JS usage

```js
function getOrSetCache(key, callback) {
	return net Promise((resolve, reject) =&gt; {
		redisClient.get(key, async (error, data) =&gt; {
		 if (error) return reject(error)
		 if (data != null) return resolve(JSON.parse(data))
		 const freshData = await callback()
		 redisClient.setex(key, int_time, JSON.stringify(freshData))
		 resolve(freshData)
	  })
	})
}

// now inside app.get we just do
const responseData = await getOrSetCache(`key_name?param_name=${req.query.param_name}`, async () =&gt; {
	let json_data = {}; // get from your real database, i.e, supabase or sql or mongodb and return it
	return json_data
})
res.json(responseData)
```</description><pubDate>Fri, 21 Mar 2025 18:30:00 GMT</pubDate></item><item><title>An ideal hustle timetable, according to me.</title><link>https://looparchive.pages.dev/routes/blog/5</link><guid isPermaLink="true">https://looparchive.pages.dev/routes/blog/5</guid><description>This time table is a comprehensive guide to set up your daily chores and grindset during the day and achieve almost everything, without having to stay awoke late nights. 

(I&apos;ll assume you are a CS student) It covers your morning workout, leetcode, GATE preparation, university studies, time when you learn to code, research, blogging, internship, projects, and also helps you take out time to doomscroll at the end of the day. 

### Disclaimer:
To whomsoever it may concern,
&gt; This blog describes what I think an ideal time table for a multi-grinder university student should be, there might be people out there getting better results from some other strategies, so these are just my thoughts, and niether I am forcing you to follow this time table. You like it, you follow it, or you don&apos;t.

You are free to edit whatever and however you want it to be. Let&apos;s begin discussing about how an average day will be.

---

# TL;DR
- **7:00 AM** - Wake Up (alarms/apps if needed)  
- **7:00 AM - 8:00 AM** - Workout (gym, walk, or run)  
- **8:00 AM - Class Time** - Daily Chores (shower, breakfast, streaks) 
- **University Break Hours** - Assignments/GATE prep or Leetcode  
- **5:00 PM - 6:00 PM** - Skill Learning (courses, coding, notes)  
- **6:00 PM - 7:30 PM** - Teaching/Blogging/Research  
- **8:30 PM - 11:30 PM** - Projects/Freelance/Job Applications  
- **11:30 PM - 12:30 AM** - Diary, Planning, Skincare, Social Media  

---

# 7.00am - Wake up

Waking up at 7 am is good enough for night owls, maybe reset your night schedule a bit.

If you cant wake up anyways, you can ask your hostel mate or use apps like &quot;Alarmy&quot; or &quot;I can&apos;t wake up&quot;.

You can wake up at 6-6.30 depending on your requirements.

Personally, I think waking up at a scheduled time rather than 4am or sleeping at 3am could help you anyways because you will be unfocussed most of the time. Fix your sleep schedule. I used to sleep 3 hours a day, have experienced a lot of body problems, your eyes look disgusting, hair start falling, skin becomes dull, and you get ulcers in mouth. Which I don&apos;t feel you would love to have.

---

# 7.00am to 8.00am - Workout

You may go to the gym, work-out in the room or get a good walk/run outside, just touch grass.

This will be done for 1 hour after waking up depending on your schedule.

Working out in the morning rather than evening is the best thing that could make your day better, you will feel motivated throughout the day. Trust me, you won&apos;t regret it. Yet, it&apos;s your choice.

---

# 8.00am to class time - Daily chores

You can have a shower, breakfast and a lot of stuff done.

Moreover you need to try completing daily streaks (like duolingo, or leetcode) during this time. No worries if you cant complete it all.

This will be done after your morning workout.

---

# During the university time (i.e during the free lectures) - Assignments and Study.

Complete pending assignments and if you don&apos;t have any, start preparing for the college exams/GATE.  

If you don&apos;t attend lectures, then you can start preparing for GATE or complete your daily incomplete work.

Alternatively if you think it&apos;s not how you do it, then you can solve leetcode problems, practice DSA, etc.

---

# 5.00pm to 6.00pm - Learning Phase 1

Assuming you have already had evening snacks, you start learning new skills from a course or [roadmap.sh](roadmap.sh).

- Code alongside if you&apos;re new or watch at 2x speed if you&apos;re familiar.  
- Make notes side by side in [Obsidian](obsidian.md).

If you are not focussed, here are some apps I suggest you must have in your phone. (no advertising here)
- [No-scroll Shorts and Reels blocker](https://play.google.com/store/apps/details?id=com.newswarajya.noswipe.reelshortblocker)
- [Yeolpumta](https://yeolpumta.com/en/)
- [StayFree App Blocker](https://stayfreeapps.com/)

---

# 6.00 pm to 7.30pm - Learning Phase 2

Here, either you continue learning from phase 1, take a break, or start teaching people what you have learnt.

- You can write blogs at dev.to and medium or if you&apos;re cracked then go work on your research paper.

---

# 8.30pm to 11.30pm - Working Phase

After the dinner and a long walk, you will start working on your projects.

- If you have a freelance client then this is the best time to earn some quick cash.  
- Apply for internships, jobs, find new people online if you&apos;re not doing this anyway.

---

# 11.30pm to 12.30am - end-of-the-day

- Can write a diary entry  
- Plan next day&apos;s targets  
- Skincare  
- Games  
- Instagram reels doomscrolling  

Its your time! but don&apos;t forget to go back to bed in time, so that you get charged for the next day.

---

And that&apos;s how I think what an &quot;ideal&quot; daily time-tabke of a university student (studying in cs branches) should be like. Your feedback is appreciated, any edits or suggestions will be loved.

&quot;Woah, that was amazing&quot;? Thank you so much for reading! Do check out my full site.</description><pubDate>Mon, 03 Mar 2025 18:30:00 GMT</pubDate></item></channel></rss>