Welcome!

Hello, welcome to my blog! This is where I collect my projects and other thoughts!

This website is divided in these sections:

  • Arduino: hardware projects and my journey logbook in electronics;
  • Programming: all of the software I wrote;
  • Italy: stuff that is either in Italian or only relevant if you live there;
  • Blog: works in progress, thoughts, ideas, unit tests, documentation, and everything else.

You can find most resources via the sidebar or the header menu. Have a look around, follow me on social media to receive updates!

Flipping coins securely over the Internet

I have built Live Coin Flips after I’ve spent some time thinking how can two persons, in remote locations, flip a coin and agree on the result. It’s more challenging than what it looks like at first; flipping a coin while on a live video call is probably the easiest way, but it is not always feasible, and also any sleight-of-hand trick is much much easier to do remotely.

See for example these guys on YouTube predicting the coin flip outcome every time:

So I’ve come up with the idea of using a third-party, independent, unpredictable, universally agreed upon, continuous source of randomness. After some candidates I’ve singled out one: the Bitcoin price.

To make everything simpler, I’ve built a web application to calculate the outcome every minute. By deciding on a date in the future (it doesn’t need to be in the far future, just far enough for the Bitcoin price to not be published yet), you also commit on a certain coin flip outcome which will happen on that date.

You can see it in action here: Live Coin Flips

Let’s go back to static websites

In the era of continuously generated AI content, we can hardly describe the web as static. Yet, Amazon’s “static website” tool seems may be good enough for most.

I’ve collected a couple tools to create static websites on AWS S3, and manage the basic tasks (update SSL certificates, upload files and the like). Want to know why? Read on.

First, even by AWS price standards, static websites on S3 are dirt cheap. They scale with the amount of users, so for a small “experimental” website it might be pennies. This should be compared with the cost of a VPS that is in the 5$/month or so at the cheapest. If the traffic stays small, I have estimated that for around 100kB of data a page, the final cost for a million page loads would be around 10$. Egress fees is about the only cost here.

The other big advantage is scale. Serving a million page loads with a 5$/month VPS can be challenging. The few times by blog had thousands of visitors/hour, WordPress would struggle keeping up. For an S3 bucket however, that’s hardly a problem.

Third, why not; most of my blog viewers would perceive this website as “static” anyway (at least those that don’t leave comments… would you believe this was a thing? Leaving a comment in a website?). I have a feeling that anything that doesn’t need synchronous server-side logic can magically become “static”. Also platform maintenance is greatly simplified.

I’m probably not saying anything new here, but I always think about how much “the cloud” can scale up, without spending a minute thinking how much it can scale down. This is one of those occasions where it does. And actually, I wish it would happen more often.

Leather EDC keychain 2.0 pattern

This keychain wallet features some pockets to hold everyday items. Options vary. I use to carry a Leatherman Piranha (which is TSA compliant but don’t be too optimistic), a pen, a comb, tweezers, some business cards. The key rings have rivets; for a once-in-a-while job you can try at the local shoe repair store to ask to apply the rivets for you.

My only note here is that pocket width should be adjusted based on what you want to put in it.

Leather glass case pattern, lined with rolled edges

This is the pattern I use to make glass cases. This pattern has rolled edges. They are tricky to get right, but they allow to line the case with fabric. I use Italian printed silk. The silk is glued using glue sheets.

The pattern has a couple concentric lines. The inner line is where skiving should start (this is the most difficult part). The fabric should be glued at least up to the stitching points.

If skiving goes wrong, you have the option to patch it with some other leather rectangle, like the blue one in these pictures. Or throw it away and start over.

Leather 40mm belt pattern

This is the pattern I use to make belts. It is meant for 40mm wide belts. It is fully stitched (no rivets).

A wedge is needed to shape the belt loop. I recommend letting the loop rest for 48 hours. Wetting the loop will probably bring better results. The loop length should be adjusted based on the leather thickness.

I also recommend thinning the leather on the part where the loop is, with the help of a skiving machine.

Leather magnetic cable holder pattern

Let my first pattern to be related to wires. It’s a cable holder. It’s meant to tidy up your cluttered wires. It doesn’t look like it came out of a datacenter.

This holder is designed to wrap a 10x20x60mm magnet, and stick to a magnetic surface (in the picture, it’s a magnetic glass wall). Dimensions might need a bit of adjustment as Chinese magnets tend to have impredictable sizes.

Leather projects and patterns!

I’ve picked up leathercrafting as a hobby for several years now. It is kind of my personal take on 3d printing; more functional, more elegant, and when done right your projects will last forever.

I have a bunch of original designs collecting dust, maybe sharing them here will be of use to someone.
For the time being, I’m not going to include detailed tutorials, but just the patterns.

There is a fee of 19.99€ per download, but just for today, it’ll be free.

Making things on a beach: bamboo tongs

Instead of solving sudokus, why not making something useful for the environment?

Did you ever go to a beach so far away from everything else, so isolated, so hard to access, to find out it is littered anyway? That’s not unexpected: isolated places are gorgeous, but they have nobody that looks after them. Do you remember when #TrashTag was trendy? I might be a couple of years late but I decided to took the matter in my own hands anyway or at least do my part of picking up some bags of trash.

The bamboo tongs are very effective at picking up trash from the sand (also for relocating the occasional jellyfish, if needed). You’ll find out that if you can see trash on the sand surface, it means there will be (a ton of) more trash below. Bamboo is pretty common on the seaside, it’s sturdy, and the tongs are long enough to make me feel safe whatever I pick up.

Making the tongs is simple, but here is a step-by-step guide anyway. Be careful with sharp tools.
Find a bamboo stick with at least 2 uncracked sections, ideally around 2cm thick, at least 20cm long.
Cut it sideways so that you keep a “knot” about 2cm from the tip.

If your Swiss army knife has a reamer, it’s a good time to use it as a drill tip to make a hole. Do it about 2cm from the knot, on both sides of the bamboo.

Then with a knife make a cut at the side of the hole, pointing down the long end. The round hole will prevent the crack from going upwards.

You’ll end up with a chopstick-like bamboo strip, that you can discard.

Starting from the round hole again, cut diagonally. Try to cut in a straight line. Don’t overdo it and don’t rush it. Don’t cut the bottom away. Make several incremental passes. The bottom end of the tong should be almost flat.

Pinch the tong to check it is straight. Flatten the contact points so that the whole border touches each other.

That’s it. Don’t forget to bring a small bag with you; the best places to go don’t have trash bins, so a bag is always handy to clean after yourself, and with a simple tool you can also leave the place a little better than how you found it.

The laws of cooking as Venn diagrams

I’ve been reading Justin Warner’s excellent cooking book The laws of cooking: and how to break them.
I tried to make an extreme summary of the laws, and represent them as Venn diagrams, where each set in the diagram is a set of flavours that work well together according to the book. Do not worry, it’s not a spoiler: the book is still very worth buying.

I was expecting something more complicated to show up: only 3 flavours belong to more than one set (if we don’t count “Salty”, which goes well with everything). And this is including a slight personal “update” to the laws that I made, by splitting the “sour” flavour in two different flavours: “sweet” and “acid”.
Also, for those of you that try to avoid fat foods, I have bad news.