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!