Friday, 1 November 2019

Setting default configuration in putty , to apply on all the server sessions

Hi All,

One may come across situations when one have to work with multiple linux servers.
And the default putty configuration is not convenient. One ends up modifying the configuration every time a new session is opened.

This can be simplified by saving the settings as Default Settings as highlighted in the below snapshot:



Just configuration the session as you want (i.e. update the Appearance settings etc) and then save this settings as Default_Settings!!

Tuesday, 29 October 2019

Self levitating holy stone at Kamar ali durvesh dargah!

It's rightly said, faith can move mountains. Although, we may not be able to witness such a thing, we can definitely witness faith moving a fragment of it, in the holy Kamar ali durvesh dargah. Situated on the pune-satara highway, is this 700 years old dargah. Devotees from all walks of life throng here round the year to witness this miracle first hand.







Even science has not been able to explain the miracle of self levitating holy stone. This stone is around 90kgs in weight. But when 11 people come together, place their index finger below this stone, and chanting the holy name of 'Kamar ali durvesh' lift the stone to nearly 10 feet above the ground, we are naturally inclined to believe that miracles do happen provided we have enough faith!




I myself became party to this holy event on my recent visit to this pious dargah few days back. Video below :)



This place is known to fulfill the desires and hence invites people from all castes , religions etc. alike.
And it's nearness to highway makes it convenient to reach. One can offer prayer and tie thread on the holy border. And can offer chadar etc. to pay respect.

I really enjoyed my visit and am pretty sure there would be more such visits in near future!!

PS: Let me know in case of any query (s), and I will try to respond as soon as I can.

Happy travelling!!!

Friday, 11 October 2019

How to use awk to modify the file on Linux

Hi,

Am giving a sample use case here.

Say, there is a file called detectionData.csv which has data separated with pipe symbol ( | )

And, you wish to update the 5th column of all the records, you can use something like below:

cat detectionData.csv | awk 'BEGIN { OFS=FS="|" } { $5="PartyExtreme00003"; print }' > detectionDataNew3.csv

Now, say, you wish to do the above but only every 10th row and not all the rows, you can use something like below:

cat detectionData.csv | awk 'BEGIN { OFS=FS="|" } { if (NR % 10==1) {$5="PartyExtreme00001"}; print }' > detectionDataNew10.csv

And, now say, you wise to do for part of the file, say for the first 50000 records, you can use something like below:

cat detectionData_1L.csv | awk 'BEGIN { OFS=FS="|" } { if (NR < 50000) {$5="PartyExtreme00001"} else {$5="PartyExtreme00003"}; print }' > detectionData_1L_50_50.csv
Enjoy!

How to copy files from Linux machine to Windows machine

Hi,

This is what you need to do:

1. Install putty on your local windows machine via below link

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

2. By default, it will get installed at below location (for 64 bit machine)

C:\Program Files\PuTTY



3. Copy your key file i.e. .ppk file at the above location (see, baseline.ppk as e.g. copied above)

4. Now, open command window from this same location (Shift + Right Click, select Open command window here Option)

5. Run the below command (say, to copy 165.zip from home location on the Linux server to this location)

 .\pscp.exe -i ".\baseline.ppk" ec2-user@10.220.XXX.XXX:165.zip .

Notice the . at the end, this actually means, copy to this current location. You can give any actual path here to copy to that location(say, D:\Here)

  .\pscp.exe -i ".\baseline.ppk" ec2-user@10.220.XXX.XXX:165.zip D:\Here
Likewise,  if you want to copy the file not from the home directory but from other location on the server, say, /home/ec2-user/rahul/, below command can be used

  .\pscp.exe -i ".\baseline.ppk" ec2-user@10.220.XXX.XXX:/home/ec2-user/Test.txt D:\Here
Done!

Hope you find it useful.. let me know in the comment section in case of any query!


Thursday, 29 August 2019

How to find the list of all the large files in the system [/dev/xvda1/ is 100% full error]

Hi All,

You might have seen this error xvda1 is 100% full and might have felt the need to check what are the files that are occupying so much space.

You can get this information and write to an output file via below command:

sudo find / -type f -size +500M -exec ls -lh {} \; > largeFiles.txt

You can then remove the unwanted files using the rm command.

Enjoy!

Thursday, 8 August 2019

wsimport command not found error [SOLVED]

[Issue]

The wsimport tool is used to parse an existing WSDL [Web Services Description Language] file. And generate the required files ( i.e. JAX-WS portable artifacts) for web service client to access the published web services. 

This wsimport tool is normally present in the $JDK/bin folder.

[Root Cause]

So if the system is not able to find this command, this means that either the JAVA_HOME system variable is incorrectly configured or not present at all.

[Resolution]


