danielquinn

joined 2 years ago
[–] [email protected] 15 points 19 hours ago (1 children)

It's a rather brilliant idea really, but when you consider the environmental implications of forcing web requests to ensure proof of work to function, this effectively burns a more coal for every site that implements it.

[–] [email protected] 42 points 3 days ago* (last edited 2 days ago) (1 children)

I'm a Canadian that's lived in the EU, and then moved to the UK just as they Brexited. Your statements here are inaccurate.

At irregular intervals, the EU is given more powers in order to have more power.

The EU is a collection of independent states who, through an ever-evolving complex array of treaties between those states have formed a cohesive union to pursue their collective interests. Each state makes its own decision to become a party to a treaty or not, and so what you might see as a singular union from the outside is actually a patchwork of agreements when you look closer.

At no point is the EU "given" power, nor is it taken. However, in the interests of the union in general, many of these treaties have non-negotiable requirements. Notoriously, membership in the customs union requires the freedom of movement, goods, and capital. Additionally, there's considerable pressure to applying members to join the Eurozone as that simplifies a lot

There is currently a debate about whether the 27 armies should be converted into a European army.

This is a great illustration of my point above. The EU does not have its own standing army. Instead, the member states have not seen any value in forming one... that is until recently when Russians started invading nations on its borders and the cohesive structure of NATO started falling apart. Now people are talking about it, and if the idea proves workable, some of the EU states will likely propose and possibly sign a treaty. It is highly unlikely that membership in the EU would automatically include membership in a defence union.

Canada would lose its powers and passing them on to the EU.

This is sort of true, but no more so than how we've given up our rights with other treaties. For example, were Canada to join the Schengen treaty, we'd have to allow passport-free access from Schengen member countries, in exchange for our rights to do the same. To reference a treaty you might be more familiar with, under NAFTA, Canada enjoyed a stable market for its oil exports to the US, but under that treaty, Canada's hands were tied when looking for non-US markets for that same oil. Like any treaty, it's a relationship with give-and-take, hopefully to the mutual benefit of both parties.

You would have to adopt the Euro as your currency and the European Central Bank would make interest rate policy.

This is likely, though as a member of the EU and Eurozone, Canada would have seats in the European Parliament, respresentation in the the European Commission, and would therefore have some influence on things like interest rate policy.

Conversely, consider the benefits of joining the Euro vs. our current situation where our currency is effectively tied to the US dollar because our economies are so tightly coupled. Consider the implications of tariff-free trade without currency conversions between 27 rich countries.

Of course there are more positive things, but you have to understand and accept that you would lose some of your independence.

This is the classic eurosceptic line: "but muh indententz!" It's a claim made in a vacuum of ignorance about how the world actually functions.

All EU member states are independent for some value of that term. Canada is economically and politically dominated by the US. They've bullied our government, crippled our industries, and even killed national projects like the Avro Arrow, and yet we still think of ourselves as "independent".

We live in a community of nations, and with that comes living with the understanding that we can't just invade other countries and take whatever resources we like. That's a restriction on our independence, but we don't see it that way because it's normalised. Similarly, Italy can't stop Germans from moving to Milan and setting up sausage restaurants, and the Dutch can't sell their own feta-like cheese and call it "feta" because it wasn't made in Greece. Sure that's an encroachment on their "independence", but it's a move that makes sense as it also means that Italians can live in France, and the Dutch can secure the rights to the name "gouda" in the markets of 27 member states.

It's not about giving away your independence. It's about forming a super-state with like-minded nations to grow your power as a collective and making that decision as an independent state.

I've lived in Vancouver, Ottawa, Toronto, Amsterdam, London, and Cambridge. I watched the UK tear itself from the Union and have seen first hand what a catastrophic act of self-harm that was, all in the name of "independence". The UK is now poorer, more xenophobic, and less safe. Were Canada ever offered the opportunity to join the EU, I should hope that we'd do better than the Brits.

[–] [email protected] 2 points 6 days ago* (last edited 6 days ago)

Everything people blame him for is basically what you would get from an average leader of the liberal party.

Exactly. He's a hypocrite, and drove a wedge through this country that won't heal for a long time.

  • The man campaigned on the environment and then literally bought a pipeline to shield fossil fuel companies from financial risk.
  • He later further subsidised the fossil fuel industry by sending the RCMP, armed like soldiers onto native land to evict people from their homes, literally hacking through their front doors with axes, all to clear the way for a pipeline.
  • He wouldn't shut up about how progressive and welcoming Canada is, but the quotas for refugees from desperate countries remained tiny compared to other nations a fraction of our size.
  • He lied about electoral reform, and when the working group returned with the answer he didn't like, threw out the whole process.
  • During the pandemic he made a lot of (necessary) political decisions to limit freedoms, but refused to acknowledge the way those reforms affected affected Canadians differently. When the poorer classes reacted to these limits in massive popular protest, he labeled them racists and Nazis rather than acknowledging their plight and offering better support. He also made a lot of objectively idiotic decisions, like locking down the country while allowing international flights and blocking driving across the US border.
  • He made a big song and dance about how Canada wouldn't sell arms to Israel due to their genocide campaign, then started shipping those arms to Israel via the US instead.
  • Finally, on his way out the door, as one of his final acts as PM, he gets behind a mic and declares himself a Zionist.

