The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,115 other followers

Archive for September 13th, 2016

Firebird gbak backing up a remote database that has spaces in the path and is on a remote Windows machine

Posted by jpluimers on 2016/09/13

I will likely need a batch file like this again:

setlocal
set gbakExe=C:\Program Files (x86)\Firebird\Firebird_2_5\bin\gbak.exe
set dbPart=MyDatabase
set dbSource=192.168.199.24:C:\Path with spaces\%dbPart%.fdb
set dbUser=sysdba
set dbPassword=masterkey
"%gbakExe%" -verify -transportable -user %dbUser% -password %dbPassword% "%dbSource%" %dbPart%.fbk
endlocal

You need the quotes around %gbakExe% and %dbSource% to ensure spaces in paths are preserved.

–jeroen

Sources:

Posted in Batch-Files, Database Development, Development, Firebird, Scripting, Software Development | Leave a Comment »

vim-cmd suspending/resuming a bunch of VMs

Posted by jpluimers on 2016/09/13

These two vim-cmd scripts come in very handy:

#!/bin/sh
VMS=`vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}'`
for VM in $VMS ; do
# echo "Probing VM with id: $VM."
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "VM with id $VM has power state $PWR (name = $name)."
done

#!/bin/sh
RUNNING=0
VMS=`vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}'`
for VM in $VMS ; do
# echo "Probing VM with id: $VM."
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "VM with id $VM has power state $PWR (name = $name)."
if [ "$PWR" == "Powered on" ] ; then
RUNNING=1
echo "Powered on VM with id $VM and name: $name"
echo "Suspending VM with id $VM and name: $name"
vim-cmd vmsvc/power.suspend $VM > /dev/null &
fi
done
while true ; do
if [ $RUNNING -eq 0 ] ; then
echo "Gone…"
break
fi
RUNNING=0
for VM in $VMS ; do
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
if [ "$PWR" == "Powered on" ] ; then
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "Waiting for id $VM and name: $name"
RUNNING=1
fi
done
sleep 1
done

#!/bin/sh
SUSPENDED=0
VMS=`vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}'`
VMstateToProcess="Suspended"
for VM in $VMS ; do
# echo "Probing VM with id: $VM."
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "VM with id $VM has power state $PWR (name = $name)."
if [ "$PWR" == "$VMstateToProcess" ] ; then
SUSPENDED=1
echo "Suspended VM with id $VM and name: $name"
echo "Resuming VM with id $VM and name: $name"
# you'd think power.suspendResume is the inverse of power.suspend, but actually power.on is:
vim-cmd vmsvc/power.on $VM > /dev/null &
fi
done
while true ; do
if [ $SUSPENDED -eq 0 ] ; then
echo "Gone…"
break
fi
SUSPENDED=0
for VM in $VMS ; do
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
if [ "$PWR" == "$VMstateToProcess" ] ; then
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "Waiting for id $VM and name: $name"
SUSPENDED=1
fi
done
sleep 1
done

–jeroen

Posted in bash, Development, ESXi4, ESXi5, ESXi5.1, ESXi5.5, ESXi6, Power User, Scripting, Software Development, Virtualization, VMware, VMware ESXi | Leave a Comment »

New Book: MVVM in Delphi by John Kouraklis should be available at the beginning of november.

Posted by jpluimers on 2016/09/13

John Kouraklis last week announced a new book: MVVM in Delphi.

It will be available early november and is already listed at the APress site: MVVM in Delphi – Architecting and Building Model View ViewModel Applications [WayBack] where you can pre-order.

It’s good to see that the last years more Delphi books have been published and I hope this MVVM book falls in the more advanced category.

Since I’ve given a few Delphi MVVM talks (latest at https://github.com/jpluimers/Conferences/tree/master/2013/20131121-BE-Delphi) I’m genuinely interested. So I will get this book and – time permitting – write a review.

Nick Hodges did the technical review, and since Nick’s book are great I have high hopes (:

From the APress site:

Full Description

Dive into the world of MVVM, learn how to build modern Windows applications, and prepare for cross-platform development. This book introduces you to the right mindset and demonstrates suitable methodologies that allow for quick understanding of the MVVM paradigm. MVVM in Delphi shows you how to use a quick and efficient MVVM framework that allows for scalability, is of manageable complexity, and provides strong efficiency.

One of the biggest challenges developers face is how to convert legacy and monolithic Delphi applications to the MVVM architecture. This book takes you on a step-by-step journey and teaches you how to adapt an application to fit into the MVVM design.

What you’ll learn

  • Gain the fundamentals of MVVM
  • Visualize MVVM as a design philosophy
  • Create easy-to-use frameworks for building your own MVVM applications
  • Develop a methodology for converting legacy applications to the MVVM pattern
  • Architect cross-platform and multi-lingual applications using the MVVM pattern

Who this book is for

Delphi developers with a good knowledge of Delphi or programming experience in a different language. In addition, this book is attractive to Delphi developers who want to modernize existing applications based on the MVVM design.

and

Table of Contents

1. MVVM as Design Pattern
2. Setting Up the POSApp
3. MVVM as Design Philosophy
4. Two-way Communication
5. MVVM and Delphi
6. Planning the Application
7. Developing the Application
8. How to Convert your App to MVVM
A. Appendix: Other MVVM Delphi frameworks

–jeroen

via: New Book: MVVM in Delphi… [WayBack]

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

 
%d bloggers like this: