[HowTo] Automation – Photo resizing script

  • Prerequisites:
    • Mac Portshttps://www.macports.org/
      • Apple’s Command Line Developer Tools
      • type in the following command to get Apple’s Command Line Developer Tools installed:
xcode-select --install
  • If you get the following message about xcode-select command requiring command line developer tools, go ahead and install
  • Apple’s Xcode Developer Tools
xcodebuild -license
sudo port -v selfupdate
  • Now Mac Ports has been installed on your Mac
  • Go ahead and close your terminals and open a new terminal window
  • ImageMagick:
sudo port install perl5.34
sudo port install imagemagick
sudo port install p5.34-perlmagick
% sudo port install perl5.34
---> Computing dependencies for perl5.34
The following dependencies will be installed:
db48
gdbm
gettext-runtime
libiconv
ncurses
readline
Continue? [Y/n]: Y
.....
% sudo port install imagemagick
---> Computing dependencies for ImageMagick
The following dependencies will be installed:
aom
bash
brotli
bzip2
cairo
coreutils
dav1d
djvulibre
expat
fftw-3
fontconfig
freetype
gdk-pixbuf2
ghostscript
giflib
glib2
gmp
gobject-introspection
icu
imath
jasper
jbig2dec
jbigkit
kvazaar
lcms2
lerc
libde265
libdeflate
libedit
libelf
libffi
libgcc
libgcc14
libheif
libidn
libjpeg-turbo
libpaper
libpixman
libpng
libraw
libtool
libxml2
lz4
m4
mpdecimal
openexr
openh264
openjpeg
openssl
openssl3
pcre2
perl5
pkgconfig
py313-mako
py313-markdown
py313-markupsafe
py313-setuptools
python313
python3_select
python3_select-313
python_select
python_select-313
shared-mime-info
sqlite3
svt-av1
tiff
urw-fonts
webp
x265
xorg-libX11
xorg-libXau
xorg-libXdmcp
xorg-libXext
xorg-libXt
xorg-libice
xorg-libsm
xorg-libxcb
xorg-xcb-proto
xorg-xcb-util
xorg-xorgproto
xrender
xz
zlib
zstd
Continue? [Y/n]: Y
....
---> Some of the ports you installed have notes:
coreutils has the following notes:
The tools provided by GNU coreutils are prefixed with the character 'g' by
default to distinguish them from the BSD commands.
For example, cp becomes gcp and ls becomes gls.

If you want to use the GNU tools by default, add this directory to the front
of your PATH environment variable:
/opt/local/libexec/gnubin/
libheif has the following notes:
Support for rav1e now disabled by default; enable via +rav1e
libidn has the following notes:
GNU libidn2 is the successor of GNU libidn. It comes with IDNA 2008 and TR46
implementations and also provides a compatibility layer for GNU libidn.
python313 has the following notes:
To make this the default Python or Python 3 (i.e., the version run by the
'python' or 'python3' commands), run one or both of:

sudo port select --set python python313
sudo port select --set python3 python313
shared-mime-info has the following notes:
A startup item has been generated that will start shared-mime-info with
launchd, and will be enabled automatically on activation. Execute the
following command to manually _disable_ it:

sudo port unload shared-mime-info
  • Depends on which version of Python 3 gets installed/available, you may want to set the default version of Python by running the ‘select -set’ commands at the bottom of the install
