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 1,862 other subscribers

Archive for 2016

Why the Apple II ProDOS 2.4 Release is the OS News of the Year « ASCII by Jason Scott

Posted by jpluimers on 2016/09/18

http://ascii.textfiles.com/archives/5054

Posted in Uncategorized | Leave a Comment »

 Becker Mexico Cassette AUX input Upgrade by Ken Tyler for W116 : Mercedes-Benz S-Class – 280S, 280SE, 280SEL, 300SD, 350SE, 350SEL, 450SE, 450SEL & 450SEL 6.9

Posted by jpluimers on 2016/09/16

A modification to fit a 3.5 mm stereo socket to the front face of a Becker Mexico Cassette to allow use of mp3 players and the like but still retaining AM/FM radio and cassette functions.

Source: W116 : Mercedes-Benz S-Class – 280S, 280SE, 280SEL, 300SD, 350SE, 350SEL, 450SE, 450SEL & 450SEL 6.9

Interesting…

We’ve such a receiver in our classic car (see 1970 Becker Mexico AM-FM Cassette Car Radio showing operation & sound – YouTube « The Wiert Corner – irregular stream of stuff).

It would be a great way to add AUX to it, but I’d rather not modify the front-panel. Since the 450SEL69 has plenty of room, I will try to see if the above instructions can make the cable external so the AUX connector will be either near the arm rest or the glove compartment.

–jeroen

 

Posted in cars, LifeHacker, Power User, W116 | 2 Comments »

VMware KB: Configuring Network Time Protocol (NTP) on ESX/ESXi hosts using the vSphere Client

Posted by jpluimers on 2016/09/16

Often it is better to configure more than just a single pool.ntp.org server in case the IP-address of the name gets cached too long and it becomes unresponsive during that period.

