Kunaljain's Weblog

April 29, 2020

List ec2 instances with details like – Platform, Lifecycle, Instance Type

Filed under: AWS — Kunal Jain @ 14:45
Tags: , , ,

While gathering few data from my Instances I came across how can I list my EC2 instances with details as – Lifecycle (Spot/Normal), Platform (Linux/Windows,) Instance Type (c3, m4, m5, r5…. etc).

So ran the following command to get the desired output.

aws ec2 describe-instances –query “Reservations[*].Instances[*].{PublicIP:PublicIpAddress,Type:InstanceType,LifeCycle:InstanceLifecycle,Name:Tags[?Key==’Name’]|[0].Value,Status:State.Name,Platfrom:Platform}” –filters “Name=instance-state-name,Values=running” –output table

Output –

Note:-

For Lifecycle – None means Normal Instance type

For Platform – None means Linux Platform.

January 3, 2011

Grep a process ID and kill it

Filed under: Linux Tips & Tricks — Kunal Jain @ 04:46
Tags: ,

Following is the command to grep a process ID and kill it.

ps auxww  | grep wget | awk '{ print $2; }' | xargs kill -9

December 24, 2010

subversion: Server sent unexpected return value (502 Bad Gateway) in response to COPY

Filed under: Linux Tips & Tricks — Kunal Jain @ 07:05
Tags: , ,

Got the following error while branching. Googled the error and found the solution.

Just add the following line in httpd.conf file

RequestHeader edit Destination ^https http early


July 6, 2010

module php5_module is already loaded, skipping

Filed under: PHP — Kunal Jain @ 08:24
Tags: , ,

Got the following Error while restarting Apache

[warn] module php5_module is already loaded, skipping

Then i have a close look at my httpd.conf file and found

LoadModule php5_module        modules/libphp5.so

twice in my configuration file. I removed one from my configuration file and now apache is working fine.

May 27, 2010

Error – cannot restore segment prot after reloc: Permission denied

Filed under: Linux Tips & Tricks — Kunal Jain @ 05:37
Tags:

Got the following error while starting apache –

cannot restore segment prot after reloc: Permission denied

Then i google a bit and found that it is because of SE linux setting being set to enforcing.

So i temporarily disable enforcemnt.To Temporarily disable enforcement on a running system use the following command

/usr/sbin/setenforce 0

To permanently disable enforcement during a system startup

change "enforcing" to "disabled" in ''/etc/selinux/config'' and reboot.

October 9, 2009

Error:- Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386

Filed under: Linux Tips & Tricks — Kunal Jain @ 12:04
Tags: ,

While installing subversion on my CentOS 5.2 64bit OS i got this error

yum install subversion
Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386

I google the error and found the solution.

  • Fistly i download perl(URI) which is greater than 1.17. I downloaded perl(URI) 1.35 using the following command
wget http://yum.trixbox.org/centos/5/RPMS/perl-URI-1.35-3.noarch.rpm
  • Then i install the perl package by using following command
rpm -i perl-URI-1.35-3.noarch.rpm
  • Then i install the subversion by using following command
yum install subversion

Now subversion is working fine on my server.

October 4, 2009

Auto-Complete function stop working in command prompt on windowsXP

Filed under: XP Tweakers — Kunal Jain @ 05:16
Tags: , ,

Somehow Auto completion stops working in command prompt in windows XP. Then I google about this error and found the solution
I just follow the follwoing steps and now its working fine.

  • Go to Start -> Run, type regedit
  • Navigate to HKEY_CURRENT_USER\Software\Microsoft\Command Processor
  • On the right, double-click on the "CompletionChar", type 9 and press OK.
  • On the right, double-click on the "PathCompletionChar", type 9 and press OK.

If there are no entries like CompletionChar or PathCompletionChar in Commnad Processor Folder then you can add them as string values.

September 27, 2009

Java Error – Error occurred during initialization of VM

Filed under: Java,Linux Tips & Tricks — Kunal Jain @ 08:21

While running Java i faced this problem

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

This error occur because java was not able to get enough Virtual Memory as i did ulimit -a on my linux machine and i found that the virtual memory and max memory size is limited on my machine.

so i change this to unlimited by editing limits.conf file which is located in /etc/security/limits.conf and now java is working fine.

ulimit -a before making changes in limits.conf file

ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 40960
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) 524288
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 40960
virtual memory          (kbytes, -v) 524288
file locks                      (-x) unlimited

ulimit -a after making changes in limits.conf file

ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 40960
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 40960
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

June 3, 2009

dos2unix: command not found

Filed under: Linux Tips & Tricks — Kunal Jain @ 04:01
Tags: , ,

If you get this error

dos2unix command not found

check the manual for dos2unix. if the manual is present in your distribution it means that dos2unix is installed, find it and add it in your path.

if you found this error

No manual entry for dos2unix

then install in in your distribution( I am using debian) by typing the following command

apt-get install tofrodos

April 21, 2009

Apple:- No Battery Avaliable

Filed under: Mac — Kunal Jain @ 03:37
Tags: , ,

Just pulled the MacBookPro out of my bag and found that the battery meter showed on battery. When i clicked the pull-down menu it said “No battery available”

I google about this error and found the solution here

http://support.apple.com/kb/HT1411?viewlocale=en_US.

I followed the exact same instructions and my system starts working perfectly fine.

Here are the instructions that i follow

  1. If the computer is on, turn it off.
  2. Disconnect the AC adapter and remove the computer's battery.
  3. Press and hold the power button for 5 seconds and then release the button.
  4. Reconnect the battery and AC Adapter.
  5. Press the power button to restart the computer
Next Page »

Create a free website or blog at WordPress.com.