Archive for March, 2019
Posted by jpluimers on 2019/03/15
Posted in LifeHacker | Leave a Comment »
Posted by jpluimers on 2019/03/15
For me, scp is like tar; somehow I Google this every time…
On the remote machine, find out the full path of the remote file:
~ # ssh username@192.168.71.123
...
~ # ls -alh `find /vmfs/volumes/ | grep -w W81Entx64CI | grep '\.vmdk$'`
-rw------- 1 root root 200.0G Aug 26 22:48 /vmfs/volumes/552f5788-33e30274-8dba-001f29022aed/VM/PSO/W81Entx64CI/W81Entx64CI-flat.vmdk
-rw------- 1 root root 500 Aug 19 16:36 /vmfs/volumes/552f5788-33e30274-8dba-001f29022aed/VM/PSO/W81Entx64CI/W81Entx64CI.vmdk
On the local machine, go to the right directory, then copy the file from the remote machine:
~ # cd /vmfs/volumes/Samsung512NVME/PSO/VM/W81Entx64CI/
~ # time scp -v username@192.168.71.123:/vmfs/volumes/552f5788-33e30274-8dba-001f29022aed/PSO/W81Entx64CI/W81Entx64CI-flat.vmdk W81Entx64CI-flat.vmdk
I don’t know what’s worse–the fact that after 15 years of using tar I still can’t keep the flags straight, or that after 15 years of technological advancement I’m still mucking with tar flags that were 15 years old when I started.
The last line will logon over ssh and shows the file transfer in a verbose way.
Requirements:
both machines have ssh
local machine has firewall entry to allow client ssh
remote machine has sshd and firewall entry to allow sshd server connections
Via [WayBack ] shell – How to scp a folder from remote to local? – Stack Overflow (thanks [WayBack ] Gryphius)
Image source: [WayBack ] xkcd: tar
–jeroen
Posted in Communications Development , Development , Internet protocol suite , SSH , TCP | Leave a Comment »
Posted by jpluimers on 2019/03/15
VIDEO
Chain Sinnet (AKA Daisy Chain or Monkey Chain)
Farrimond Friction Hitch
https://nl.scoutwiki.org/Farrimond_steek
Trucker’s Hitch
Constrictor Knot
https://nl.scoutwiki.org/Constrictorknoop
Cow Hitch
ringknoop
Half hitch
https://nl.scoutwiki.org/Halve_steek
Fisherman’s Bend
https://nl.scoutwiki.org/Vissersknoop
Water Knot
Dutch / English knot translations via
Via the comments: the Automatic Trucker’s Hitch:
VIDEO
–jeroen
Posted in LifeHacker , Power User | Leave a Comment »
Posted by jpluimers on 2019/03/14
From a while ago [WayBack ] delphi – Why was TDataSource created originally? – Stack Overflow
It is all about decoupling and indirection .
And with TDataSource there are two kinds of them:
Decoupling the master detail relations (TDataSource is in the same module as the TDataSets that are being bound; the detail TDataSet references the master TDataSet by pointing its’ MasterSource property to the TDataSource that points to the master TDataSet)
Decoupling the UI from the business layer (TDataSets are in a DataModule; TDataSource is on the Form/Frame which contains your UI controls, UI controls reference their DataSource property).
Since many components can point to the same DataSource, you can quickly switch which underlying TDataSet they use by just flipping one TDataSource.DataSet property.
–jeroen
Posted in Conference Topics , Conferences , Delphi , Development , Event , Software Development | Leave a Comment »
Posted by jpluimers on 2019/03/14
One more article about differences between the old C# Windows vSphere Client and “new” vSphere HTML5 Web Client in ESXi 6.5 and up.
This time about changing the startup/shutdown sequence so automatically power on and power off virtual machines.
In the old C# Windows vSphere Client, this was at the host level in the configuration tab under Virtual Machine Startup/Shutdown. There you click on Properties, then adjust the order by moving them up and down (screenshots and more detailed instructions are at ESX(i) AutoStart virtual machines: how to change the VM startup/shutdown settings (via: VMware Communities) ).
In the vSphere HTML5 Web Client, there are two bits for this:
On the server you need to enable AutoStart:
From: to:
For each VM you have to enable AutoStart, then determine the order
In the left, select the VM
In the right, choose Actions, then Autostart, then Enable:
Enable the columns in the VM overview:
Order 1 means highest; adjust accordingly for each VM:
If after boot you get a “Failed – The operation is not allowed in the current state. “, then your machine still is in maintenance mode.
–jeroen
Related: ESXi 6.5: change the host name in the “new” vSphere HTML5 Web Client, or using DHCP option 12 « The Wiert Corner – irregular stream of stuff
Posted in ESXi6.5 , Power User , Virtualization , VMware , VMware ESXi | Leave a Comment »
Posted by jpluimers on 2019/03/14
On my systems these so far give the best compression results with 7zip and p7zip 16.02:
-t7z -m0=lzma2:d=1024m -mx=9 -aoa -mfb=64 -md=32m -ms=on
Note the -d=1024m is mentioned on some sites, but is gone around version 16.
Via:
If you want to delete the files after archiving, then use the -sdel switch: -sdel (Delete files after including to archive) switch
If -sdel switch is specified, 7-Zip deletes files after including to archive. So it works like moving files to archive., moves txt files from disk’s directory to a.7z archive.
–jeroen
Posted in 7zip , Compression , Power User | 1 Comment »
Posted by jpluimers on 2019/03/13
Based on [WayBack ] windows – How to run batch file command with elevated permissions? – Super User :
powershell -command "Start-Process cmd.exe -Verb runas"
This works better than "runas /user:administrator cmd.exe" as that forces to use the specific Administrator account, whereas the PowerShell way allows you to specify the actual account during elevation.
You can extend this to run a command with one or more parameters based on [WayBack ] Launch Elevated CMD.exe from Powershell – Stack Overflow (thanks [WayBack ] mklement0 ):
powershell -command "Start-Process cmd.exe -Verb runas -Args /k, call, goto-bin"
This will actually pass “call goto-bin” to cmd.exe which tries to execute the “goto-bin” command (which I have around on the PATH as goto-bin.bat).
You can either use comma-separated parameters or a quoted string. In this expansion, comma-separated is easier in this PowerShell construct.
–jeroen
Posted in Batch-Files , CommandLine , Console (command prompt window) , Development , Power User , PowerShell , PowerShell , Scripting , Software Development , Windows | Leave a Comment »
Posted by jpluimers on 2019/03/13
Reminder to self when checking “new” disks to see what partitions they contain before formatting them as VMFS.
There is a truckload information at [WayBack ] Using the partedUtil command line utility on ESXi and ESX (1036609) | VMware KB .
A few tips; example output is further below:
Disks are listed under /vmfs/devices/disks/ where there are two entries per device: a path leading to the device, and a link to that path which starts with vml. which I filter out with grep.
If a disk under under /vmfs/devices/disks/ ends with :# where # is a number, then it is a partition
Just skip partedUtil get as partedUtil getptblwill give you exactly the same information,
plus an extra initial line indicating what kind of partition table it is. KB 1036609 has a longer list, but these are the ones you usually see:
unknown: the disk has no partition table yet (usually), or the type of partition table cannot be determined (hardly)
gpt: there is a GUID Partition Table
msdos: there is a Master Boot Record partition table
on ESXi 6.x two extra columns listing the partition GUID and partition type description
The output of partedUtil is unformatted, which means it is easy to parse, but hard to read for humans. You can pipe through sed 's/ /\t/g' (as there is no tr on the ESXi busybox)
Some more background reading
On scripting:
The shell is sh (always been there)
There is Python (ESXi 5.1 has Python 2.7.8; ESXi 6.5 has Python 3.5.3; it has likely been available in earlier versions too).
On device names:
On errors:
~ # find /vmfs/devices/disks/ | grep T1500LM0032D9YH148
/vmfs/devices/disks/t10.ATA_____ST1500LM0032D9YH148__________________________________Z110C4Q0a
~ # partedUtil getptbl /vmfs/devices/disks/t10.ATA_____ST1500LM0032D9YH148__________________________________Z110C4Q0
unknown
182401 255 63 2930277168
~ #
I know of three VMFS types:
VMFS-3: Supported in ESXi 3.X, 4.X, 5.x & 6.x; deprecated as of 6.0 (cannot be created as of 6.0), has quite some limitations.
VMFS-4: got never released.
VMFS-5: Can be converted from VMFS-3
VMFS-6: Cannot be converted from other VMFS types
Some interesting links about the various VMFS types:
Busybox has been updated over time:
Examples and output
Example outputs on one of my systems, of which I stripped most of the disks as they’re not really relevant here.
[root@ESXi-X10SRH-CF:~] ls -1 /vmfs/devices/disks/ | grep -v '^vml\.'
naa.5000c50087762d1b
...
naa.600605b00aa054a0ff000021022683ae
naa.600605b00aa054a0ff000021022683ae:1
...
t10.ATA_____ST1500LM0032D9YH148__________________________________Z110C4Q0
t10.ATA_____Samsung_SSD_850_PRO_2TB_________________S2KMNCAGB04321L_____
t10.ATA_____Samsung_SSD_850_PRO_2TB_________________S2KMNCAGB04321L_____:1
...
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372:1
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372:5
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372:6
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372:7
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372:8
t10.SanDisk00Ultra_Fit000000000000004C530001240406103372:9
[root@ESXi-X10SRH-CF:~] partedUtil getptbl /vmfs/devices/disks/t10.ATA_____ST1500LM0032D9YH148__________________________________Z110C4Q0
unknown
182401 255 63 2930277168
[root@ESXi-X10SRH-CF:~] partedUtil get /vmfs/devices/disks/t10.ATA_____ST1500LM0032D9YH148__________________________________Z110C4Q0
182401 255 63 2930277168
[root@ESXi-X10SRH-CF:~] partedUtil get /vmfs/devices/disks/t10.ATA_____SAMSUNG_MZHPV512HDGL2D00000______________S1X1NYAGB09589______
62260 255 63 1000215216
1 2048 1000214527 0 0
[root@ESXi-X10SRH-CF:~] partedUtil getptbl /vmfs/devices/disks/t10.ATA_____SAMSUNG_MZHPV512HDGL2D00000______________S1X1NYAGB09589______
gpt
62260 255 63 1000215216
1 2048 1000214527 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
[root@ESXi-X10SRH-CF:~] partedUtil getptbl /vmfs/devices/disks/t10.SanDisk00Ultra_Fit000000000000004C530001240406103372
gpt
3738 255 63 60062500
1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128
5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
9 1843200 7086079 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
[root@ESXi-X10SRH-CF:~] partedUtil get /vmfs/devices/disks/t10.SanDisk00Ultra_Fit000000000000004C530001240406103372
3738 255 63 60062500
1 64 8191 0 128
5 8224 520191 0 0
6 520224 1032191 0 0
7 1032224 1257471 0 0
8 1257504 1843199 0 0
9 1843200 7086079 0 0
[root@ESXi-X10SRH-CF:~] partedUtil getptbl /vmfs/devices/disks/t10.SanDisk00Ultra_Fit000000000000004C530001240406103372 | sed 's/ /\t/g'
gpt
3738 255 63 60062500
1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128
5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
9 1843200 7086079 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
[root@ESXi-X10SRH-CF:~] partedUtil get /vmfs/devices/disks/t10.SanDisk00Ultra_Fit000000000000004C530001240406103372 | sed 's/ /\t/g'
3738 255 63 60062500
1 64 8191 0 128
5 8224 520191 0 0
6 520224 1032191 0 0
7 1032224 1257471 0 0
8 1257504 1843199 0 0
9 1843200 7086079 0 0
[root@ESXi-X10SRH-CF:~] partedUtil --help
Usage:
Get Partitions : get
Set Partitions : set ["partNum startSector endSector type attr"]*
Delete Partition : delete
Resize Partition : resize
Get Partitions : getptbl
Set Partitions : setptbl ["partNum startSector endSector type/guid attr"]*
Fix Partition Table : fix
Create New Label (all existing data will be lost): mklabel
Show commonly used partition type guids : showGuids
Get usable first and last sectors : getUsableSectors
Fix GPT Table interactively : fixGpt
[root@ESXi-X10SRH-CF:~] partedUtil showGuids
Partition Type GUID
vmfs AA31E02A400F11DB9590000C2911D1B8
vmkDiagnostic 9D27538040AD11DBBF97000C2911D1B8
vsan 381CFCCC728811E092EE000C2911D0B2
virsto 77719A0CA4A011E3A47E000C29745A24
VMware Reserved 9198EFFC31C011DB8F78000C2911D1B8
Basic Data EBD0A0A2B9E5443387C068B6B72699C7
Linux Swap 0657FD6DA4AB43C484E50933C84B4F4F
Linux Lvm E6D6D379F50744C2A23C238F2A3DF928
Linux Raid A19D880F05FC4D3BA006743F0F84911E
Efi System C12A7328F81F11D2BA4B00A0C93EC93B
Microsoft Reserved E3C9E3160B5C4DB8817DF92DF00215AE
Unused Entry 00000000000000000000000000000000
[root@ESXi-X10SRH-CF:~] cat /local/bin/what-is-my-shell.sh
if test -n "$ZSH_VERSION"; then
PROFILE_SHELL=zsh
elif test -n "$BASH_VERSION"; then
PROFILE_SHELL=bash
elif test -n "$KSH_VERSION"; then
PROFILE_SHELL=ksh
elif test -n "$FCEDIT"; then
PROFILE_SHELL=ksh
elif test -n "$PS3"; then
PROFILE_SHELL=unknown
else
PROFILE_SHELL=sh
fi
echo $PROFILE_SHELL
echo $SHELL
[root@ESXi-X10SRH-CF:~] /local/bin/what-is-my-shell.sh
sh
/bin/sh
[root@ESXi-X10SRH-CF:~] python --version
Python 3.5.3
[root@ESXi-X10SRH-CF:~]
–jeroen
Posted in Development , ESXi4 , ESXi5 , ESXi5.1 , ESXi5.5 , ESXi6 , ESXi6.5 , Power User , Software Development , Virtualization , VMware , VMware ESXi | Leave a Comment »
Posted by jpluimers on 2019/03/13
Interesting read and watch:
At the recent Embedded Linux Conference and OpenIoT Summit, Mozilla Technical Evangelist Dietrich Ayala proposed a simple and affordable solution to home automation: A discarded smartphone can handle some of the most useful home automation tasks without requiring expensive hubs and sensors — or risking data security in the cloud.
Source: [WayBack ] Repurposing Old Smartphones for Home Automation | Linux.com | The source for Linux information .
Via Ruurd Pels .
GitHub Repository autonome/context by autonome (Dietrich Ayala)
–jeroen
https://www.youtube.com/watch?list=PLGeM09tlguZRbcUfg4rmRZ1TjpcQQFfyr&v=4RWSXlai6PE
Posted in Development , Hardware Development , IoT Internet of Things , Network-and-equipment , Power User , Software Development | Leave a Comment »