RSSAmplifier

Blog

Christian Engvall

Posts about software development in languages like Objective-C, PHP, C#, Ruby, Javascript. And software like Git, drupal, Phonegap, wordpress.

christianengvall.seRSS feed ↗145 posts

Latest posts

Setting up Cypress for a React application

I took the lead on setting up Cypress for end-to-end testing in a React + Vite + TypeScript application. The app is a shipping logistics portal and the test suite now covers 31 test files across the application. Here is how I approached the setup. Installing Cypress pnpm add -D cypress Then add scripts to package.json : "cy:open" : "cypress open" , "cy:open:frontend" : "cypress open --env…

Update pihole running in a Docker container

The Pihole web interface tells you to run pihole -up to get the latest version. But if you are running pihole as a docker container we need to do it a little bit different. To update pihole; Open a terminal and do the following: Stop the container: docker stop pihole Pull the latest Pihole docker pull pihole/pihole Remove your existing pihole container docker rm -f pihole Start container…

Setting up NGROK to work with Litium apps

To be able to place orders locally using a payment app it needs to be able to communicate with the outside world. Lets have a look how to get that working with ngrok . 1. Download and register ngrok Download ngrok and sign up free account. We will need that to use https. After you have signed up you will get an authtoken. Fire up you ngrok-terminal and type: ngrok authtoken <my-token> use…

Client secret validation failed for client

fail: IdentityServer4.Validation.ClientSecretValidator[0] Client secret validation failed for client: I got the error Client secret validation failed for client when using a Litium app one day. The reason was that Litium apps are not built to be used in a multiple development environment scenario and another developer has reinstalled an app on his machine. That way the app got new service…

Litium fileshares when switching from IIS to Kestrel

One way to access the shared files folder that is used in some projects is to let the IIS application pool use the identity of the user that has access to that shared folder. That won’t work now when we are using the Kestrel web server. Instead you can map that shared folder as a Network drive and reference that in appsettings.json . In Windows you right click in the explorer and select Add…

Configuring webpack to generate two or more css files

If you are going to use a multi-site setup where the sites should look a bit different to each other you need to change the default webpack configuration that is delivered with the Accelerator. This is tested with the first version of the Litium 8 accelerator. Previous and later versions may differ. 1. Change entries Add a new .scss file at Litium.Accelerator.Mvc/Client/Styles that we call…

Free gift campaign based on content in cart

The criteria for which product that needs to be present in the cart needs to be created as a target group. Then we need to create a campaign using that target group. Lets have a look at how to set it up. 1. Creating the target group Go to Customers -> Target groups and add a new target group . Litium target groups Then create a Has product in cart filter condition and select the product that must…

SveaPayment app - Unable to obtain configuration from System.String

When setting up an existing dev site I got this error for the SveaPayment-app: 2022 - 02 - 17 10 : 32 : 44.1039 [ App : 01 ] [ 916919702 a6a8343af56f989db5df72b ] [ ERROR ] [] Microsoft . AspNetCore . Server . Kestrel - Connection id "" , Request id "" : An unhandled exception was thrown by the application . System . InvalidOperationException : IDX20803 : Unable to obtain configuration from : '…

SveaPayment app BIO_new_file:no such file error

I noticed that the SveaPayment app container kept restarting in docker. And at least I thought that I had set up my local dev certs the correct way, but this message showed up in the logs of the app: Unhandled exception . Interop + Crypto + OpenSslCryptographicException : error : 2006D080 : BIO routines : BIO_new_file : no such file at Interop . Crypto . CheckValidOpenSslHandle ( SafeHandle handle…

A collection of Litium posts

This post contains all posts targeting Litium in one place. Litium 8 Posts written for Litium 8 Apps SveaPayment app BIO_new_file:no such file error SveaPayment app - Unable to obtain configuration from System.String Client secret validation failed for client Setting up NGROK to work with Litium apps Campaigns Free gift campaign based on content in cart Clientside Configuring webpack to generate…

Add an admin user to database using Litium CLI

Add an admin user to database using Litium CLI with the litium-db command. dotnet litium-db user --file . \L itium.Accelerator.Mvc \a ppsettings.Development.json --login agoodusername --password anevenbetterpassword By supplying –file the command picks up the connection string for us. Don’t forget to change agoodusername and anevenbetterpassword to something else. Read more about Database…

CurrentUICulture and CurrentCulture in Litium

You see a lot of CultureInfo.CurrentUICulture and CultureInfo.CurrentCulture references in the Accelerator. Those are connected to two channel fields called Language for pages and block and Language for products . Lets have a look at when to use which! Language for pages and blocks and language for products on a channel Usage Language for pages and block sets the value for…

Using middlewares with Litium

To use a Middleware with Litium we can create a startup class that inherits the IOwinStartupConfiguration interface and use it to insert a middleware into the OWIN pipeline. A middleware is, put simply, a piece of code which can read information about the current request and add information to the response. And it’s a good place to put code that doesn’t really fit into controllers or services…

Litium filesDirectory and commonFilesDirectory

There are two folders where Litium stores files. The Files Directory and the Common Files directory . Both contains uploaded images, thumbnails, and search indices etc. But the Common files directory is used in multiserver environments, and it stores information that servers would share. filesDirectory You can set these paths in web.config. By default the Accelerator v 7.2.3 has the filesDirectory…

Using Papercut and StateServer

Lets take a look at using Papercut as SMTP-server during web site development. We’ll also take a look at StateServer. These tools works for any ASP.NET MVC-project but this post is a continuation of the Installing Litium Accelerator post . 1. Papercut Papercut will act as an SMTP-server and will display every email sent from the website we are building. This is how the creators of Papercut explain…

Installing Litium Accelerator

Litium is installed via a Nuget feed in Visual studio. You can install Litium without the Accelerator but in this tutorial we’ll take a look at installing Litium and Litium Accelerator. Litium Accelerator The Litium Accelerator is a pre-packaged Litium site which speeds up the development when starting new projects. It is delivered as source-code and you have the possibility to change what you…

Updated Electron tutorial app to use Electron v5.0.8

The Electron tutorial app is now working with Electron version 5.0.8. After downloading the new version make sure to run: npm install npm install -g electron@5.0.8 The biggest difference in this version is enabling nodeIntegration: webPreferences: { nodeIntegration: true } You can see the code on Github Posted on https://www.christianengvall.se/updated-electron-tutorial-app-to-use-electron-v508/

Installing Visual Studio Code and ASP.NET Core on Linux Mint

In this post we’ll take a look at installing ASP.NET core and Visual Studio code on Linux Mint. 1. Installing .NET CORE To install .NET Core I downloaded the X64 Binary and ran these commands in a console: cd Downloads mkdir -p $HOME /dotnet && tar zxf dotnet-sdk-2.2.202-linux-x64.tar.gz -C $HOME /dotnet export DOTNET_ROOT = $HOME /dotnet export PATH = $PATH : $HOME /dotnet After that to verify…

Electron showSaveDialog tutorial

In this tutorial we’ll look at how to use Electron showSaveDialog. The save dialog will return a string containing a path which the user selected. To only display a save dialog this is what is needed as a minimum: const { dialog } = require ( ' electron ' ) const savePath = dialog . showSaveDialog ( null ); console . log ( savePath ) But as with the other dialogs we can do more with it: const {…

Electron showMessageBox tutorial

With showMessageBox we can display a message with our without a set of buttons from which the user can choose from. The minimum required code to show a message box is: const { dialog } = require ( ' electron ' ) const response = dialog . showMessageBox ( null ); console . log ( response ); But that would only display a box with no info and an OK-button. The dialog would return a response which…

Electron showErrorBox tutorial

Use the Electron dialog showErrorBox to display an error message to the user. Not much to it: Call it on the main process. Require dialog. Call showErrorBox() with a title and a message. const { dialog } = require ( ' electron ' ) dialog . showErrorBox ( ' Oops! Something went wrong! ' , ' Help us improve your experience by sending an error report ' ) This is what the message will look like on…

Electron dark mode with electron packager tutorial

At the time of writing this tutorial there is no support for dark mode in electron. But it’s on its way. Before it’s released we can use Electron-packager for any electron app we want dark mode support for. The Electron tutorial app already uses Electron packager. If your app doesn’t you can check out the electorn-packager tutorial . However we first need to update the packager version to 12.2.0 .…

Update to latest Electron version

The electron tutorial app has not been updated to the latest version of electron. Lets take a look at how to do that. At the time of writing the latest stable version is electron v3.0.5. 1. Updating the version used in package.json Start a terminal and run this command: npm install electron@latest This will give me the currently latest stable version of electron. And I can see that by opening…

Electron showOpenDialog tutorial

With the showOpenDialog you can open files or folders. To show an open dialog all you need to do is: const { dialog } = require ( ' electron ' ) const selectedPaths = dialog . showOpenDialog (); console . log ( selectedPaths ); the showOpenDialog returns an array of strings with the paths chosen by the user. If you instead decide to use the callback method it will return undefined . There are more…

Electron dialog tutorials

In this Electron dialog tutorial we’ll take a look at using the different dialogs electron provides. With the dialog we can display native system dialogs for opening and saving files, alerting, etc. Each dialog has its own post to make them easier to read. Using showOpenDialog With the showOpenDialog you can let the user select one or more files or folders. The selected paths are returned as an…

Git cherry pick from another branch

This post takes a look at Git cherry-pick . We’ll cherry pick a commit from one branch to another. The Git cherry-pick documentation explains cherry picking as: Apply changes introduced by some existing commits. Given one or more existing commits, apply the change each one introduces, recording a new commit for each. This requires your working tree to be clean (no modifications from the HEAD…

Check for changes on remote origin Git repository in shell script

In a build shell script I use I needed to check for changes on the remote of a git repo to make sure I’m deploying the latest version. To do that I use Git rev-parse . You could probably do this better and in some other way. But this worked for me. To be more specific: I need to check if there are more changes/commits on the origin master than I have on my local machine. This is all done in a…

Update to latest Jekyll version

Every now and then a new version of Jekyll is released. How do you go about to update to that version? I found information in the Jekyll docs about it. This post covers minor updates. There is information about major versions in the link above as well. This might break your site so make sure to take actions so you won’t lose anything. Minor version update I needed to upgrade from 3.5.2 to the…

Guest post about Knex, Bookshelf and PostgreSQL at Proposales

I’m currently helping Proposales to develop their platform and a while back I posted a guest post over at their blog. It’s about Knex migration, Bookshelf ORM, PostgreSQL and Boolean . Posted on https://www.christianengvall.se/guest-post-about-knex-bookshelf-postgresql-proposales/

Git reset origin to commit

How do you reset a Git repository to a certain commit? This example will delete the commits made after the commit you want to reset to, and then we’ll push it to origin. This is what my latest commit looks like on a testrepo, but lets say I want the signs? commit to be the latest commit. repository before reset Git reset Make sure you are on the branch where the commit is. I’m doing this on…

Screenbar released on Mac app store

Screenbar is an application that takes screenshots for you when you need your hands to do something else, like playing a game. It has now been released on the Mac App store. It was also shipped with a new design. Download and install You can download and install it from the Mac app store The new stuff This version comes with two changes. It is sandboxed and has a new design. Sandboxed This version…

Klarna CSCOE wrong url

On a project I’m working on there is an integration to the payment provider Klarna . I was having trouble to get it to work on my local development environment. Everytime a purchase was made the visitor(me) was supposed to get redirected back to the dev-environment. I was… but to the wrong url: https://local-dev-env-url/+CSCOE+/wrong_url.html In my case this was connected to the validation_uri…

Decrypt Bitlocker encrypted partition on Linux and macOS

By using Dislocker we can decrypt a Bitlocker encrypted partition on Linux and macOS. In this post we’ll be doing this on macOS. 1. Installing Dislocker and FUSE for macOS Start by downloading Dislocker and extract the package. Then we can install Dislocker and FUSE for mac OS (which is a needed for dislocker) using Homebrew . Enter the following commands in a terminal: brew update brew install…

Electron installer debian package

In this tutorial we will be using the Electron installer debian package to create a debian package. This tutorial expects you to have packaged your app already. If you haven’t, you can check out the Electron packager tutorial . 1. Installing the package Start by installing electron-installer-debian package: npm install -g electron-installer-debian 2. Create config file Then create a new file…

Install Electron tutorial app

How do you install and run the Electron tutorial app? . This is a quick guide to get it running. 1. Install Node.JS and Electron First you need to install Node.JS if you haven’t done that already. Then run the following command to install electron globally. npm install -g electron 2. Clone or download the repo from Github. Clone the Github repo by running this command: git clone…

React Native No Bundle Url Present

In the latest post about React native - build for iOS App store deploy there was a step about removing NSExceptionAllowsInsecureHTTPLoads before publishing to the App store. After doing that step I was happy and tired and didn’t add that key into the info.plist again before going on vacation. Bad move. I spent an hour figuring out why my app wouldn’t start when running react-native run-ios .…

React Native - Build for iOS App store deploy

There are some steps that need to be taken in order to publish a React Native app to the iOS App Store. But first you need to know how to submit a native app to the app store. That is out of scope for this tutorial since there is a tutorial at Ray Wenderlich that covers that whole process. It helps you with setting up a developer account, create certificates and profiles and so on. After finishing…

Install React Native

I’m interested in trying React native instead of Ionic for Dogwalk . And when doing this i’ll be writing the steps I take if someone else is interested in learning this as well. Now we’ll take a look on how to install React Native . For React Native we need node , Watchman , React Native CLI and Xcode . Watchman is a service for watching changes in files and trigger actions when that happens.…

Git rebase

When running git rebase you reapply commits on top of another base tip. Ok, nice what does that mean? The official git docs provides a good explanation of this. If we have a feature branch called topic created from master at commit E. And if master has new commits before our branches can look like this: A---B---C topic / D---E---F---G master To rebase this branch with master we would use this…

Error Missing binding node in Visual Studio 2017

When working in a Visual Studio 2017 solution I started to get this problem when running sass.js task via task runner explorer. >> File "ui \_ checkout.scss" changed. Loading "sass.js" tasks...ERROR >> Error: Missing binding C:<path> \n ode_modules \n ode-sass \v endor \w in32-x64-46 \b inding.node >> Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 4.x…

What is Redis

What is Redis and what is it used for? I’ve come across it in two of the projects I’ve been working on, but never had to do anything else than start it. It seems to be used along side a persistence database. This is the first post in the What is series where I’m aiming to answer questions I’m thinking about but never take the time to answer. I got this idea from another Swedish developer, who I…

Screenbar version 0.3 released

Screenbar version 0.3 adds a feature to enable and disable sound while taking automated screenshots. Update Screenbar is now available for download on the Mac app Store What is new in version 0.3 A user called btecu opened an issue on Github asking for a feature to disable the sound in Screenbar. I thought that sounded like a nice feature to have in the app. This is what the setting looks like:…

Proposales Electron app - My first freelance assignment

In recent days Proposales released a new version. And with that version came an Electron app which I was hired to develop. Proposales Proposales is an award-winning startup by Joakim Green that helps you to create, deliver and monitor business proposals online. This is how Proposales explain their business: Replaces the traditional PDF proposal. Proposales is a new standard for interactive and…

Google map marker InfoWindow - Ionic

This tutorial walks you through how to add an info window when a user clicks or taps on a Google map marker. The tutorial starts where the Ionic 2 Google map markers left off. Open up src/pages/home/home.ts and add a new method in that class called addInfoWindowToMarker . addInfoWindowToMarker ( marker ) { var infoWindowContent = ' <div id="content"><h1 id="firstHeading" class="firstHeading"> ' +…

rsync example - ssh

This rsync example sends folder contents to a remote server using ssh. It also shows how to exclude multiple files or folders. I recently switched to jekyll . And in that switch i created my own deploy-script using secure copy. It seemed to work well but I recently discovered that some of my files wasn’t being deployed at all. Not sure why, possibly because of a crappy folder exclude technique I…

Dogwalk app released

Dogwalk app has been released for Android and iOS Devices What does it do? This summer I got a Bernese mountain dog . About now both him and me got tired and bored of the places we went for walks. So I got online and found new spots. This app collects these spots on a map and hopefully you can find some new places to go from it. Dogwalk screenshot Minimum viable product The version released is a…

The snippet to create all snippets in Atom editor

After switching from Wordpress to Jekyll I got a lot faster load times. But I also got to type more to get a post published. This can be eased by using snippets in the Atom editor in which i write my posts. A snippet is a small region of code that you use often. In Atom and many other editors these can be inserted by typing a few words and then let the editor fill in the rest by pushing tab.…

Add android platform in Ionic 2

When I used the Ionic CLI to create the Dogwalk project it came with an iOS project. Now it’s time to add the Android platform. These are the steps i took to install the Android SDK and add the Android Platform. I ran into errors, maybe you’ll get them as well, so even though this was not a smooth install maybe it helps! Ionic add platform Android To add the android platform to your app you run…

Ionic 2 splash screen and icon

Ionic CLI comes with a command to automatically generate splashscreen and icon with correct dimensions. Splash screen and icon resources Open the file resources/splash.png and edit it as you wish. The dimensions are 2208x2208 pixels. The icon is called.. you guessed it.. icon.png and is located in the same folder. The dimensions for the icon is 1024x1024 pixels. I’m aiming to release Dogwalk…

Ionic2 Google maps markers

This tutorial covers how to add markers on a Google map in an Ionic 2 app. We’ll continue where we left of the last with a Google map that is displayed in our app. If you haven’t already got that take a look at that tutorial first. 1. Markers JSON To keep it simple we’ll store the marker information in a json file. Add a file called markers.json in the folder src/assets/data/ (create the folder…