sudo port install p5.34-perlmagick
sudo port install p5.34-image-exiftool
% sudo port install p5.34-image-exiftool
---> Computing dependencies for p5.34-image-exiftool
---> Fetching archive for p5.34-image-exiftool
---> Attempting to fetch p5.34-image-exiftool-13.300.0_0.darwin_any.noarch.tbz2 from https://packages.macports.org/p5.34-image-exiftool
---> Attempting to fetch p5.34-image-exiftool-13.300.0_0.darwin_any.noarch.tbz2.rmd160 from https://packages.macports.org/p5.34-image-exiftool
---> Installing p5.34-image-exiftool @13.300.0_0
---> Activating p5.34-image-exiftool @13.300.0_0
---> Cleaning p5.34-image-exiftool
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
sudo port install wget
% sudo port install wget
---> Computing dependencies for wget
The following dependencies will be installed:
curl-ca-bundle
gnutls
gsettings-desktop-schemas
libidn2
libproxy
libpsl
libtasn1
libunistring
libxslt
nettle
p11-kit
Continue? [Y/n]: Y
% cd ~/Downloads
% wget https://www.sentex.ca/~mwandel/jhead/os-x/jhead
--2025-05-26 15:24:31-- https://www.sentex.ca/~mwandel/jhead/os-x/jhead
Resolving www.sentex.ca (www.sentex.ca)... 64.7.148.55
Connecting to www.sentex.ca (www.sentex.ca)|64.7.148.55|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 72696 (71K)
Saving to: ‘jhead’

jhead 100%[===================>] 70.99K 291KB/s in 0.2s

2025-05-26 15:24:32 (291 KB/s) - ‘jhead’ saved [72696/72696]
% sudo cp ~/Downloads/jhead /opt/local/bin/
% sudo chmod +x /opt/local/bin/jhead
  • close all Terminal windows and restart a new one to test:
% cd ~/Pictures
% % ./scripts/raw2jpeg.pl -h
Unknown option: h
-F- Unknown option encountered.
-F- Availabel options : tn, bw, op, cc, SV, AV, SSP, title, desc, src, desc, move & debug
-F- -src : Location for Source imgs(jpeg)
-F- -dest : Location for Destination
-F- -SV : Generate SimpleView Web contents.
-F- -AV : Generate ActiveView Web contents.
-F- -SSP : Generate SlideShowPro Web contents.
-F- -3W : Triple Width 1800x600
-F- -title : Web Title for SV/AV/SSP.
-F- -desc : Web Description for SV/AV/SSP.
-F- -tn : Generate Thumbnail size.
-F- -bw : Generate Grayscale images(800x).
-F- -pr : Generate Polaroid images(800x).
-F- -op : Generate OilPaint images(800x).
-F- -cc : Generate Charcoal images(800x).
-F- -bdr : Generate Bordered/framed images(800x).
  • Sample runs:
  • Let’s assume that the photos are arranged in ~/Pictures folder with <date>_<title> and scripts are also in ~/Pictures folder as above
% cd ~/Pictures
% % ./scripts/raw2jpeg.pl -SSP -AV -SV -bw -src 20250525_Friday-Party/uncompressed -dest 20250525_Friday-Party -title 20250525_Friday-Party
  • (Here, you can use auto-completion by pressing <tab> key after 20250525…)

[HowTo] LG Styler Steam Closet S5WBC Door Reversal

We wanted a LG Styler Steam Closet for a while and part of the pre-BlackFriday deal, we pulled a trigger and ordered one.

https://www.lg.com/us/washers-dryers/lg-s5wbc-styler-steam-closet

However, we we need the door direction to be reversed – it came with hinge on the right so it opens left to right but we needed it to be reversed so the door does not collide when it opens.

I have searched everywhere for the Door Reversal Kit/Parts and even contacted LG via chat and phone call but they were not able to help me other than asked me to be in contact with encompass.

I have found an YouTube video on the door reversal on a very similar model but no info on the kit – https://youtu.be/aEJNrZInqT0?si=iaJadN87_P8aqx5U

To make the long story short, I found the kit – CLS30860013

and here are some sites where I found the kit for sale:

Part Advantage – https://www.partadvantage.com/modelproduct/index/view/id/S5MSB?srsltid=AfmBOootafj55-ourrpBMA8975WToX8CHjmnUN0zykjH1hteyrN1Cy4l

$164.98

encompass – https://encompass.com/item/12643060/LG/CLS30860013

$192.95

$192.95

Reliable Parts – https://www.reliableparts.com/lge-cls30860013.html

$184.31

Although it is not the lowest, I ended up ordering it from Reliable Parts since their web site was the most helpful with diagrams and etc.

