Ubuntu Reconfigure Locale

When the default locale is not setup properly, following warning displayed in the ubuntu terminal

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "en_AU.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

To setup locale

sudo dpkg-reconfigure locales
sudo locale-gen

How to Extract the Private and Public Key From pfx File

Converting Private Key

// Convert Private RSA Key PEM 
openssl pkcs12 -in {pfx_file_name}.pfx -nocerts -nodes -passin pass:{password} | openssl rsa -out privkey.pem 

// Convert Private RSA Key to Private PEM 
openssl pkcs8 -topk8 -inform PEM -in privkey.pem -outform PEM -nocrypt > private.pem

Converting Public Certificate Pem

openssl pkcs12 -in {pfx_file_name}.pfx -clcerts -nokeys -passin pass:{password} -out publicCert.pem

Convert to Public Key

openssl pkcs12 -in {pfx_file_name}.pfx -clcerts -nokeys -passin pass:{password} | openssl x509 -pubkey -noout | ssh-keygen -f /dev/stdin -i -m PKCS8 > public_key

An alternative way

// Exports all keys
openssl pkcs12 -in {pfx_file_name}.pfx -nocerts -nodes -passin pass:{password} -out exported.key
// Export Private RSA Key PEM 
openssl rsa -in exported.key -out privkey.pem
// Convert Private RSA Key to Private PEM 
openssl pkcs8 -topk8 -inform PEM -in privkey.pem -outform PEM -nocrypt > private.pem

// Export Public key
openssl rsa -in exported.key -pubout -out publicCert.pem