Create the JAVA_HOME system variable as shown below and add “;%JAVA_HOME%\bin;” at the end of the PATH system variable:

Now the system will be able to find the wsimport command successfully!

How to create a list of the EC2 instances for any account

1. Find out the IP address of the jenkins slave for the particular account

2. Connect to this IP using putty using ec2-user

3. Switch to root using command : sudo -i

4. Run the below command to write the output to a text file :
[root@...] # aws ec2 describe-instances >> instancesDetails.txt

Similar command can be executed to output the list of AMIs as well, as shown below:
[root@...] # aws ec2 describe-images >> imagesDetails.txt

5. Now you can use the Data filter functionality of excel to just capture, say, IP address, instance id etc.

Another quick way to list out the IDs is as below,
1. Click on the Check box to the left of the Name field as shown below

2. This will select all the instances on the particular page
3. Navigate to bottom of the list section and you will see all the details in a notepad sort of window
4. You can copy all the details from here and paste it into notepad++ / excel
5. Enjoy!

Friday, 26 July 2019

Windows ignores JAVA_HOME [Solved!!!] [System restart required : )]

Problem : 
Windows ignores JAVA_HOME [Solution that works, even in Windows 10!!!]

Cause : 
Actually, in windows, the java executable uses the windows registry to locate the default version of java to run.
The copy of java.exe to run is found by using the PATH environment variable.Unless step is taken to change this,by default a copy will be found in the windows directory.

Since this copy is not present in the java run-time directory, it locates one by looking at the registry.

Solutions :
1st Solution (recommended) : Put the version of Java that you want, before the Windows directory in your system PATH variable under Environment variables.

i.e. put %JAVA_HOME%\bin in first position of PATH variable. Also, perform below Solution. Do a system restart for the changes to take effect. Done!!!

2nd Solution : Remove the C:\ProgramData\Oracle\Java\javapath directory from the PATH variable or move it to the end. Do a system restart for the changes to take effect.

3rd Solution : Rename the java.exe, javaw.exe and javaws.exe in Windows/System32 folder. This makes them non-available and hence the JAVA_HOME variable gets referred. Do a system restart for the changes to take effect.

4th Solution (least recommended) : Modify the registry to point to the right path to java. Do a system restart for the changes to take effect.

Helpful notes:
a. Path to Environment variables is as below:
[Computer/Properties/Advanced System Settings/Environment Variables]

b. System PATH needs to be modified and not the User PATH environment variable

c. Moving the Entry related to the JDK in the PATH variable before Windows i.e. in the first position solves this issue as well.

Please let me know if you have any query..

Monday, 17 December 2018

How to view certificate in internet explorer && how to enable Copy to File... option in case its disabled!!!

Hi..

There might be a time when you wish to export the server certificate using the browser and you may encounter the below issue, i.e. Copy to File... option is disabled (when using the internet explorer):



The solution is quite simple!!!

1. Close the current browser window i.e. internet explorer (not a mandatory step though)

2. Navigate to where the internet explorer executable (iexplore.exe) is present on your machine. Could be something like this:- C:\Program Files\Internet Explorer

3. Do a right click on this executable and select "Run as administrator" option


4. Now relaunch and login to the website for which you wanted to capture the certificate details. This time you will see the "Copy to File..." option enabled
5. Enjoy!!!


BONUS : If you want to know how to view the certificate in the first place, then this is what you have to do:
1. Launch the website and do a login
2. You will see something like a lock symbol next to the URL as shown below:
3. Click on this lock symbol and a popup will appear. Click on View certificates appearing at the bottom of this popup as shown below:

4. Navigate to the Details tab on this certificate and you will see the button "Copy to File..."

Hope this helps :) 

Please let me know in the comment section in case you have any query..

Friday, 28 September 2018

Thursday, 27 September 2018

How to find the missing dependencies for a Linux executable [how to resolve the cannot open shared object file: No such file or directory]

Problem statement :
When you run the executable in putty and get the below message,
"..cannot open shared object file: No such file or directory..". This is in spite of the fact that the file is actually present.

Solution :
This is actually the case of missing libraries. You can check this by running the below command:
ldd /path/to/file and you will get the output with one or several files being listed as "not found"

Now search for all the files which are being referred as "not found" using the find command.Then add the path of these files to LD_LIBRARY_PATH.Now, export it and try to run the application again.

This time you should be able to run successfully!

How to copy text from the putty window

Quite a handy tip :)

If you want to copy the entire text or some part of the text from putty window, all you have to do is
1. Click on the screen from where you want to copy the text
2. Keeping the mouse clicked, drag the mouse upto the point you want to copy and release the mouse
3. The area that you have selected by means of the above actions will get highlighted in white.
4. Now again do a left click, the text will get automatically copied to the clipboard and can be pasted anywhere, say, notepad etc.