All of this is about what he did. When a much longer list could be written about what he didn't do over a ten year term as the most powerful man in the country. He neglected critical portfolios like the environment, housing, infrastructure, and poverty while simultaneously devaluing the currency and allowing greedflation to balloon.

In other words, he did the classic Liberal thing of campaigning on what the country needs, and then doing the opposite or nothing at all.

As an expat, I'm glad to see the back of him. The man wrapped himself in the good reputation of my country and then sullied it. Canada is worse off now than it was in 2015 and zero progress has been made on the critical issues of our time.

[–] [email protected] 5 points 6 days ago

Occupy, resist, produce!

[–] [email protected] 5 points 6 days ago (2 children)

I upvoted 'cause "types while bootlicking" was genius. The actual article is trash though.

[–] [email protected] 2 points 6 days ago

This. The Liberals haven't earned union support, and electing Carney, who as far as I've read is just another neoliberal capitalist should be a warning that their pattern of abuse will continue.

[–] [email protected] 5 points 6 days ago (10 children)

A lot of people are going to tell you that "it's the algorithm", and there's some truth to that, but honestly I think it's a lot more straightforward:

The boomers got everything, and when they burned through that, they burned through the millennials' share too. If you're growing up a zoomer, you're looking around at a world literally on fire, and the emergence of what is effectively feudalism as the dominant world ~~religion~~ economic system. You'll never own a home, because literally everything is rented now. You're probably working 2 jobs, though they barely qualify for that word because there's zero security and you're carrying all the risk.

You're watching a literal genocide playing out on your phone, while the outgoing Trudeau proudly declares himself a Zionist, and literally everything is expensive, especially food.

Now, consider the political climate:

  • The NDP (and to a greater extent, the entire global left) is toothless and obsessing over identity politics, and if you tell your friends you're going to vote for them you're either laughed at or told you're "wasting" your vote.
  • The Liberals are refusing to recognise the dire state of the economy and the fear & frustration you have. Instead they go on TV and say that the problem with the economy is "vibes" and that voting for Conservatives means you hate gay people.
  • The Conservatives acknowledge that fear and frustration. They don't gaslight you with claims that "the stocks are up, so the economy is fine". No, they cast blame: "Trudeau did this. He torched the economy for 'wokeism'. He put on silly costumes with foreign dignitaries while you had to move back in with your parents. He did this. Him, and those immigrants, and if you vote for us, we'll get rid of all of that".

They've got the best story, and their opposition is either inept or oblivious. If they hadn't made the mistake of cozying up to Trump, they'd be a shoe-in for the next election.

[–] [email protected] 8 points 1 week ago (1 children)

That's fair. Frankly, asking for donations is a half-decent way of gauging interest in a project as a whole, and if there aren't enough people in the whole world willing to meet a threshold for support, maybe the mountain of effort required to maintain said project isn't worth it.

[–] [email protected] 8 points 1 week ago (3 children)

"These Americans, they're out of their minds!"

Gotta love old people. They're all out of fucks to give.

Also, the dude is 101 years old and is sharper mentally than most people I've met over 60. We should all be so lucky.

[–] [email protected] 14 points 1 week ago

You wouldn't go directly from country status to state. It would be from "country" to "occupied territory", to "state". My point is that we'd never leave the occupied territory stage.

[–] [email protected] 4 points 1 week ago

A fascinating take on an old idea. I wish they'd spent more time covering the economics of mass producing these things.

 

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.

63
Developing with Docker (danielquinn.org)
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/[email protected]
 

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()
 

My father is 75 and not very capable on a computer. He's got an old MacBook Air at home behind a typical ISP router for which he has no access controls (so no port forwarding).

My immediate need is actually not his machine at all, but the Raspberry Pi I installed at his house before I left the country and forgot to enable cron on so it's not doing what I need yet. However, it would be really nice if I could also do one of the following as well:

  • VNC (or something) into his computer whenever something "isn't working" rather than doing the talk-him-through-it dance over Skype.
  • Install a new OS (the Mac is no longer supported by MacOS). I don't know how plausible this is though.

My current plan is to email him a shell script that should create a reverse SSH tunnel to a server in Montréal or something and then I can shell into his Mac through there. It's not ideal though since we're still talking shell scripts and he's easily frustrated.

I know that in Windows land there are all sorts of tools scammers use to take over a machine remotely. Does Mac allow for the same thing? Note that I only have Linux machines available to me on this side of the Atlantic.

 

A break from the usual in this community, but I trust it'll be appreciated. I think this is very solarpunk: using technology to improve the lives of all creatures.

 

I needed something for a presentation I'm doing on advanced Linux, so I thought something like this might be appropriate.

Annoyingly, I can't seem to get Bing to generate an image that isn't square.

 

[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.

 

...but I think I'd probably be miserable there.

I'm violently allergic to pollen, am terrified of bees, wasps, and grasshoppers, and generally despise bugs and dirt. My ideal world would see everything paved in marble. No cars, (obviously) with a quiet, sustainable, walkable communiy, but green, as beautiful as it is, causes me a great deal of pain.

It's there any place for me in a solarpunk world?

view more: next ›