Today-I-Learned
Disabling Hyper-V in Windows 11
- If you need AVX/AVX2 instruction sets on your VBox VM, you’ll need to disable Hyper-V. Run these commands in Powershell:
bcdedit /set hypervisorlaunchtype off
# maybe need this line
DISM /Online /Disable-Feature:Microsoft-Hyper-V
# shut down completely
shutdown -s -t 2
- However, in new windows 11 installations, you also have to disable the Memory Integrity feature to get rid of Hyper-V. Search for ‘Core Isolation’ in Windows Settings and turn off the memory integrity feature. Reboot and you’re golden.
Images and EXIF
- Apparently, when you snap a picture with an iPhone in portrait mode, pixel data is saved as landscape and its orientation added in its EXIF. This means you gonna get hurt real bad (like me) if you’re not careful when preparing data for training a model.
- Fortunately,
pillow
has a great module for transposing images:
import os, glob
from PIL import Image, ImageOps
count = 0
def mylistdir(directory):
"""A specialized version of os.listdir() that ignores files that
start with a leading period."""
filelist = os.listdir(directory)
return [x for x in filelist
if not (x.startswith('.'))]
for dirName in mylistdir(os.getcwd() + '/img'):
dirPath = os.getcwd() + '/img/' + dirName + '/*.jpg'
for infile in glob.glob(dirPath):
img = Image.open(infile)
rotated_img = ImageOps.exif_transpose(img)
rotated_img.save(infile)
count += 1
print('Transposed %d images' % count)
Google Cloud SDK
gsutil rsync
will sync OS-related files and symlinks if you don’t supply it with the necessary flags. This one worked particularly well for me:
# https://stackoverflow.com/a/35210687
gsutil -m rsync -r -d -e -x '\..*|.*/\.[^/]*$|.*/\..*/.*$|_.*' [YOUR_DIRECTORY] gs://[YOUR_BUCKET]
UniFi Controller
Unifi Network Application v8.1
has begun supporting MongoDB 7.0, which requires a ARMv8.2-A processor.
- If you run your controller on a Raspberry Pi, you’ll need to pony up cash for the Pi 5 to meet the requirements. Otherwise, you’re effectively stuck with network application versions
8.0
and below.
Game development
- Finally understood what
Delta time
means. It’s the time difference between the previously rendered frame and the current frame. Multiplyingvx * dt
will move a sprite the same distance in the same amount of real world time regardless of frame rates! - Also, gafferongames is like the bible for game networking.
Random
- So I plugged in my long-abandoned ATH-M50x headphones today and everything sounded great except the vocals. Almost binned the thing but it turns out that the 6.35mm jack was just dirty. Wiped it down with isopropyl alcohol and all is well.