Where to download vSphere free license key - Solved

The VMware homepage is a damn maze. Every time I reinstall an vSphere server I can never find the page to get the key I generated.

Anyway login to your vSphere account and click here: https://my.vmware.co … ree-esxi5&lp=default

Elevate UAC / Admin rights for a batch file!

A great tool for all system administrators!

@echo off

:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------

<YOUR BATCH SCRIPT HERE>

Save the whole thing as install.bat
Now with WinRAR (yes go and install it), Right click install.bat and select “Add to archive…”
Under Archiving Options select: Create SFX archive
Click on the Comment tab (across the top)
Enter the following:

Path=%tmp%
SavePath
Setup=%tmp%\install.bat
Silent=1
Overwrite=1

If you want to add a pretty icon etc, thats done under the Advanced tab.
Click OK and your Done!

Now your practically unstoppable, Admin Rights and an executable file - Your life just got so much easier!

Link back for the WinRAR exe
Regards to this guy for BatchGotAdmin!

Import private key and certificate into java keystore

How to import RSA private key into java keystore for tomcat
# You need:
# Your CA signed certificate (acme.com)
# Your private key (RSA)
# Your CA intermediate Certificate

# Import the certificates and key into a PKCS12 bundle

openssl pkcs12 -export -in certs/acme.com.crt -inkey acme.com.key -CAfile certs/DigiCertCA.crt  
-name "acme.com-2013-2014" -out acme.com.p12

(Remember the password you assigned it)

# Check if it worked:

openssl pkcs12 -in acme.com.p12  -info

# Import the PKCS12 bundle into a java keystore:

keytool -importkeystore -deststorepass YOUR-PASSWORD -destkeystore acme-keystore  -srckeystore acme.com.p12 
-srcstoretype PKCS12 -srcstorepass YOUR-PASSWORD 

Entry for alias acme.com-2013-2014 successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or cancelled

# Check your keystore:

keytool -list -keystore acme-keystore

Output should be similar to:

Enter keystore password:  YOUR-PASSWORD

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: acme.com-2013-2014
Creation date: Jan 3, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
-----BEGIN CERTIFICATE-----
keytool -list -keystore acme-keystore
Enter keystore password:  

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

acme.com.au-2013-2014, Jan 3, 2013, PrivateKeyEntry, 
Certificate fingerprint (SHA1): FA:A6:A3:42:95:34:15:68:26:35:40:18:8D:50:68:D4:15:C8:12:9E

# And match it against the import:

openssl x509 -fingerprint -in certs/acme.com.au.crt -noout
SHA1 Fingerprint=FA:A6:A3:42:95:34:15:68:26:35:40:18:8D:50:68:D4:15:C8:12:9E

Export mail within a date range on Exchange 2010 Powershell

$MailboxAlias = “YOUR-USER-NAME”
$BatchName=$MailboxAlias + “-export”
# SHARED-FOLDER-PATH requires Exchange Trusted Subsystem with NTFS modify permissions
$ExportShare = “\SERVER-NAMESHARED-FOLDER-PATH”

# There is also a date parsing bug with powershell, set servers regional settings to English (America)
# before opening your powershell window.

New-MailboxExportRequest -ContentFilter {(Received -le ‘01/12/2013′) -and (Received -ge ‘12/28/2012′)} -Name $BatchName -Mailbox $MailboxAlias -FilePath “$($ExportShare)$($MailboxAlias).PST”

Generate Entropy for Linux under VMware

Often with virtualised servers you can have a slow time generating entropy for virtualised systems and you get stuck with this message:

 We need to generate a lot of random bytes. It is a good idea to perform some other action (type on
 the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the 
random number generator a better chance to gain  enough entropy.
 

The quickest way in my opinion is the following command. Just make sure you have a dvd / cdrom iso mounted and connected with vmware.

 until [ 1 = 0 ]; do dd if=/dev/sr0 of=/tmp/dvd.iso; rm /tmp/dvd.iso -f; done 

and ^C when your done!