Readit News logoReadit News
gkfasdfasdf commented on Show HN: Base, an SQLite database editor for macOS   menial.co.uk/base/... · Posted by u/__bb
gkfasdfasdf · 21 hours ago
Looks like the homebrew formula is one behind the latest, 3.0.0 vs 3.0.1 on your site - is the homebrew formula maintained by you or someone else?
gkfasdfasdf commented on Getting decent error reports in Bash when you're using 'set -e'   utcc.utoronto.ca/~cks/spa... · Posted by u/zdw
Grimeton · a month ago
You can just do

  trap 'caller 1' ERR
should do the same thing. Also you should set "errtrace" (-E) and possibly "nounset" (-u) and "pipefail".

gkfasdfasdf · a month ago
or even use caller to print a full backtrace: https://news.ycombinator.com/item?id=44636927
gkfasdfasdf commented on Getting decent error reports in Bash when you're using 'set -e'   utcc.utoronto.ca/~cks/spa... · Posted by u/zdw
bjackman · a month ago
But trap doesn't "stack" (like e.g. defer in Go) so if you do this it's not available for other purposes like cleanup
gkfasdfasdf · a month ago
not sure what you mean, you can have separate ERR and EXIT traps that run independently.
gkfasdfasdf commented on Uv: Running a script with dependencies   docs.astral.sh/uv/guides/... · Posted by u/Bluestein
gkfasdfasdf · a month ago
I love this feature of uv but getting linters/language servers to pick up the venv when editing the files is a bit of a pain. I currently have a script 'uv-edit' which I am using to run Neovim with the correct environment:

  #!/bin/bash
  SCRIPT="$1"; shift
  uv sync --quiet --script "$SCRIPT" && exec uv run --python "$(uv python find --script "$SCRIPT")" nvim "$SCRIPT" "$@"

gkfasdfasdf commented on Debugging Bash Like a Sire (2023)   blog.brujordet.no/post/ba... · Posted by u/gfalcao
bmoyles · a month ago
You can also skip the subshell invocation of date by using %(fmt)T from bash's printf:

  %(fmt)T -output the date-time string resulting from using FMT as a format string for strftime(3)
The man page provides a bit more detail:

  %(datefmt)T causes printf to output the date-time string resulting from using datefmt as a format string for strftime(3).  The corresponding argument  is  an  integer
  representing  the  number of seconds since the epoch.  Two special argument values may be used: -1 represents the current time, and -2 represents the time
  the shell was invoked.  If no argument is specified, conversion behaves as if -1 had been given.  This is an exception to the usual printf behavior.
With that,

    timestamp=$(date +'%y.%m.%d %H:%M:%S')
becomes

    printf -v timestamp '%(%y.%m.%d %H:%M:%S)T' -1

gkfasdfasdf · a month ago
That would indeed be faster, looks like it requires bash 4.2+
gkfasdfasdf commented on Debugging Bash Like a Sire (2023)   blog.brujordet.no/post/ba... · Posted by u/gfalcao
gkfasdfasdf · a month ago
Why not leverage the bash 'caller' builtin? It's meant for printing stack traces, e.g.

    #!/bin/bash
    
    die() {
      local frame=0
      while caller $frame; do
        ((++frame));
      done
      echo "$*"
      exit 1
    }
    
    f1() { die "*** an error occured ***"; }
    f2() { f1; }
    f3() { f2; }
    
    f3


 Output
    
    
    12 f1 ./callertest.sh
    13 f2 ./callertest.sh
    14 f3 ./callertest.sh
    16 main ./callertest.sh
    *** an error occured ***
Via: https://bash-hackers.gabe565.com/commands/builtin/caller/

gkfasdfasdf commented on Supabase MCP can leak your entire SQL database   generalanalysis.com/blog/... · Posted by u/rexpository
gkfasdfasdf · 2 months ago
I wonder, what happens when you hook up an MCP server to a database of malicious LLM prompts and jailbreaks. Is it possible for an LLM to protect itself from getting hijacked while also reading the malicious prompts?
gkfasdfasdf commented on How fast are Linux pipes anyway? (2022)   mazzo.li/posts/fast-pipes... · Posted by u/keepamovin
gkfasdfasdf · 2 months ago
Great article, discussed previously on HN:

https://news.ycombinator.com/item?id=31592934 (200 comments)

https://news.ycombinator.com/item?id=37782493 (105 comments)

gkfasdfasdf commented on Claude 4   anthropic.com/news/claude... · Posted by u/meetpateltech
_peregrine_ · 3 months ago
Already test Opus 4 and Sonnet 4 in our SQL Generation Benchmark (https://llm-benchmark.tinybird.live/)

Opus 4 beat all other models. It's good.

gkfasdfasdf · 3 months ago
Just curious, how do you know your questions and the SQL aren't in the LLM training data? Looks like the benchmark questions w/SQL are online (https://ghe.clickhouse.tech/).
gkfasdfasdf commented on MinC Is Not Cygwin   minc.commandlinerevolutio... · Posted by u/thingfish
gkfasdfasdf · 4 months ago
Ok so it's not Cygwin, how is it better (or worse) than Cygwin?

u/gkfasdfasdf

KarmaCake day1450November 18, 2014View Original