Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

How to upload images with e.g. WhatsApp in Firefox

Posted by admin |

Images can show up blank. In that case:
In about:config, Set

privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts

to

false

and allow WhatsApp access to canvas data.

It seems to be enough to toggle this,  confirm access for Whatsapp, and toogle it off again We'll see.

Web WhatsApp shows blank/white image : firefox

Jul 10, 2019 01:30

A salsa video with Magna Gopal & June from Seoul 2008

Posted by admin |

For whatever reason, this dance video has stuck with me, I like it:

https://www.youtube.com/watch?v=GBWMOurhmpk

 

If the embed doesn't work, follow the link!

Jul 04, 2019 10:40

Taleb's fundamental notion: ­The world is nonlinear

Posted by admin |

A random like on Twitter reminded me of this old tweet:

 

taleb
Click to view full-size image…

 

Jul 01, 2019 12:01

Testing electrical scooters (kickbikes, mopeds) in Stockholm

Posted by admin |

Tried 3 electric scooters (kickbikes) rentals in Stockholm: Tier (Austrian, I think), Lime (American) and Voi (Swedish). The scooters are everywhere! I think the way they look & work though will evolve rapidly, because commercial use sets a different set of constraints.

  • Tier is the best scooter, but they become unavailable at late evenings
  • Lime has jerky accelerator
  • Voi is ok, with super availability and a stronger motor than Tier

Tier lacks external battery so I guess they have to collect all scooters every evening. Voi & Lime can just switch batteries. Hope Tier upgrades soon. It has smooth throttle & mechanical brake, & half the price/minute. These kind of vehicles the way they are designed today are front heavy & thus handle a bit weird.

tier
Click to view full-size image…

Update 2019-06-27: As can be seen above, some of the Tier scooters now have been fitted with external batteries (the black bulb halfway down the back of the steering column) afaict. The competition goes on… However I also see Tier scooters without this modification. Update 2019-06-30: Tier still shuts down the entire network at around 22.00 every day. That is truly weird. Also, their bikes seem to dropped back in clumps of four to six, near metro stations. Unless then, tier travellers like to travel and abandon their bikes in packs of six…

Better scooters ahead


Once they start designing their own rental vehicles they could well place the battery further back to ge a better weight distribution methinks. Update: I think that is exactly what Lime-S Generation 3 does! They do not mention it but you can see the space under the floorboard. And as you can see demonstrated in the above video I just found, Voi does it too. Also bigger wheels. I have not seen these new ones in Stockholm. Anyone who has been skating on inlines on surfaces with cones or stones, knows how much every extra couple of millimeters at the wheels help (in inlines from e.g. 72mm to 80mm). Voi will also try a three-wheeler as can be seen in the background of the above video.

An electrical moped

800px Blinkee electric scooter in Burjassot
Click to view full-size image…

Also tried the @blinkeecity (Polish company) moped. With a passenger I think it all weighed in at 218 kg! & you need to balance that with a wide stance due to the floorboard of what I'm fairly sure is a Viarelli Vincero. Good experience but this ain't no kick bike. Price/min not much higher than a kickbike though!

I think the moped itself weighs in at just below 90kg.

 

Jun 23, 2019 10:55

Breaking changes in Riot-js 4, first impressions from the migration guide

Posted by admin |

Firstly, it's interesting with a migration guide that starts with saying you should not migrate. What is meant afaict is that you should upgrade your brain to write for Riot 4, but keep old components on e.g. Riot3.

Migration Guide · Riot.js

Version 3 documentation is here https://v3.riotjs.now.sh/

A number of things have changed that I have not used, such as the observable pattern and referencing parents and children.

More verbose

Pretty much all changes will make you write more code inside of a web component. That is a minus I think.

Some good things

The general idea is to be more compatible with contemporary javascript syntax.

There is one thing that has changed that I think is for the better and that is that the "refs" way of referring to DOM elements is gone and instead replaced by the jquery-like selector "$". That makes more sense. I have never used the "yield" tag but it sounds like the new term "slot" is a better word for it.

Some things that add lines of code

Methods operating on the component now need to be wrapped inside an "export default" block, which adds code. I guess you could just put the method names in there and keep the rest outside of the export block. The inline logical statements of the form {truthyOrFalsyTing ? 'iftrue': 'iffalse'} seem to have been removed, and instead you are supposed to create or import functions and put them in the template.

Conclusion

I see no reason to upgrade now, which is inline with the recommendation in the upgrade guide. I'll look through a bit more later onto the new things and see if there is some cool stuff that I'd like to use.

Also

It is hard to find the old docs on the riot site for verison 3, I think they have been deleted, and hence many Google links are broken. I had to go to GitHub to find stuff. I now see that the new FAQ refers you to https://riot.js.org/v3, but that page does not exist.

