rutrum

joined 2 years ago
[–] rutrum@lm.paradisus.day 8 points 6 months ago

There's so many useful methods for iterators its worth reading the doc page to familiarize yourself. Its wicked powerful: https://doc.rust-lang.org/std/iter/trait.Iterator.html

[–] rutrum@lm.paradisus.day 2 points 6 months ago (1 children)

No I was being accusatory unfairly. I've updated my post.

[–] rutrum@lm.paradisus.day 3 points 6 months ago (1 children)

Glancing through zettlr's website and docs, Im not sure I understand it. Is it just notetaking software, that utilizes pandoc to build professional documents (via pdflatex)? Whats an example use case?

[–] rutrum@lm.paradisus.day 4 points 6 months ago (1 children)

Wow, all in 600 lines of python. Looks great!

[–] rutrum@lm.paradisus.day 8 points 7 months ago (2 children)

How was jumping from windows to NixOS?

[–] rutrum@lm.paradisus.day 10 points 7 months ago* (last edited 7 months ago)

It might take a screenshot and keep in memory, and only save to disk after some image processing that detects if there is sensitive data.

[–] rutrum@lm.paradisus.day 17 points 7 months ago (2 children)

Hey OP, how do you follow all these updates? Is it RSS feeds on these projects? You're on top of it this morning.

[–] rutrum@lm.paradisus.day 9 points 7 months ago* (last edited 7 months ago) (1 children)

Flakes are just a mechanism of pinning dependencies to fixed versions. When you run a flake it doesnt matter if you're on 24.05, 24.11, or unstable, it'll produce the exact same output.

[–] rutrum@lm.paradisus.day 1 points 7 months ago (9 children)

Im a monero noob. Can someone explain the need of a ban list? And how it works?

[–] rutrum@lm.paradisus.day 1 points 7 months ago

Thats a great solution...Im not interested in learning a new slicer right now!

[–] rutrum@lm.paradisus.day 1 points 7 months ago (1 children)

First off, understanding the different data structure from a high level is mandatory. I would understand the difference between a dataframe, series, and index are. Further, learn how numpy's ndarrays play a role.

From there, unfortunately, I had to learn by doing...or rather struggling. It was one question at a time to stack overflow, like "how to filter on a column in pandas". Maybe in the modern era of LLMs, this part might be easier. And eventually, I learned some patterns and internalized the data structures.

[–] rutrum@lm.paradisus.day 1 points 7 months ago

You are correct. For some data sources like parquet it includes some metadata that helps with this, but it's not as robust at databases I dont think. And of course, cvs have no metadata (I guess a header row.)

The actually specification for how to efficiently store tabular data in memory that also permits quick execution of filtering, pivoting, i.e. all the transformations you need...is called apache arrow. It is the backend of polars and is also a non-default backend of pandas. The complexity of the format I'm unfamiliar with.

 

Came across a new nix wiki attempt. The announcement post is made on discourse with high skepticism.

But I really like it for two reasons:

  • For now, its incredibly informal and the barrier to entry is low. And because I can make edits directly in the web interface, it felt easy to contribute.
  • The creator mentions wanting this to be like the Arch wiki. In other words, contain information useful to nix users, but not necessarily nix specifically.

I was able to contribute a new article about distrobox, a tool I discovered and made a post about here a month or so ago.

Maybe we don't "need" another wiki, but the opportunity to contribute really made this one stand out to me. In case you all might want to contribute or learn something, I thought I would share.

 

I'm conflicted on what should handle my login manager, desktop environment, and window manager. What are the pros and cons of doing it from a nixos configurations versus a home manager configuration?

 

I made a post a while ago asking what you do when NixOS isn't cutting it. You need a package that isn't available as a flatpak/appimage or already in nixpkgs. You don't want to build from source, because it's either too difficult or too time consuming. One suggestion was containerization or virtual machines, but those seemed too cumbersome. Well, distrobox is the tool that fixes it.

Distrobox is a shell script that wraps over docker/podman to run a container of a distribution of your choice. But it does it behind a very high level API, and integrates the container environment seemlessly with your host environment. It is seriously as easy as this, if you need to install something with apt inside debian.

$ distrobox create -n my_debian --image debian:latest
$ distrobox enter my_debian

And bang, your in a debian container and it won't even feel like it. It automatically integrates your shell environment and maps your root directory inside the container (or something like that.) You seriously wouldn't know unless you neofetch. Best part is that since everything is in the nix store, every program in your environment should work, for the most part, inside this container. I've not noticed problems yet.

Tada! apt is available in this environment and you can install what you need. Then you can run it while inside the container. From the host machine, outside the container, you can run it directly too. Say you installed program X in debian:

$ distrobox enter my_debian -- X

And it will just run the command and send you back to the host machine.

In the case of docker, you can type docker ps and it will show you your debian image my_debian listed.

There's two more things I want to do to really polish this workflow. The first is to change my shell prompt so I know that I'm actually in debian without typing neofetch! Inside the box the variable CONTAINER_ID is set and the hostname is modified. I've adjusted my starship prompt to look like this when inside the box:

