HNHacker News
TopNewBestAskShowJobs

sakisv

973 karma · joined September 16, 2015

https://www.sakisv.net
submissionscomments
sakisv··on Web Scraping in Python – The Complete Guide
My main drive was to document the crazy price hikes that's been going on in my home country, Greece, so I'm scraping its 3 biggest supermarkets and keep track of the prices of their products*

Had a lot of fun building and automating the scraping, especially in order to get around some bot catching rules that they have. For example one of them blocks all the requests originating from non-residential IPs, so I had to use tailscale to route the scraper's traffic through my home connection and take advantage of my ISP's CGNAT.

You can take a look here: https://pricewatcher.gr/en/

* I'm not doing any deduplication or price comparisons between the supermarkets, I only show historical prices of the same product, to showcase the changes.

sakisv··on Web Scraping in Python – The Complete Guide
The way I'm bypassing it is by using tailscale to route the scraper's traffic through my home connection and take advantage my ISP's CGNAT. Works like a charm.
sakisv··on Web Scraping in Python – The Complete Guide
Came here to write about Playwright. I've been using it for the last ~13 months to scrape supermarket prices and it's been a great experience.
sakisv··on Confusing Git Terminology
Ah yes, the fact that git brings the remote stuff locally when you `git pull` and all the `origin/<whatever>` are just branch names is something that I realised only too late.

As for the refs, yes, good point ;)

sakisv··on Confusing Git Terminology
> "Detached HEAD" means that HEAD is pointing directly to a commit, instead of pointing to a branch pointer.

Ah, thanks for pointing it out, always good to learn the finer distinctions

sakisv··on Confusing Git Terminology
A recent scenario had to do with me rebasing something to squash out some intermediate commits, and then I opened a PR, only to realise that some of the things I squashed I actually needed them.

