danielquinn

joined 2 years ago
[–] danielquinn@lemmy.ca 6 points 1 day ago* (last edited 1 day ago) (2 children)

The bit of information you're missing is that du aggregates the size of all subfolders, so when you say du /, you're saying: "how much stuff is in / and everything under it?"

If you're sticking with du, then you'll need to traverse your folders, working downward until you find the culprit folder:

$ du /*
(Note which folder looks the biggest)
$ du /home/*
(If /home looks the biggest)

... and so on.

The trouble with this method however is that * won't include folders with a . in front, which is often the culprit: .cache, .local/share, etc. For that, you can do:

$ du /home/.*

Which should do the job I think.

If you've got a GUI though, things get a lot easier 'cause you have access to GNOME Disk Usage Analyzer which will draw you a fancy tree graph of your filesystem state all the way down to the smallest folder. It's pretty handy.

[–] danielquinn@lemmy.ca 1 points 2 days ago

Plus the FF extension is really full-featured. I can clip in different formats or even take a screenshot if the webpage makes clipping hard.

I didn't even know there was a Firefox extension! I might give it a look.

[–] danielquinn@lemmy.ca 8 points 2 days ago (1 children)

It's shit like this that makes it so hard to support unions.

The North American auto industry has failed miserably to produce vehicles people want, instead opting for high-cost monster trucks with low visibility and high fatality ratings. They deserve to be decimated by companies producing smaller, more efficient, and safer vehicles, but no. They'll have to pry these monster abominations from our cold dead nation instead.

Unions are proving time and again that they can't be trusted to be on the right side of critical issues like climate if it means some people might be out of a job that kills people.

[–] danielquinn@lemmy.ca 2 points 4 days ago

I was a Windows user as a kid in the 80s & 90s doing pirate installs of 3.11 and later 95 for friends and family. I got into "computers" early and was pretty dedicated to the "Windows is the best!" camp from a young age. I had a friend who was a dedicated Mac user though, and she was bringing me around. The idea of a more-stable, virus-free desktop experience was pretty compelling.

That all changed when I went to school and had access to a proper "Mac lab" though. Those motherfuckers crashed multiple times an hour, and took the whole OS with them when they did it. What really got to me though was the little "DAAAAAAAAAAA!" noise it would make when you had to hard reboot it. It was as if it was celebrating its inadequacy and expected you to participate... every time it fucked you over and erased your work.

So yeah, Macs were out.

I hadn't even heard of Linux in 2000 when I first discovered the GPL, which (for some reason) I conflated with GNOME. I guess I thought that GNOME was a new OS based on what I could only describe as communist licensing. I loved the idea, but was intimidated by the "ix" in the name. "Ix" meant "Unix" to me, and Unix was using Pine to check email, so not a real computer as far as I was concerned.

It wasn't until 2000 that I joined a video game company called "Moshpit Entertainment" that I tried it. You see, the CEO, CTO, and majority of tech people at Moshpit were huge Linux nerds and they indoctrinated me into their cult. I started with SuSe (their favourite), then RedHat, then used Gentoo for 10 years before switching to Arch for another 10+.

TL;DR: Anticapitalism and FOSS cultists lead me into the light.

[–] danielquinn@lemmy.ca 1 points 4 days ago (1 children)

What exactly is an external drive case? Are you just talking about a USB enclosure for a single drive or something that can somehow hold multiple drives and interface over something more stable than USB?

[–] danielquinn@lemmy.ca 21 points 4 days ago (3 children)

Joplin will do this for you. It comes ready to sync with all sorts of cloud options, as well as "local folder" which works well with Syncthing. It's offline-first, cross-platform, and FOSS.

[–] danielquinn@lemmy.ca 7 points 1 week ago

I agree 100% with this take and want to thank you for that excellent video! I'm not all the way through yet, but I'm thoroughly enjoying it.

[–] danielquinn@lemmy.ca 18 points 2 weeks ago (5 children)

...or contribute to Mozilla's work while getting something in return.

[–] danielquinn@lemmy.ca 3 points 2 weeks ago (1 children)

That's exactly the reasoning Google has followed with its development and promotion of webp. Unfortunately, whether the website cares or not, CO₂ emissions are markedly higher due to increased client energy consumption, and that does directly affect you, so it's worth considering the implications of using webp in a popular site.

[–] danielquinn@lemmy.ca 15 points 2 weeks ago* (last edited 2 weeks ago) (5 children)

Webp is pretty great actually. Supporting a 32bit alpha channel means I've actually managed to reduce file sizes of what were formerly PNGs by something like 80%, which drastically improved performance (and the size of my project). I don't get where the complaint of image quality came from either, as it seems to perform better than JPEG at the same file size.

The worst part is that you missed the real problem with the format: the CPU overhead (and therefore the energy cost) of handling the file. A high-traffic site can dramatically increase the energy required for the images processed by the thousands/millions of clients in a single day, which places a drain on the grid and emits more CO₂ (yes, this is really a thing that people measure now).

Basically Google invented the format to externalise their costs. Now, rather than footing the bill for bigger datacentres and greater bandwidth, they made everyone else pay for decompression.

[–] danielquinn@lemmy.ca 19 points 2 weeks ago (1 children)

That's pretty dark. I love it.

[–] danielquinn@lemmy.ca 71 points 3 weeks ago

Oh we're passionate alright, in a "fuck that country in particular" fashion.

 

I've been a Steam customer for a very long time, having spent a few thousand dollars over the years with them. Like many of you, I've got a (small?) group of games that I bought and barely-if-ever played, and I'm cool with that. As they say, piracy is a service problem, and Steam is just... easy.

That was until I bought my Deck. Suddenly, I had two devices on which I could play my games: my proper gaming rig upstairs and my Deck plugged into the TV downstairs.

I also however, have a kid that likes video games, so sometimes I let her play a few games on the TV... and that's where everything breaks down. If she's playing Lego Marvel on the Deck, my copy of Dyson Sphere Program flakes out upstairs with a warning that "someone else is playing a game, so this game will have to shut off" or some nonsense like that.

I'm suddenly face to face with the fact that I don't actually own my games and those few thousand dollars weren't spent on what I expected. It's... enraging to put it gently.

I can appreciate that there would be an attempt to prevent me from playing the same game on two devices (though I think that's bullshit too), but to prevent me from playing two different games on two different machines when both are legally purchased running on my own hardware is not ok.

 

I find the whole "Ctrl+b followed by another key" way of navigating tmux to be too cumbersome to warrant a switch away from something like Tilix where I can hit Ctrl+Alt+| and the screen splits vertically, or Alt+Left to switch to the terminal on the left. I think it's the mandatory release of all keys followed by more keys that does it.

Is there a way to tell tmux to understand that "Alt+Left means switch to the terminal on the left" and bypass the whole Ctrl+b song and dance altogether?

 

I'm a web developer, mostly with Python and have close to zero Java or Kotlin experience, but I want to build a bunch of tools for my phone where I can Share a URL (for example) to an app that simply takes that URL string and sends an HTTP POST request to a pre-arranged URL with some pre-arranged headers or POST data.

So basically I'm looking for an app that:

  • Lets you define a series of endpoints
  • Accepts share intents from other apps to then bring up a selector asking "Which endpoint do you want to send this to?", sends it, and exits.

It seems a little nuts that I should have to develop a separate app for each endpoint, when the app experience isn't really something I'm interested in. Can someone here point me to an app that already does something like this? I'd prefer a FOSS option if possible, but at this point I don't even know what to search for.

Example use-cases:

  • Send a YouTube URL to a service that downloads said video and stores it on a share on my VPN
  • Send a text snippet to a service that stores that snippet as a Markdown file for use as ideas for future blog posts
  • Send an article URL to a service that strips the ads and images out and saves a Markdown file for future reading.
 

cross-posted from: https://lemmy.ca/post/33126960

 

From time to time, often after I've restored from sleep or finished playing a Steam game, one of my CPU cores is pinned at 100% with no indication of what might be doing it. Running htop, btop, or GNOME system monitor all show the same thing: CPU0 at 100% while the rest are doing near-nothing, and no process in particular seems to be using those resources.

If I restart, it's back to normal, and sometimes I can play a game in Steam or let the computer go to sleep and it doesn't do this, but it happens often enough that's annoying/confusing so I'd like to know if there's a way to either (a) diagnose which processes are using which CPU cores, or (b) somehow "reset" the checking of these values to make sure that something's not just being misreported.

This is a desktop system running Arch & GNOME.

62
Developing with Docker (danielquinn.org)
submitted 1 year ago* (last edited 1 year ago) by danielquinn@lemmy.ca to c/python@programming.dev
 

I've been writing code professionally for 24 years, 15 of which has been Python and 9 years of that with Docker. I got tired of running into the same complications every time I started a new job, so I wrote this. Maybe you'll find it useful, or it could even start a conversation, but this post has been a long time coming.

Update: I had a few requests for a demo repo as a companion to this post, so I wrote one today. It includes a very small Django demo user Docker, Compose, and GitLab CI.

 

It would seem that I have far too much time on my hands. After the post about a Star Trek "test", I started wondering if there could be any data to back it up and... well here we go:

Those Old Scientists

Name Total Lines Percentage of Lines
KIRK 8257 32.89
SPOCK 3985 15.87
MCCOY 2334 9.3
SCOTT 912 3.63
SULU 634 2.53
UHURA 575 2.29
CHEKOV 417 1.66

The Next Generation

Name Total Lines Percentage of Lines
PICARD 11175 20.16
RIKER 6453 11.64
DATA 5599 10.1
LAFORGE 3843 6.93
WORF 3402 6.14
TROI 2992 5.4
CRUSHER 2833 5.11
WESLEY 1285 2.32

Deep Space Nine

Name Total Lines Percentage of Lines
SISKO 8073 13.0
KIRA 5112 8.23
BASHIR 4836 7.79
O'BRIEN 4540 7.31
ODO 4509 7.26
QUARK 4331 6.98
DAX 3559 5.73
WORF 1976 3.18
JAKE 1434 2.31
GARAK 1420 2.29
NOG 1247 2.01
ROM 1172 1.89
DUKAT 1091 1.76
EZRI 953 1.53

Voyager

Name Total Lines Percentage of Lines
JANEWAY 10238 17.7
CHAKOTAY 5066 8.76
EMH 4823 8.34
PARIS 4416 7.63
TUVOK 3993 6.9
KIM 3801 6.57
TORRES 3733 6.45
SEVEN 3527 6.1
NEELIX 2887 4.99
KES 1189 2.06

Enterprise

Name Total Lines Percentage of Lines
ARCHER 6959 24.52
T'POL 3715 13.09
TUCKER 3610 12.72
REED 2083 7.34
PHLOX 1621 5.71
HOSHI 1313 4.63
TRAVIS 1087 3.83
SHRAN 358 1.26

Discovery

Important Note: As the source material is incomplete for Discovery, the following table only includes line counts from seasons 1 and 4 along with a single episode of season 2.

Name Total Lines Percentage of Lines
BURNHAM 2162 22.92
SARU 773 8.2
BOOK 586 6.21
STAMETS 513 5.44
TILLY 488 5.17
LORCA 471 4.99
TARKA 313 3.32
TYLER 300 3.18
GEORGIOU 279 2.96
CULBER 267 2.83
RILLAK 205 2.17
DETMER 186 1.97
OWOSEKUN 169 1.79
ADIRA 154 1.63
COMPUTER 152 1.61
ZORA 151 1.6
VANCE 101 1.07
CORNWELL 101 1.07
SAREK 100 1.06
T'RINA 96 1.02

If anyone is interested, here's the (rather hurried, don't judge me) Python used:

#!/usr/bin/env python

#
# This script assumes that you've already downloaded all the episode lines from
# the fantastic chakoteya.net:
#
# wget --accept=html,htm --relative --wait=2 --include-directories=/STDisco17/ http://www.chakoteya.net/STDisco17/episodes.html -m
# wget --accept=html,htm --relative --wait=2 --include-directories=/Enterprise/ http://www.chakoteya.net/Enterprise/episodes.htm -m
# wget --accept=html,htm --relative --wait=2 --include-directories=/Voyager/ http://www.chakoteya.net/Voyager/episode_listing.htm -m
# wget --accept=html,htm --relative --wait=2 --include-directories=/DS9/ http://www.chakoteya.net/DS9/episodes.htm -m
# wget --accept=html,htm --relative --wait=2 --include-directories=/NextGen/ http://www.chakoteya.net/NextGen/episodes.htm -m
# wget --accept=html,htm --relative --wait=2 --include-directories=/StarTrek/ http://www.chakoteya.net/StarTrek/episodes.htm -m
#
# Then you'll probably have to convert the following files to UTF-8 as they
# differ from the rest:
#
# * Voyager/709.htm
# * Voyager/515.htm
# * Voyager/416.htm
# * Enterprise/41.htm
#

import re
from collections import defaultdict
from pathlib import Path

EPISODE_REGEX = re.compile(r"^\d+\.html?$")
LINE_REGEX = re.compile(r"^(?P<name>[A-Z']+): ")

EPISODES = Path("www.chakoteya.net")
DISCO = EPISODES / "STDisco17"
ENT = EPISODES / "Enterprise"
TNG = EPISODES / "NextGen"
TOS = EPISODES / "StarTrek"
DS9 = EPISODES / "DS9"
VOY = EPISODES / "Voyager"

NAMES = {
    TOS.name: "Those Old Scientists",
    TNG.name: "The Next Generation",
    DS9.name: "Deep Space Nine",
    VOY.name: "Voyager",
    ENT.name: "Enterprise",
    DISCO.name: "Discovery",
}


class CharacterLines:
    def __init__(self, path: Path) -> None:
        self.path = path
        self.line_count = defaultdict(int)

    def collect(self) -> None:
        for episode in self.path.glob("*.htm*"):
            if EPISODE_REGEX.match(episode.name):
                for line in episode.read_text().split("\n"):
                    if m := LINE_REGEX.match(line):
                        self.line_count[m.group("name")] += 1

    @property
    def as_tablular_data(self) -> tuple[tuple[str, int, float], ...]:
        total = sum(self.line_count.values())
        r = []
        for k, v in self.line_count.items():
            percentage = round(v * 100 / total, 2)
            if percentage > 1:
                r.append((str(k), v, percentage))
        return tuple(reversed(sorted(r, key=lambda _: _[2])))

    def render(self) -> None:
        print(f"\n\n# {NAMES[self.path.name]}\n")
        print("| Name             | Total Lines | Percentage of Lines |")
        print("| ---------------- | :---------: | ------------------: |")
        for character, total, pct in self.as_tablular_data:
            print(f"| {character:16} | {total:11} | {pct:19} |")


if __name__ == "__main__":
    for series in (TOS, TNG, DS9, VOY, ENT, DISCO):
        counter = CharacterLines(series)
        counter.collect()
        counter.render()
 

I'm working on a some materials for a class wherein I'll be teaching some young, wide-eyed Windows nerds about Linux and we're including a section we're calling "foot guns". Basically it's ways you might shoot yourself in the foot while meddling with your newfound Linux powers.

I've got the usual forgetting the . in lines like this:

$ rm -rf ./bin

As well as a bunch of other fun stories like that one time I mounted my Linux home folder into my Windows machine, forgot I did that, then deleted a parent folder.

You know, the war stories.

Tell me yours. I wanna share your mistakes so that they can learn from them.

Fun (?) side note: somehow, my entire ${HOME}/projects folder has been deleted like... just now, and I have no idea how it happened. I may have a terrible new story to add if I figure it out.

 

I've been playing a lot of Fallout 4 over the holidays. I started and finished the Nuka World DLC (killed all the baddies), made it to level 90, etc.

Today I was playing on my Deck as the battery got a little low (11%) so I saved my game, exited the game, and went to shut down.

As it was shutting down, the Deck displayed a message, something like "Syncing to Steam Cloud" as the logo was spinning.

A few hours later, on a full charge, I booted it back up, started Fallout 4 again and... some of my old saves are there, but only about 30% of them, and critically not the most recent ones.

Has this ever happened to anyone else? Is this a known issue? Can I fix it, or report it? I've basically lost interest in finishing the game now.

 

[For reference, I'm talking about Ash in Alpine Linux here, which is part of BusyBox.]

I thought I knew the big differences, but it turns out I've had false assumptions for years. Ash does support [[ double square brackets ]] and (as best I can tell) all of Bash's logical trickery inside them. It also supports ${VARIABLE_SUBSTRINGS:5:12}` which was another surprise.

At this stage, the only things I've found that Bash can do that Ash can't are:

  • Arrays, which Bash doesn't seem to do well anyway
  • Brace expansion, which is awesome but I can live without it.

What else is there? Did Ash used to be more limited? The double square bracket thing really surprised me.

 

The other day someone was complaining about the new ad blocker-blocker on YouTube and I mentioned that it might be fun to write a Firefox extension that would just load up yt-dlp and play the video through mpv.

It turns out, writing a Firefox extension is easy and tricking Firefox into launching yt-dlp isn't much harder (though it does require some annoying configuration on the user's end).

Anyway, if you're a Linux user, feel free to try it out. I don't know how much I'm going to pour into this, but as an exercise of "can this be done", it was pretty good for a few hours on a Friday night.

view more: next ›