Wednesday, 2 August 2023

Open TTD settings

Settings

Settings > Interface > General > Close window on right-click: on

Settings > Disasters/Accidents > Vehicle breakdowns: none

Settings > Localisation > Speed units: Imperial (mpg)

Settings > World Generation > Road vehicles: Drive on left

Settings > Limitations > Vehicles never expire: on

Settings > Environment > Authorities > Allow buying exclusive transport rights: off


GRFs

BRTrains v2

British Town Names






Get an app to open this 'ms-gamingoverlay' link error

Whenever I loaded OpenTTD on a locked-down machine it raised the error 

"Get an app to open this 'ms-gamingoverlay' link"


This was because Windows had detected a game had been loaded and started to invoke XBox Game features - such as the Game Bar and the ability to record video. However the PC was locked down through policy and these features were unavailable. Clicking on the "Browse Microsoft Store" link wouldn't work because the Windows Store was removed by policy.

This article helped.

Creating the DWORD registry key

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR\AppCaptureEnabled

and setting the value to 0 fixed it.

Thursday, 22 June 2023

Removing X-Frame-Options in ASP.NET MVC Core 7

I had an ASP.NET Core 7 App that used forms.

And I actually WANTED it to be used within an iFrame.

As soon as you add a form to a Web App, the server immediately starts returning X-Frame-Options: SameOrigin in all requests.

I tried a variety of means to remove this, including:

app.UseStaticFiles();

            app.Use(async (context, next) =>
            {
                context.Response.Headers.Remove("X-Frame-Options");
                context.Response.Headers.Add("Bob", "Hello");
                await next.Invoke();
            });


            app.UseRouting();

The Bob header was being added, but X-Frame-Options stubbonly remained.
In the end I found the solution was to use:

// Remove X-Frame-Options, allowing Framing
            builder.Services.AddAntiforgery(options =>
            {
                options.SuppressXFrameOptionsHeader = true;
            });


Saturday, 17 June 2023

Transferring domains to Google

I decided to leave 123-reg after they chose to upgrade their email services and removed catch-all email forwarding. I found a slight issue when transferring Nominet (.uk) domains to Google. The transfer process requires Google to send a handshake email to the registrant's email address, requesting them to approve the transfer. However, if you don't have a gmail address registered, you don't seem to get an email. So it is important to set the registrant's contact email to a Gmail address first, before setting the IPS tag.

Saturday, 25 February 2023

FreeBSD discretionary ACLs

 As well as the normal user,group,all file permissions, my FreeBSD server had additional ACLs that were preventing the NFS client from accessing files.


To solve this, use setfacl:

setfacl -bn *

Friday, 24 February 2023

Docker bind mount assumes ownership of container user

I had a mosquitto image running in Docker, with a bind mount:

docker run -it --name mosquitto -p 1883:1883  -v /home/pi/mosquitto/mosquitto:/mosquitto/ -v ~/mosquitto/mosquitto/log:/mosquitto/log -v ~/mosquitto/mosquitto/data:/mosquitto/data  eclipse-mosquitto

Before I ran the container: I created the source folder and set the owner to pi:

sudo chown -R pi /home/pi/mosquitto/

Yielding the following permissions

drwxr-xr-x  5 pi 1883 4096 Feb 19 20:14 mosquitto

On running the container the folder changes permissions:

drwxr-xr-x  5 1883 1883 4096 Feb 19 20:14 mosquitto

Debugging the container:

docker exec -it mosquitto /bin/sh

and checking the users:

sudo nano /etc/passwd

It can be seen that UID 1883 is the mosquitto user:

mosquitto:x:1883:1883:mosquitto:/var/empty:/sbin/nologin



Linux utilities

The strace program prints all the system calls made by a program.

strace ls -lhn $(which sleep) 2>&1 | grep passwd

What you are trying to see is whether ls command is trying to read the /etc/passwd file or not.

Networking tools:

Performance tools:






Pe