With reflog I was able to go back before my rebase and redo it again, more carefully this time. (Unfortunately I couldn't just cherry-pick the thing I wanted)

In general it saves you from having to do what you described with delete/re-clone/re-apply things.

sakisv··on Confusing Git Terminology
I was having a similar hard time to remember most of these (the remaining ones I just don't use often, so I still haven't quite grasped).

The single thing that made everything "click" together is that most things are just pointers to commits: branch names, HEAD, tags, all of them are pointers.

HEAD is pointing to the commit you're currently looking at

The name of each branch (e.g. `my-feature` points to the latest commit of that branch)

When you're on main and you `git checkout -b my-feature` then you have at least 3 pointers to the latest commit on main: `main`, `my-feature` and `HEAD`.

Every time that you make a commit on `my-branch`, then both the `HEAD` and `my-branch` move to point to the new commit.

"detached HEAD" means that the the `HEAD` (the commit you're looking at) is not pointed at by a branch.

The difference between tags and branches is that the tags point to a specific commit and do not move.

----

The other thing caught me out multiple times is that most commands seem inconsistent because git assumes default arguments:

`git checkout file.txt` is the same as `git checkout HEAD -- file.txt`

When you're on `my-branch`, `git rebase main` is the same as `git rebase main my-branch`

The difference is that the latter you can run it from other branches too.

----

Last but not least, when everything goes wrong, the single command that can take you out of any weird situation is `git reflog` which shows you all the commits that HEAD has pointed to.

Having said all that, I'm glad that git is acknowledging all this confusion and are implementing commands with fewer surprises and simpler interface as that will make it easier for newcomers to pick it up.

sakisv··on Confusing Git Terminology
Ah, but it's not switched! Remember that rebase essentially replays commits against a different branch/base commit:

e.g. if you have your branch `feature-1` and want to rebase it on `main`, then you would do `git checkout feature-1; git rebase -i main`

Git will then switch to main (that's "ours" now) and then it will replay the changes from `feature-1` on top of it (that's "theirs" now) - like cherry-picking all your commits, but in sequence (and not actually merging them in `main`)

sakisv··on Using extra Firefox profiles to make my life better
For a moment there I hoped that this was about using some kind of new interface to manage profiles but unfortunately not.

While it's been ages since I last used Chrome I remember that it was so easy to switch between different profiles with a couple of clicks.

Firefox on the other hand really doesn't want you to use them: https://support.mozilla.org/en-US/kb/profile-manager-create-...

We just have to hope that at some point in the future they'll revamp it.

sakisv··on Cash payments above €3000 to be outlawed in Netherlands
Wow Greece has a limit of 500 euro, but: "There is no cash limit for car purchases"

wth?

EDIT:

Also this something that I didn't know about the UK

> With regard to the change, there are unlimited payments of £ 5, £ 2 and £ 1. Coins with a face value of 50p, 25p and 20p can pay amounts up to £ 10, with 10p and 5p up to £ 5 and with 2p and 1p up to 20p.

sakisv··on Comparing K3s with vanilla Kubernetes
Well, for me the whole replace-letters-with-numbers thing is idiotic and requires some inside knowledge to understand which letters are replaced by all the numbers in words like a11y i19n k8s, etc.

On the bright side you can put whatever you want there. Personally I read k3s as "kerts", because why not. Similar to "thirds" but with the "t" from kubernetes.

sakisv··on Midjourney CEO Silencing Satire About Xi Jinping
If I may point out here that if we take the word "democracy" at face value (i.e. That the ruling entity needs to have the support of the majority of demos) then most countries are really not democratically governed:

The people in charge get voted in by a minority of the people who go to vote - which gets even worse if you account for people who are eligible to vote but abstain.

sakisv··on Treat your to-read pile like a river, not a bucket
The lede is buried near the end:

> To return to information overload: this means treating your "to read" pile like a river (a stream that flows past you, and from which you pluck a few choice items, here and there) instead of a bucket (which demands that you empty it). After all, you presumably don't feel overwhelmed by all the unread books in the British Library – and not because there aren't an overwhelming number of them, but because it never occurred to you that it might be your job to get through them all.

I find the analogy with the British library spot on, and very liberating.

sakisv··on Git commands you probably do not need
This is precisely what reflog shows you btw, i.e. all the things that HEAD has pointed to.

Running it after a rebase it's very informative, for example it helps clarify things like "ours" and "theirs".

sakisv··on Git commands you probably do not need
Yes, this another thing doesn't get said enough to a beginner:

A branch is nothing more than a pointer (or mark) to a commit.

This realisation along with the `git reflog` command I wrote above, made for a tremendous mental shift and suddenly almost everything around git just clicked together.

sakisv··on Git commands you probably do not need
The single best command that made working with `git rebase` infinite times easier is

    git reflog
At the very least it will stop you from "oh I fucked up the <rebase/merge/cherrypick/whatever> so bad that I must delete and clone the repo again".

At best you can salvage commits that have been rebased out, get back whatever you happened to checkout and basically it's the best command I found that does true to the "it's almost impossible to lose something in git once you've commited it"

sakisv··on Amazon Closing AmazonSmile
Or, better yet, go from 0.5% to 0.6% or 1%.
sakisv··on The State of HTTP in 2022
Just a heads-up that cloudfront will return a 403 when it receives a GET with body.

It's documented and all but I still find it a peculiar choice. A 400 would have been better and less of a red herring.

sakisv··on Turn your best programmers into managers
Assuming it's not a joke site, I could kinda agree with some of the "values" but not with the "pointless tests".

I mean, I agree that some tests are, indeed, pointless, but I wouldn't trust someone who "just wants to program" to decide which tests are useful and which are pointless.

sakisv··on A simple guide on words to avoid in government
Maybe "createad a website", "built a website" are simpler and deliver the meaning.

My thinking is that if by "launched" we mean "deployed to production" then it's useless for the end user. If it's not deployed to production, then the user has nothing to visit so for all intents and purposes of the end user you haven't built anything (or launched).

sakisv··on Passwordless Authentication – Access Your Bitwarden Web Vault Without a Password
That's very nice, well done!

For a moment there I had hoped that maybe it would solve the problem in the opposite direction: I'm typing the master password so mechanically when I'm on my laptop, that I really struggle to remember it when I have to type it on a screen - to the point that I must go sit at a computer open a notepad, let muscle memory take over and then look at the screen to see what I typed /facepalm

Anyway, in all seriousness, while this is a scenario that happens very rarely, it still makes me wonder if it would be possible to do the pasdwordless login the other way, i.e. authenticate the phone using a trusted laptop (maybe a fingerprint enabled one)?

sakisv··on I strive to be a 0.1x Engineer (2016)
For me only the last one is a big red flag.

Apart from this, I'm of the opinion that one crucial job of a team lead/manager is protecting their team and, their product.

One way to do this is saying "no" to feature requests, being mindful of which hype to follow and balancing the value and the cost of doing so, etc.

sakisv··on Signal Introduces Stories
Nice, I like seeing new features being added - despite on my personal opinion about them. As someone else pointed out, the more feature parity we reach with WhatsApp (or other popular messengers) the fewer battles we'll have to fight to bring people over.
sakisv··on Cloud services like AWS or Google Cloud Platform may be the wrong choice
> Heroku/Dokku > Public Cloud >Dedicated servers in someone else's DC > Custom Hardware in custom built data centers.

I think stackoverflow and its siblings proved that having a handful of servers can go a very long way, even making cloud ops redundant.

Of course this is function of what you're optimizing for, and whether you want to go down the "boring monolithic app" route.

sakisv··on New Pegasus spyware abuses identified in Mexico
A bit of a tangent but a quick search didn't find any references to this so I may as well post it here:

There's a big wiretapping scandal going on Greece since the beginning of August, accompanied by an equally big attempt to cover it up.

What happened is that a Greek MEP discovered that there was an attempt by someone to infect his phone with Predator. Later it was confirmed that he was also being spied upon by the Greek Intelligence Agency during a period that he was running for leader of the 3rd largest party of the country (which he won).

This came as an addition to reports from a journalist that he being targeted by the intelligence agency when they were investigating the scandalous legislation that gave the country's bankers immunity.

The PM had admitted the spying of the MEP stating that "it was lawful, but wrong" and he fired the director of the intelligence agency as well as his nephew that was the director of the PM's office.

It's worth pointing out that the the first piece of legislation passed by the current government was one that transferred the intelligence agency directly under the PM. They also legislated more laxed criteria for the position of the agency's director to fit the profile of a person the PM had already chosen. It's worth pointing out that the PM claims that he didn't know the reason the MEP was being targeted and that he it would be outrageous if he knew.

Relevant news articles:

https://www.bbc.co.uk/news/world-europe-62822366

https://www.nytimes.com/2022/07/27/world/europe/eu-spyware-p...

https://www.theguardian.com/world/2022/aug/07/greek-pm-kyria...

https://www.theguardian.com/world/2022/aug/08/greek-pm-denie...

sakisv··on Rammstein Get Restraining Order Blocking Viagogo from Reselling Concert Tickets
Well following your reasoning, maybe they didn't want it that badly /shrug

In both cases you trade your time for a ticket, either directly or indirectly.

In both cases, having blackmarket as a service is not helping.

sakisv··on Rammstein Get Restraining Order Blocking Viagogo from Reselling Concert Tickets
> It is not ‘just because’, it’s because there are more people who want to go than there are tickets.

The emphasis is on the last part, i.e. "just because they could". My point is that they should not have been allowed in the first place.

> how do you suggest the tickets be allocated

First come first served. There are usually different price ranges anyway, so the market forces are already at play. I don't understand why we need to have black-market-as-a-service.

sakisv··on Rammstein Get Restraining Order Blocking Viagogo from Reselling Concert Tickets
Viagogo is one of the worst out there.

Back in 2015 I bought 2 tickets for AC/DC through them and I paid ~£270. When I got the tickets in my hands I saw that the price was ~£75-£80 each and Viagogo added more than £100, just because they could.

Kudos to Rammstein and I hope more bands will follow and help us get rid of these scammers.

sakisv··on Why we’ve decided to decommission Gov.uk PaaS
Something which won't exactly inspire confidence for any similar attempts in the future
sakisv··on Why we’ve decided to decommission Gov.uk PaaS
You'd think that this is something that would have be done before announcing the decommissioning in 18 months.
← PreviousPage 3 of 7Next →