Jun 06, 2019 02:40

How to add a 12GiB swap volume on Ubuntu

Posted by admin |
sudo fallocate -l 12g /mnt/12GiB.swap

sudo chmod 600 /mnt/12GiB.swap

sudo mkswap /mnt/12GiB.swap

sudo swapon /mnt/12GiB.swap

echo '/mnt/12GiB.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab

Source: https://help.ubuntu.com/community/SwapFaq#How_do_I_add_or_modify_a_swap_partition.3F

May 23, 2019 11:20

"docker-compose up" on Ubuntu 19.10, by Jove it stays up!

Posted by admin |

I had to run a docker-compose file today to get access to some cool services and had big problems getting the services out of it that I thought I would. It all seemed a bit old. It turned out that I ran an older version of this file 2 weeks ago, and I never ran "docker-compose down". I did do a ctrl-c though which in older Ubuntu versions seemed to settle the matter. But in 19.10 it seems different. It stays up.

Those old containers have been running on my laptop through hell and high rain for two weeks now, through approximately 20 restarts and shutdowns of the laptop. And I could not get them down afaict with "docker-compose-down" now, since that file has changed. Systemd starts docker every reboot and then docker starts its stuff, including the containers.

I had to resort to docker rm and docker kill to get the new stuff up.

May 22, 2019 03:40

How to set up a semi private Syncthing system

Posted by admin |

Syncthing is designed to be secure even when running mutual discovery between your computers and relaying their data — through servers that are all run by other people. As long as the TLS encryption holds up, the data should be safe. But if you think it may not be safe you may want to run it a little more private. First in order to make it somewhat private you will need to set up a relay server; you can see my notes here for Ubuntu: Notes on getting a syncthing relay server running on Ubuntu 18.04LTS


However, the computers cannot discover each other through the relay server, for that a discovery server is needed. This threw me a bit, since I thought the relay server would be enough. However it is not. This means that you need to run a private discovery server or be cool with the public discovery server. How you feel about depends a bit on whether you're cool with the announcements of your machines being somewhat public or not.

May 06, 2019 05:20

Notes on getting a syncthing relay server running on Ubuntu 18.04LTS

Posted by admin |

I created a dedicated user with a shell so that I could easier see why things did not work. It may also automagically work if you do everything right from the beginning.

It can be good to know that the server is called "strelaysrv" on Ubuntu, which the Ubuntu man page does not mention, but instead uses the "relaysrv" name.

You have to make sure the keys for the server are stored where the server can find them. One way of doing this is to supply the -keys parameter to ExecStart in systemd. For a systemd conf, see https://wiki.archlinux.org/index.php/Syncthing#Running_a_relay

Clients will not connect to the server unless they know the server's key, so you have to configure them with an id parameter and not just protocol, server and port:

relay://server.example.com:22067?id=<id string>

The key is output by the server on startup, which you can catch if you run it from the command line (if you have shell).

If you forget to incude the id of the relay server, these are the errors you get (or at least I got) on the client side:

Disconnecting from relay relay://relay.example.com:22067 due to error: EOF
c.S.listenerSupervisor: Failed service 'relay://relay.example.com:22067' (2.985913 failures of 2.000000), restarting: false, \
error: "{relay://relay.example.com:22067 relay://relay.example.com:22067} returned unexpectedly", stacktrace: [unknown stack trace]

On the server side I believe it was:

read: connection reset by peer

and:

connection refused

 

May 02, 2019 12:55

Serverless Syncthing vs Dropbox — You may need a server anyway

Posted by admin |

Since Dropbox doesn't support my file systems anymore, I decided to take a look at Syncthing and Sparkleshare, free and open source folder synchronization alternatives. Syncthing is by far the most polished of these two offerings. It's also cool in that it is peer-to-peer and hence has no center.

Instead it goes point to point and if that doesn't work it (which due to NAT it often does not) it relies on a public cluster of relay servers, or you can run your own if you do not trust that the public servers are unable to read the encrypted traffic.

However the p2p nature of Syncthing becomes a bit of a problem if you want to sync between your own devices, because obviously the sync can only work if the machines are switched on and online at the same time. For your laptops, this is unlikely. And hence Syncthing does not work for that scenario. Unless you have an always on machine also in the mix (you can sync many machines, not just two).

But what do we call a machine that is always switched on? Yup, a server. Although the system would be robust since if you lose that machine you can just fire up another one and everything works again.

Still Syncthing feels like it is more for synchronizing files between people. And there git may be a contender. Still Syncthing looks great and I will see if I can tailor it to my needs. Worst case scenario I'll put two servers in the mix, one for relaying and one for making sure synching always works!

That would be two-server serverless architecture :) But with great resilience since the servers can be replaced at any time.

Apr 28, 2019 11:15