I have an old monitor which only supports DVI and when I work from home, I connect my notebook to it using an HDMI to DVI adapter. This approach, which has never caused a problem with any of my notebooks, has never worked when trying to connect a Raspberry Pi to it. Most of the…
Blog
Missing codec in Ubuntu
Those who try to play videos on a fresh installed Ubuntu are likely to be confronted with the problem of missing codecs. The good news is that, even though these are not present by default, they are still available and can be easily installed with apt or apt-get. The codecs are part of the ubuntu.restricted-extras…
VS-StudioCode
I have recently begun using Visual Studio Code for development on linux. It is a fine Editor, and it seems as there is an extension for almost every development or dev-ops related task. Although I am far from being an expert and for the most part use only a very small part of the available…
linux: find -exec
Find is a fine command of itself, however what elevates find to the next level is its ability to execute other commands. The argument for that is -exec. -exec consists of 3 parts: command arguments delimiter The syntax is: find <path/to/search> [search expression] -exec <command> <arguments> <delimiter> The command This is just any command that…
VMware: Module Disk Power on Failed
When using VMware you may encounter a “Module Disk Power on Failed” error while starting up a VM which was not properly shut down. It appears accompanied by “The process cannot access the file because another process has locked a portion of the file” and followed by “Failed to start the virtual machine”. It usually…
Open-VM-Tools(VMware)
Install open-vm-tools Distros which use rpm, yum, dnf: Distros which use apt, apt-get: apt-get install -y open-vm-tools Mounting the host shares Temporarily. Execute the following command. This will mount the shared folders for the current Session. It will have to be done again the next time you start the VM. Make it persistent. Putting the…
Windows: Spotlight images
Those images one see on the login page of Windows are (at least temporarily) stored in the local machine. The containing folder can be found under: C:\Users\USERNAME\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets where USERNAME is the logged-in user. The folder may be hidden, so one should have the show hidden folders option active to see it. The images are in…
Python Generators
A generator is a function that returns an iterator. It uses yield instead of return. Each time the generator fetches a value and gives it back to the calling function, it yields control to the caller while keeping track of its current state. When the caller accesses the next value in the iterator, the generator…
Python Decorators
The decorator pattern in Python is a means to add functionality to a function without actually changing the code of the decorated function. The pattern The decorator pattern consists of Defining a decorator function calling the decorator with the decorated function as parameter and assigning the return value of this call to the decorated function…
Creating a user in Postgres
Users can be created either by using the command createuser or one the SQL statements CREATE ROLE or CREATE USER. The createuser command, which is a wrapper to the SQL Command CREATE ROLE, has the added advantage of providing for the interactive creation users by answering a series of questions. To run createuser interactively you…