Archive for the ‘Software Development’ Category
Posted by jpluimers on 2019/03/19
Based on [WayBack ] How can I open a cmd window in a specific location? – Stack Overflow :
cmd /K "pushd ""D:\Versioned Stuff\wiert.me"""
The quoting is required for paths having spaces, so I always include them just in case I ever have a path with spaces.
If I want it with bash, then I run it as follows:
cmd /K "pushd ""D:\Versioned Stuff\wiert.me""" && "C:\Program Files\Git\bin\bash.exe"
Documentation: [WayBack ] CD Change Directory – Windows CMD – SS64.com
–jeroen
Posted in CommandLine , Console (command prompt window) , Development , Power User , Software Development , Windows | Leave a Comment »
Posted by jpluimers on 2019/03/19
While checking out an issue with the SSH server for ContinuaCI issue (see info below), I wanted to look at the files leading to the issue: .pem and .rsa files with the private key for the SSH server.
So I browsed through my series of openssl related articles to see if I already had made a script better explaining the cryptic openssl command-line parameters. I didn’t have it yet, but it turned out to be really simple:
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.rsa
writing RSA key
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.rsa -text
Private-Key: (1024 bit)
modulus:
..:..:..:.....
publicExponent: 35 (0x23)
privateExponent:
..:..:..:.....
prime1:
..:..:..:.....
prime2:
..:..:..:.....
exponent1:
..:..:..:.....
exponent2:
..:..:..:.....
coefficient:
..:..:..:.....
writing RSA key
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.pem
Enter pass phrase for server_keypair.pem:
unable to load Private Key
2675996:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:529:
2675996:error:23077074:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 cipherfinal error:p12_decr.c:108:
2675996:error:2306A075:PKCS12 routines:PKCS12_item_decrypt_d2i:pkcs12 pbe crypt error:p12_decr.c:139:
2675996:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:141:
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.pem -passin pass:password
unable to load Private Key
2675996:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:529:
2675996:error:23077074:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 cipherfinal error:p12_decr.c:108:
2675996:error:2306A075:PKCS12 routines:PKCS12_item_decrypt_d2i:pkcs12 pbe crypt error:p12_decr.c:139:
2675996:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:141:
The command-lines use the [WayBack ]rsa tool with:
the -in parameter
(for the first file) the -text parameter to dump it into human readable form
(for the second file) the -passin parameter with a [WayBack ] pass phrase argument pass:password.
The server_keypair.pem file (having the header -----BEGIN ENCRYPTED PRIVATE KEY----- and footer -----END ENCRYPTED PRIVATE KEY-----) was a password protected RSA private key where somehow ContinuaCI had the wrong password for.
I’m not sure it’s a good idea that the server_keypair.pem file has not password at all.
Read the rest of this entry »
Posted in Continua CI , Continuous Integration , Development , OpenSSL , Power User , Security , Software Development | Leave a Comment »
Posted by jpluimers on 2019/03/19
Odd, the [WayBack /Archive.is ] Delphi Intrinsic Routines – RAD Studio indicates quite a few compiler intrinsics are not available on Windows.
I wonder if this list is correct:
Especially since this compiles fine with the DCC32 compiler:
program CompilerIntrinsicsConsoleProject;
{$APPTYPE CONSOLE}
{$R *.res}
var
I, J, K: Integer;
begin
System.AtomicCmpExchange(I, J, K);
System.AtomicDecrement(I);
System.AtomicExchange(I, J);
System.AtomicIncrement(J);
end .
–jeroen
Posted in Delphi , Delphi 10.3 Rio (Carnival) , Development , Software Development | 3 Comments »
Posted by jpluimers on 2019/03/18
Soon this is a thing of the past, but for just a few more days, you can help: Archiving Google+ .
Either run this project: [WayBack ] GitHub – ArchiveTeam/googleplus-grab: Archiving Google+.
Or even better: run the appliance, and help the WayBack machine with any archiving projects setup by the virtual appliance: the [WayBack ] ArchiveTeam Warrior – Archiveteam .
See some of their other pages for more background information:
You can donate both to the archive team, and the internet archive:
How is G+ archiving doing?
The tracker is well under way: [WayBack ] Googleplus tracker Dashboard . History: archive.is 1 ; archive.is 2
Read the rest of this entry »
Posted in ArchiveTeamWarrior , Development , G+: GooglePlus , Google , Internet , InternetArchive , Power User , Python , Scripting , SocialMedia , Software Development , WayBack machine | 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/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
VIDEO
Posted in Development , Hardware Development , IoT Internet of Things , Network-and-equipment , Power User , Software Development | Leave a Comment »
Posted by jpluimers on 2019/03/12
On my list of things to install soon IDE Fix Pack 6.4 and 6.4.1:
Technically, there is 6.4 that works in Delphi 10.3 Rio Update 1, but it is better to install 6.4.1 as it works with 10.3 and 10.3.1:
The dependencies file looks interesting for good uses list optimisation, given that you compile with all conditional define permutations:
There is a ton of changes, of which I like the bold ones most:
6.4
Fixed: Packages with duplicate units may not have caused a fatal compiler error.
Added: Support for Delphi 10.3 Rio
Added: StyleUtils.inc performance optimizations for faster UI rendering (D10.3)
Added: Infinite loop detection in TDebugger.UpdateEventLog
Added: Fix for TStringList.IndexOfName bug (RSP-21633)
Added: Fix for access violation in the Welcomepage JScript9.dll binding
Added: TCustomListBox.ResetContent is skipped if the handle isn’t created yet
Added: More STRINGCHECKS-free RTL code (2009/2010)
Added: More DFM Streaming optimizations
Added: RTL and DFM streaming patches to remove STRINGCHECKS (2009/2010)
Added: Removed VclFixPack OutputDebugString calls (2009)
Added: FillChar uses Enhanced REP MOVSB/STOSB cpu feature if available for large sizes.
Added: Enabled CPU LOCK string assignment optimization for local variables
Added: -x-Oe (experimental optimizations) and -x-cgo compiler option extension
Added: CodeGen: Remove of some unnecessary push/pop operations
Added: Expression Evaluator allows array access to pointers even if the type wasn’t declared with {$POINTERMATH ON}
Added: Max number of constants in a function was increased from 64K to 16M (2009-XE3)
Added: New compiler option extensions: -x–compileonly, -x–reslist, -x–depfile, -x–unitstats
Added: More performance optimization for the DCC64 compiler
Added: TStringBuilder.SetLength optimization [RSP-19178] (XE+)
Added: TStrings.GetDelimitedText optimization
Improved: Slight faster TStringList.IndexOfName optimization for sorted string lists.
6.4.1
Fixed: StyleUtils.inc patch contained a hard coded address causing the patch to fail if the DLL’s base address was relocated. (10.3 only)
Fixed: TCustomListBox.ResetContent patch crashed with an access violation. (2010 only)
–jeroen
Read the rest of this entry »
Posted in Delphi , Development , Software Development | Leave a Comment »