Mass Converting .svg to .png on macOS

When playing around with Royal TSX I needed to mass convert the VMware Clarity .svg files to .png files that I could use as icons in Royal TSX.

After trying a series of different approaches, I ended up with using rsvg-convert from libRSVG. In order to get rsvg-convert installed on my MacBook, I turned to HomeBrew.

HomeBrew, which calls itself The missing package manager for macOS is in my opinion essential for any macOS user. If you are missing a command or utility, chances are that HomeBrew has you covered.

Mass Converting:

Once you have HomeBrew installed, you’re pretty much ready to go by running the following command in Terminal:

brew install librsvg

This installs the libRSVG formulae, and all it’s dependencies, and makes rsvg-convert available.

Once libRSVG installed locally, you can mass-convert .svg files by running the following command in your terminal of choice.

for i in *; do rsvg-convert $i -o `echo $i | sed -e 's/svg$/png/'`; done

This loops through every .svg file in the current directory, and creates .png versions of them, for usage elsewhere.

Cross vCenter VM Mobility Fling – macOS?

The VMware Cross vCenter VM Mobility – CLI was recently updated so I decided to try it out. In short, this little Java based application allows you to easily move or clone VMs between disparate vCenter environments.

The Fling is listed with the following requirements:

  • JDK 1.7 or above
  • Two vCenter instances with ESX 6.0
  • Windows : Windows Server 2003 or above
  • Linux : RHEL 7.x or above, Ubuntu 11.04 or above

There is no mention of macOS there, but I decided to give it a go any way, and it turns out that it works just fine on macOS as well!
Just make sure you have the Java JDK installed locally. When I ran it the first time, I got the following error, since the JAVA_HOME environment variable was not set.

[cc lang=”bash”]
~/Downloads/xvc-mobility-cli_1.2$ sh xvc-mobility.sh
set JAVA_HOME to continue the operation
[/cc]

This is very easy to fix, just run the following command in your terminal of choice, and xvc-mobility.sh should work just fine on your Mac.

[cc lang=”bash”]
export JAVA_HOME=$(/usr/libexec/java_home)
[/cc]

Next up is running the fling with the correct parameters (this is a clone operation, not a relocate):

[cc lang=”bash”]
~/Downloads/xvc-mobility-cli_1.2$ sh xvc-mobility.sh -svc [source-vcenter] -su [source-vcenter-username]
-dvc [destination-vcenter] -du [destination-vcenter-username]
-vms [vm-name] -dh [destination-host]
-dds [destination-datastore] -op clone -cln [destination-vm-name]

13:41:40.591 [main] INFO com.vmware.sdkclient.vim.Task – CloneVM_Task | State = SUCCESS | Error = null | Result = [email protected]
13:41:40.597 [main] INFO com.vmware.sdkclient.vim.Task – Monitor task end
13:41:40.597 [main] INFO com.vmware.sdkclient.vim.Task – CloneVM_Task took : 0:51:33.728
13:41:40.603 [main] INFO c.v.s.helpers.CrossVcProvHelper – Successfully cloned the vm:[destination-vm-name]
[/cc]

I was able to clone a VM from my lab in Bergen to my lab in Oslo, without any problems what-so-ever. Not only is that a Cross vCenter vMotion, but also a Cross Country one, awesome!

Now this is just an example, please check the official documentation for all the parameters, and what the tool expects.

Software Recommendation: macOS: Spectacle

Working with the keyboard to move resize, focus and arrange your applications is a great productivity tip. When I changed from Windows to macOS a few years ago, I had a pretty convoluted setup based on Slate for managing keyboard shortcuts, especially for moving applications around, but this has since been simplified by using Spectacle instead of Slate.

Spectacle has everything I need, especially keyboard shortcuts for maximising an application, of “flinging” it over to another display.

Spectacle is free and comes highly recommended, give it a try!

#vDM30in30 progress: