Wednesday, March 31, 2021

Saving an image or file to MongoDB GridFS using Lua

Install the following packages
$: sudo apt install lua5.3
$: sudo apt install luarocks
$: sudo apt install libbson-dev
$: sudo apt install libmongoc-dev
$: sudo apt install liblua5.3-dev
$: sudo luarocks install lua-mongo

Then save image like below:
local mongo = require 'mongo'
local client = mongo.Client('mongodb://127.0.0.1')
local gridfs = client:getGridFS('GridFS')
local f = gridfs:createFileFrom('/home/u1/tmp/image.png', {filename='/home/u1/tmp/image.png'})
f:save()

Tuesday, March 30, 2021

Changing the color of the title bar via registry

This will change the title bar to black
c:\> reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "AutoColorization" /t REG_SZ /d "0" /f
c:\> reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM" /v "ColorPrevalence" /t REG_DWORD /d "1" /f
c:\> reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM" /v "AccentColor" /t REG_DWORD /d 4282203453 /f
c:\> reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM" /v "AccentColorInactive" /t REG_DWORD /d "13882323" /f

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...