Enjoy!

Tuesday, 11 September 2018

How to get the RC book returned from Post Office to RTO

Hi All,

This blog is about how to get your RC Book that was returned by the Post Office to RTO. As you might be aware that Address Proof is one of the mandatory document when purchasing a vehicle. Also, this is the same address where the RC Book is sent via Speed Post .

In case, the person is not available to receive it, it is first taken back to the Post Office. And a message is left at your door providing you the tracking id. You will also receive an SMS with the same tracking id. You can then track the status of your RC book location using this tracking id on the below portal:
https://www.indiapost.gov.in/_layouts/15/dop.portal.tracking/trackconsignment.aspx

It shall look something like below:

The RC Book stays at the Post Office for around 15 days. If during this period, you check with the tracking id at the RTO instead of the Post Office, you will be directed to contact the Post Office asking to check there. In my case, RC book was present at Chinchwad Station Post Office shown below.


Please note that you can get the RC Book from the Post Office only between 10 AM to 1 PM (Monday to Saturday). No request will be entertained outside this duration. Please see below:



If the RC Book is not collected during this period of 15 days, it is sent back to the RTO. This is what happened in my case.I missed collecting it within 15 days and hence the RC Book was sent to Dy RTO in Moshi. Please see the "Return To Sender .." message and the date in the above snapshot.

To collect the document from the RTO you will need the ID Proof, Address Proof, and copy of Tax Receipt.

You will be required to fill the Return Form (available from the Xerox outside the RTO building) and submit it along with the ID Proof, Address Proof, Tax receipt at the counter. Please note that in case of Dy RTO building shown in one of the pics above, the RC counter is present in the left section of the building.

After verification, i was directed to pay the Fee of 50 Rs at Window No. 10 on the Second Floor.
Upon making the payment, i came back to the same counter and showed the receipt of this payment:

And, finally i was handed over my RC Book !!!

PS : Feel free to post your query in the comment section and i shall revert soon :)

Monday, 10 September 2018

How to get full path of any file or folder via cmd

Hi All,

I would like to share a handy tip via this blog.
So assume you are need to find full path of any file or folder quickly, then what you can do is,

1. Open the command prompt by typing cmd in the Run box
2. Then drag the file or folder whose full path you need into this cmd window
3. The complete path of this will be printed in the cmd which then you can use as you wish

Enjoy!!

PS: This is just one of the method. The same objective can be achieved in several other ways as well :)

Thursday, 2 August 2018

How to add photo to Skype using AD (Active Directory) method when not able to do it from Skype itself [100% working]

Hello friends,

Below are the steps that you can use to setup your Skype photo in case it is disabled and you are not able to change it from the Skype itself i.e. "Edit or Remove picture" option is disabled.

1. Download the AD Photo Edit software from the below link:
http://www.cjwdev.com/Software/ADPhotoEdit/Download.html

2. Install and run it and you will be greeted with below interface:

3. Enter your Full Name in the Search input box and click on Search: 

4. Since have already updated my photo using this method, you can see my image is already visible. In your case it might be blank

5. Now click on the search result. The Edit Image button becomes visible. Click on this button and you will be greeted with Edit Image window as shown:

6. Now click on Select New Image button and you will be able to browse to the location where you have the image you want to apply. Select the image after navigating to it.

7. If you get the error message "Image is over specified size limit", as shown below:


8. Then, click on the "Resize to recommended dimensions" button and you will see that your image is resized as shown in the below(compare this snapshot with above snapshot):

9. Now click on the OK button and you will get message "Active Directory updated successfully". SignOut from your Skype session and then SignIn again. Now you will see that the photo is visible :)



10. Enjoy!!

Wednesday, 10 January 2018

How to get the owner's details from the vehicle registration number in India??

Owners details can be obtained as below:-
1. Type SMS as VAHAN <space> the vehicle's registration number (upper case letters with no spaces) and,
2. Send it to 7738299899.
(eg: VAHAN MH14DY6520)
Details such as the,
  • vehicle owner's name, 
  • the car's model, 
  • fuel type, 
  • category (e.g. LMV), 
  • RC expiry date and 
  • motor vehicle tax validity 

will be received via SMS shortly.

Wednesday, 29 November 2017

How to view hidden files such as .bash_profile in WinScp (Linux)

If you are using a graphical file system browser such a WinScp,  you may need to switch it to display hidden files by pressing the key combination (Ctrl+H).

Monday, 27 November 2017

How to check CPU info on a Linux machine

Hi,

You can use the below command to see the CPU info for a linux machine:-

$ cat /proc/cpuinfo


How To Check RAM Size for Redhat Linux Desktop System

Hi,

You can use the below command to check the RAM Size:

$ cat /proc/meminfo