[HowTo] Windows 11 Setup –

3DP Net NIC driver – https://www.3dpchip.com/3dpchip/3dp/net_down_en.php
3DP Net detects ethernet card automatically and provides the newest or the most suitable drier. It supports off-line installation.

Winaero Tweaker – https://winaero.com/winaero-tweaker/
Winaero Tweaker is a free app for all versions of Windows that lets you adjust (i.e. tweak) hidden secret settings that Microsoft does not let you adjust from the user interface. In addition, it allows you to add extra value to existing Windows apps and tools with advanced context menus, options, and handy commands.

PotPlayer – https://potplayer.daum.net/

HoneyView – https://en.bandisoft.com/honeyview/

Everything – https://www.voidtools.com/

EarTrumpet – https://eartrumpet.app/

CBX Shell – https://www.softpedia.com/get/System/OS-Enhancements/CBX-Shell.shtml

Parsec – https://parsec.app/

CCleaner Portable – https://www.ccleaner.com/ccleaner/builds

TreeSize – https://www.jam-software.com/treesize_free?ca=1

AppCheck – https://www.checkmal.com/

Malware Zero – https://malzero.xyz/

[HowTo] APC Masterswitch AP9211 with AP9606 Firmware Upgrade

I have a few old APC Masterswitch Power Controller with AP9606 Web/SNMP Management Card stored away in my garage for years…

Finally I found some use for them and I wanted to update the firmwares before I install them for good.

What’s needed:
Tripp-Lite USB to DB9 Adapterhttps://www.tripplite.com/support/usa19hs
Plugable USB Serial Adapter – https://plugable.com/products/pl2303-db9
DB9 Null Modem Female to Female adapter – https://a.co/d/dl8Q76C

On MacOS(Monterey v12.5), I had to download and install the driver for Tripp-Lite USB to DB9 adapter and use the following command to connect to APC Masterswitch:

screen /dev/tty.usbserial-1410 2400,cs8,-ixon

I did some web searching and found the following firmwares:

  • aos309a.bin – APC OS for AP9606(download link below)
  • ms225a.bin – Masterswitch Application(download link below)

I followed the ftp instruction for firmware update – https://www.apc.com/us/en/faqs/FA156047/

First, once I get logged into the AP9606 via Serial connection, I figured out the MAC address then assigned IP via BOOTP with:

apc -s 192.168.?.? <MAC Address>

Then uploaded MasterSwitch APP, v2.2.5.a via ftp then Web/SNMP Management Card AOS v3.0.9.a then disabled BOOTP and configured static IP TCP/IP

[macOS] Ripping CD and Converting to FLAC

It has been a long time since I rip a CD to FLAC files and I used to do this on Windows. Now my primary system is macOS, I want to find out how to do this on a Mac.

