I came across this interesting post . Some notes after reading it: Context engineering involves the process of activily making the context window work for the given task. Since LLMs have a bias to information close to the end of the context window, it’s important to optimize for this and remove all noise as the conversation progresses. Fresh invocations of LLMs with context perform better…
https://a2a-protocol.org/latest/ It is primarily for agents to collaborate on long running tasks. A primary agent could leverage many agents to complete tasks. This is useful because the primary agent doesn’t have to polute it’s context with other tasks that can be handled in a seperate “thread”. The primary agent is responsible to steer the conversation with the secondary…
Download netboot efi wget https://boot.netboot.xyz/ipxe/netboot.xyz-arm64.efi Move it to /boot/efi/ Open cloud shell connection from the instance page. On the instance page it’s labeled “Console Connection” under “Resources” “Reboot” the instance Continuously press Esc in the cloud shell. EFI boot manager pops up. Then open the EFI shell and type…
Create R2 tokens from the r2 Overview page. “Manage r2 API Tokens” -> “Create API Token” Copy the access key id and secret access key values Copy the endpoint url. It’s of the form <cloudflare_account_id>.r2.cloudflarestorage.com . Cloudflare account id is present in the url bar too when you are accessing the cloudflare dashboard and is also displayed in overview page…
poetry build poetry run pip install --upgrade -t dist/lambda dist/reporter*.whl cd dist/lambda; zip -r ../lambda.zip . -x '*.pyc'; cd ../../ If there are problems with some dependencies (GLIBC version mismatch) use --platform manylinux2014_x86_64 (or another type of linux pypi package) and --only-binary=:all: poetry run pip install --platform manylinux2014_x86_64 --only-binary=:all: -t dist/lambda…
Use mkcert mkcert -install mkcert localhost # creates two localhost.pem (cert) and localhost-key.pem (key) file provide the key and cert file to the http server program. For example in python if using uvicorn: uvicorn.run("api.main:app", host="0.0.0.0", ssl_keyfile=key_path, ssl_certfile=cert_path, reload=True) Also read How to Create Your Own SSL Certificate Authority for Local HTTPS Development…
When you use an import statement in your code, the Python runtime searches the directories in its search path until it finds the module or package. By default, the runtime searches the $LAMBDA_TASK_ROOT ( /var/task ) directory first. If you include a version of a runtime-included library in your image, your version will take precedence over the version that’s included in the runtime. Other…
Check your /etc/hosts So ran into this stupid error where lnd was not starting because it was trying to lookup localhost and it couldn’t resolve it so it asks the DNS server (1.1.1.1) and obviously can’t resolve it either. failed to load config: lookup localhost on 1.1.1.1:53: no such host Add this to /etc/hosts 127.0.0.1 localhost
Faced an issue where I would get stuck in a redirect loop when configured a cloudflare dns as ‘proxied’. Turns out the solution is to set SSL/TLS mode to ‘Full’ and that solves it. Ref https://community.cloudflare.com/t/enabling-cloudflare-dns-proxy-results-in-redirect-loop/510465
I use dwm as my window manager and I always wanted to hack on it ever since I started using it and I have taken my first step towards that by debugging it and understanding the codebase a little. This post is just going to be a lot of snippets from dwm source code with my explanation on it as I understand it myself and sharing what I learnt while debugging dwm along the way. I wanted to fix an…
I have this alias in my bashrc: alias qn = "cd ~/docs/org/0-inbox/ && vim `date +%Y-%m-%d-%H%M`.md" which uses Command-Substitution 1 and basically just makes a “quick note” which I can refer later and move it a more appropriate place in my organized notes when I have the time. But when I run this alias it always opens the same note even if I run it at another time. TIL that using `…
--force-with-lease git push --force-with-lease – safer than just --force since if it doesn’t expect the same commit before the force push to be there as yours, it doesn’t push it. git maintenance start makes things faster. Does a bunch of stuff in the config that does automatic stuff in the background using systemd timers git blame -w -C -C -C much better than just git blame…
Make sure that URL lengths are within range 8192 bytes Some other services might follow a generic 2000 character limit. http - What is the maximum length of a URL in different browsers? - Stack Overflow
Although s3 has a flat structure—unlike a filesystem—it has a concept of “folders”. Folders are 0-byte objects whose key names end with a ‘/’ When you create a folder from the s3 console it creates this object automatically and you can manually create it using cli with an object key ending in ‘/’…
install pyenv install a python version using pyenv install 3.9 this should have created a directory ~/.pyenv tell poetry to use a specific python version - poetry env use /home/prithu/.pyenv/versions/3.9.18/bin/python then run poetry install
Software How to “think” (and design) like a Software Architect at Silicon Valley Code Camp 2019 Hardware The Future of Microprocessors — Sophie Wilson
These are not the same docker tag api-service:latest 123456789012.dkr.ecr.eu-west-1.amazonaws.com/api:latest docker push 123456789012.dkr.ecr.eu-west-1.amazonaws.com/api:latest docker tag api-service:latest 123456789012.dkr.ecr.eu-west-1.amazonaws.com/api-service:latest docker push 123456789012.dkr.ecr.eu-west-1.amazonaws.com/api-service:latest Maybe this is obvious for future me. But this is the…
A few months ago, I wanted to host files stored on a portable hard disk on the public internet. These files were just some photos and videos that I wanted to share with some of my cousins. Nothing fancy, just a webdav server using rclone would suffice—a very ad-hoc setup as you can see. I wanted it to be reachable at share.prithu.dev to give it a short and friendly rememberable name. I used the…
The example.com equivalent of IP address is the block of 192.0.2.0/24. From rfc-3330 192.0.2.0/24 - This block is assigned as “TEST-NET” for use in documentation and example code. It is often used in conjunction with domain names example.com or example.net in vendor and protocol documentation. Addresses within this block should not appear on the public Internet.
Complete this note with auth methods and how they are implemented are resources. https://security.stackexchange.com/questions/166724/should-i-use-csrf-protection-on-rest-api-endpoints
Computer Science Reducible - 3b1b type videos of CS topics Ben Eater - Computer architecture and electronics Computerphile - Computer science explained Zero To ASIC Course Science Nils Berglund - YouTube Makes cool simulations Infotainment Asianometry - YouTube Video essays on business, economics, and history. Sometimes about Asia, but not always.
broot - A new way to see and navigate directory trees hstr - shell history suggest box - easily view, navigate, search and manage your command history. pasystray - A nice pulse audio system tray written in c GitHub - Canop/rhit: A nginx log explorer
These are notes that I took while reading the The Go Prgogramming Language book Interesting points Go has some strictness when it comes to compiling if packages are imported but not used - don’t compile if a newline is placed incorrectly - don’t compile. Newlines follwing certain tokens are converted to semicolons automatically Semicolons are used only when statements are to be written…
Wrote the following in the FOSS United Telegram group, might expand this later as a blog post. Context Razorpay was put under scrutiny for accepting donation for a news org (altnews I believe?) from foreign sources. The discussion in the group was that whether or not it should have been allowed. I just chipped in. But, is it right to curb the inflow of money from foreign sources in some cases but…
If you want to give access to everything in the bucket (objects) make sure the resource arn for the s3 bucket must also have a /* indicating all objects in the bucket "Resource": [ "arn:aws:s3:::BUCKET-NAME", ] This one won’t give access to objects in the bucket, the following one will. "Resource": [ "arn:aws:s3:::BUCKET-NAME", "arn:aws:s3:::BUCKET-NAME/*" ] There is a difference between…
There are two ways to manage access of a bucket - user policies or resources policies. Access policies that you attach to your resources (buckets and objects) are referred to as resource-based policies. You can also attach polcies to your users in your account, called user policies. Resources policies are attached to the resource (in s3 for eg. buckets or even objects). Resource policy dictates…
tldr; ECS is just AWS’s proprietary orchestration solution. EKS is their kubernetes service - you don’t have to manage the kubernetes control plane (don’t have access to master node, but you do get the kubernetes API). Fargate can be used with ECS or EKS and basically abstracts away the compute nodes on which containers run.…
xxd is a great tool. I have seen it be use in so many places. For some weird reason though it seems to come packaged with vim ?. Don’t know about other distros, but that’s the case with Arch. Seems like xxd was created by Bram and is a part of vim source code. Haven’t looked into it further, but that’s what I concluded. Anyways here’s a small example: echo -en…
playwright is really good for browser automation. It is a re-write of puppeteer, I believe, and is maintained by the same devs and has tons of improvements, maybe because it was supported/sponsored by microsoft. It also has a wonderful feature of automatically recording your actions and converting them to a script. Running this would open a browser window and you can then record your actions. npx…
TIL from RFC2732 that the way you access an ipv6 address in a browser is by enclosing it in square brackets http://[2401:4900:f00b:dead:2f2d:48ac:9fdb:b7ff]:8080/path/file.txt
Was just setting up shiori behind nginx and I wanted it such that https://prithu.dev/shiori passess the request to port 8001. I have been in this situation before as well where a path needs to be sent to a another host or application server. Just doing the following wont work: location /app { proxy_pass http://localhost:8001 ; proxy_set_header Host $host ; } nginx forwards the client request (…
I am going to try to keep this as dense and precise as possible and only store “usefull” knowledge. I am going keep this for things like “how was I supposed to run a webdav server using rclone again”; well maybe not that, because that’s just a one line and belongs in the snippets.md file. But more like “how do I setup weechat on android using an ssh tunnel and a…
Git hooks are great to automate your software development workflow. They can be used to implement CI/CD workflows. Many PaaS services like Netlify and Heroku trigger a build process of your app or website when you push to a remote repository. In this post I want to go through how one could implement that automated process using git hooks for a static blog using just a bash script with nginx…
TIL that there are really good ways of writing one-liners in python. I knew they existed but today I took a closer look at them. Most of the iterations can be done using list composition. You don’t even have to be composing a list, you could be just executing a normal function call like in the example below uses “print” curl -s https://www.imdb.com/list/ls020046354/export |\…
I saw a cool video by ghidra ninja on yt that went over firmware reversing for an a small security camera. He got the firmware from the site of the manufacturer and went over binwalk and showed how there’s a linux filesystem on it in squashfs form. This was really amusing — the fact that there is a whole file system in a single binary. He then goes on to to see a rc script that runs on the…
There are hardware skimmers that collect card data when swiped but there can also be code written that can skim cards in an online checkout screen using code injection techniques. There was this incident where a group of hackers got access to a Magneto site and they modified a js library used in the checkout page and added a skimming code that would capture the card data entered in the forms of…
I was listening to an episode of darknet diaries and learnt that there is this profession called a “physical penetration tester” where basically a person works for a institution who wants to test the security of their physical infrastructure (buildings). A client could be a bank or some other financial firm. The episode interviews two such people that worked for the security firm…
View discussion on Hacker News The Unix philosophy lays emphasis on building software that is simple and extensible. Each piece of software must do one thing and do it well. And that software should be able to work with other programs through a common interface – a text stream. This is one of the core philosophies of Unix which makes it so powerful and intuitive to use. This is an excerpt…
I see configurable software like vim and i3 really good tools to work with. I strongly believe you should have control over how something works in your toolset. Tools like vim and i3 allow for users to customize their workings in order fit their needs - this is what makes them so powerful and a joy to use. There are many instances where one feels the need to tweak their tools so that they could do…
i3bar screenshot It’s the IPL season and I thought why not keep a track of the score of the matches that are in progress. I have two tests tomorrow and I don’t want to be wasting time looking at the scores every now and then; instead let’s spend some more time looking into an utility that I haven’t used before and test and play around with it. I don’t even like…