#neovim messages are often hard to grab. If you see an error near the
status-line, print it out with :messages
-
-
Need #nginx to run as non-root? Just use the unprivileged #docker image.
FROM nginxinc/nginx-unprivileged:1.27.2-alpine WORKDIR / COPY ./my-html /usr/share/nginx/html/ COPY ./nginx.conf /etc/nginx/nginx.conf
Since non-root can't use
:80
, the above image defaults to:8080
, so anynginx
configuration will need to reflect that, as well as any other infrastructure, likeistio
orkubernetes
.# nginx.conf worker_processes 1; pid /tmp/nginx.pid; events { worker_connections 1024; } http { server { listen 8080; } }
Links #
-
I've built a
GenServer
pub/sub to handle async effects from my #phoenix application, but have been wondering how it handles multiple broadcasts. Given that aGenServer
processes messages from a queue, how can I concurrently handle those messages.Answer: by dispatching to
Task
defmodule Subscriber do use GenServer alias Handler def start_link(_opts) do GenServer.start_link(__MODULE__, %{}, name: __MODULE__) end @impl true def init(_) do Phoenix.PubSub.subscribe(MyPubSub, "my-topic") {:ok, nil} end @impl true def handle_info(msg, _) do # Task.start for fire-and-forget Task.start(Handler, :handle, [msg]) {:noreply, nil} end end defmodule Handler do def handle({:foo, %{url: url }}) do # Maybe this is an API request to another service end def handle({:bar, %{url: url }}) do # ... end end
Links #
-
staaaaahp #
Trying a variety of incantations to block the #ai crawlers, though it'll take constant revision. May build a lil' generator for it.
User-agent: GPTBot Disallow: / User-agent: ChatGPT-User Disallow: / User-agent: Google-Extended Disallow: / User-agent: PerplexityBot Disallow: / User-agent: Amazonbot Disallow: / User-agent: ClaudeBot Disallow: / User-agent: Omgilibot Disallow: / User-Agent: FacebookBot Disallow: / User-Agent: Applebot Disallow: / User-agent: anthropic-ai Disallow: / User-agent: Bytespider Disallow: / User-agent: Claude-Web Disallow: / User-agent: Diffbot Disallow: / User-agent: ImagesiftBot Disallow: / User-agent: Omgilibot Disallow: / User-agent: Omgili Disallow: / User-agent: YouBot Disallow: /
#deno install #
Seems deno continues to converge towards v2
node
- there's an install command in v2. Will revise somedeno.json
to see how the lockfiles work in CI.Links #
- https://www.cyberciti.biz/web-developer/block-openai-bard-bing-ai-crawler-bots-using-robots-txt-file/
- https://github.com/ai-robots-txt/ai.robots.txt
- https://www.404media.co/websites-are-blocking-the-wrong-ai-scrapers-because-ai-companies-keep-making-new-ones/
- https://docs.deno.com/runtime/fundamentals/modules/#integrity-checking-and-lock-files
-
#fly.io and flycast #
I've been working on some html -> markdown conversions with #elixir. It's been quite tricky to build a general-purpose utility for this, and so I've despaired by deciding to just do it with #deno. This means deploying a small deno app that accepts API requests from an elixir app. I don't want it on the public internet, and fly.io has a pretty simple way to support non-public facing apps that still benefit from fly proxy features, like auto-starting machines.
fly ips allocate-v6 --private
Now, from my other fly machines, I can simply make requests to
http://my-fly-app.flycast
.#finch vs ipv6 #
Blurgh, because these requests are on an #ipv6 private network, I had to swap out #finch for #req, as there's no obvious way (to me) by which I can set finch's connection options. I also had to revise the deno app to use
::
as a host.Links #
-
An #ollama cheatsheet...
Also, I saw a hero trailer on netflix that had obviously been AI dubbed... sounded totally demented.
links #
-
#til I mixed up #ecto
queue_target
forqueue_interval
links #
-
#til how to turn capslock off when I magically get it stuck under #windows:
Ctrl + ALT then Ctrl + k
I am occasionally mired in using an Ubuntu guest with a Windows host. I swap back and forth quickly, and something about the way I type yields a state where capslock is just... stuck... worth mentioning that I remap capslock to ctrl anywhere that I can, so when I get into this state, I can't simply hit capslock.
-
#vim bigfiles #
#til a sweet lil' hack to disable #neovim plugins and features that might make things sluggish... this has definitely not happened to me 100 times before.
local bigfile = vim.api.nvim_create_augroup('bigfile', { clear = true }) vim.g.bigfile_size = 1024 * 1024 * 1.5 vim.filetype.add({ pattern = { [".*"] = { function(path, buf) return vim.bo[buf].filetype ~= "bigfile" and path and vim.fn.getfsize(path) > vim.g.bigfile_size and "bigfile" or nil end, }, }, }) vim.api.nvim_create_autocmd({ "FileType" }, { group = bigfile, pattern = "bigfile", callback = function(ev) vim.b.minianimate_disable = true vim.schedule(function() vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or "" end) end, })
trigger actions on events with
vim.api.nvim_create_autocommand
#-- vim.api.nvim_create_autocmd({event}, {opts}) vim.api.nvim_create_autocmd( -- the event "BufWritePost", -- the effect { pattern = "*.js", command = "silent! !prettier --write %", } )
organizing autocommands with
vim.api.nvim_create_augroup
#local myGroup = vim.api.nvim_create_augroup("MyAutoGroup", { clear = true }) vim.api.nvim_create_autocmd( "BufWritePost", { -- the group group = myGroup, pattern = "*.js", command = "silent! !prettier --write %", } )
links #
-
#vmware disk going berserker-mode #
Had to tear down my long-lived guest VM today. After bumping to Ubuntu 24 LTS, the disk inexplicably grew to 390gb...
- i'd set a disk size... way smaller than 390gb
- no snapshots...
- no space to triage
- corporate security that kills usb
- having to virtualize my daily-dev env is, uh... productive
#fly.io, #phoenix &
queue_interval
#Found a helpful thread for tuning how
phoenix
will talk to the db, in my casesupabase
.queue_interval: 500
is pretty long, but seems to help with the machine resume thing...