Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home

jorgenmodin.net - Blog

"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

Autostart programs and scripts in ubuntu

Posted by admin |

There is a GUI for that (tested by me). Just find the autostart GUI application through your application launcher. You can also edit directly the desktop files that are constructed in ~/.config/autostart . Keep in mind though that the GUI decides the names there so if you need to find and edit a specific statup you may need to look around a bit!

Read more: Link - autostart - How do I start applications automatically on login? - Ask Ubuntu

Apr 28, 2019 08:15

Timeout a function in Javascript

Posted by admin |

Here's one way that seems to work, you set a time to change a function-scoped variable and return out of the function when that changes.

function thisShouldTimeOut() {

  var shouldIStopDoingThis = false

  setTimeout(() => {
    shouldIStopDoingThis = true
  }, 2000)

  for () { // some loopy stuff
    if (shouldIStopDoingThis) {
      return
    }
  }
}
Apr 05, 2019 02:50

Updating a part of a Riot.js tag

Posted by admin |

Edit 2019-04-07: This does not work!

 

In order to get a less jumpy page, I'm looking at how to render just a sub part of a Riot.js tag. According to this conversation it should be possible. The example given is this:

var item = this.tags['big-data-tag'].tags.item[0]
item.first_name = 'jack'
item.update()

I think it could be adapted to work like this, untested by me:

 

<maintag>
    <subpart>
        { onlyupdatethis}
    <subpart>
Some other stuff that is static

   <script>
   const tag = this

     this.on('mount', function () {
       stateManager.subscribeToUpdates(function(state){
          tag.tags.subpart.update()
        })
       }   
      )

   </script>

</maintag>

 

Apr 04, 2019 02:55

Notes on order of speech processing and on automix

Posted by admin |

These are just some notes jotted down for my memory, so not authoritative at all, not even inside my own head yet :)

Remove noise → Compress → Normalize

After having watched one of Curtis Judd's videos it was clear it is a good idea to compress/limit before normalizing. There may be some peaks otherwise in your recording that would make the normalizing not be good enough. Also I noted that Judd eyeballs on the left hand dB scale where to put the compressor's knee. That makes sense too.

And completely on my own I realized that noise reduction should go first in the chain. Chances are your noise is at a certain level and it's easier to remove it before compression has introduced a varying noise floor.

Automix

Finally in this post, I have seen that some newer digital recorders and mixers have "automix", that is they mute the microphones of those not talking. This I think would be a great feature to have in post-production! Imagine having six tracks and you just tell the software to automix it. I guess that exists somewhere. Otherwise it would be fun to write an algorithm for it, for post production. You could do voice detection (is this voice?) and amplitude detection, reverberation detection, phase and distance detection (like in a microphone array) and so on.

Update 2019-04-24

Julian Krause has just released a video with his workflow, it's a bit different: https://www.youtube.com/watch?v=GVovXsbCjjU

He normalizes the audio first to a certain LUFS level, then removes rumble and proximity effect with high pass filters, then applies a compressor and a noise gate. What is most interesting for me here is that he sets the attack of the compressor to 1ms and the decay to I think it was 100ms, settings that are on the shorter side but that he argues make sense for voice. Gotta try that.

Mar 27, 2019 09:20

What makes a good YouTube thumbnail? My opinions.

Posted by admin |

I just looked through a list of thumbnails on YouTube and I think I know now what kind of thumbnails I prefer at least:

There should preferably be two people on the thumbnail, facing each other

twopeople

If there is only one person, there must be text, and the text must not be continuous


discrete text

hertz

An example with continuous text:

ngplay
 

A whiteboard or similar can work instead of discrete texts, and it is good if the video title is visible in the thumbnail

comp

A single person with no text I do not think works that well:
 
ngscreen
 
 

ngspeech

And finally a group of people without any text fragments also does not work that well:

ngted
 

So for my tastes, put two people facing each other, or one person with discrete texts or a whiteboard or other teaching instrument!

 

Mar 21, 2019 12:55

Change VS code's insane default behavior of changing your text when you hit return

Posted by admin |

Start a new document in VS code, and before saving, type:

Worklist
Describe how the certificate registration works

Hit return, and the line now says (my bold):

Worklist
Describe how the certificate registration WorkList

At least on my machine. That is insane! VS Code has no idea of what I am trying to code or write or even in what language yet.

You can get rid of this behavior in settings by disabling:

"Editor: Accept suggestions on Enter"

Mar 18, 2019 12:40