Posts

monitor your gas counter with a webcam

Image
During my certification I have learned about DocumentAI and I am eager to put it into practical use. So, here is my project: I will install a webcam to watch my gas counter and take a picture every day. Will use DocumentAI to find out its read and store it in a table. Here is the prototype: Webcam monitoring my gas counter OK, first we have the physical setup. I use an old Ubuntu laptop (will be a Raspberry Pi soon) with a very new and good webcam:  On Ubuntu, I issue the command to grab the picture from the webcam: $ fswebcam -r 4000x3000 -d /dev/video0 test2.jpg --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. Adjusting resolution from 4000x3000 to 2304x1296. --- Capturing frame... Captured frame in 0.00 seconds. --- Processing captured image... Writing JPEG image to 'test2.jpg'. When I upload it to DocumentAI, it does recognize the counter's number, in this case 9153.486 m³ Now, this deserves to be autom

Windows is too slow - let's try Linux

Image
Today I decided to try Linux again as my desktop operating system. Here is an assessment how it worked out - especially for people who have other things to do in their lives than operating systems. Windows Windows was slow and had a lot of hiccups where it would suddenly stall for some seconds. Reboot button did not exist any longer, instead a message that power options are not available. It suggested updating to Windows 11, but said my beloved VMware Player would then cease to work. So, time for a change... to Linux. Considerations What I don't want is constant switching between operating systems. Live has better things to experience. Also, what I don't want is a USB installation that forgets the WLAN password and all my settings on reboot. Functionality The functionality I need is: Video Editing - I do it via wevideo.com, this is available where Chrome is, so, as well on Linux and Windows FreeCiv - my favorite game is available both on Windows and Linux (and the reason I do n

Set up a webcam with Linux

Image
You want to use your webcam with a Linux computer? Good, then this article is for you. If you have a notebook or a laptop with an integrated webcam, this will most probably work out of the box. If you have a USB webcam, connect it to your computer. Then, you  open a console (aka terminal)  and type  cheese The "cheese" application will start up and show your webcam's output like this: A capture from a webcam in the program Cheese If this works, congratulations, you can now use your webcam with video editors, conferencing software, and so on. But: cheese may not be installed the drivers (aka kernel modules) for the webcam may not work your Linux computer may not have a graphical user interface (or you may not want it) you may want to switch between several webcams Install Cheese If you do not have the software cheese installed, you can install it by means of your distribution.  Find out your Linux distribution , open a terminal and enter: for Debian, Raspbian, Ubuntu, Kubu

AppEngine hello world

Image
During my certification I learned that you can save a lot of time by using AppEngine. Instead of setting up a web server, installing nginx and python, and wondering why they don't work together, you use AppEngine and can start programming right away. Today I wanted to check this out and deployed a "hello world" app on AppEngine. I will show you how I did it - with everything you can possible do wrong and how to correct it. Later I will show you how to put this application behind a load balancer. Go to Google Cloud Console, open Cloud Shell, check out the hello world code: git clone https://github.com/GoogleCloudPlatform/python-docs-samples Cloning the "hello world" AppEngine app from github Now deploy the application: cd python-docs-samples/appengine/ gcloud app deploy OK, now I got the first error message: So I went to Google Cloud Console -> IAM and looked for the AppEngine default Service Account. Once I had it, I gave it the requested permissions: I again

Permission denied (publickey).

Image
Whenever I tried to ssh from one of my Google Cloud VMs to another, I got an error message. SSH asks me if I want to continue connecting, and when I say "yes", I get: Permission denied (publickey). If I just type enter (fingerprint), I get Host key verification failed. Here I want to show you how to resolve this. The reason for this error message is that password logins are disabled by default, and that is a very sensible default. So we have to use host keys. A host key consists of a public and a private part. Let's create it right away. Use any VM, log in via browser-ssh and issue: ssh-keygen -t rsa Confirm all the defaults (even a hen could do this if you put enough corns onto the Enter key). Let's look at your public key: $ cat .ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCWo9/5gZ6Du51Rz3T7MOqgJg3aHPqw8CzVw20+DxeUh5FEGuZWQmRpToI7yH+9pR6JgqThJQ/MUyFELKKuKN4uafpOzPwclrLqv9oP+CWp3dYv020u3847eqBxotltD1L8o5D5+O1REbKKOlGQxyrs0xdYVuA3vm2UYH5aFXxs0BDlJTrKXYjjAOy6a

When bookmarks are not enough...

Image
When bookmarks are not enough...  I just want to type tr whatever into Chrome's search bar and get a translation of whatever : The quickest way to get a translation,  in this case of "bookmark". Read below how to set it up. I knew this was possible and searched for it using the terms quicksearch , shortcuts and extended bookmarks . But the real feature name is site search . Let's see how we set it up: in Chrome's settings menu, select search engine -> manage search engines and site search: scroll to "site search", click "add": enter a keyword and URL to be composed from the string you give after the keyword: You see that you configure a keyword here (in this example tr) and tell the browser to move to an URL on this keyword. This URL can contain the string you enter after they keyword. You just write %s and the URL will contain the string at this place. OK, cool thing, especially because it is so versatile. I recall in the KDE project we ha

How do databases work?

Image
When you study databases, you wonder why some people always seem to get it right, while the majority just doesn't seem to get it right. I will tell you in the next 10 minutes how to get it right - or you get your money back. So, the secret is storytelling. When I think of a database, I think of my friend John who works in front of a big file cabinet like this here: John's job is to keep his boss happy. His boss comes in every now and then and wants to have some information from the file cabinet, like "how many blue cars have we sold in 2021". Sometimes, the boss also tells John some information that he is supposed to write into the files. This takes a lot of time because every folder has an index that needs to be updated (one index is for "car salesmen", the other for "car types" and many more). Plus, there are " aggregates " (how many cars are still in stock) that need to be updated whenever a car sale goes into the folders. And much mor