Wednesday, April 27, 2022

connect using ssh to Azure VM from powershell

If you are on windows 10 you can install the ssh client from Settings-Apps and Features.

During your VM creation in Azure it will ask to save the private key and if you have it saved. It might be with an extension of .pem.

Copy this private key to a directory where no one else has permissions except you. Or remove everyone from the security properties except yourself.

Open powershell and navigate to the directory where ssh is installed. 

Enter the command in the following format

.\ssh.exe -i C:\\ubuntukey.pem username@publicipfothevm

The username must have been created during the VM creation. 

The public ip can be seen in Azure portal.

 

If you dont have the VM username or key. You can reset the username and use your own public key using the following in command prompt.

 ssh-keygen.exe -m PEM -t rsa -b 4096.

This command will create two files in the directory you specify with extensions.  .pub and .pem

These are your pulic and privatekeys. Rename them to yourkey.pem and yourkey.pub.

Copy the contents of the .pub file and put that in the ssh public key section of reset password blade in Azure portal. Give an username you would like to be used as admin on the server.

user ssh.exe in the following format. 

ssh.exe -i c:\youdirectory\yourkey.pem username@publicipofthevm

Friday, March 25, 2022

बिकट वाट वहिवाट नसावी धोपट मार्गा सोडुं नको

 

Singer/Poet: Anant Phandi

बिकट वाट वहिवाट नसावी धोपट मार्गा सोडुं नको
Stay on a well traveled path. Don't go on a dangerous and unknown one.
संसारामधि ऐस आपुला उगाच भटकत फिरूं नको
Settle down in life instead of wandering around.
चल सालसपण धरुनि निखालस खोट्या बोला बोलुं नको
Be truthful.Don't lie every time.
अंगि नम्रता सदा असावी राग कुणावर धरूं नको.
Stay humble. Don't be angry on anyone.
नास्तिकपणांत शिरुनि जनाचा बोल आपणां घेउं नको
If you are an atheist. Don't tell that to people.
भली भलाई कर कांहीं पण अधर्ममार्गीं शिरूं नको
Do any kind of good deed but don't do any bad ones.
मायबापांवर रुसूं नको
Don't be upset with your parents and hold grudges.
दूर एकला बसूं नको
Always be in a company instead of sitting alone.
व्यवहारामधिं फसूं नको
In business dealings be careful.
कधीं रिकामा असूं नको
Don't sit idle any time. Always do something.
परि उलाढाली भलत्यासलत्या पोटासाठीं करूं नको
But don't do any bad deeds just for money.
वर्म काढुनी शरमायाला उणें कुणाला बोलुं नको.
Don't point out other peoples faults which may cause them to be ashamed.
बुडवाया दुसर्‍याचा ठेवा करुनी हेवा झटूं नको
Don't try to take anything deserved or reserved for someone else.
मी मोठा शहाणा जगामधि गर्वभार हा वाहुं नको
Don't think that you are the smartest around.
एकाहुनि एक चढी जगामधि थोरपणाला मिरवुं नको
There is always someone bigger than you.
हिमायतीच्या बळें गरिबगुरिबाला तूं गुरकावुं नको
If you have money don't be unkind to poor people.
दो दिवसांची जाइल सत्ता अपयश माथां घेउं नको
Failure is temporary. You will suceed eventually.
बहुत कर्जबाजारी हो‍उनि बोज आपुला दवडुं नको
Don't get loans which you cannot afford to pay.
स्‍नेह्यासाठीं पदरमोड कर परंतु जामिन राहुं नको
Lend money to friends. Don't be a guarantor.
विडा पैजेचा उचलुं नको
Don't offer to takeup challenges that other's won't.
उणी तराजू तोलुं नको
Measure everyones worth the same.
गहाण कुणाचें बुडवुं नको
If you borrow from someone. Always return it.
असल्यावर भिक मागुं नको
If you have it don't beg or borrow from someone.
नसल्यावर सांगणें कशाला गांव तुझा भिड धरूं नको
Don't lie and spread rumors.
कष्टाची बरि भाजिभाकरी तूपसाखरेचि चोरि नको
Eat food or money that you have earned with hardworkd.Don't steal.
दिली स्थिती देवानें तींतच मानीं सुख कधिं विटूं नको
If you are not happy with the state that you are in. Don't accept it saying it's fate.
आल्या अतिथा मुठभर द्याया मागेंपुढती पाहुं नको
If you have guests at home. Be very generous to them.
उगीच निंदास्तुती कुणाची स्वहितासाठीं करूं नको.
Don't say bad about someone just because it suits or benefits you.
बरी खुशामत शाहण्याची ही मूर्खाची ती मैत्रि नको
It better to be subservient to a good person that being friends with a fool.
आतां तुज ही गोष्ट सांगतों सत्कर्मा ओसरूं नको
If you get a chance to do a good deed. Do it.
असल्या गांठीं धनसंचय कर सत्कार्यी व्यय हटूं नको
Make sure you have saved enough first before spending for a good cause.
सुविचारा कातरूं नको
If you have a chance to hear something useful.Never miss it.
सत्संगत अंतरूं नको
If you get a chance to keep good company.Never miss it.
द्वैताला अनुसरूं नको
Dont worship false gods.
हरिभजना विस्मरूं नको
Don't forget to pray to God.
गावयास अनंतफंददिचे फटके मागें सरूं नको
If you get a chance to sing AnandPhandi's songs. Don't miss it.
सत्कीर्तिनौबदिचा डंका वाजे मग शंकाच नको
You good reputation will spread. There is no doubt.

Friday, February 25, 2022

Cannot open backup device. Operating system error 5(Access is denied.). RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

Came across this error while trying to restore a SQL database backup which was stored in a container to Azure SQL managed instance.

Operating system error 5(Access is denied.).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

The blob would connect properly and show the backup file.

Solution:

Deleted the stored credentials in the database and did the process again for restoring backup.