MySQL on Docker Swarm
Posted on February 26, 2020 1 Comment
For several applications around the house, I need a MySQL backend. The biggest database I run is about 60Mb of data for my Kodi media players. By using centralized storage like this I only need to update one of them when I add new media. Also convenient if I watch a movie in the living room, pause it, and then want to continue in the bedroom. A few years ago we actually did this with our apartment in San Francisco and our other apartment in Sweden. So this has been battle-proven over the years for me.
Read MoreRaspberry Pi Docker Swarm
Posted on February 25, 2020 6 Comments
For small home server applications like Hassio, Plex and headless BitTorrent boxes Raspberry Pi has been a great solution for years. I came to a point where I was running several ones with different software on it depending on it’s intended use. This, however, isn’t ideal for a number of reasons. Even though Raspberry Pis are cheap you usually end up underutilizing the hardware. So we could be running more stuff on the same hardware. The second issue is the setup, I have done numerous posts about setting up different systems and how to maintain them.
Read MorereCAPTCHA v2 vs reCAPTCHA v3
Posted on February 24, 2020 Leave a Comment
CAPTCHA was first invented in 1997 to distinguish a human from a bot performing an action. Back in the day captchas were usually obscured or deformed letters. Before that, we had the simple question verification like “what is 1 + 9” which is simple enough once the bot scrapes it off the page.
In 2007 reCAPTCHA was originally launched and then acquired by Google in 2009. The new thing with reCAPTCHA is that the work effort used to prove you’re a human isn’t wasted. Initially, reCAPTCHA was used in the digitalization of the New York Times and Google Books archive. By presenting the user with images where the OCR had failed you got a human interpretation to add to the OCR results. By combining known and unknown images you could still be confirmed as a human while providing this service.
Read MoreDealing with credentials in PowerShell
Posted on February 10, 2020 Leave a Comment
Whenever you write PowerShell scripts that are going to be used for automation you need to secure your credentials. The best practice is to use a service account to execute the PowerShell script and delegate whatever privileges it needs to execute. When dealing with internal systems and resources that are usually pretty easy if they all authenticate from the same ecosystem or are integrated properly. But there is instances where you need to store credentials like when working with external APIs or deattached internal system.
Read MoreGoogle Cloud Functions local testing – auto releod
Posted on February 3, 2020 Leave a Comment
Cloud Functions is Google Cloud’s event-driven serverless compute platform. Run your code locally or in the cloud without having to provision servers. Go from code to deploy with continuous delivery and monitoring tools. Cloud Functions scales up or down, so you pay only for compute resources you use. Easily create end-to-end complex development scenarios by connecting with existing Google Cloud or third-party services.
It’s easy enough to get up and running with a local dev environment but with the basic setup you need to restart the dev server on every file change. Doing a lot of Google AppEngine development recently I got use to the dev server reloading changed files. When you have the basic environment up and running (specified here: https://cloud.google.com/functions/docs/functions-framework) just follow these simple steps.
Read MoreMultiple ReCaptcha on the same page
Posted on May 20, 2018 Leave a Comment
Been trying to use multiple Google reCAPTCHAs on the same page with mixed success. Reason for doing this is for example a login page with a reCAPTHCA for the login form and a modal opening with a reset password form. I prefer to use the “invisible” reCAPTCHA since it gives a cleaner look. To be able to use the native validation of forms in HTML5 i need to manually execute the reCAPTCHA when the form is submitted which gave me issues with multiple reCAPTCHAs.
Powershell: IIS Application Pool Killer
Posted on January 8, 2018 Leave a Comment
Every now and then IIS application pools lock up and needs to be killed. You can add the field PID in Task Manager and then use cmd tools to find which one of the IIS Worker Process is the right one and kill it. I created a simple script that lists all the IIS Application Pools by name, select the one you need to kill and the script kills it. The script is available on my Github and is named IISAppPoolKiller.ps1. Please comment below what you have been using this for!
Powershell: Pending Windows Updates
Posted on January 5, 2018 Leave a Comment
Every now and then you need to check if your servers or client computers have pending updates. You can generate a simple list of this with Powershell. I have created a script for this on my Github named ListPendingWindowsUpdates.ps1. Here is a quick breakdown of the script, feel free to use and modify it anyway you like. Please comment below what you ended up doing with it.
We always need to declare the functions of the Powershell script first but I will dig into the only function of this script below and start with the locally executed code. This script have one locally executed part and then a function that is executed on each and every server/client it lists. For this to work you need to run the script with domain admin rights. Both to access the Active Directory and to remote execute the code on each server/client.
Powershell: Manage folder permissions
Posted on January 4, 2018 Leave a Comment
Working with folder and share security is to often treated as set and forget. A good practice is to run daily jobs to check, report and reset permissions on shared folders and home directories. There are several ways to do this but it can easily be done from Powershell. This can also be used when migrating between servers and access needs to be added or removed. Here is a few useful code snippets when working with folder access and shares in Powershell.