The Wiert Corner – irregular stream of stuff

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

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

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

    Join 1,776 other followers

Archive for the ‘bash’ Category

OpenSuSE Tumbleweed – testing the password of any user with getent and openssl

Posted by jpluimers on 2017/06/21

For one of my VMs I forgot to note which of the initial password I had changed, so I wanted to check them.

Since I didn’t have a keyboard attached to the console and ssh wasn’t allowing root, I needed an alternative than actual login to test the passwords.

Luckily /etc/shadow, with getent and openssl came to the rescue.

Since getent varies per distribution, here is how it works on OpenSuSE:

Read the rest of this entry »

Posted in bash, Development, Scripting, Software Development | Leave a Comment »

Mac OS X – need to research this one day: How do I Check DHCP Lease info in terminal – via Ars Technica OpenForum

Posted by jpluimers on 2017/06/20

One day I need to research how to get the conversions right for this: How do I Check DHCP Lease info in terminal – Ars Technica OpenForum as I think that ipconfig getoption en0 lease_time gives me the value in a different format than date -r expects.

Also:

At T1 seconds (typically set to 0.5*lease_time) after the last successful renewal, the DHCP client attempts to renew it’s lease with the DHCP server that granted it’s current address via unicast. If unsuccessful, at T2 seconds (typically set to 0.875*lease_time) after the last renewal, the DHCP client attempts to rebind with any DHCP server via multicast.

–jeroen

Posted in Apple, bash, Development, Mac, OS X, OS X El Capitan, OS X Maverick, OSX Yosemite, Power User, Scripting, Software Development | Leave a Comment »

use vmrun – via How do I find the IP address of a virtual machine using VMware Fusion? – Super User

Posted by jpluimers on 2017/04/20

Note this works only when the VMs have VMware Tools installed (more on that below):

VMWare provides, not surprisingly, a built in tool for this, vmrun. It’s under /Applications/VMware Fusion.app/Contents/Library/vmrun although it has moved around in other Fusion releases a bit.

🍺 vmrun list Total running VMs: 1 .docker/machine/machines/myvm.vmx
🍺 vmrun getGuestIPAddress ~/.docker/machine/machines/myvm.vmx 172.16.213.128

via: How do I find the IP address of a virtual machine using VMware Fusion? – Super User [WayBack]

vmrun [WayBack] is barely documented and most of is in PDF of which this is the most recent I could find: www.vmware.com/pdf/vix180_vmrun_command.pdf [WayBack]

Based on the above path, I added this to my ~/.bash_profile file:

alias vmrun='/Applications/VMware\ Fusion.app/Contents/Library/vmrun'
alias vmrun-list-running-VMs='vmrun list | grep vmx'
vmrun-list-ipv4-of-running-VMs()
{
  vmrun-list-running-VMs | while read line ; do echo $line && vmrun getGuestIPAddress $line; done
}

Now I can do this:

$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
/Users/jeroenp/VM/diaspore-opensuse-Tumbleweed-x64.vmwarevm/diaspore-opensuse-Tumbleweed-x64.vmx
Error: The VMware Tools are not running in the virtual machine: /Users/jeroenp/VM/diaspore-opensuse-Tumbleweed-x64.vmwarevm/diaspore-opensuse-Tumbleweed-x64.vmx
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
Error: Unable to get the IP address
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
Error: Unable to get the IP address
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
172.16.172.134
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
172.16.172.134
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.142

These are the messages I observed:

Error: The VMware Tools are not running in the virtual machine: /Users/jeroenp/VM/diaspore-opensuse-Tumbleweed-x64.vmwarevm/diaspore-opensuse-Tumbleweed-x64.vmx
Error: Unable to get the IP address
172.16.172.135

The first one means a machine is running but has no VMware Tools installed. For an OpenSuSE machine you can install it with zypper install open-vm-tools, for other Linux systems read VMware Tools auf Ubuntu, Mint, CentOS oder openSUSE installieren | ITrig [WayBack]

Some more examples of vmrun for VMware Fusion are at Control VMware Fusion from the Command Line | James Reuben Knowles [WayBack]

–jeroen

Posted in *nix, bash, Development, Fusion, openSuSE, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed, Virtualization, VMware | Leave a Comment »

Bash that JSON (with jq) — Librato Blog

Posted by jpluimers on 2017/04/18

 Glueing together APIs requires working with JSON: parsing it, extracting it, transforming it. JQ is a fast, lightweight, flexible, CLI JSON processor, that does the job well. Learn how to use it by getting your hands dirty with a JSON blob that represents the open issues in the public Docker GitHub repository.

Source: Bash that JSON (with jq) — Librato Blog [WayBackhttp://blog.librato.com/posts/jq-json

via: http://blog.librato.com/posts/jq-json – Joe C. Hecht – Google+

–jeroen

Source: http://blog.librato.com/posts/jq-json

Posted in bash, Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | Leave a Comment »

.bashrc generator: create your .bashrc PS1 with a drag and drop interface

Posted by jpluimers on 2017/04/13

Cool: .bashrc generator: create your .bashrc PS1 with a drag and drop interface

http://bashrcgenerator.com/

–jeroen

http://bashrcgenerator.com/ – Joe C. Hecht – Google+

Posted in bash, Development, Scripting, Software Development | Leave a Comment »

 
%d bloggers like this: