• 0 Posts
  • 607 Comments
Joined 3 years ago
cake
Cake day: June 10th, 2023

help-circle

  • HTTP sends data in plain text, without any sort of verification. If you’re a malicious actor it’s a dream.

    While you need to understand a little bit of cryptography to fully understand it we can simplify a lot of you just accept public/private keys work. If you want to learn more about it you can read the wiki, but for the time being just accept that there’s a way to generate a pair of keys, a public one you share with the world, and a private one only you know, and that with these it’s possible for people to use the public key to send messages that only you can read, and for you to use the private keys to sign messages in a way that anyone can verify it’s you using the public key.

    So, HTTP is just a protocol to send text over the network, anyone can grab a package and read it. To make it secure there are some specific sites that contain a list of sites and their public keys. Your browser has an internal list of these sites. When you try to access, for example Google, your browser contacts one of these sites, and asks for Google’s public key, when it gets it it encrypts the message leaving only the header (which says this message is for Google) unencrypted and sends it. For everyone in the middle of the road they see a message for Google containing garbage, but when Google gets it they use their private keys to read it. Then whatever they reply they can sign it so that you can use the key to verify it came from them.

    With that in mind you might have noticed that what the server sends you back is plain text and publicly viewable. Therefore, every time you connect to a website there needs to be a handshake procedure, in short you send a message to the site (encrypted with his public key) telling it to reply to you using a public key you send them, now besides signing the message they also encrypt it using the key you gave them. And voila, no one can know what you said to the server because you encrypted it with its public key, and no one can know what the server told you because it encrypted it with your public key.

    This is a simplification of the protocol, but that’s the core idea on how it works. You also might have noticed that everyone can see who you’re talking too, and that there’s no way around that since your message has to reach the server other computers HAVE to know where to send it to. But, if you have access to another computer to use as a Hub, you can send messages to that computer encrypted with its public key where the content is an encrypted message to the site you’re actually trying to access, so no one knows where they go afterwards, and it can then send it to the site you’re trying to access. When it gets the response it can then encrypt it to send to you.

    That doesn’t really work if you’re the only one accessing that middle computer, but if lots of people do then it’s impossible to know what message is for who, because from the outside you see a bunch of messages directed to that computer, and a lot of messages from that computer to different sites. Some companies offer this service, its called Virtual Private Network, or VPN for short. Another reason why VPNs are important is that you have the public key on your system, so there’s less surface of attack.


  • Let’s get into very basic things.

    You have two computers you want to connect, you grab a cable, plug it in both and voila!

    You now need to connect a third computer, you could have a three way cable, but that makes it hard to replace things. Instead you have a box that has multiple connectors and internally it just connects all of them, essentially making a multi-end cable ok demand, this is what’s called a Hub because it’s just a centralized location where every package goes in/out.

    But now your machines need to know how to send messages to one or another, so you implement a protocol where each machine has a number, and every message sent you encapsulate in a header saying something like “For X”, and computers know their own number so they can discard messages that are not for them.

    Cool, but as you add more computers and longer cables the signal might become weak, you could add a very small chip to that box and some electricity so it can now act as a repeater. Most hubs were also repeaters, it was a small extra cost but a lot of extra functionality so it was an easy choice.

    As you add more computers you start to have an issue, whenever two computers send a message at the same time they collide and no one receives it. Now, this is silly, you have computer 1 sending a message to computer 2 and computer 3 sending a message to computer 4, there’s no reason these should collide, but because of the Hub they do (because both messages are actually sent to all computers and they just discard what’s not for them).

    It’s time to make your box a bit smarter. Instead of naively sending all messages everywhere, you add a computer there, it can understand the protocol we described before, and instead of just being a blind signal repeater. This box now knows which port each computer is plugged in, and so when 1 sends a message to 2 the signal only goes from the port 1 to the port 2, all other ports are free and can send messages at the same time. This is what’s called a Switch, because it switches what output the message goes to.

    Cool, but now we have two separate networks, which means there are two Computer 1. You can’t just put one cable between the two switches because they won’t know where computer 1 is. Each switch needs to have it’s own number, and you need to wrap the message twice, e.g. Computer 1 connected to switch 1 wants to send a message to computer 2 connected to switch 2. Switch 2 is connected on port 5 to switch 1, so you wrap your message with something like “For 5, For 2”. The first switch sends to 5, the second switch receives it, notices it’s for himself, discards the first wrapper, and sends to 2.

    Magic, right? Well, not quite, you need to know where computer 2 is located, and know all of the path to it. That’s not feasible for users to manage. What if we gave each computer a unique number across networks? It would be a sort of an Inter-Network Protocol address, or an Internet Protocol address for short, or even shorter IP. So now each computer has a unique number, and computer one can just send a message to computer 10 and not have to worry where it is.

    But how does the message actually get to computer 10? Well, it’s time to add some extra logic to our Switch, and have it store a table of routes, so it knows that computer 10 is on port 5. Because they now not only know what’s on their ports but what route a package needs to take to reach its destination between networks this device is called a Router.

    And there you go. A short introduction to network to explain what a router is and how it works. Obviously I simplified a lot of stuff and the real thing is a lot more complex, but this should give you a good ELI5 version of routers and networking.


  • One thing that helped shift my perspective was to use it for its intended purpose. I have it enabled on my code editor to use for auto-complete instead of traditional code parser or snippet library, it’s honestly very good at that, it still makes a few mistakes and suggests shitty code, but overall I think it mostly works and it’s easier to hit tab and have the full for loop or small function written and correct the variable access it got wrong when it does.

    Another thing that has made it very useful to me was in situations where I need to write code using libraries or languages I’m not used to. Having a copilot or Claude tab opened and asking it how to do certain stuff is a lot faster than reading the documentation to figure out the API or syntax. If something doesn’t work you feed it the error and it usually spots the problem. This has made me a lot more productive with for example Jenkins, since it’s a different language from what I use for everything else, and to properly test it you have to commit the code and let the pipeline run, before LLMs this was a very tedious work of reading docs, stack overflow, extrapolating responses, etc. Now it’s still tedious work, but at least I have my first draft much quicker and can then deal with the hallucinations or obsolete APIs it told me to use.





  • No, hate speech should not be protected, and there’s an obvious reason for that. We already recognize that speech that purposely harms people is not protected, for example going into a theater room and screaming FIRE causing people to panic and stampede and killing someone the person will be charged with involuntary manslaughter. That is not so different from someone going online and saying “gay people should be killed” and causing people to go out and do that, in fact I would even drop the involuntary from the charges against that person, because his intention was clearly to incite someone to do it. I’m not taking away the responsibility from the person who committed the act, but this situation is similar to a how in a group planning a crime even the boss who was in every meeting telling people to commit the crime but did not actually participate in gets charged with. And the same excuses apply “No, I didn’t think that because I told them to go and kill someone they would do it” is not a valid defense for a mafia boss, and it shouldn’t be for any person with public influence.


  • Alexander is a common name, but it depends on context, if you say “at the time Alexander conquered X” most people would understand, but if you say “Alexander was here” you might be talking about a work college.

    There’s not only one Caesar, while you probably beat Julius Caesar, Augustus, Tiberius and others were also “Caesar”, and you might referring to any of them. For example, “give to Caesar what is Caesar’s” does not refer to the same Caesar you probably meant.

    Slim shady is a made up name and it’s way more specific than <common name> the <common adjective>.

    Charlemagne is short for Charles Magnus, or in English Charles the great, so that’s exactly the same.

    Attila is a very unique name, I’ve never met nor heard about any other Attila so the name is disambiguation enough, but it’s likely that if that is a common name in some country they have an extra qualifier to it, I’ve heard Attila the Hun, but there might be others.

    There’s nothing special, if a name is common you need disambiguation, if a name is overly specific you don’t, same reason why we have last names, “I met with John the other day”, “which John?”, “The Smith”, “Ah yeah, John Smith, not John the son of Richard”, “No, I haven’t seen John Richardson in a few weeks”.





  • One of my favorites are the chains between Spanish and Portuguese:

    • Garbage in Spanish is Basura
    • But Vassoura in Portuguese means broom
    • But in Spanish broom is said Escova
    • Which in Portuguese means brush

    Or

    • Tea cup in Spanish is Taza
    • A Taça in Portuguese is a wine cup
    • But in Spanish wine cup is a Copa
    • And in Portuguese a Copo is a regular glass
    • But in Spanish regular glasses are called Vaso
    • Which in Portuguese means vase.

    Or

    • Cutlery in Portuguese is Talher
    • But Taller in Spanish is a workshop
    • Which in Portuguese is Oficina
    • Which in Spanish means office
    • But in Portuguese you say Escritorio
    • Which in Spanish means desk

    Or a short one:

    • Your last name in Portuguese is your Sobrenome
    • But in Spanish Sobrenombre is your nickname
    • While in Portuguese nickname is Apelido
    • But in Spanish Apellido means last name

    Another one I like is Vamos a chatear 1 rato which in Spanish means “let’s chat for a little while” but in Portuguese means “let’s bother a mouse”.


  • Sure, but “camera” doesn’t really mean room, it means chamber, which is a small enclosed space, and if you grab a box it is a camera by definition (just a very small one). And if you close every place where light can get into a small chamber you get a “camera obscura” which just means a dark chamber. And if you poke a hole on a camera obscura you will see an image of the outside being projected on the opposite wall. This was a very common trick in pre-industrialization, and became known as Camera Obscura, from then someone had the idea to put photosensitive material, also known as photographic, on the opposite wall and created the first photographic chamber, or “photographic camera”, which eventually was abbreviated to camera.

    So yeah, they mean different things, but not really.


  • Batman: I could see a street level Batman without as many gadgets in a more rudimentary batcave still be Batman. I think this is because if you take away all of the wealth Batman is still Batman, an excellent detective with extensive martial arts training who enjoys terrorizing criminals.

    Iron Fist: that’s a title, like Ghost Rider or Spawn there are other Iron Fists that are not rich. So while not exactly the same there are some Iron Fists that are not rich.

    Iron Man: I don’t think Iron man without money would work. Either you would have to change a core detail of him or it wouldn’t make sense that he’s not rich. The main defining characteristic of Iron man is his suit, which requires an extraordinary power source. So either he doesn’t understand the power source (e.g. it’s an alien artifact) or you would have to explain why he doesn’t sell products with a similar power source and becomes rich.


  • Cryptocurrency is a decentralized digital currency, it can be used for the same thing as any other digital currency, the difference being that you can use it without relying on a centralized authority like a bank or similar financial institutions.

    Yes you can buy pizzas with it, although that’s less common nowadays because there are more practical ways to pay for that and you probably don’t mind the bank and government to know you buy pizzas.

    I thought what made money money was everyone agreed it was valuable and was willing to exchange it for goods and services directly. I don’t see that with crypto.

    You don’t? If I were to offer you 1BTC for your mouse, would you accept it? If you say no you’re stupid, if you say yes you confirmed you see it as valuable and are willing to exchange it for goods directly.



  • Bitcoin in specific doesn’t scale, but other things like Bitcoin Cash scale without increasing the energy usage, because the energy cost of PoW Blockchains comes from their security, not from the scale, so doing 1 or thousands of transactions costs the same.

    Plus, things like Ethereum have migrated to PoS which uses very small amount of energy comparable and also scales without increasing energy costs.