Hacker Newsnew | past | comments | ask | show | jobs | submit | renewiltord's favoriteslogin

This reminds me very much of one of my favourite series on Netflix, Midnight Diner (not Midnight Diner - Tokyo Stories, which is a Netflix remake with many of the same cast, but not as enjoyable as the original in my opinion). Most of the action centres around a group of regulars talking while at a small izakaya in Shinjuku, Tokyo, which is run by someone known only as "Master" and only opens from midnight to 7am. You see a bit of their lives outside, but it always reverts back to the izakaya where they debate on various topics. Given the setting, each episode feels a bit like a theatre play.

My fav little-known trick is to test various syscalls fail with strace fault injection, like:

  $ strace -e trace=clone -e fault=clone:error=EAGAIN

random link: https://medium.com/@manav503/using-strace-to-perform-fault-i...

Micro Wake Word is a library and set of on device models for ESPs to wake on a spoken wake word. https://github.com/kahrendt/microWakeWord

Recently deployed in Home Assistants fully local capable Alexa replacement. https://www.home-assistant.io/voice_control/about_wake_word/


There is also 'lsd' but I still prefer eza.

For everyone interested there is a lot of modern command line tools I nowadays prefer over the old stuff:

  bat - cat with highlight
  difftastic - better diff
  gdu - ncdu for ssds (disk space analyser)
  zoxide - modern cd
  fd - find alternative
  rg - ripgrep (grep)
  fzf - fuzzy finder
  jless - json viewer with mouse folding
  dra - download and install release assets
  lazygit - git TUI
  lazydocker - docker TUI
  yazi - file manager with image preview
  zellij - better tmux / screen
  starship - cross shell prompt config
Have fun

