Monthly Archives: January 2020

Force Vue Update ($forceUpdate)

Occationally you want to force some part of your Vue application to update. One situation is that I have a “big” web application not written in Vue, and somewhere I add a Vue component. Something in the world around it changes but it is not aware of it, so I want to force it to update.

It seems, the vm.$forceUpdate method is just updating the component itself, and children with slots. I didn’t use slots, and $forceUpdate was useless.

So, if you do myVue.$forceUpdate() without success, try:

    myVue.$children.forEach(c => c.$forceUpdate());

It might do what you want. It did for me.

QNAP TS 251+ for Container Station

PLEASE READ THE ENTIRE ARTICLE – ESPECIALLY ABOUT THE PROBLEMS IN THE END THAT OCURED OVER TIME. AT THE MOMENT I ONLY HAVE OBSCENE THINGS TO SAY ABOUT THE PEOPLE WHO DESIGNED THE QNAP WEB UI, AND YOU SHOULD STAY AWAY FROM BRIDGED NETWORKS AND VIRTUAL SWITCHES!

After many years of running home server systems on Raspberry Pi, another one broke down and I decided I can to better, so I bought a QNAP TS 251+ with two WD 6TB Red drives (suitable for NAS).

My objective here is to mostly use the QNAP with Container Station; for running virtual machines on it.

First Impression

The TS 251+ looks profesionally black, but it is all plastic. Installation was fine but for someone with little computer experience I would imagine it a bit scary. A few things to note:

  • It restarted several times for firmware upgrades, and restarting took some time
  • There are some “I accept privacy…”-things to accept. I guess it is fine. But one reason you get your own hardware instead of running in the cloud is that you know your data is private. So if you are paranoid, read the fine print or get into the details.
  • I suggest you familiarize yourself with RAID0, RAID1 and JBOD before you start it up.
  • I suggest you read about Static Volume, Thin Volume and Thick Volume, and make up your mind, before you start it up (I think Thin makes most sense, especially for use with Container Station).
  • The Web GUI is good – very “modern” – in a way that it almost feels like a desktop computer. A bit over-engineered and messy if you ask me. There are very many features and details, and it is a bit intimidating and confusing at first.
  • Container Station is just what I want and need!
  • I find it silent and cool enough (44C reported under load)
  • It automatically started some “Raid Syncronization” that takes about 24h with my drives. Guess it is fine, but it makes me a bit nervous with something new that I hesitate to restart or reconfigure it because it is doing something low-level and important.

Container Station Problem

When I woke up in the morning it turned out my container was down. There was message from the middle of the night:

 [Container Station] Created interface "lxcbr0" with errors. Unable to start DHCP service.   

I found this strange, I could not start Container Station again, and I found other people had had this problem with no elegant solutions. I found that the problem was solved if I deleted the two virtual switches (docker0) and (lxcbr0); Container Stations creates them automatically when it starts.

I think my container may have crashed due to too little RAM in the middle of the night, and that somehow corrupted something.

Memory Upgrade

This model comes with 2GB RAM. That is quite enough, but not if you want to run Container Station conveniently. I have switched off most QNAP services, running a single LXC Container with syncthing using about 500MB of RAM, and the QNAP complains there is little available RAM (and it uses swap). So I think it is safe to say that to run Container Station or Virtualization Station, more RAM is recommended.

Officially max RAM is 8GB but there are multiple records of people saying it works with 16GB as well. It also appears that you may use just one memory module (out of two), they dont need to be installed in pairs.

So I bought 2x8GB and it seems to work perfectly:

  • Corsair DDR3L 1600MHz MACMEMORY
  • CMSA16GX3M2A1600C11

Virtualization

There are several Virtualization options with the QNAP:

  • Virtualization Station: running real virtual machines (like VMWare), emulating hardware. Just starting Virtualization Station used almost 1GB or RAM.
  • Container Station:
    • running (LXC) virtual linux machines, emulating just the kernel. This is much more light-weight, and it means the virtual machine shares disk and RAM with the main system (you do not need to allocate disk, all disk is available and shared for every virtual machine – they just live in separate folder)
    • running Docker containers
  • Linux Station: allowing the QNAP to work as a Linux Desktop.

Apart from virtualization, the QNAP also allows you to install things like WordPress, Mediawiki, MySQL and other services as packages.

Update and Problems 2020-02-29

One of my virtual container station machines had its clock out of sync. When I started investigating I could not connect to the QNAP itself. The two virtual machines were up normally. The QNAP itself was nowhere to be seen on the network. I restarted it (using the power button – I believe it shuts down properly), it came up and it wanted a firmware update, which I immediately accepted. After that it did not come up (on the network) again.

I tried to reach it on 169.254.100.100 with no success.

I finally did a “reset” (using a paperclick on the rear side of the QNAP for 3-4s when it was already on). Following the reset it immediately appeared normally on the network. Password was “admin”.

However, the virtual container station machines did not start. I had to change their network settings to NAT, and then back to Bridge, then they worked. So it seems to me the virtual switch is not quite 100%.

All seems good now, but this took quite a while to figure out and fix. I bought a QNAP to get something much more stable and reliable than my old Raspberry Pi, but this was not impressive.

Update and Problems 2020-05-08

Quite same story as in February. The combination of

  • Container Stations
  • Virtual Switches / Bridged connections for Containter Station
  • Leaving QNAP up for a long time