distrobox:my_debian ~ $

And lastly, I really want to blur the lines. If I install X in debian, I want to just call it directly from the host as X, not invoke my debian instance with distrobox enter.

When you type X and the program is missing, bash (and fish and zsh I'm sure) runs a hook that you can look at by typing

$ declare -p -f command_not_found_handle

By overriding this, you could first have it try the inside container if it can't find the application in the host container, like so.

command_not_found_handle () {
  distrobox enter my_debian -- $@
}

This is not a perfect solution, but I'm still experimenting with how to integrate this both seamlessly and also not accidentally run things inside debian and not realize it. If you have suggestions for how to improve handling calling commands from the outside environment, please share. Best case might just be adding aliases for programs explicitly. For example, `alias X=distrobox enter my_debian -- X.

Anyway, distrobox is the solution! This is one more barrier removed that was preventing me from moving my main computer over to NixOS. I'm so happy to have found this and wanted to share.

 

Dust is a rewrite of du (in rust obviously) that visualizes your directory tree and what percentage each file takes up. But it only prints as many files fit in your terminal height, so you see only the largest files. It's been a better experience that du, which isn't always easy to navigate to find big files (or atleast I'm not good at it.)

Anyway, found a log file at .local/state/nvim/log that was 70gb. I deleted it. Hope it doesn't bite me. Been pushing around 95% of disk space for a while so this was a huge win 👍

 

I came across privacy.com, a service that generates virtual credit cards, like aliases for your real credit card that can be paused or discarded at any moment.

My own credit card company has this feature. But it requires a browser plugin that so obviously is there to track my spending habits, so I've not wanted to consider it. Privacy.com looks like a great alternative.

But is it even worth it? It may be a hastle, but I can also cancel my actual credit card at any moment and they will send me a new number immediately and a card a few days later. From a privacy prospective, how much can a company use my credit card credentials to track me? Maybe a third-party virtual card provider even masks my own purchases so not even my credit card company knows? Not sure about that one.

Please share if you use one, who its with, and if its worth it.

 

I've been spending a couple weeks unable to modify my system, because using my window manager was ungodly slow (like 1fps.) Luckily NixOS lets you pick a previous generation to load so I could make changes, build a new generation, and try again.

It took me too long to find, but I realized I had both the x session managed by both nixos and home manager. Removing this fixed the problem. I assume this had 2 xsessions open and they were competing for resources or something. Be cautious! :)

 

This is the 800ml server from Hario. I make 600g water / 30-35g coffee in it every morning.

I drink my coffee slowly, and really like it hot. When I made a single 300g cup of coffee, I'd time my consumption wrong and it would be lukewarm before I finished. I didnt necessarily mind this, but now that I've been using this server I get hot coffee on demand, very conveniently.

I downsized my regular mug for a teacup, so I always get just enough hot coffee to sip and enjoy before it loses too much temp. So now I drink a lot of small teacups worth instead of a regular mug. I recommend you try this style of serving coffee and see if its for you.

Bonus: this has been so helpful when making for multiple people, since I dont always know when others wake up or come downstairs. Since its a huge insulated server I never worry about not being able to serve my roommates hot coffee.

 

Every now and then I see a program that doesn't have a default.nix or flake.nix in the source, doesn't have an entry in nixpkgs, and otherwise can't find a derivation for. So I write them myself.

What's the best way to share these? Should I contribute to nixpkgs? (does this count if I'm making flakes?) Do I maintain a single repo for each program? Or do I create a repo with a collection of flakes? Something else?

 

Hi all, I've been getting into nix lately (I've been posting here frequently) and wanted to know what projects everyone is working on. Are you trying to integrate nix into an existing project? Contribute to nixpkgs? Experiment with your configs?

 

Short video from Vimjoyer on how to setup a firefox install using home manager and flakes. In particular, the focus of this video was how to use an external flake as a source for firefox extensions, since they aren't available in nixpkgs.

 

I came across this article when wondering how to integrate the "building" aspect of nix (that is, not just a devshell) with static websites or other projects that involve some output that is not an executable.

This article also talks about adding inputs from GitHub that aren't necessarily flakes. I've used this myself to pull some example configurations for certain programs that I haven't felt like tinkering with myself yet.

 

I'm been wanting to move over my main desktop for almost a year now. But from 3+ years of tinkering, installing applications, and configurations Ive been super hesitant. The jump from Ubuntu to NixOS would be a big one. I have a laptop running nixos thats given me some exposure to the nix language, but when it comes to my main rig, I still have the worry of "what if something I need wont be available?" and "what if I forget something?"

Well I finally tried home manager and wow, its the absolute perfect way to slowly transition to nixos. I'm slowly going through my package managers (cargo, npm, pip, apt, snap) and checking for applications that I can just drop into my home.nix. And every now and then I see an app I cant install (say, vtracer from cargo, very cool app). Well, I just make a mark and eventually I'll build my own derivation around it.

Home manager has been easing my worries as I make the transition. For those of you also unsure, I recommend integrating with home manager. You can do such small jumps at a time, no need to go full blown nix all at once.

view more: ‹ prev next ›