So it is better to configure multiple, choose from this list from [WayBackpool.ntp.org: How do I setup NTP to use the pool?.

0.pool.ntp.org
1.pool.ntp.org
2.pool.ntp.org
3.pool.ntp.org

Here are the steps for one server where you need to repeat the steps after entering pool.ntp.org:

To configure NTP on ESX/ESXi 4.1 and ESXi 5.x hosts using the vSphere Client:

  1. Connect to the ESX/ESXi host using the vSphere Client.
  2. Select a host in the inventory.
  3. Click the Configuration tab.
  4. Click Time Configuration.
  5. Click Properties.
  6. Click Options.
  7. Click NTP Settings.
  8. Click Add.
  9. Enter the NTP Server name. For example, pool.ntp.org.
    1. Note: When entering the multiple NTP Server names, use a comma (,) followed by a space ( ) between the entries.
  10. Click OK.
  11. Click the General tab.
  12. Click Start automatically under Startup Policy.
    1. Note: It is recommended to set the time manually prior to starting the service.
  13. Click Start and click OK.
  14. Click OK to exit.

–jeroen

via:

Posted in ESXi4, ESXi5, ESXi5.1, ESXi5.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

Decompression libraries and tools for many formats

Posted by jpluimers on 2016/09/15

7-zip can uncompress a truckload of formats, but what if you need formats it doesn’t support or you want to integrate decompression in your own software?

Then some libraries can be really useful provided you regularly update them (otherwise you – like Symantec – can run in substantial security risks).

libmspack (license: GNU LGPL, version 2)

Formats supported:

File format Year Algorithm Supported?
COMPRESS.EXE (SZDD) 1990 LZSS Decompression
Microsoft Help (.HLP) 1990 LZSS To-do
COMPRESS.EXE (KWAJ) 1993 LZSS, Huffman, DEFLATE Decompression
Microsoft Cabinet (.CAB) 1995 DEFLATE, Quantum, LZX Decompression
HTML Help (.CHM) 1997 LZX Decompression
Microsoft eBook (.LIT) 2000 LZX, SHA, DES To-do
Windows Imaging Format (.WIM) 2007 LZX, XPRESS To-do
Exchange Offline Address Book (.LZX) 2008 LZX DELTA Decompression

cabextract (license: GNU GPL)

Pre-compiled console wrappers around libmspack for many platforms.

WinRAR archiver, a powerful tool to process RAR and ZIP files

Libraries and pre-compiled console applications for many platforms.

HTML Help (CHM) Index

Background on CHM files.

–jeroen

Via:

Symantec dropped the ball here. A quick look at the decomposer library shipped by Symantec showed that they were using code derived from open source libraries like libmspack and unrarsrc, but hadn’t updated them in at least 7 years.

Source: Project Zero: How to Compromise the Enterprise Endpoint

Posted in 7zip, Compression, Development, Power User, Software Development | Leave a Comment »

Converting sendmail .db files to text

Posted by jpluimers on 2016/09/15

If you want to inverse the work of newaliases, you can use makemap to convert them to text:

makemap -u hash access.db

This is quite handy to see if the newaliases indeed put all information into the db file (for instance if you use a script, you can verify it ran correctly).

It works for any db, but you need to be aware of the database format: hash type or btree type.

To my knowledge only one uses the btree type format:

  • userdb.db

All others use hash type format:

  • aliases.db
  • aliases-maillist.db
  • mailertable.db
  • genericstable.db
  • virtusertable.db
  • access.db
  • auth-info.db
  • domaintable.db

–jeroen

via: Reading Sendmail .db files.

Posted in *nix, *nix-tools, bash, Development, Linux, openSuSE, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »

Mac OS X – installing pdf-tools using homebrew to circumvent “For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later.”

Posted by jpluimers on 2016/09/14

Adobe marketing scam

Adobe marketing scam

I don’t want Acrobat/Adobe Reader on my Mac. Period.

But Preview will show some PDF files as “For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later.” or “For the best experience, open this PDF portfolio in Acrobat X or Adobe Reader X, or later.

This is some Adobe marketing scam where they generate a PDF file actually as a portfolio of PDF files having the first PDF being “marketing” message.

So I needed the pdf-tools on my Mac for which many sites suggest to use brew install pdf-tools. That worked not so well:

$ brew install pdf-tools
Error: No available formula with the name "pdf-tools" 
==> Searching for similarly named formulae...
This similarly named formula was found:
mupdf-tools
To install it, run:
  brew install mupdf-tools
==> Searching taps...
This formula was found in a tap:
homebrew/emacs/pdf-tools
To install it, run:
  brew install homebrew/emacs/pdf-tools

Searching for “Error: No available formula with the name” “pdf-tools” didn’t return useful results but looking for brew “pdf-tools” gone revealed pdf-tools: move to homebrew/emacs · wingyplus/homebrew@6e73af9 indicating the command should indeed be brew install homebrew/emacs/pdf-tools however that also ended up failing, in fact with multiple errors:

==> make server/epdfinfo
Error: No available formula with the name "homebrew/dupes/tcl-tk" 
Please tap it and then try again: brew tap homebrew/dupes
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.

After doing abrew tap homebrew/dupes it finally worked.

Read the rest of this entry »

Posted in Apple, Development, DVCS - Distributed Version Control, git, GitHub, Home brew / homebrew, Power User, Source Code Management | Leave a Comment »

Gmane Alive! – Random Thoughts

Posted by jpluimers on 2016/09/14

Just found out that about a week ago this happened: Gmane Alive! – Random Thoughts [WayBack]

Wonderful! Thanks Lars for taking care of it so long, and thanks to the new team from Yomura Corporation for bringing it back alive!

I don’t use Gmane often, but when I do

So after six weeks of cold turkey for many (The End of Gmane? – via: Random Thoughts) it’s back (:

If you don’t know what it is: Gmane – Wikipedia, the free encyclopedia [WayBack]

–jeroen

Posted in gmane, Power User, SocialMedia | Leave a Comment »

ESXi: when esxtop shows garbage.

Posted by jpluimers on 2016/09/14

The ESXi console top to show processes is not available *, the alternative is esxtop. But that can show garbage because the ESXi console has a very limited support of terminals **.

For instance, when connecting from a Mac OS X terminal through ssh, this is my terminal:

# echo $TERM
xterm-256color

The solution:

TERM=xterm esxtop

–jeroen

via: VMware KB: Output of esxtop defaults to non-interactive CSV with unknown TermInfo.

Read the rest of this entry »

Posted in *nix, *nix-tools, bash, bash, Development, ESXi5, ESXi5.1, ESXi5.5, ESXi6, Power User, Scripting, Virtualization, VMware, VMware ESXi | 2 Comments »

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
# https://wiert.me/2021/04/30/vmware-esxi-console-viewing-all-vms-suspending-and-waking-them-up-part-5/
RUNNING=0
vmids=`vim-cmd vmsvc/getallvms | sed -n -E -e "s/^([[:digit:]]+)\s+((\S.+\S)?)\s+(\[\S+\])\s+(.+\.vmx)\s+(\S+)\s+(vmx-[[:digit:]]+)\s*?((\S.+)?)$/\1/p"`
for vmid in ${vmids} ; do
# echo "Probing VM with id: $vmid."
powerState=`vim-cmd vmsvc/power.getstate ${vmid} | sed '1d'`
name=`vim-cmd vmsvc/get.config ${vmid} | sed -n -E -e '/\(vim.vm.ConfigInfo\) \{/,/files = \(vim.vm.FileInfo\) \{/ s/^ +name = "(.*)",.*?/\1/p'`
vmPathName=`vim-cmd vmsvc/get.config ${vmid} | sed -n -E -e '/files = \(vim.vm.FileInfo\) \{/,/tools = \(vim.vm.ToolsConfigInfo\) \{/ s/^ +vmPathName = "(.*)",.*?/\1/p'`
# echo "VM with id ${vmid} has power state ${powerState} (name = ${name}; vmPathName = ${vmPathName})."
if [ "${powerState}" == "Powered on" ] ; then
RUNNING=1
echo "Powered on VM with id ${vmid} and name: $name"
echo "Suspending VM with id ${vmid} and name: $name"
vim-cmd vmsvc/power.suspend ${vmid} > /dev/null &
fi
done
while true ; do
if [ $RUNNING -eq 0 ] ; then
echo "Gone…"
break
fi
RUNNING=0
for vmid in ${vmids} ; do
# echo "Probing VM with id: $vmid."
powerState=`vim-cmd vmsvc/power.getstate ${vmid} | sed '1d'`
name=`vim-cmd vmsvc/get.config ${vmid} | sed -n -E -e '/\(vim.vm.ConfigInfo\) \{/,/files = \(vim.vm.FileInfo\) \{/ s/^ +name = "(.*)",.*?/\1/p'`
vmPathName=`vim-cmd vmsvc/get.config ${vmid} | sed -n -E -e '/files = \(vim.vm.FileInfo\) \{/,/tools = \(vim.vm.ToolsConfigInfo\) \{/ s/^ +vmPathName = "(.*)",.*?/\1/p'`
# echo "VM with id ${vmid} has power state ${powerState} (name = ${name}; vmPathName = ${vmPathName})."
if [ "${powerState}" == "Powered on" ] ; then
RUNNING=1
echo "Waiting for id ${vmid} and name: $name…"
fi
done
sleep 1
done
exit 0


#!/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 »