Site is slow after a while – Adding a swap file

Continuing from the previous post about migrating this site to an Azure VM… I noticed the the site’s performance was horrendous on the free B1s VM size 1CPU 1GB.

I increased the VM size to B1MS 1CPU 2GB which takes me out of the free tier but so far it seems to work. But in the interest of going back to free tier, I’m going to want to go back to the 1GB VM size. I’ll need to look into this some more.

So it turns out the Azure Ubuntu VM by default doesn’t have a swap file. This appears to be the reason why the VM bogs down and runs out of memory. I checked the site this morning and it wasn’t responsive at all. Azure portal showed it had 35Mb of RAM free.

So I just created a swap file and rebooted. Let’s see if this works. So far so good.

Create 2GB file in root directory called swapfile:
sudo dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress

Give only system permission:
sudo chmod 600 /swapfile

Make it a swap file:
sudo mkswap /swapfile

Turn on swap file:
sudo swapon /swapfile

Make persistent by editing /etc/fstab and adding swapfile entry:
sudo nano /etc/fstab
“/swapfile none swap 0 0”

Reboot:
sudo reboot

TSN.ca/live requires third party cookies to work

This week tsn.ca/live stopped working for me in Chrome on Windows 10. I was able to login and authenticate via TV provider login method, but it would just bounce me back to the same screen asking me to logon to view content.

It works at work on work laptop. It works on TSN app on my android phone at home. It even worked in Edge on the same computer where it doesn’t work in Chrome.

It doesn’t work even in Incognito mode in Chrome or with VPN turned on. No DNS blocks logged. No blocks logged on the Firewall.

I had “Block third party cookies” turned on. It worked when I switched to “Allow all cookies” which obviously isn’t desirable.

I added account.bellmedia.ca to the “Allow third party cookies” list in Chrome and it worked again.

watch.sportsnet.ca doesn’t require this.

Interesting that drive.google.com was already on the “Allow third party cookies” list.

No hits turn up on Google regarding TSN specifically. The first hit on this topic was some university’s FAQ for accessing course content.

There was also a hit on an article saying Google wants to ban third party cookies but delayed it until 2023.

Very interesting.

Upgrading HDDs/SSDs using CloneZilla

Just upgraded the boot drive on my HTPC from 128GB SSD to 480GB SSD using CloneZilla. Back in the day, my weapon of choice was Norton Ghost but it was discontinued. CloneZilla works even better/faster/easier than Norton Ghost.

I wasn’t able to get the UEFI .zip files to boot, but downloading the .iso file and using Rufus to “burn” the iso to the same USB key I was struggling with, worked like a charm. It’s weird cuz the computer is UEFI and in the end using the iso method it was also using UEFI.

Regardless, the clone took about 10 minutes for about 93GB of data. Restarted the computer and Windows boot right up none the wiser. Only thing I had to do was extend the partition to take advantage of the full drive, else it was still showing a max of 115GB.

Going to do the same on my server now, going from 128GB SSD to 1TB SSD.

What happens when Windows Evaluation period runs out?

Windows Server powers itself off.

slmgr /rearm to add another 180 days

I was surprised my VMs and Windows Server wasn’t responding to pings or ssh. Went over to check the HP host and found it was turned off.

When I powered it back on everything was looking fine so I went digging through event viewer. Had to scroll through a bunch of stuff but one obscure “information” entry in Application Logs that said:

The license period for this installation of Windows has expired. The operating system is shutting down.

One hour as well as a half hour before Windows Server shut itself down, there are a couple of information logs that said:

The license period for this installation of Windows has expired. The operating system will shutdown every hour.

It logged an identical entry when I turned the machine back on as well.

Rebuilding boot record and EFI partition

Found the following post on reddit:
https://www.reddit.com/r/Windows10/comments/njr7we/if_you_accidentally_deleted_the_efi_partition/

…for rebuilding the boot record/EFI partition on a drive

If You Accidentally Deleted The EFI Partition, Broke Your Boot Record, Can’t Boot Into Safe-Mode or Have Too Many Boot Options in Bios This Tutorial is for You.

I’m making this to pretty much assemble all of the steps I found across the web to re-create my non-existent boot record; after cloning from my previous GPT SSD everything still functioned perfectly however I could not boot into safe-mode in order to use DDU as I had no recovery partition.

The final straw was when windows update refused to work and kept throwing me into a ” Sorry, we’re having trouble determining if your PC can run Windows 10 ” loop with an error code 0x80070003.

I planned on reinstalling windows but somehow ended up fixing everything within an hour. Well I wish you luck you who is finding this thread by randomly searching up those key words in google’s index; I hope this helps.

This is particularly useful if the only solution you’ve found has been to set your C:/ drive as active which won’t work if it is formatted to GPT/runs UEFI.

Before performing these steps please disconnect every USB file/Drive not necessary for the fix or you’ll only more than likely end up confusing yourself; more so than you already are.

  1. Download Media Creation Tool; from Microsoft’s Website, install it to an external USB and boot into it from the Bios or however you know how and run the Repair Tool after verifying the language and system settings.
  2. Open the Command Prompt from within the Repair Tools
  3. Once in the Command Prompt you have potentially two main things you want to do; delete whatever messed up boot records you currently have and or create news ones.
  4. We will delete what currently exists first. Use ‘bcdedit /v‘ to view a list of boot loaders currently connected to the System and ‘bcdedit /delete {identifier}‘ to remove said bootloader (Yes, include the curly brackets from the former command too). If you later find yourself still having too many bootloaders in the bios you can use ‘bcdedit /enum firmware‘ and delete unknown identifiers that way. Further more programs like VisualBCD can display the current bootloaders on your system; that is if you are able to boot.
  5. Next we will create the partition to copy the boot files over to, type ‘diskpart‘ and wait for the environment to load, next ‘list disk‘ to view a list of all the disks connected look at all the current disks and their sizes and the use ‘select disk {disk number}‘ to select the disk that the Windows OS is currently installed on; if you are unsure, select a disk and type ‘detail disk‘ afterwards to view the drive information; you are more than likely looking for a drive assigned the letter ‘C:
  6. Next we will list the partitions, ‘list part’ in a perfect world there is a Primary partition with the majority of the disk space listed, another recovery/EFI partition and maybe a Reserved partition for whatever else. We are focusing on the recovery partition; if it already exists for the sake of simplicity we are going to recreate it if it does not skip this next step.
  7. Type ‘select part {number of partition we plan to delete}‘ and then type ‘delete partition‘.
  8. If your EFI/Recovery partition already existed you can skip this next command, if it did not then before you create a partition you need to shrink your current main one, first select the partition where the main OS is; ‘select partition {number of partition where OS is located}‘ and then shrink it by 500MB, ‘shrink desired=500‘. Now we’re good to go.
  9. Create a new partition of size 500MB, ‘create partition efi size=500‘ and then format it to fat32 don’t worry this next command won’t format your original OS drive as long as you have the new partition selected but just to be safe ‘list part‘ and look at what partition is selected(it should have a star on the left-hand side of it) if it’s the wrong one then ‘select part {Number of the new 500MB partition you just created}‘. Format the partition by typing ‘format quick fs=fat32‘ and then assign a letter to the drive ‘assign letter=s‘. Type ‘list part’ and ‘list vol’ to verify everything is in the right place for me my OS drive is labelled ‘Boot’ and Recovery Drive ‘System’.
  10. Now the last step, type ‘exit‘ to leave diskpart and then ‘S:‘ or replace S with whatever drive letter you gave the recovery drive. Again if you were having issues formatting the drive you can also do it here with ‘format S: /FS:FAT32‘ but that’s besides the point. Next run ‘bcdboot C:\windows /s S: /f UEFI‘ this should work in all Windows 10 versions past 1709 and copy the boot files from the recovery device to your recovery partition. Now you should be ready to go with a working recovery partition and less of a headache visiting windows forums for a solution that never comes.

Enjoy!

Thanks for reading. Good luck & Stay Blessed.

EDIT: Changed 100MB Partition Size to 500MB to account for installing larger operating systems in boot loader in the future.

