REST API entry points to a message based, event driven architecture

REST API entry points to a message based, event driven architecture

A while back I started working at an IT department that didn’t really have must in-house development, and thus didn’t have any integration architecture defined. I set out to look into our business needs along with potential architectures. I’d been a great fan of message based, event driven architecture, and found that to be a good fit for our needs. One of my first projects was quite simple – the user would visit one of our internal websites and submit…

Read More Read More

Using AWS Cognito to authorize access to API Gateway

Using AWS Cognito to authorize access to API Gateway

I’m writing a simple web application that at the moment basically does this: In the web app, users log in The web app contacts AWS Cognito for user authentication. In AWS Cognito, I’ve set up a user pool, think of it as a database, in which my users are stored. When a user sign in, AWS Cognito checks the user pool to verify the password. AWS Cognitor responds with different JWT tokens, including an ID token for the user The…

Read More Read More

Setting up Visual Studio for developing SharePoint online site provisioning software

Setting up Visual Studio for developing SharePoint online site provisioning software

We’re in the process of setting up SharePoint Online as our Intranet platform, and are looking to automate site creation using something like Azure Functions. Currently, I’m developing the business logic for creating the new sites, including setting the correct permissions, theme, links and so forth. I’m using Visual Studio for this project. I’m new to both SharePoint Online as .NET, and as tutorials on setting up Visual Studio with regards to SharePoint Online provisioning seems to be lacking, I…

Read More Read More

Modifying cn=config in OpenLDAP without rootDN password

Modifying cn=config in OpenLDAP without rootDN password

Using a configures “admin” user and the corresponding password, I successfully created a bind user uid=bind_user,ou=users,dc=work,dc=com on an OpenLDAP server. The bind user needed escalated privileges, but as the cn=admin,dc=work,dc=com user didn’t have write access to the cn=config database, all my efforts running commands such as ldapmodify on the bind user, resulted in this error message: I didn’t have access to the rootDN password, so I was kind of stuck for a while. Then I was advised to try ldapvi,…

Read More Read More

React: Auto scroll when overflow

React: Auto scroll when overflow

I recently had an issue with an React app, in which contents was added to the bottom of an area – a <div> element with the CSS property overflow: scroll; set – on the screen. I wanted the app to automatically scroll to the latest element. I found this post on StackOverflow which seemed to be what I needed, and while the auto scroll feature did work it was kind of our of sync with the content. I figured the…

Read More Read More

Docker automatically stopped

Docker automatically stopped

This morning I found that the Docker service on one our linux servers for no apparent reason had stopped. From the entries in syslog I could see that Docker had been going up and down since about 06:34 in the morning. Extract from syslog: I came across https://www.claudiokuenzler.com/blog/689/rancher-error-response-from-daemon-dockerd-deleted-no-such-file-or-directory, and from the comment section there I was led to check what the unattended upgrades had been doing this morning, and found this: On this particular linux server we don’t really wish…

Read More Read More

openpyxl’s “load_workbook” return empty list of sheets

openpyxl’s “load_workbook” return empty list of sheets

Consider this code: When using one of my xlsx-files as input, my code produced the output Sheet names: [] followed by this expection: After some investigating, I found that the file had been saved as “Strict Open XML Spreadsheet (xlsx)” instead of “Excel Workbook (xslx)”. Both files for some reason have the same file extension, but the former was not supported by the openpyxl library. Saving the file as “Excel Workbok (xslx)” got the code working again.

Adding “–version” parameter to “python3 setup.py”

Adding “–version” parameter to “python3 setup.py”

When building Python packages using setuptools, you typically manually set the upcoming package version in setup.py. For my use case, I found it better to provide the version number on the command line such as this: setuptools isn’t very fond of command line parameters, so I made a quick-n-dirty hack to work around this limitation:

Python: Writing test to verify command line arguments

Python: Writing test to verify command line arguments

I wrote a small Python script that will be executed from the command line. After finishing the tests to verify the business logic, I decided to test the command line arguments as well, just to make sure they’re parsed correctly and passed to their appropriate places in the business logic code. Initially I was thinking I needed to write a test that executes the actual command line such as python3 myscript.py –argument=value, but as this is neither appropriate nor really…

Read More Read More