is simply a very bad idea. Somehow the Network settings get corrupted and the entire f***ing QNAP, its bloated UI, and containers suffer. It takes hours to fix. Here is a little picture of the pleasure of trying to get rid of a virtual switch once it is corrupt (this was after mostly waiting for UI for an hour, achieving nothing).

My advice for now is to simply not use Bridged Network with containers and avoid creating virtual switches.

Dungeon Master Inspirational Reading

This is work in progress.

I read to get inspiration for my D&D Dungeon Master hobby.

5/5 Recommended

  • Conan Chronices (short stories of varying length and quality)
  • Northlanders 1-3 (comic)
  • Untold Adventures – Dungeons & Dragons (short stories)
  • The Outsider (short story, H.P. Lovecraft)
  • The stolen sacrifice (Dragon Magazine #13)
  • Thorgal (comic)

4/5 Recommended

  • Berserk (Deluxe, 1-2, manga)
  • Kull Exile of Atlantis (short stories)
  • Lone Wolf (Project Aon)
  • The Forest of Flame (Dragon Magazine #6)

3/5 Average

  • Crannog Saga 1-2 (Comic)
  • Fall of Gondolin
  • Legends and Myths: Knights of the round table

2/5 Not so recommended

  • Den eviga nattens riddare + Det mörka hjärtats vilja (Swedish)
  • Legends and Myths: Charlemagne
  • Vox Machina
  • Roads from Jakalla (Dragon Magazine #4)

1/5 Not recommended

  • Legends and Myths: King Arthur

Getting Ripped with Jordan Peterson

I have never been the exercising type. I walk quite much. But I don’t run, I don’t lift weights, I don’t like to get exhausted and I don’t like when it hurts.

Having passed the age of 40 I realized I am not getting younger, healthier or stronger. Although a little bit heavier – not overweight at all, but skinny-fat.

In the autumn of 2018 I listened to Jordan Peterson talking about his book 12 Rules for Life. This particular lecture was about Rule #4: Compare yourself to who you were yesterday, not who someone else is today. Peterson mentioned in his lecture that if you make small consistent improvements over a long period of time, you will eventually make significant improvements in the long run.

Inspired by this I set up a scheme of exercising that works for me:

  • I have a number of simple exercises I can do at home, in a hotel room, or elsewhere: pushups, squats, planks and things like that. Most are body-weight only exercises.
  • Every week I do at least as many of each exercise as I did last week.
  • Every week, in total, I do more than last week.

That is it!

I started out with very low ambition. The first weeks I did ridiculously little exercise. But after 8-9 weeks I saw some improvements, I had got the habit, and I did not want to fail and give up. I have now done this for a little more than a year, and not a single week I have failed to improve.

A few more things:

  • A week starts on Sunday (so it is easy to get a good start) and ends on Saturday (so I have time to catch up after a bad week)
  • Some exercises I do better/heavier after a while, even though the amount is the same. For example, there are different pushup techniques and I allow myself to change between them, generally this makes my exercise harder than it was a year ago. I get more quality out of the same time or repetitions.
  • Sometime I add a new exercise to the list rather than doing more of the old ones.

This is my weekly (every 4 week printed) progress:

Week  49    1    5    9   13   17   21   25   29   33   37   41   45   49
a)   195  320  380  400  420  435  440  450  460  460  460  460  460  460
b)                        30   30   35   50   60   65   70   75   80   80
c)    40   75  105  120  120  120  120  120  125  130  130  140  140  140
d)    29   80  100  120  155  160  165  165  171  175  175  180  180  180
e)    60   85  105  120  120  120  120  120  120  125  125  125  125  125
f)    30   45   60   75   80   90  100  100  120  120  135  150  155  170
g)                   20   30   35   40   45   55   60   65   70   70   80
h)                                  30   45   50   50   50   50   50   50
i)                                                 15   20   25   25   30
j)                                                 15   30   35   35   40
k)                                                                60   60

Total 354  605  750  855  955  990 1050 1095 1161 1215 1260 1310 1380 1415

The different exercises are here named a-k (the important thing is that you find exercises that you like) and the number can be seconds or repetitions (sometimes this is for two sides so I do twice as many). So I think it is a good guess that I exercise almost one hour per week, but that is effective time. I would not be able to do this in a gym in one hour, that would be too heavy.

As you can see it levels out a bit. It is hard, I sometimes hate it, but I improve and I do not give up!

In the beginning I set up a few goals: new personal records when it comes to pushups and planks for example. I reached those and now my goal is to be able to walk on my hands. So I do see results! Also my body looks and feels different.

Discipline, systems and motivation

Motivation will not take you too far. There comes a day when motivation simply fails you and you can lose a good habit. However, if you are disciplined about systematic improvement, you do not fail even when your motivation is low.

Conclusion

If you already exercise regularly and you are happy about it, you are probably already better than I will ever be. But if you really do not exercise and you are aware that you and your body would benefit from it, I think this is a method for you.

Start out with very low ambition. You need to negotiate with yourself (as Peterson says). Perhaps you can do 10 pushups and 10 situps the first week? And 11 the next. Do it, you have nothing to lose. And after a few months giving up on your good development is harder than doing those damn pushups.

I think for me a weekly goal has been good. Some days are just not good days but I can make my weekly goal anyway.