<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>pwn::musings &amp; syndications</title><description>Posts and syndications feed</description><link>https://pwnwriter.me/</link><image><url>https://pwnwriter.me/favicon-lg.png</url><title>pwn::musings logo: a simple tree icon formed by light lines on a dark background</title><link>https://pwnwriter.me</link></image><item><title>Hacking 10$ Nexus Phone Into a Hacking Machine</title><link>https://pwnwriter.me/notes/nexus-google-phone-kali/</link><guid isPermaLink="true">https://pwnwriter.me/notes/nexus-google-phone-kali/</guid><pubDate>Fri, 17 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;img src=&quot;/_astro/cover.D0fIoEzx.jpg&quot; alt=&quot;Nexus 6P running Kali NetHunter chroot manager on a laptop&quot;/&gt;
&lt;p&gt;I saw Nexus 6P on Facebook Marketplace for $10. Owner forgot the PIN, just wanted it gone.&lt;/p&gt;
&lt;p&gt;I already know Kali NetHunter support this phone officially. So I bought immediately without a second thought.&lt;/p&gt;
&lt;p&gt;Literaly drove 25 miles after college to pick it up. First I spent a couple hours researching how to get in without the PIN. Wanted to do it properly and then i found &lt;code&gt;CVE-2016-8467&lt;/code&gt;. Tried it. It worked. Here&apos;s the full story on how come.&lt;/p&gt;
&lt;h3&gt;The Phone&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Nexus 6P&lt;/strong&gt; : Inside name &lt;code&gt;angler&lt;/code&gt;. Made by Huawei, Google flagship from 2015.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://pwnwriter.me/images/nexus-google-hack/google-nexus-boot.jpg&quot; alt=&quot;Nexus 6P booting up&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ fastboot getvar version-bootloader
version-bootloader: 03.61
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Bootloader &lt;code&gt;03.61&lt;/code&gt;. This one is weak. Safe version is &lt;code&gt;03.64&lt;/code&gt; and above. When I see this number I actually pump my fist lol.&lt;/p&gt;
&lt;h3&gt;CVE-2016-8467&lt;/h3&gt;
&lt;p&gt;It&apos;s a High risk cve and was already fixed in January 2017, but the phone wasn&apos;t even updated since then. A big plus point for me ;P
So, to summarize this,&lt;/p&gt;
&lt;p&gt;| &lt;strong&gt;CVE&lt;/strong&gt;       | &lt;strong&gt;&lt;code&gt;CVE-2016-8467&lt;/code&gt;&lt;/strong&gt;                 |
|---------------|-------------------------------------|
| &lt;strong&gt;Type&lt;/strong&gt;      | &lt;strong&gt;&lt;code&gt;Boot mode bypass&lt;/code&gt;&lt;/strong&gt;              |
| &lt;strong&gt;Risk&lt;/strong&gt;      | &lt;strong&gt;&lt;code&gt;High&lt;/code&gt;&lt;/strong&gt;                          |
| &lt;strong&gt;Affected&lt;/strong&gt;  | &lt;strong&gt;&lt;code&gt;Nexus 6P bootloader &amp;#x3C; 03.64&lt;/code&gt;&lt;/strong&gt;   |
| &lt;strong&gt;Need&lt;/strong&gt;      | &lt;strong&gt;&lt;code&gt;Physical access only, no PIN&lt;/code&gt;&lt;/strong&gt;  |&lt;/p&gt;
&lt;p&gt;So basically: this phone has hidden boot modes that Huawei put inside for factory testing. One of them called &lt;code&gt;bp-tools&lt;/code&gt;. When you turn it on, phone open ADB connection &lt;strong&gt;even if you already disable developer mode&lt;/strong&gt;, because the system enable it from boot level, not from the settings toggle.&lt;/p&gt;
&lt;p&gt;The bug is Huawei forget to block this option when phone is locked. Anyone can just select it. No password, nothing.&lt;/p&gt;
&lt;h3&gt;Why PIN not important here&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;  PIN / Lock Screen  →  protect Android only
  CVE-2016-8467      →  go in before Android even start

  We didn&apos;t pick the lock. We went through the basement.
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;The Exploit&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Need: phone, USB cable, laptop with &lt;code&gt;fastboot&lt;/code&gt;. That&apos;s all.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hold &lt;strong&gt;Volume Down + Power&lt;/strong&gt; to enter fastboot mode. On weak phone you see this menu:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  START
  RESTART BOOTLOADER
  RECOVERY MODE
  POWER OFF
  BP-TOOLS          ← this one
  FACTORY
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Press volume to go down to &lt;strong&gt;BP-Tools&lt;/strong&gt;. Press Power.&lt;/p&gt;
&lt;p&gt;That&apos;s it. One button. No command, no tool, no password. I&apos;m serious.&lt;/p&gt;
&lt;p&gt;Phone save this setting inside, so every reboot also still have it. Lock screen look totally normal. Owner don&apos;t know anything.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ fastboot devices
84B5T15B08000140    fastboot
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Full access on a locked phone. Can flash anything.&lt;/p&gt;
&lt;h3&gt;Unlock and Flash&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ fastboot oem unlock
(bootloader) Bootloader unlocked.
OKAY
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then flash TWRP recovery:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ fastboot boot twrp-3.7.0-angler.img   # test before flash
$ fastboot flash recovery twrp-3.7.0-angler.img
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://pwnwriter.me/images/nexus-google-hack/twrp.jpg&quot; alt=&quot;TWRP 3.7.0 running on the Nexus 6P&quot;&gt;&lt;/p&gt;
&lt;p&gt;Here I made mistake ,i flashed custom ROM but forget to wipe cache. Phone go bootloop straight away. Had to reflash stock and start again. So painful.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Always wipe Dalvik and cache before flash new ROM.&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Wipe → Advanced Wipe: ☑ Dalvik  ☑ System  ☑ Cache  ☑ Data
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://pwnwriter.me/images/nexus-google-hack/nethunter-boot.jpg&quot; alt=&quot;Kali NetHunter boot logo&quot;&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ adb shell
angler:/ $ chroot /data/local/nhsystem/kali-arm64 /bin/bash
┌──(root㉿kali)-[/]
└─# whoami
root
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Full Kali Linux. On a phone. For $10. Cannot believe.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;What It Can Do&lt;/h3&gt;
&lt;p&gt;WiFi monitor mode work on built-in WiFi, can run full &lt;code&gt;aircrack-ng&lt;/code&gt;, no need extra hardware. Can also do USB attack where target computer think phone is a keyboard, i always wanted to try this and it did work, i might write an another blog for the same if i get a chance from these college assignments..&lt;/p&gt;
&lt;p&gt;I guess that&apos;s it for this. See ya :/&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Aditional resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;CVE-2016-8467 original research — &lt;a href=&quot;https://alephsecurity.com/2017/01/05/attacking-android-custom-bootmodes/&quot;&gt;alephsecurity.com/2017/01/05/attacking-android-custom-bootmodes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Bypassing Nexus 6 Secure Boot.. - &lt;a href=&quot;https://alephsecurity.com/2017/05/23/nexus6-initroot/&quot;&gt;Bypassing Nexus 6 Secure Boot through....&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IBM X-Force full paper — &lt;a href=&quot;https://www.docdroid.net/dxKUj5c/attacking-nexus-6-6p-custom-bootmodes.pdf.html&quot;&gt;docdroid.net/dxKUj5c/attacking-nexus-6-6p-custom-bootmodes.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;January 2017 Android Security Bulletin — &lt;a href=&quot;https://source.android.com/security/bulletin/2017-01-01.html&quot;&gt;source.android.com/security/bulletin/2017-01-01&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;NetHunter downloads — &lt;a href=&quot;https://www.kali.org/get-kali/#kali-mobile&quot;&gt;kali.org/get-kali/#kali-mobile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;TWRP for angler — &lt;a href=&quot;https://twrp.me/huawei/huaweinexus6p.html&quot;&gt;twrp.me/huawei/huaweinexus6p.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title>hackathon: won best elevenlabs at morganhacks</title><link>https://pwnwriter.me/syndications/morganhacks-26/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/morganhacks-26/</guid><pubDate>Wed, 15 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;img src=&quot;https://pwnwriter.me/me-proud-nix-user.jpg&quot; alt=&quot;morganhacks&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;
&lt;p&gt;Hacked for 2 days straight at MorganHacks and walked away with the &lt;strong&gt;Best ElevenLabs&lt;/strong&gt; title. Our project was &lt;strong&gt;inventoryAi&lt;/strong&gt;, really proud of what the team pulled off. Tired but happy.&lt;/p&gt;</content:encoded></item><item><title>nvim: per project configuration</title><link>https://pwnwriter.me/syndications/neovim_per_dir_config/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/neovim_per_dir_config/</guid><pubDate>Thu, 02 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I recently flipped the switch and upgraded to &lt;strong&gt;Neovim 0.12&lt;/strong&gt;, and it’s a meaningful shift in how configuration and package management can be handled.&lt;/p&gt;
&lt;img src=&quot;https://pwnwriter.me/images/syndications/neovim-11-12/neovim-11-12.png&quot; alt=&quot;neovim 12&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;
&lt;p&gt;The standout change for me is the &lt;strong&gt;built-in package manager&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Leaving &lt;code&gt;lazy.nvim&lt;/code&gt; Behind&lt;/h3&gt;
&lt;p&gt;Previously, I relied on &lt;code&gt;lazy.nvim&lt;/code&gt; with a &lt;code&gt;.lazy.lua&lt;/code&gt; setup. That approach worked well, but with the direction Neovim is heading, and things are getting inside neovim itself. Why to bother with external plugins.&lt;/p&gt;
&lt;p&gt;So I migrated away from &lt;code&gt;lazy.nvim&lt;/code&gt; to use the native package management approach.&lt;/p&gt;
&lt;p&gt;Here’s what my &lt;code&gt;.nvim.lua&lt;/code&gt; looks like now:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-lua&quot;&gt;vim.pack.add({
  { src = &quot;https://github.com/neovim/nvim-lspconfig&quot;, name = &quot;lspconfig&quot; }
})

vim.lsp.enable({
  &quot;ts_ls&quot;, -- typescript
  &quot;astro&quot;, -- astro
  &quot;tailwindcss&quot;, -- tailwindcss
  &quot;tinymist&quot;, -- typst
  &quot;harper_ls&quot;, -- markdown
  &quot;ty&quot;, -- python
})

return {}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;What This Does&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Installs &lt;code&gt;nvim-lspconfig&lt;/code&gt; using the built-in package manager&lt;/li&gt;
&lt;li&gt;Enables a set of LSP servers with default config from upstream lspconfig plugin.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://pwnwriter.me/images/syndications/neovim-11-12/lsp.mov&quot; alt=&quot;lsp usages&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;
&lt;p&gt;That’s it.&lt;/p&gt;</content:encoded></item><item><title>on eipi.boo</title><link>https://pwnwriter.me/syndications/eipi-boo/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/eipi-boo/</guid><pubDate>Tue, 24 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;made this because it deserved a place on the internet&lt;/p&gt;
&lt;p&gt;$e^{i\pi} + 1 = 0$&lt;/p&gt;
&lt;p&gt;https://eipi.boo&lt;/p&gt;</content:encoded></item><item><title>SSH Home Server Anywhere</title><link>https://pwnwriter.me/notes/cloudflared-ssh/</link><guid isPermaLink="true">https://pwnwriter.me/notes/cloudflared-ssh/</guid><pubDate>Thu, 05 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I recently got a ThinkPad and decided to turn it into a small home server. I
plan to use it for heavier tasks like running Hack The Box machines, practicing
for Red Hat, and other lab work. Since it stays at home, I wanted a simple way
to SSH into it from anywhere.&lt;/p&gt;
&lt;p&gt;The usual way is to &lt;strong&gt;port-forward port 22&lt;/strong&gt;, but that exposes your server
directly to the internet. I didn’t want that.&lt;/p&gt;
&lt;p&gt;Instead, I used &lt;strong&gt;Cloudflare Tunnel&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;With a tunnel, my server creates a secure outbound connection to Cloudflare’s network, and I reach it through my domain. No open ports, no public IP, and it works even behind NAT.&lt;/p&gt;
&lt;h3&gt;Create the tunnel&lt;/h3&gt;
&lt;p&gt;After installing &lt;code&gt;cloudflared&lt;/code&gt;, I logged in and created a tunnel:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cloudflared tunnel login
cloudflared tunnel create pwnlab
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cloudflare generates a credential file inside &lt;code&gt;~/.cloudflared/&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Configure the tunnel&lt;/h3&gt;
&lt;p&gt;Then I created a small config file:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;~/.cloudflared/config.yml&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;tunnel: pwnlab
credentials-file: /home/pwn/.cloudflared/&amp;#x3C;tunnel-id&gt;.json

ingress:
  - hostname: ssh.pwnwriter.me
    service: ssh://localhost:22
  - service: http_status:404
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This tells the tunnel to send traffic from &lt;code&gt;ssh.pwnwriter.me&lt;/code&gt; to my local SSH server.&lt;/p&gt;
&lt;h3&gt;Add the DNS route&lt;/h3&gt;
&lt;p&gt;Next I mapped the subdomain to the tunnel:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cloudflared tunnel route dns pwnlab ssh.pwnwriter.me
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cloudflare automatically creates the DNS record.&lt;/p&gt;
&lt;h3&gt;Run the tunnel&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cloudflared tunnel run pwnlab
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now my server stays connected to Cloudflare through a secure tunnel.&lt;/p&gt;
&lt;h3&gt;SSH from anywhere&lt;/h3&gt;
&lt;p&gt;From any machine I can now simply run:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh pwn@ssh.pwnwriter.me
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That’s it.&lt;/p&gt;
&lt;p&gt;No router configuration.
No exposed ports.
Just a clean and secure.&lt;/p&gt;</content:encoded></item><item><title>Oneshot canceled haylxon</title><link>https://pwnwriter.me/notes/on-shot-haylxon/</link><guid isPermaLink="true">https://pwnwriter.me/notes/on-shot-haylxon/</guid><pubDate>Thu, 26 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A small bug in &lt;a href=&quot;https://github.com/pwnwriter/haylxon&quot;&gt;&lt;code&gt;haylxon&lt;/code&gt;&lt;/a&gt;caused screenshots to fail with this warning:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;warning: oneshot canceled&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But the tool still said:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;info: Screenshots Taken and saved in directory hxnshots
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No screenshot was actually saved.&lt;/p&gt;
&lt;h2&gt;What Was Happening&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;haylxon&lt;/code&gt; uses &lt;code&gt;chromiumoxide&lt;/code&gt; to talk to Chrome. In the background, there’s a handler loop that keeps reading messages from Chrome and sending responses back through oneshot channels.&lt;/p&gt;
&lt;p&gt;This was the code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-rust&quot;&gt;task::spawn(async move {
    while let Some(h) = handler.next().await {
        if h.is_err() {
            break;
        }
    }
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It looks fine. If something errors, stop.&lt;/p&gt;
&lt;p&gt;But Chrome sends non-fatal errors all the time — like console warnings from websites. When that happened:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;handler.next()&lt;/code&gt; returned &lt;code&gt;Some(Err(...))&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The loop hit &lt;code&gt;break&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The handler stopped running&lt;/li&gt;
&lt;li&gt;All pending oneshot senders were dropped&lt;/li&gt;
&lt;li&gt;The receiver saw that and returned: &lt;code&gt;&quot;oneshot canceled&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So the screenshot call was waiting for a response… but the handler had already exited.&lt;/p&gt;
&lt;p&gt;The connection wasn’t broken. We just stopped listening too early.&lt;/p&gt;
&lt;h2&gt;The Fix&lt;/h2&gt;
&lt;p&gt;I changed it to:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-rust&quot;&gt;task::spawn(async move {
    while handler.next().await.is_some() {}
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now it keeps running until Chrome actually disconnects. It ignores non-fatal errors instead of shutting everything down.&lt;/p&gt;
&lt;p&gt;That’s it.&lt;/p&gt;
&lt;p&gt;One &lt;code&gt;break&lt;/code&gt; statement was killing the whole message loop. Removing it fixed the issue completely.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue:&lt;/strong&gt; &lt;a href=&quot;https://github.com/pwnwriter/haylxon/issues/140&quot;&gt;#140&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>font: migrate jetbrains → lilex</title><link>https://pwnwriter.me/syndications/new-font/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/new-font/</guid><pubDate>Tue, 24 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Today I finally switched to &lt;code&gt;Lilex Nerd Font Mono&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Feels weird… but also kinda refreshing.
Didn’t realize how attached I was to a font until I changed it.&lt;/p&gt;
&lt;img src=&quot;https://pwnwriter.me/images/syndications/font.png&quot; alt=&quot;we&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;</content:encoded></item><item><title>nix: local postgresql with nix flake</title><link>https://pwnwriter.me/syndications/postgresql-with-nix-flake/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/postgresql-with-nix-flake/</guid><pubDate>Sun, 15 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Was working on a project that needed postgres. Didn&apos;t want to install it globally or spin up docker for something this simple. So I wrote a flake that gives me a local postgres instance — data stays in &lt;code&gt;.pg/&lt;/code&gt;, auto-starts when I enter the shell, stops when I leave.&lt;/p&gt;
&lt;p&gt;No system pollution, no port conflicts with other projects. Just &lt;code&gt;nix develop&lt;/code&gt; and I&apos;m ready to go.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  inputs = {
    nixpkgs.url = &quot;github:nixos/nixpkgs/nixos-unstable&quot;;
  };

  outputs =
    { nixpkgs, ... }:
    let
      systems = [ &quot;x86_64-linux&quot; &quot;aarch64-linux&quot; &quot;x86_64-darwin&quot; &quot;aarch64-darwin&quot; ];
      forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn (import nixpkgs { inherit system; }));
    in
    {
      devShells = forAllSystems (pkgs: {
        default = pkgs.mkShell {
          packages = with pkgs; [
            postgresql
            pgcli          # nicer postgres cli with autocomplete
            sqlx-cli       # if you&apos;re doing rust + sqlx
          ];

          shellHook = &apos;&apos;
            export PGDATA=&quot;$PWD/.pg/data&quot;
            export PGHOST=&quot;$PWD/.pg&quot;
            export PGPORT=5432
            export PGDATABASE=&quot;devdb&quot;
            export DATABASE_URL=&quot;postgresql:///devdb?host=$PGHOST&quot;

            if [ ! -d &quot;$PGDATA&quot; ]; then
              echo &quot;Initializing postgres...&quot;
              initdb -D &quot;$PGDATA&quot; --auth=trust --no-locale --encoding=UTF8
              echo &quot;unix_socket_directories = &apos;$PGHOST&apos;&quot; &gt;&gt; &quot;$PGDATA/postgresql.conf&quot;
            fi

            if ! pg_ctl status -D &quot;$PGDATA&quot; &gt; /dev/null 2&gt;&amp;#x26;1; then
              mkdir -p &quot;$PGHOST&quot;
              pg_ctl start -D &quot;$PGDATA&quot; -l &quot;$PGHOST/log&quot; -o &quot;-c listen_addresses=&quot;
              createdb &quot;$PGDATABASE&quot; 2&gt;/dev/null || true
            fi

            trap &quot;pg_ctl stop -D &apos;$PGDATA&apos; -m fast 2&gt;/dev/null&quot; EXIT
          &apos;&apos;;
        };
      });
    };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add &lt;code&gt;.pg/&lt;/code&gt; to your &lt;code&gt;.gitignore&lt;/code&gt; and you&apos;re set.&lt;/p&gt;</content:encoded></item><item><title>milestone: calculus reaches 1M+ members</title><link>https://pwnwriter.me/syndications/calculus-milestone/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/calculus-milestone/</guid><pubDate>Thu, 12 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;img src=&quot;https://pwnwriter.me/images/syndications/calculus/calculus-1m.png&quot; alt=&quot;we&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;
&lt;p&gt;We just reached &lt;strong&gt;1M+ members&lt;/strong&gt; in the Calculus group.&lt;/p&gt;
&lt;p&gt;We started in &lt;strong&gt;2021&lt;/strong&gt; with just &lt;strong&gt;4 admins&lt;/strong&gt;, from different countries — and it’s honestly unreal to see how far this community has come.&lt;/p&gt;
&lt;p&gt;Managing the posts and members at this scale has become challenging, but I’m truly grateful for the support, contributions, and kindness from everyone here.&lt;/p&gt;
&lt;p&gt;Thank you for being part of this journey.&lt;/p&gt;
&lt;p&gt;$$\text{Love MATHS} &amp;#x3C; 3 = \lim_{x \to \infty}\text{happiness}$$&lt;/p&gt;</content:encoded></item><item><title>gadget: got my first split keyboard</title><link>https://pwnwriter.me/syndications/split-keyboard/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/split-keyboard/</guid><pubDate>Mon, 12 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Got my split keyboard today. Still slow, but enjoying every keystroke.&lt;/p&gt;
&lt;img src=&quot;https://pwnwriter.me/images/syndications/split-keyboard.jpg&quot; alt=&quot;we&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;</content:encoded></item><item><title>Cozy</title><link>https://pwnwriter.me/notes/dev-setup/</link><guid isPermaLink="true">https://pwnwriter.me/notes/dev-setup/</guid><pubDate>Wed, 10 Dec 2025 14:52:14 GMT</pubDate><content:encoded>&lt;div style=&quot;display: flex; gap: 10px;&quot;&gt;
  &lt;img src=&quot;https://pwnwriter.me/images/setup/nix-setup.jpg&quot; style=&quot;width: 50%; height: auto;&quot;&gt;
  &lt;img src=&quot;https://pwnwriter.me/images/setup/server.jpg&quot; style=&quot;width: 50%; height: auto;&quot;&gt;
&lt;/div&gt;
&lt;p&gt;I spend a lot of time building, breaking, and rebuilding software, so my workspace matters.&lt;/p&gt;
&lt;p&gt;For the past two years, I’ve been using Nix on my MacBook and NixOS as a daily driver. Everything is declarative, reproducible, and easy to roll back when experiments go wrong.&lt;/p&gt;
&lt;p&gt;Most of my work happens in the terminal and Neovim — for coding, notes, and writing. The setup is simple, predictable, and quiet.&lt;/p&gt;
&lt;p&gt;Nothing fancy. Just cozy, reliable tools that stay out of the way.&lt;/p&gt;</content:encoded></item><item><title>life: buffering</title><link>https://pwnwriter.me/syndications/mood-2025-12-06/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/mood-2025-12-06/</guid><pubDate>Sat, 06 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I swear something’s wrong with me rn, not a single song is hitting. All
my playlists feel dead. Music isn’t even curing my mood anymore.&lt;/p&gt;</content:encoded></item><item><title>milestone: bought my first car</title><link>https://pwnwriter.me/syndications/car/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/car/</guid><pubDate>Mon, 13 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Never thought I’d say this, I just got my license today and also bought my first car. Used to walk those roads in the rain, now I drive them 💢&lt;/p&gt;</content:encoded></item><item><title>thought: gratitude without chains</title><link>https://pwnwriter.me/syndications/independent/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/independent/</guid><pubDate>Wed, 17 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Too much gratitude lowkey turns into chains. Be thankful, but don’t get stuck worshipping one thing. Stay free.&lt;/p&gt;</content:encoded></item><item><title>Typst for University Notes</title><link>https://pwnwriter.me/notes/typst/</link><guid isPermaLink="true">https://pwnwriter.me/notes/typst/</guid><pubDate>Thu, 17 Jul 2025 12:26:54 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Your assignments look so beautiful — do you spend hours making them?”&lt;/em&gt;&lt;br&gt;
My professor once asked me this with genuine curiosity.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The truth? &lt;strong&gt;Not really.&lt;/strong&gt; I just take my rough class notes, clean them up a bit, and turn them into polished PDFs — all in far less time than most of my classmates.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Why I moved from Markdown to Typst&lt;/h2&gt;
&lt;p&gt;In my first two semesters, I relied on &lt;a href=&quot;https://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; and &lt;a href=&quot;https://obsidian.md/&quot;&gt;Obsidian&lt;/a&gt; to take notes, &lt;a href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt; to version them, and &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt; to back them up. I exported them as PDFs when needed. It worked — but it always felt like a patchwork solution.&lt;/p&gt;
&lt;p&gt;Then I discovered &lt;a href=&quot;https://typst.app/&quot;&gt;Typst&lt;/a&gt; — a modern typesetting system built for simplicity and power. The moment I tried it, I knew this was the upgrade I needed. Typst gives me &lt;strong&gt;beautiful PDFs, powerful macros, and math support&lt;/strong&gt; — all without the friction I had with Markdown.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Here’s a screenshot of a CSIT assignment I did using Typst:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;~/assets/typst/typst-assignment.png&quot; alt=&quot;Typst Assignment&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;My Workflow: Typst + Git + Neovim&lt;/h3&gt;
&lt;p&gt;Here’s how I’ve set up my note-taking flow now:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A dedicated &lt;code&gt;Git&lt;/code&gt; repo for notes on &lt;code&gt;Github&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://neovim.io/&quot;&gt;Neovim&lt;/a&gt; as my editor with &lt;a href=&quot;https://github.com/nyinyithann/tinymist&quot;&gt;tinymist&lt;/a&gt; for Typst LSP.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;flake&lt;/code&gt; / &lt;code&gt;nix-direnv&lt;/code&gt; for all dependencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Now, you&apos;d be asking, why this complex setup??&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I use &lt;code&gt;NixOS&lt;/code&gt; and macOS, so flakes work everywhere.&lt;/li&gt;
&lt;li&gt;I love &lt;code&gt;git push/pull&lt;/code&gt; workflow.&lt;/li&gt;
&lt;li&gt;I can use &lt;code&gt;Neovim&lt;/code&gt; as the editor.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;My &lt;code&gt;flake.nix&lt;/code&gt; setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  inputs = {
    nixpkgs.url = &quot;github:nixos/nixpkgs/nixos-unstable&quot;;
  };

  outputs = { nixpkgs, ... }:
    let
      systems = [ &quot;x86_64-linux&quot; &quot;aarch64-linux&quot; &quot;x86_64-darwin&quot; &quot;aarch64-darwin&quot; ];
      forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (import nixpkgs { inherit system; }));
    in {
      devShells = forAllSystems (pkgs: {
        default = pkgs.mkShell {
          packages = with pkgs; [
            typst         # Typesetting
            tinymist      # LSP for Typst
            python3       # Python runtime
            basedpyright  # Python LSP
            ruff          # Formatter
            uv            # Python package manager
          ];

          env.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
            pkgs.libz
            pkgs.stdenv.cc.cc.lib
          ];
        };
      });
    };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3&gt;Neovim Configuration&lt;/h3&gt;
&lt;p&gt;I use &lt;code&gt;lazy.nvim&lt;/code&gt; plugin manager which allows having a seprate &lt;code&gt;.lazy.lua&lt;/code&gt; file for setting up plugins specific to the project &lt;code&gt;directory&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here’s my &lt;code&gt;.lazy.lua&lt;/code&gt; spec for the &lt;code&gt;lazy.nvim&lt;/code&gt; plugin manager which sets the &lt;code&gt;lsp&lt;/code&gt; for &lt;code&gt;python&lt;/code&gt; and &lt;code&gt;typst&lt;/code&gt; with a couple of keybind for the specific project only.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-lua&quot;&gt;return {
  {
    &quot;neovim/nvim-lspconfig&quot;,
    name = &quot;lspconfig&quot;,
    event = { &quot;BufReadPost&quot;, &quot;BufNewFile&quot; },
  },

  vim.lsp.enable({ &apos;basedpyright&apos;, &apos;tinymist&apos; }),

  vim.api.nvim_create_autocmd(&quot;filetype&quot;, {
    pattern = &quot;python&quot;,
    callback = function()
      vim.keymap.set(&quot;n&quot;, &quot;&amp;#x3C;leader&gt;lf&quot;, function()
        vim.cmd(&quot;silent! !ruff format %&quot;) -- Format current file
        vim.cmd(&quot;edit!&quot;)                  -- Reload file after formatting
      end, { desc = &quot;Format Python file with ruff&quot; })
    end,
  }),
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this, I get inline errors, autocompletion, signature help, and quick formatting — exactly what I want.
Here’s how it feels in action:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://github.com/user-attachments/assets/feafaffe-3db2-4e67-8bb0-ae16d3b69744&quot; alt=&quot;typst-nvim&quot;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Final Thoughts&lt;/h3&gt;
&lt;p&gt;At this point, Typst feels like the real OG. A couple of years ago, my older
brothers introduced me to LaTeX — and I thought that was the gold standard. But
after showing them Typst, even they’ve made the switch.&lt;/p&gt;
&lt;p&gt;I’m still keeping an eye on the &lt;a href=&quot;https://github.com/typst/typst/issues/5512&quot;&gt;HTML support&lt;/a&gt; pull request, which would make
it even easier to integrate Typst on many places like even website itself.. But
even now, it’s already changed how I work.&lt;/p&gt;
&lt;p&gt;If you’re a student, especially one who writes a lot of math-heavy content, I
can’t recommend Typst enough.&lt;/p&gt;
&lt;!-- Links --&gt;</content:encoded></item><item><title>Remaining silent</title><link>https://pwnwriter.me/notes/remain-silent/</link><guid isPermaLink="true">https://pwnwriter.me/notes/remain-silent/</guid><pubDate>Tue, 15 Jul 2025 04:49:36 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Staying silent is powerful. Not every question needs an answer. Not every
comment deserves a reply. And not every situation needs your voice in it.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I was watching &lt;a href=&quot;https://www.youtube.com/watch?v=neUaSTSKFZc&quot;&gt;this video by Ron White&lt;/a&gt;, where he says,&lt;strong&gt;&lt;em&gt;“You have
the right to remain silent, and I wish to God you’d use it.”&lt;/em&gt;&lt;/strong&gt;.It’s a joke,
but it really stuck with me. Silence is a choice, one that can save you from
unnecessary trouble and help you stay in control of yourself.&lt;/p&gt;
&lt;p&gt;When you’re quiet, you notice more, not just what people say, but how they
feel. You give yourself space to think before reacting, and you avoid saying
things you might later regret.&lt;/p&gt;
&lt;p&gt;Remaining silent has helped me focus on what really matters. It gives me time
to reflect and keeps me out of unnecessary conflicts.&lt;/p&gt;
&lt;p&gt;Not every moment needs words. Sometimes, silence says enough.&lt;/p&gt;</content:encoded></item><item><title>life: turned 21</title><link>https://pwnwriter.me/syndications/turned-21/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/turned-21/</guid><pubDate>Fri, 11 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Turned 21 today, I feel grateful for the growth, the lessons, and the people who made it all worthwhile 🤍&lt;/p&gt;</content:encoded></item><item><title>college: first semester done</title><link>https://pwnwriter.me/syndications/first-sem/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/first-sem/</guid><pubDate>Thu, 28 Nov 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;First semester done!&lt;/p&gt;
&lt;p&gt;Sometimes I miss home, the food, the people, but it’s okay.&lt;/p&gt;
&lt;p&gt;I really appreciate how my professor is helping me connect with everyone at the university.
I also work in the computer lab here, and it feels awesome to be part of it.&lt;/p&gt;</content:encoded></item><item><title>travel: first flight, miami bound</title><link>https://pwnwriter.me/syndications/first-flight/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/first-flight/</guid><pubDate>Mon, 26 Aug 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Goodbye home, hello hustle. Miami bound 🤍&lt;/p&gt;</content:encoded></item><item><title>A Year in Corporate</title><link>https://pwnwriter.me/notes/job/</link><guid isPermaLink="true">https://pwnwriter.me/notes/job/</guid><pubDate>Mon, 19 Aug 2024 23:32:00 GMT</pubDate><content:encoded>&lt;h2&gt;Background&lt;/h2&gt;
&lt;p&gt;After high school, I was at home with my parents, doing errands and
self-learning while preparing for my &lt;strong&gt;USA&lt;/strong&gt; visa interview. Out of the blue, a
well-known company reached out with a job offer. Despite not getting the terms
I hoped for, I decided to take the opportunity.&lt;/p&gt;
&lt;h2&gt;The job&lt;/h2&gt;
&lt;p&gt;There wasn&apos;t anything specifically like working on just one domain. I used to
manage linux server&apos;s, providing technical support and so on.&lt;/p&gt;
&lt;h2&gt;what did i get..?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The best boys:&lt;/p&gt;
&lt;p&gt;It’s probably impossible to find teammates who are both incredibly helpful and equally supportive and encouraging at the same time.&lt;/p&gt;
&lt;p&gt;Gotta miss them ♥&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&quot;https://pwnwriter.me/images/mulkot/we.png&quot; alt=&quot;we&quot; style=&quot;width: 100%; max-width: 500px; height: auto;&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A new opportunity :&lt;/p&gt;
&lt;p&gt;I was able to introduce &lt;a href=&quot;https://nixos.org/&quot;&gt;&lt;code&gt;nix&lt;/code&gt;&lt;/a&gt; across my teammates, Not
just that but 3 of our production servers now use &lt;code&gt;nix&lt;/code&gt; as a user level and
&lt;code&gt;core&lt;/code&gt; level.&lt;/p&gt;
&lt;p&gt;It was an absolutely fantastic opportunity for me to learn
and apply Nix on servers according to user requirements, rather than just
for personal projects.&lt;/p&gt;
&lt;p&gt;I believe that working to fulfill other’s needs teaches you more than
working on personal projects alone.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Experience :&lt;/p&gt;
&lt;p&gt;While I’m a bit sad this is ending, we had an amazing time exploring different
places. My first week alone was filled with tours and adventures. The office
environment was incredibly friendly and helpful, which made the experience even
better.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;&quot;&gt;
    &lt;img alt=&quot;patan&quot; src=&quot;https://pwnwriter.me/images/mulkot/patan.png&quot; style=&quot;width: 15rem; height: 20rem; object-fit: cover;&quot;&gt;
    &lt;img alt=&quot;nix-mac&quot; src=&quot;https://pwnwriter.me/images/mulkot/nix.png&quot; style=&quot;width: 15rem; height: 20rem; object-fit: cover;&quot;&gt;
&lt;/div&gt;
&lt;h2&gt;Moving on&lt;/h2&gt;
&lt;p&gt;I&apos;ve my &lt;strong&gt;USA&lt;/strong&gt; flight soon within a very few weeks. I took resign from the job
but i miss the boys i met there. They were absolute amazing people. I wish to
work with them later and forever.&lt;/p&gt;
&lt;!-- links --&gt;</content:encoded></item><item><title>My talk on PTN 11</title><link>https://pwnwriter.me/notes/my-talk-on-ptn/</link><guid isPermaLink="true">https://pwnwriter.me/notes/my-talk-on-ptn/</guid><pubDate>Sat, 03 Aug 2024 20:32:00 GMT</pubDate><content:encoded>&lt;img src=&quot;/_astro/cover.D4X3o7Xu.jpg&quot; alt=&quot;pwnwriter&apos;s talk in owasp Kathmandu&quot;/&gt;
&lt;p&gt;&lt;a href=&quot;https://pentesternepal.com/&quot;&gt;PTN&lt;/a&gt; — Pentester Nepal, is a community for security folks in Nepal. They
organize events, meetups, and challenges. PTN 11 was their 11th anniversary event,
and I got to speak there.&lt;/p&gt;
&lt;p&gt;My talk was on &lt;strong&gt;OS as Code: Using Nix on Apple Silicon&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;What even is Nix?&lt;/h2&gt;
&lt;p&gt;Nix is three things at once — a purely functional programming language, a package
manager, and an entire Linux distro (NixOS) built around it.&lt;/p&gt;
&lt;p&gt;The package repo, &lt;a href=&quot;https://github.com/nixos/nixpkgs&quot;&gt;nixpkgs&lt;/a&gt;, lives on GitHub and is honestly the largest
and most up-to-date collection of packages I&apos;ve seen. Everything is a derivation.&lt;/p&gt;
&lt;h2&gt;NixOS&lt;/h2&gt;
&lt;p&gt;If you take Nix the package manager and build an entire OS around it, you get NixOS.
Your whole system — packages, services, users, networking — lives in a single
&lt;code&gt;configuration.nix&lt;/code&gt; file. That&apos;s the &quot;OS as Code&quot; part. You commit it to git, push
it, and spin up the exact same machine anywhere. Wipe and reinstall? Just run
&lt;code&gt;nixos-rebuild switch&lt;/code&gt;. Back to exactly where you were.&lt;/p&gt;
&lt;h2&gt;Why Nix though?&lt;/h2&gt;
&lt;p&gt;The main idea is &lt;strong&gt;declarative&lt;/strong&gt; configuration. Instead of running:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ apt install git
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You write:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  environment.systemPackages = with pkgs; [ git ];
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And you get the exact same result every time, on every machine. That&apos;s the whole
point — &lt;strong&gt;reproducible&lt;/strong&gt; environments. No more &quot;works on my machine&quot; nonsense.&lt;/p&gt;
&lt;p&gt;It&apos;s also &lt;strong&gt;immutable&lt;/strong&gt; by default. All packages live in &lt;code&gt;/nix/store&lt;/code&gt; with their
hash in the path. Nothing overwrites anything. Rollbacks are trivial.&lt;/p&gt;
&lt;p&gt;The learning curve is real though. New filesystem layout, new language, a whole
rabbit hole — but once it clicks, it clicks.&lt;/p&gt;
&lt;h2&gt;Installing&lt;/h2&gt;
&lt;p&gt;The cleanest way to install Nix (not NixOS, just the package manager) is via the
Determinate Systems installer:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl --proto &apos;=https&apos; --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It comes with flake support out of the box, it&apos;s easy to uninstall, and it&apos;s
written in Rust — so obviously I like it.&lt;/p&gt;
&lt;h2&gt;Flakes and Direnv&lt;/h2&gt;
&lt;p&gt;A &lt;code&gt;flake.nix&lt;/code&gt; has two parts — &lt;code&gt;inputs&lt;/code&gt; (your dependencies) and &lt;code&gt;outputs&lt;/code&gt; (what
you&apos;re providing). It pins everything, so unlike the old &lt;code&gt;nix-shell&lt;/code&gt; approach,
you&apos;re not at the mercy of whatever channel your system has.&lt;/p&gt;
&lt;p&gt;Pair that with &lt;a href=&quot;https://direnv.net/&quot;&gt;direnv&lt;/a&gt; and &lt;code&gt;nix-direnv&lt;/code&gt;, and your dev shell loads
automatically when you &lt;code&gt;cd&lt;/code&gt; into a directory. The presentation repo itself is an
example of this — just &lt;code&gt;direnv allow&lt;/code&gt; and you&apos;re in.&lt;/p&gt;
&lt;h2&gt;Home Manager and nix-darwin&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/nix-community/home-manager&quot;&gt;Home Manager&lt;/a&gt; lets you manage all your dotfiles and user packages declaratively
through Nix. One fun example from the talk — building a starship prompt that
shows a different icon depending on whether you&apos;re on macOS or Linux, all in Nix.&lt;/p&gt;
&lt;p&gt;For Apple Silicon specifically, &lt;a href=&quot;https://github.com/LnL7/nix-darwin&quot;&gt;nix-darwin&lt;/a&gt; brings the NixOS-style
declarative config to macOS. You get the same &lt;code&gt;environment.systemPackages&lt;/code&gt; and
module system but on Darwin.&lt;/p&gt;
&lt;p&gt;This is what makes &quot;OS as Code&quot; actually work on a Mac — nix-darwin handles the
system layer, home-manager handles the user layer, and flakes tie it all together.&lt;/p&gt;
&lt;p&gt;The presentation itself was built and rendered using &lt;code&gt;presenterm&lt;/code&gt;, inside a Nix
flake, on NixOS. Bit of a meta moment.&lt;/p&gt;
&lt;p&gt;You can find the slides at &lt;a href=&quot;https://github.com/pwnwriter/PTN11&quot;&gt;github:pwnwriter/PTN11&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title>career: resigned from job</title><link>https://pwnwriter.me/syndications/job/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/job/</guid><pubDate>Thu, 25 Jul 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Wrapped up my job, said goodbye to colleagues. I feel both sad and excited at the same time.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://pwnwriter.me/notes/job&quot;&gt;Read my full blog post »&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;</content:encoded></item><item><title>NixOS on a VPS</title><link>https://pwnwriter.me/notes/nixos-hetzner/</link><guid isPermaLink="true">https://pwnwriter.me/notes/nixos-hetzner/</guid><pubDate>Fri, 19 Jul 2024 23:32:00 GMT</pubDate><content:encoded>&lt;img src=&quot;/_astro/nix-pills.DFDk_uot.png&quot; alt=&quot;pwnwriter&apos;s talk in owasp Kathmandu&quot;/&gt;
&lt;p&gt;My company has recently provided me with a VPS to test things before deploying
them to production. This is a great opportunity for me to push the envelope and
use Nix extensively.&lt;/p&gt;
&lt;p&gt;While most VPS providers don&apos;t offer Nix as a default OS installation option,
there is a workaround using &lt;a href=&quot;https://github.com/nix-community/nixos-anywhere&quot;&gt;nixos-anywhere&lt;/a&gt;. In this post, I&apos;ll walk you
through how to install NixOS on any VPS.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;PS: I&apos;m using &lt;code&gt;hetzner&lt;/code&gt; vps, already running an ubuntu iso.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;How&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://wiki.archlinux.org/title/kexec&quot;&gt;Kexec&lt;/a&gt; is a system call that allows you to load and boot into a new kernel
directly from the currently running kernel. We will use it to boot into our
minimal install system without needing a flash drive. Additionally,
&lt;a href=&quot;https://github.com/nix-community/nixos-anywhere&quot;&gt;nixos-anywhere&lt;/a&gt; allows us to automatically format and
partition using &lt;a href=&quot;https://github.com/nix-community/disko&quot;&gt;disko&lt;/a&gt; declaratively, and install the OS.&lt;/p&gt;
&lt;p&gt;Requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A nix(os) system&lt;/li&gt;
&lt;li&gt;Root access over the server&lt;/li&gt;
&lt;li&gt;1 gigs of RAM&lt;/li&gt;
&lt;li&gt;1 cores of cpu&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Configuration&lt;/h2&gt;
&lt;p&gt;We&apos;ll be using &lt;code&gt;flakes&lt;/code&gt; to define our overall &lt;code&gt;nixos&lt;/code&gt; config.&lt;/p&gt;
&lt;p&gt;The file tree structure should look like this below.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ tree .
   nixos-on-vps
   ├── configuration.nix
   ├── disk-config.nix
   └── flake.nix
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;flake.lock&lt;/code&gt; is similar to &lt;code&gt;cargo.lock,&lt;/code&gt; &lt;code&gt;package.json,&lt;/code&gt; &lt;code&gt;lazy-lock.json&lt;/code&gt; it locks the package git rev hash.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;configuration.nix&lt;/code&gt; is used to define our configuration for the nixos.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;disk-config.nix&lt;/code&gt; is to define our disko config&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The initial &lt;code&gt;flake.nix&lt;/code&gt; skeleton look like this&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  inputs = {

  };

  outputs = { ... }: {

  };
}

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Inside &lt;code&gt;flake.nix&lt;/code&gt;, we&apos;ll add our input repository url, &lt;code&gt;nixpkgs&lt;/code&gt; and &lt;code&gt;disko&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  inputs = {
    nixpkgs.url = &quot;github:nixos/nixpkgs/nixpkgs-unstable&quot;;
    disko.url = &quot;github:nix-community/disko&quot;;
    disko.inputs.nixpkgs.follows = &quot;nixpkgs&quot;;
  };

  outputs = {  ... }: {

  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then we&apos;ll define our output servers. For this example, i&apos;m using my
server name as &lt;code&gt;wolf&lt;/code&gt;, you can name yours anything.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  inputs = {
    nixpkgs.url = &quot;github:nixos/nixpkgs/nixpkgs-unstable&quot;;
    disko.url = &quot;github:nix-community/disko&quot;;
    disko.inputs.nixpkgs.follows = &quot;nixpkgs&quot;;
  };

  outputs = { nixpkgs, disko, ... }: {
    nixosConfigurations.wolf = nixpkgs.lib.nixosSystem { #FIXME: change server name
      system = &quot;x86_64-linux&quot;; # FIXME: Change arch
      modules = [
        disko.nixosModules.disko
        ./configuration.nix
      ];
    };
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;My server is &lt;code&gt;x86_64-linux&lt;/code&gt; you&apos;ll want to change that accordingly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&apos;m using the default example &lt;code&gt;disk&lt;/code&gt; config from &lt;code&gt;disko&lt;/code&gt;. It&apos;ll create &lt;code&gt;boot&lt;/code&gt;
and &lt;code&gt;root&lt;/code&gt; partitions. I also recommend using the default unless you explicitly
want to change. You&apos;ll want to change the device name, to know run &lt;code&gt;$ lsblk&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;disk-config.nix&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{ lib, ... }:
{
  disko.devices = {
    disk.disk1 = {
      device = lib.mkDefault &quot;/dev/sda&quot;; # FIXME: do lsblk  and change it to your&apos;s
      type = &quot;disk&quot;;
      content = {
        type = &quot;gpt&quot;;
        partitions = {
          boot = {
            name = &quot;boot&quot;;
            size = &quot;1M&quot;;
            type = &quot;EF02&quot;;
          };
          esp = {
            name = &quot;ESP&quot;;
            size = &quot;500M&quot;;
            type = &quot;EF00&quot;;
            content = {
              type = &quot;filesystem&quot;;
              format = &quot;vfat&quot;;
              mountpoint = &quot;/boot&quot;;
            };
          };
          root = {
            name = &quot;root&quot;;
            size = &quot;100%&quot;;
            content = {
              type = &quot;lvm_pv&quot;;
              vg = &quot;pool&quot;;
            };
          };
        };
      };
    };
    lvm_vg = {
      pool = {
        type = &quot;lvm_vg&quot;;
        lvs = {
          root = {
            size = &quot;100%FREE&quot;;
            content = {
              type = &quot;filesystem&quot;;
              format = &quot;ext4&quot;;
              mountpoint = &quot;/&quot;;
              mountOptions = [
                &quot;defaults&quot;
              ];
            };
          };
        };
      };
    };
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now the configuration part.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;configuration.nix&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&apos;ll first import &lt;code&gt;qemu-guest&lt;/code&gt; module since it&apos;s a virtual machine.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{ modulesPath, config, lib, pkgs, ... }: {
  imports = [
    (modulesPath + &quot;/installer/scan/not-detected.nix&quot;)
    (modulesPath + &quot;/profiles/qemu-guest.nix&quot;)
    ./disk-config.nix
  ];
  system.stateVersion = &quot;24.05&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&apos;ll be using &lt;code&gt;grub&lt;/code&gt; as bootloader.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  boot.loader.grub = {
        efiSupport = true;
        efiInstallAsRemovable = true;
    };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;Openssh&lt;/code&gt; is necessary for us to be able to ssh into the new server.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
  services.openssh.enable = true;
  users.users.root.openssh.authorizedKeys.keys = [
    &quot;Your public ssh key&quot; #FIXME: Add your ssh public key
  ];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can define aditional packages to install as follows.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{
environment.systemPackages = map lib.lowPrio [
    pkgs.curl # FIXME: define your more packages here
    pkgs.gitMinimal
  ];
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, our final &lt;code&gt;configuration.nix&lt;/code&gt; should look like this.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nix&quot;&gt;{ modulesPath, config, lib, pkgs, ... }: {
  imports = [
    (modulesPath + &quot;/installer/scan/not-detected.nix&quot;)
    (modulesPath + &quot;/profiles/qemu-guest.nix&quot;)
    ./disk-config.nix
  ];
  boot.loader.grub = {
    efiSupport = true;
    efiInstallAsRemovable = true;
  };
  services.openssh.enable = true;

  environment.systemPackages = map lib.lowPrio [
    pkgs.curl
    pkgs.gitMinimal
  ];

  users.users.root.openssh.authorizedKeys.keys = [
    &quot;You&apos;re public ssh key&quot;
  ];

  system.stateVersion = &quot;24.05&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Install the os&lt;/h2&gt;
&lt;p&gt;Now, we&apos;ll have to run our flake to install nixos on the vps.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt; nix run github:nix-community/nixos-anywhere -- --flake .#wolf root@&amp;#x3C;server-ip&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;ll ask for the root password on installation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;~/assets/nix-vps/ssh-upload.png&quot; alt=&quot;&quot;&gt;
&lt;img src=&quot;~/assets/nix-vps/final.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Congratulations!! The nixos has been installed successfully. You should be able to just edit the configuration and run&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nixos-rebuild switch --flake .#wolf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the other time on any changes.&lt;/p&gt;
&lt;h2&gt;Aditional tips&lt;/h2&gt;
&lt;p&gt;You can use &lt;code&gt;justfile&lt;/code&gt; to make this script running easy&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Makefile&quot;&gt;set shell := [&quot;zsh&quot;, &quot;-c&quot;]

_default:
    @just -l

alias g := gens
alias c := clean
alias r := rebuild

# lists build generations
gens:
    @echo &quot;Listing build generations &quot;
    @nix-env --list-generations

# cleans up the nix garbage
clean:
    @echo &quot;Cleaning up unused Nix store items&quot;
    @sudo nix-collect-garbage -d

# Builds the serer
rebuild:
    @echo &quot;Rebuilding server configuration&quot;
    @sudo nixos-rebuild switch --flake .#wolf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The recipe should look like this&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ just
Available recipes:
    clean   # cleans up the nix garbage
    c       # alias for `clean`
    gens    # lists build generations
    g       # alias for `gens`
    rebuild # Builds the serer
    r       # alias for `rebuild`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, rebuild the os with &lt;code&gt;just r(ebuild)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Well, it&apos;s this for now, I&apos;ll see you in the next one!&lt;/p&gt;
&lt;!--links--&gt;</content:encoded></item><item><title>life: US student visa approved</title><link>https://pwnwriter.me/syndications/got-visa/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/got-visa/</guid><pubDate>Mon, 20 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Got my US student visa approved today! Excited to start this new chapter.
Flying to Miami, FL for my bachelor’s!&lt;/p&gt;</content:encoded></item><item><title>My talk on owasp 0x03</title><link>https://pwnwriter.me/notes/owasp-talk/</link><guid isPermaLink="true">https://pwnwriter.me/notes/owasp-talk/</guid><pubDate>Tue, 25 Apr 2023 20:32:00 GMT</pubDate><content:encoded>&lt;img src=&quot;/_astro/cover.Com0j-Ay.jpg&quot; alt=&quot;pwnwriter&apos;s talk in owasp Kathmandu&quot;/&gt;
&lt;p&gt;&lt;a href=&quot;https://owasp.org/&quot;&gt;OWASP&lt;/a&gt; is a non-profit open-source foundation focused on application
security. They have local and global &lt;a href=&quot;https://owasp.org/chapters/&quot;&gt;chapters&lt;/a&gt; around the world
aimed at improving community security. We also have a local chapter called
OWASP Kathmandu, which organizes events to spread awareness within Nepal. I had
the privilege to speak at OWASP Kathmandu 0x03, where I presented my tool,
&lt;a href=&quot;https://github.com/pwnwriter/haylxon&quot;&gt;Halyxon&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you do not know what haylxon is, simple, it&apos;s a tool to take screenshots of webpages
from terminal using chrome&apos;s headless feature written in Rust!&lt;/p&gt;
&lt;p&gt;You can simply take a screenshot of a webpage as below!&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;hxn -b &amp;#x3C;path/to/chrome/bin&gt; -u https://example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But wait, you could do that by just opening a browser and pressing some holy keys?&lt;/p&gt;
&lt;p&gt;I mean yeah? but what would you do when you have &lt;code&gt;hundreds&lt;/code&gt; of urls, sub(domains) to take?&lt;/p&gt;
&lt;h2&gt;Background&lt;/h2&gt;
&lt;p&gt;There were already tools like &lt;a href=&quot;https://github.com/RedSiege/EyeWitness&quot;&gt;Eyewitness&lt;/a&gt; and &lt;a href=&quot;https://github.com/sensepost/gowitness&quot;&gt;Gowitness&lt;/a&gt;, which I had used,
but they either felt slow or lacked my personal touch. Since I wanted to learn
Rust, it was the perfect time to start a new project, especially since I
already had a basic knowledge of Rust.&lt;/p&gt;
&lt;h3&gt;Usages&lt;/h3&gt;
&lt;p&gt;Haylxon comes with a lot of options now, reading urls from &lt;code&gt;stdin&lt;/code&gt;, &lt;code&gt;defining ports&lt;/code&gt;, &lt;code&gt;running arbitary javascript&lt;/code&gt; and a lot more.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;~/assets/owasp/haylxon.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;You can pass a file containing a list of urls, and define height, width and
even a delayed screenshot is possible.&lt;/p&gt;
&lt;p&gt;One of the most interesting usages of this tools is that, you can run it on &lt;code&gt;github&lt;/code&gt; actions
to take screenshot of your subdomain, zip that out upload to &lt;a href=&quot;https://0x0.st/&quot;&gt;0x0.st&lt;/a&gt; or your own instance.&lt;/p&gt;
&lt;p&gt;After the talk, I was gifted some cute swag and a letter of appreciation. I
want to thank OWASP for that &amp;#x3C;3.&lt;/p&gt;
&lt;!---Links--&gt;</content:encoded></item><item><title>year: 2023 in review</title><link>https://pwnwriter.me/syndications/2023/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/2023/</guid><pubDate>Mon, 02 Jan 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I finally got to spend more time with my parents, staying home and helping at
our shop near the school. I enjoyed chatting with people, playing cricket with
kids, and having fun with my brother — even those foggy morning runs and
playing with goats. I also did a lot of open-source work in Rust, writing
&lt;a href=&quot;https://github.com/pwnwriter/haylxon&quot;&gt;haylxon&lt;/a&gt; and &lt;a href=&quot;https://github.com/pwnwriter/hysp&quot;&gt;hysp&lt;/a&gt;, and diving deep into Rust internals.
Like last year, I attended Threatcon again — it was a blast. Bye!&lt;/p&gt;</content:encoded></item><item><title>year: 2022 in review</title><link>https://pwnwriter.me/syndications/2022/</link><guid isPermaLink="true">https://pwnwriter.me/syndications/2022/</guid><pubDate>Sat, 01 Jan 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This year was amazing. I launched &lt;a href=&quot;https://github.com/metis-os&quot;&gt;METISLinux&lt;/a&gt;, met great people
at &lt;a href=&quot;https://threatcon.io/&quot;&gt;Threatcon&lt;/a&gt;, and finished +2 science with some good grades. I got
recognized by the Dutch government and Cambridge for bug reports, earned eJPT,
and started learning Rust. Met some old online friends in real.&lt;/p&gt;
&lt;p&gt;See yaa!&lt;/p&gt;</content:encoded></item></channel></rss>