Browsed by
Category: computer

SharePoint Online hub sites namespace and structure

SharePoint Online hub sites namespace and structure

For my company’s upcoming intranet based on SharePoint Online (SPO), we’ve looked into ways to organize our sites. As I haven’t found much online information on the subject, I though I’d share a couple of points here. Namespacing First, let’s discuss namespacing. We’ve had SPO around for a long time, long before we got around to manage it properly, so we have numerous sites with vastly different URLs and contents. As our intranet will consist of just a subset of…

Read More Read More

Storing valid, sanitised HTML in database to mitigate malicious code injection

Storing valid, sanitised HTML in database to mitigate malicious code injection

In a typical cross-site scripting (XSS) attack, the hacker submit a HTML form which include malicious code. When another user visit the page in which this data is rendered, the malicious code is executed. There are at least a couple of ways to mitigate this risk: When the hacker submit the HTML form, any malicious code is removed before storing the data in the database When retrieving data from the database, removing any malicious code before rendering it on the…

Read More Read More

Custom CSS on SharePoint Online sites

Custom CSS on SharePoint Online sites

We’ll be using SharePoint Online as platform for our upcoming intranet. As Microsoft currently doesn’t support much visual tweaking, we were looking to apply our own CSS to the intranet related SPO sites. Applying Custom CSS is not supported, so we were looking for a workaround until Microsoft hopefully does enable this in the future. Although not supported, and likely not even recommended, we got our custom CSS up and running by creating an application customizer, based on the official…

Read More Read More

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

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

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

Running Oracle in Docker for development and testing

Running Oracle in Docker for development and testing

I’m working on a Python based microservice that needs to communicate with an Oracle database. My development environment consist only of my laptop, so to do some real testing I decided to spin up Oracle in a Docker container on my laptop. For me, the process of getting things up and running wasn’t very straight forward for an Oracle newbie as myself, so I though I’d share my setup in case others may benefit from it. Let’s start with my…

Read More Read More