(https://xiph.org/flac/links.html#software)

I decided to use macOS Music/iTunes to extract tracks from CD to Apple Lossless Audio Codec(AAC):

A Better CD Encoder(ABCDE)
with Homebrew installed, “brew install abcde”

X Lossless Decoder(XLD) – just run it once and set the Output format and directory then open the AAC files with XLD and it will convert them to FLAC automatically

[HowTo] OS X – How to change hostname

(Source: https://knowledge.autodesk.com/support/smoke/learn-explore/caas/sfdcarticles/sfdcarticles/Setting-the-Mac-hostname-or-computer-name-from-the-terminal.html)

Procedure

Perform the following tasks to change the workstation hostname using the scutil command.

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac:
    This is your fully qualified hostname, for example myMac.domain.com
    sudo scutil –set HostName <new host name>
  3. Type the following command to change the Bonjour hostname of your Mac:
    This is the name usable on the local network, for example myMac.local.
    sudo scutil –set LocalHostName <new host name>
  4. Optional: If you also want to change the computer name, type the following command:
    This is the user-friendly computer name you see in Finder, for example myMac.
    sudo scutil –set ComputerName <new name>
  5. Flush the DNS cache by typing:
    dscacheutil -flushcache
  6. Restart your Mac.

Volumio – Audio Media Player – Remote Control

I have been using Volumio on Raspberry Pi since Volumio version Beta 1.1 and I am happy with it that I can play my FLACs and MP3s directly from my home Free4NAS server via SMB mounts.

With my recent home audio upgrades, I want to control Volumio with remote control so I look for that info on the web.

https://volumio.org/forum/how-installed-lirc-with-receiver-and-remote-volumio-t360.html
https://volumio.org/forum/using-remote-with-volumio-t1923.html

My MCE remote is Rosewill RRC-126: http://amzn.com/B003WM5J0O

Installing lirc package:

 > ssh pi@volumio
 (password is raspberry)
 > sudo apt-get update
 > sudo apt-get install lirc

Testing:

 > mode2 -d /dev/lirc0

Now, if you press any button on the remote, you should see a bunch of pulse/space messages.

Editing /etc/lirc/hardware.con:

 > sudo vi /etc/lirc/hardware.conf
 
 # /etc/lirc/hardware.conf
 #
 # Arguments which will be used when launching lircd
 LIRCD_ARGS="--uinput" 
 
 #Don't start lircmd even if there seems to be a good config file
 #START_LIRCMD=false
 
 #Don't start irexec, even if a good config file seems to exist.
 #START_IREXEC=false
 
 #Try to load appropriate kernel modules
 LOAD_MODULES=true
 
 # Run "lircd --driver=help" for a list of supported drivers.
 DRIVER="default"
 # usually /dev/lirc0 is the correct setting for systems using udev
 DEVICE="/dev/lirc0"
 MODULES="mceusb"
  
 # Default configuration files for your hardware if any
 LIRCD_CONF=""
 LIRCMD_CONF=""

Now we need to learn lirc with IR commands:
http://lirc-remotes.sourceforge.net/remotes-table.html

 > sudo /etc/init.d/lirc stop
 > irrecord -n -d /dev/lirc0 ~/lircd.conf

Now copy this newly created lircd.conf

 > sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd.conf.orig
 > sudo mv ~/lircd.conf /etc/lirc/lircd.conf

(for my Rosewill MCE USB dongle remote, I am using mceusb.lircd.conf)

Now start lircd

 > sudo /etc/init.d/lirc start

Testing Config file:

 > irw

Creating .lircrc file:

 > vi /home/pi/.lircrc
begin
  remote = mceusb
  button = KEY_PAUSE
  prog   = irexec
  config = mpc toggle
end
begin
  remote = mceusb
  button = KEY_NEXT
  prog   = irexec
  config = mpc next;mpc play
end
begin
  remote = mceusb
  button = KEY_AGAIN
  prog   = irexec
  config = mpc prev;mpc play
end
begin
  remote = mceusb
  button = KEY_STOP
  prog   = irexec
  config = mpc stop
end
begin
  remote = mceusb
  button = KEY_PLAY
  prog   = irexec
  config = mpc play
end

Running irexec as a background process:

 > irexec -d

Adding irexec to rc.local to startup after every reboot:

 > sudo vi /etc/rc.local
 (add this before exit 0)
(sleep 3;
sudo -u pi irexec -d
)&

Reboot

[HowTo] perl on Windows – ActivePerl

I am a huge fan of perl scripting language and I have scripts that I want to run on Windows and I use ActiveState’s ActivePerl

ActiveState ActivePerl

During installation, do not change any of the settings, just take all of the default settings and install.

ActivePerl comes with a great tool to manage modules – Perl Package Manager(PPM)

Here is PPM repository for PerlMagick: http://www.bribes.org/perl/

Here are some of the perl modules that I install for my own use:
Image/Magick.pm
Image/ExifTool.pm

Also jhead.exe is needed for JPEG header manipulation – http://www.sentex.net/~mwandel/jhead/

ImageMagick(http://www.imagemagick.org/) also needs to be installed. I had no luck with Dynamic Link Library due to the mogrify.exe giveing “Wrong JPEG library version: library is 70, caller expects 80″… I had to use Static build binary…