Threads for bbigras

  1. 1

    Would it be a good idea for tools like this to be based on Tree-sitter?

    1. 2

      No: tree sitter is great when you want to cheaply support many languages in a single unified implementation (aka GitHub code search, which was one of the original motivations for tree sitter).

      If you have a specific language to provide rich tooling for, write a dedicated parser.

    1. 24

      Syncthing maybe.

      I use git, but I feel bad when I do a lame commit just to pick it up on another computer.

      1. 24

        That’s what a WIP branch is for!

        1. 11

          +1 on the guilty feelings about doing a commit just to move to another computer.

          1. 6

            You can directly use git between two computers with ssh access between them without pushing to your origin.

            1. 5

              Another vote for syncthing.

              It gives you a nice degree of control of what to sync (.stignore) and it’s reliable. It’s also pretty lightweight (compared to, say Dropbox) and fairly good at resolving conflicts.

              1. 5

                How I use git:

                1. Always work on a branch. Commit sloppily. Push to any other computer freely.
                2. When I’m ready for a “real” commit, squash, write a good change description, and merge to master.

                I do this for ALL changes and it works well. I have a shell script with 6 lines in it that automates some of it.

                1. 3

                  It’s annoying to forget to push as well. One nice thing about rebasing is you can clean that kind of stuff up later on, but it does feel a bit like “I am having to do this for incidental reasons”

                  Given how the internet is nowadays, I bet a lot of people could get away with working via NFS or something for their code

                  1. 3

                    I use Syncthing, too. I love it because it’s super reliable and easy to setup. I have to sync some stuff between Linux, macOS and Windows machines and I just can’t describe how happy I was the day I found out about SyncThing and could forget all the little gimmicks and flags that Samba needs so that files named “like this, brø” don’t end up called “الإعلان اÙعال when I copy them.

                    Fingers crossed I’m not summoning little Bobby Tables here…

                    1. 1

                      I use Syncthing for basically everything other than code, where I use the git-based workflow that I mentioned elsewhere in this thread. I don’t think I have any principled reason for this, other than expecting to work with code using git-based tools and not use those with other sorts of files.

                    2. 2

                      Why? Committing every time you have any reason to of any kind is good! There’s a reason git commits aren’t forever and you can amend or rebase or reset later.

                      1. 2

                        Just going to drop this here in case it interests anyone https://github.com/Emiller88/dotfiles/blob/master/modules/services/syncthing.nix

                      1. 1

                        I like hedgedoc but I wish it could be used offline for emergencies.

                        I wish there was something like logseq with crdt (free and open source).

                        1. 2

                          I’ve actually used the Hedgedoc API to extract docs for reuse in a static site generator. It’s not nearly as ergonomic as a native offline mode, but it doesn’t have the benefit of not requiring you to know that you may want a particular doc and preload/save it for use offline later.

                        1. 7

                          restic is part of the current-gen backup tools that uses rolling hashes to get snapshot-oriented block-based deduplication. (See also arqbackup.)

                          If you’re on a previous-gen tool such as duplicity, rsnapshot, Apple Time Machine, rdiff-backup, then it’s worth a look.

                          1. 5

                            Not only rolling hashes, but also content defined chunking https://github.com/restic/chunker which is just magic really. Deduplicating segments not at block boundaries.

                            The compression was holding me with Borg, but I’m happy to give restic a try now. I hope they improved with their performance issues…

                            1. 3

                              What sorts of datasets did you miss compression for? In my experience anything significant already has file-level compression (e.g. jpeg, mpeg, git packfiles, …)

                              1. 2

                                I haven’t looked into the details, but my laptop backup gets 20% smaller with compression.

                                1. 1

                                  Plenty of things don’t, think sqlite database (or any database really), most configuration files, some PDFs.

                                  By my experience even standard lz4 can squeeze 5% out of almost pure media file datasets. ZSTD as restic uses is a bit better. In more realistic applications, the compression ratio tends to be 20-50%. I’ve even got a single ZFS dataset that sits at 800% compression. An upside of ZSTD is also that decompression speed is not a function of the compression settings. So using zstd at it’s maximum (bearable) settings (already upgraded my restic repo) is well worth it for backups.

                                2. 1

                                  I just read the article linked from that github (https://restic.net/blog/2015-09-12/restic-foundation1-cdc/) and it looks like “content-defined chunking” is just a new term for the same rolling hash concept used by borg (and bitbottle). Is there some reference that can explain the difference?

                                  1. 4

                                    It think that linked article already does it, but doesn’t call out explicitly. They’re completely different concepts, just used together in this case. You could have CDC without a rolling hash (for example calculating sha each time) and you can use rolling hash for whole fixed size blocks without doing chunking. Restic and borg use them both to achieve the same thing.

                                  2. 1

                                    Do you know by chance if kopia also has “content defined chunking”?

                                1. 3

                                  I couldn’t find any examples or mention of Zstandard or Brotli in the Axum code base. It could be at this point that Axum would be better placed behind a dedicated reverse proxy if this sort of support is important to you.

                                  All the tower middleware are usable with Axum.

                                  Like this one https://docs.rs/tower-http/0.1.0/tower_http/compression/index.html

                                  let middleware_stack = ServiceBuilder::new()
                                  .layer(HandleErrorLayer::new(handle_timeout_er
                                  ror))
                                          // .load_shed() // ???
                                          .concurrency_limit(1024)
                                          .timeout(std::time::Duration::from_secs(2))           .trace_for_http()
                                          .compression()
                                  
                                  1. 2

                                    That’s a really good point. Cheers for highlighting that.

                                  1. 2

                                    I wonder if people are using systemd-homed with luks. I think systemd-homed can encrypt your home (and do other things) so I wonder if it’s redundant.

                                    1. 1

                                      Yes, LUKS is just the crypto engine for any backing block device you fancy, and that includes flat files. https://wiki.archlinux.org/title/Systemd-homed#LUKS_home_directory

                                      1. 1

                                        I mean, would you use both full disk encryption with LUKS and LUKS_home_directory at the same time?

                                        1. 4

                                          I could imagine using both if you share a laptop with someone. FDE provides a layer of defense to the laptop as a whole, and then homed provides a layer against your nefarious laptop-mate. The same could apply to a multi-user server.

                                          1. 1

                                            Thanks!

                                    1. 7

                                      I want to note that Gitter is currently backed by Matrix, and their web client will be replaced by a variant of Element once feature parity is reached. https://element.io/blog/gitter-is-joining-element/

                                      Most of the development effort has been going towards Element. https://github.com/vector-im/element-web/issues?q=sort%3Aupdated-desc+Gitter

                                      1. 6

                                        Also, matrix is supposed to get zulip-style threads one day. https://news.ycombinator.com/item?id=31132819

                                        1. 3

                                          Threads are already in beta on some Element clients.

                                          1. 5

                                            Yes, but they are planning to support both style of thread.

                                            I really like zulip’s threads, but I never had the chance to use it much.

                                        1. 3

                                          I thought the same guy’s video on using that cheap scope to troubleshoot a Commodore 64 board was even more interesting than the review.

                                          1. 1

                                            I similarly diagnosed and repaired my old C64, except I only used a multimeter and a $10 logic analyzer.

                                            1. 2

                                              Can you do most of the thing with a logic analyzer vs an oscilloscope?

                                              I was thinking of getting a logic analyzer and use that nice open source tool that I forgot the name of.

                                              Found it: https://sigrok.org/wiki/Main_Page

                                              1. 2

                                                Logic analizers give you a low vs high logic level reading. Oscilloscopes show you the actual signal voltage level, which itself is useful.

                                                Generally speaking, having an oscilloscope is indeed better, but only logic analyzers will give you a lot of channels and very high sampling frequency on the cheap.

                                                1. 2

                                                  Gotcha. Thank you very much :)

                                          1. 3

                                            I wonder what is the advantages over using the tracing crate with #[tracing::instrument].

                                            1. 4

                                              I’d guess you don’t need the whole tracing setup (can be quite a lot of stuff) and you get insights into stuff that’s in-flight, so you can observe problems as they happen, and not afterwards

                                              (see also tokio console)

                                              Can tracing even tell you anything about scheduler load ? I haven’t seen anything about that in my traces at least. Maybe that is different if you enable tracing for everything and sort out the load of data that’s not from your code.

                                              1. 1

                                                Can tracing even tell you anything about scheduler load ? I haven’t seen anything about that in my traces at least.

                                                Sorry for the late reply. Yeah, I didn’t see anything about the scheduler with tracing. Thanks!

                                            1. 3

                                              Just a nitpick, but blogs should have the published date of the articles.

                                              1. 3

                                                Agreed. We actually have it in the source, but for some reason the Pelican templating isn’t outputting it.

                                              1. 1

                                                Is there something like this or litstream to replicate Postgresql -> sqlite? For “offline” support.

                                                1. 1

                                                  Is Delta Lake only for big data, or could it be useful sometimes for smaller projects?

                                                  1. 2

                                                    It used to be only for big data because you can only read/write it from Spark. With the new rust implementation, this is not the case anymore: https://github.com/delta-io/delta-rs. You can use it for smaller project as well.

                                                  1. 10

                                                    I do care about cookies

                                                    1. 3

                                                      You’re in luck then. Soon every single useless site will have a banner :)

                                                      1. 12

                                                        Except the sites that don’t try to track you :)

                                                        1. 4

                                                          My hope is that sites will see their numbers drop from having the banners and rethink the policy of tracking everyone. You can still have analytics without saving identifying information, you can still show content without tracking the user. There is no need for this behaviour. Having said that I don’t have an issue with people blocking the banners, apparently the majority don’t even block ads so I can’t see this becoming widespread enough to damage the incentives.

                                                          1. 2

                                                            What about default Apache servers or WordPress installations? I was under the impression that GDPR technically requires them to have a banner, but I find that ridiculous.

                                                      1. 1

                                                        Why is the bundle named “Machine Learning” if the majority of the books are not about it?

                                                        1. 11

                                                          I can’t wait to say “acktually it’s Rust/Linux”.

                                                          1. 15

                                                            “Acktually,” I don’t think it works that way, or we’d call it C/Linux, right? :)

                                                          1. 1

                                                            I wonder why no password manager has support for hashicorp’s vault. I guess I also wonder why vault has so few 3rd party tools. It’s like almost nobody uses it.

                                                            1. 3

                                                              Adobe has a GUI one: https://github.com/adobe/cryptr I wrote a POSIX shell one: https://hg.sr.ht/~zie/vpw

                                                            1. 11

                                                              Wow, that’s almost as expensive as the Dygma Raise, but for a more basic, non-split board…

                                                              wait. It has a USB 3.2 Gen 2 hub. With two Type C ports for plugging devices in, i.e. not counting the port for the computer. That definitely makes it much more valuable than expected, as true USB-C hubs (as in, not just C-to-many-A, but to-many-C) are still super rare.

                                                              1. 4

                                                                I don’t get it. Wouldn’t it be better to use an external hub, so you can upgrade it when the USB standard will change again?

                                                                1. 2

                                                                  C-to-many-C won’t give you enough current. Since it’s shared with your keyboard, you don’t even want to jam the signal with any high throughput stuff. So it’s practically useless, especially on a keyboard.

                                                                  1. 8

                                                                    Your claims sound bogus to me but I have nothing concrete to dispute them. But I do use my keyboard+mouse through a USB hub and never noticed any issues even when reading data full speed from a USB SSD on the same hub.

                                                                    1. 2

                                                                      The maximum is still 900 mA going down. SSDs typically use less power than HDDs. My HDD draws near 900 mA, and it doesn’t work well with anything else on a same hub.

                                                                    2. 5

                                                                      From a naive search on internet, USB-C seems to be capable of quite enough to handle high throughput stuff:

                                                                      USB 3.2, released in September 2017, replaces the USB 3.1 standard. It preserves existing USB 3.1 SuperSpeed and SuperSpeed+ data modes and introduces two new SuperSpeed+ transfer modes over the USB-C connector using two-lane operation, with data rates of 10 and 20 Gbit/s (1 and ~2.4 GB/s).

                                                                      https://en.wikipedia.org/wiki/USB-C

                                                                      I’m not sure what you mean by jamming the signal as even with keyboard + mouse + external SSD + 1G Ethernet cable, we’d be far from 10Gbps possible with 1 single USB-C cable.

                                                                  1. 11

                                                                    Breathing gymnastics is a system of breathing exercises that focuses on the treatment of various diseases […]

                                                                    Nafas helps you find your way to a detoxified energetic workday […]

                                                                    🙄

                                                                    I’m sure it can help people relax and stuff like that. (EDIT: not /s, people feeling better is a good thing)

                                                                    1. 4

                                                                      Frankly, the page worth’s of crypto donation links don’t inspire confidence either

                                                                      1. 1

                                                                        Why?

                                                                    1. 7

                                                                      I manage my dotfiles with git and home-manager so I have no real use case for this but for someone new to dotfiles this looks promising.

                                                                      1. 1

                                                                        Could it still be useful for config files that can’t be read-only?

                                                                        1. 2

                                                                          Yes, you can use link https://github.com/knl/dotskel/blob/main/home.nix#L17.

                                                                          That essentially creates a matroshka of symbolic links, where the last one points to the checked out file. This is because for nix, all files have to be in the nix store. However, home-manager uses a clever trick to store as the content the pointer to the file outside of the nix store.

                                                                          I’ve used chezmoi in the past, but switched to home-manager as it’s model is easier for me to understand.

                                                                          1. 2

                                                                            Those are just in my git repository in my home directory.