Skip to content

Instantly share code, notes, and snippets.

@lloydchang
lloydchang / amazon.md
Created January 6, 2025 22:46 — forked from terabyte/amazon.md
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@lloydchang
lloydchang / openrouter.ts
Created December 13, 2024 07:49 — forked from ewired/openrouter.ts
OpenRouter MCP Server
#!/usr/bin/env -S deno run --allow-net --allow-env
/*
{
"mcpServers": {
"openrouter": {
"command": "/path/to/deno",
"args": [
"run",
"--allow-net",
"--allow-env",
@lloydchang
lloydchang / searxng.ts
Created December 13, 2024 06:50 — forked from ewired/searxng.ts
SearXNG MCP server
#!/usr/bin/env -S deno run --allow-net
/*
{
"mcpServers": {
"searxng": {
"command": "/path/to/deno",
"args": [
"run",
"--allow-net",
"/home/<YOUR USERNAME>/Documents/Cline/MCP/searxng.ts",
@lloydchang
lloydchang / claude_3.5_sonnet_artifacts.xml
Created December 5, 2024 09:53 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@lloydchang
lloydchang / CKAD.md
Created December 1, 2024 01:19 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@lloydchang
lloydchang / claude-autoclicker.sh
Created November 26, 2024 18:17 — forked from supersational/claude-autoclicker.sh
Claude Autoclick "Allow Tool"
while true; do
osascript -e '
tell application "System Events"
if exists process "Claude" then
tell process "Claude"
if exists button "Allow for This Chat" of group 2 of group 1 of group 1 of group 1 of UI element 2 of group 1 of group 1 of group 1 of group 1 of window "Claude" then
click button "Allow for This Chat" of group 2 of group 1 of group 1 of group 1 of UI element 2 of group 1 of group 1 of group 1 of group 1 of window "Claude"
log "clicked allow button"
end if
end tell
@lloydchang
lloydchang / dev-containers-cloud-native.md
Created November 19, 2024 17:16 — forked from craiglpeters/dev-containers-cloud-native.md
Dev Containers in the Cloud Native Ecosystem

Dev Containers

https://containers.dev an open spec that extends container definition to also include dev environment configuration including:

  • packages
  • lifecycle automation
  • processes
  • IDE configurations
  • remote connection
  • port forwarding
@lloydchang
lloydchang / pdf_metadata.md
Created September 18, 2024 02:14 — forked from Te-k/pdf_metadata.md
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - &gt; some.cleaned.pdf
@lloydchang
lloydchang / pdf_metadata.md
Created September 18, 2024 02:14 — forked from Te-k/pdf_metadata.md
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - &gt; some.cleaned.pdf