WordPress Dark Mode

Despite being ingrained in me that black text on white gives the best visuals for reading, I’ve become accustomed to white on black recently. A dark blackground is less harsh on my eyes… to the point where white backgrounds burn my eyes, esp at night or in indoor environments where I mostly operate.

Just installed the WP Dark Mode plugin here and it instantly makes my vision more comfortable. It doesn’t seem to apply to post creation though as I’m squinting to type this.

Found the plugin by searching “dark” in the plugins search function on the WP admin portal. It allows visitors to choose between white/dark mode with a moon icon in the lower right hand corner. On the admin portal, after you activate the plugin and go to settings to enable dark mode for the admin portal as well as for visitors. The white mode version of the admin portal still loads initially which then promptly gets replaced by a dark mode version.

Basic Video Editors: VLC, Video Editor, Movie Maker

Started uploading videos to Youtube recently. By no means are these viral videos or even professional videos, they’re merely unboxing videos I record as evidence in case something goes wrong. Does this still make me a Youtuber though??

In the past when shopping online, I’ve had the wrong products shipped, damaged merchandise, missing goods… just to name a few. In most cases I’ve had luck resolving the issue with the retailer but the experience of one or two disputes with customer service not going smoothly left me feeling not my best. With these videos there’s no debate as to whether I opened a working product and then later claimed it was damaged as some sellers alleged. I used to just delete the videos after confirming there was nothing wrong with the shipment and only save the ones that needed disputing.

So why am I uploading these videos to Youtube now? Why not? Much like this blog I don’t expect many to see, but it’ll serve as a record of what I bought, and when I bought it… Who knows? Maybe a video or two will end up helping someone. I do sometimes share the videos on forums or facebook to which some people do watch. There’s something about unboxing videos that pique people’s curiosity I suppose.

Most of the videos are single take and uncut thus far, shot on my phone which I then upload directly to Youtube… until today. I just uploaded a video of a belt I unboxed which I had to edit. The first clip was the belt unboxing itself and the second video was installing the belt into a buckle I had from an old belt that was pretty broken.

Originally I thought I could just use something simple like VLC to join the two MP4 files together but VLC 3.0.12 doesn’t seem to support joining videos anymore. I messed around with Video Editor that came installed with Windows 10 and while that did the job, the quality was pretty horrendous, with tons of artifacts. Youtube didn’t have a way to join two videos together despite the myriad of other online editing it allows you to do like blurring parts of the video, adding sound track, and overlaying links/cards. Finally gave Microsoft Movie Maker a shot.

Microsoft Movie Maker

I gave this a try cuz I wanted something simple to test out. Definitely not about to spend coin on Adobe Premiere and didn’t really want to install anything significant or invest in hardware to simply join two video files together.

The upside is that it works. I managed to join the two videos together, even cropped out the first few seconds where my address was showing on the package. Also managed to add a card in the middle of the two videos with text about adding the buckle. Using this allows me to skip questionable websites that join video files for free online. While using those would definitely have been quite simple, an IT security session I attended previously about Cloud Access Security Broker (CASB) clued me in to the hidden/implied user agreement and privacy concerns about using free websites to do file conversions and the sort.

The downside to Movie Maker is that the free version only outputs to 720p… it didn’t seem to let me choose the animation/transition of the credit screen I added for the “add buckle” text. (Granted, that was designed to be a credit screen.) Hence, the scrolling text. *Cringe* And even at 720p output, the visual quality wasn’t quite the same as the original videos.

All in all though, I spent probably less than 10 minutes downloading/installing and editing the video so I can’t ask for much. There is probably a feature somewhere to do the text card probably that I missed, or maybe it’s a paid feature. Much like exporting to 1080p or 4K is a paid feature. It did the job this time but I’ll probably keep looking.

Next steps

This did get me interested in researching other video editors, probably open source ones. Will I end up editing the heck out of my videos like a proper Youtuber? Probably not.

A quick google search introduced me to OpenShot. I’ll probably take a look at a few more in my spare time.

Here’s the video I uploaded if you’re interested:

https://youtu.be/JLcue3VIEbU