Reminds me of a bit from a novel I read (won't be naming the title to avoid spoilers) where one of the minor twists is that the gigastructure of galaxies that we observe in the universe - the thing that's conducive to things like "star formation" and "life" - is an art project by intelligent species who've been alive since around the time of the Big Bang.

(No, it's not part of the Xeelee Sequence :P)


If you want to pull back the curtain, I highly recommend hand-writing your own small ELF binary. In particular, on Linux, the C ELF structures are available via:

    #include <elf.h>
Writing C code to generate an ELF makes it apparent that an ELF is just a couple of structs and some assembled code dumped to a file. (I've used Keystone with decent success for assembly.) It's actually pretty easy to build something that works if you follow along with the man page:

    man 5 elf
For debugging handmade ELF files, it's handy to explicitly run the system loader under strace:

    strace /lib/ld-linux.so.3 ./homemade_elf
You can find the path to the interpreter that will be used via something like:

    readelf -a "$(which ls)" | grep -i interpreter
For example, debugging with strace will make it apparent if any memory mappings are failing. The loader also sometimes has its own error messages that are more descriptive than a normal segfault.

If you don't mind sharing, what made you make the switch two weeks ago? And which bank did you move to for the shared HYSA?

Ha! This was probably the first serious problem I ever tackled with an open source contribution!

The year was 2002, the 2.4 Linux kernel had just been released and I was making money on the side building monitoring software for a few thousand (mostly Solaris) hosts owned by a large German car manufacturer. Everything was built in parallel ksh code, “deployed” to Solaris 8 on Sun E10Ks, and mostly kicked off by cron. Keeping total script runtime down to avoid process buildup and delay was critical. The biggest offender: long timeouts for host/port combinations that would sporadically not be available.

Eventually, I grabbed W. Richard Stevens’ UNIX network programming book and created tcping [0]. FreeBSD, NetBSD, a series of Linux distros picked it up at the time and it was steady decline from there… good times!

[0]: https://github.com/mkirchner/tcping

edit: grammar


Which preventative health tests are most worth doing? I'm in my early 30s and willing to pay out of pocket if something is good.

E.g. ezra, prenuvo, q bio, Grail, Freenome, other regular blood testing, and then things like this.


It was about 30 images, though I'm planning on adding more and training again sometime. Either that or splitting it up between when her hair is short and when it's long, as it really changes how she looks.

This isn't what I used for my dog's LoRa but I used it for my wife and it worked better than what I was doing before (Adafactor): https://civitai.notion.site/SDXL-1-0-Training-Overview-4fb03...

I'd recommend increasing the network dimension to at least 64, if your VRAM can take it. I can do 64 with my 12GB card. At least for people, I've had better luck using a token that's a celebrity. I'm not sure how to try that with my dog - perhaps just "terrier dog" or something.


Wilco, sir! And will update this comment when I do.

I like combining this with a bash implementation of an event API (https://github.com/bashup/events). This makes it easy/idiomatic, for example, to conditionally add cleanup as you go.

Glossing over some complexity, but roughly:

    add_cleanup(){
        event on cleanup "$@"
    }
    
    trap "event emit 'cleanup'" HUP EXIT
    
    start_postgres(){
        add_cleanup stop_postgres
        # actually start pg
    }
    
    start_apache(){
        add_cleanup stop_apache
        # actually start apache
    }
I wrote a little about some other places where I've used it in https://www.t-ravis.com/post/shell/neighborly_shell_with_bas... and https://t-ravis.com/post/nix/avoid_trap_clobbering_in_nix-sh... (though I make the best use of it in my private bootstrap and backup scripts...)

I keep this alias in my zshrc for exactly this purpose

  alias lzf="fzf +s --tac --bind 'enter:select-all+accept' -m"
With the added bonus that you can press return to release the filtered lines to stdout. Really useful for interactively filtering logs.

jq is incredibly powerful and I'm using it more and more. Even better, there is a whole ecosystem of tools that are similar or work in conjunction with jq:

* jq (a great JSON-wrangling tool)

* jc (convert various tools’ output into JSON)

* jo (create JSON objects)

* yq (like jq, but for YAML)

* fq (like jq, but for binary)

* htmlq (like jq, but for HTML)

List shamelessly stolen from Julia Evans[1]. For live links see her page.

Just a few days ago I needed to quickly extract all JWT token expiration dates from a network capture. This is what I came up with:

    fq 'grep("Authorization: Bearer.*" ) | print' server.pcap | grep -o 'ey.*$' | sort | uniq | \
    jq -R '[split(".") | select(length > 0) | .[0],.[1] | gsub("-";"+") | gsub("_";"/") | @base64d | fromjson]' | \
   jq '.[1]' | jq '.exp' | xargs -n1 -I! date '+%Y-%m-%d %H:%M:%S' -d @! 
It's not a beauty but I find the fact that you can do it in one line, with proper parsing and no regex trickery, remarkable.

[1] https://jvns.ca/blog/2022/04/12/a-list-of-new-ish--command-l...


I use stackprinter[1] for the same. It's advisable to suppress printing of library functions (`suppressed_paths=["lib/python"])`) otherwise deep stack traces (as some libraries---hello pandas---like to produce) will cause the actually-problematic code to be elided. Long reprs are also truncated so your 2GB JSON buffer isn't going to blow up your trace.

this:

    Traceback (most recent call last):
      File "demo.py", line 12, in <module>
        dangerous_function(somelist + anotherlist)
      File "demo.py", line 6, in dangerous_function
        return sorted(blub, key=lambda xs: sum(xs))
      File "demo.py", line 6, in <lambda>
        return sorted(blub, key=lambda xs: sum(xs))
    TypeError: unsupported operand type(s) for +: 'int' and 'str'
becomes:

    File demo.py, line 12, in <module>
        9        somelist = [[1,2], [3,4]]
        10       anotherlist = [['5', 6]]
        11       spam = numpy.zeros((3,3))
    --> 12       dangerous_function(somelist + anotherlist)
        13   except:
        ..................................................
         somelist = [[1, 2, ], [3, 4, ], ]
         anotherlist = [['5', 6, ], ]
         spam = 3x3 array([[0. 0. 0.]
                           [0. 0. 0.]
                           [0. 0. 0.]])
        ..................................................

    [...]

    File demo.py, line 6, in <lambda>
        3
        4
        5    def dangerous_function(blub):
    --> 6        return sorted(blub, key=lambda xs: sum(xs))
        7
        ..................................................
         xs = ['5', 6, ]
        ..................................................

    TypeError: unsupported operand type(s) for +: 'int' and 'str'
[1] https://github.com/cknd/stackprinter

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: