[SOLUTION] – Linux – SSH Connection Refused due to non-existence of /dev/urandom


Amazon Web Services logo

Today one of our production machine (in Amazon EC2) was down and I couldn’t bring-up the instance due to unavailability of SSH in PORT 22, connection was refused and I had no clue what to do, after sometime I was able to bring-up the instance – (ok short and sweet).

Though I got it working after some work-around, I wanted to make sure what I did was correct, hence I asked experts in stackoverflow.com – got good advice/suggestion and I hope all set for a fix. BTW, the answer on the question also helped in learning a new stuff called auditd on the disk – a must have tool for system admin.

Okay, the reason why I wanted to pin-down this blog is to show what I did to fix /dev/urandom and how did I get the server up and running. Let me go straight to there.

HOW!!!?

Continue reading “[SOLUTION] – Linux – SSH Connection Refused due to non-existence of /dev/urandom”

[SOLUTION] – Linux – SSH Connection Refused due to non-existence of /dev/urandom

[HOW TO] Convert tabs to spaces in Eclipse and File (in Linux)


Tux, the Linux penguin

This is a quick tip that helped me save a lot of time – this is the reason why I love LINUX because of it’s simplicity.

I was working on a legacy code (referred as old-age code – a simple procedural coding style) for a client. In general, coding standard suggests you to have spaces instead of tabs to make it look better in all kinds of IDE, we (generally every developer) uses tab key a lot (to make our life easier) thinking it gives us the space but it inserts an actual tab (which usually jobs off from one end to the other). This legacy code was filled with tabs which looked pretty ugly in our code-review tool, though it looks perfect in the IDE, when you try to open it in Linux the favorite VI editor it looks ugly YUCK it is.

HUH, initially when my folks reported me I was like yeah go ahead and change it – what’s a big deal. But then when I came to know it not just one file but a lot (yes a lot) – it was almost more than 100 files, which had tabs instead of spaces (not GOOD – yeah I know).

Continue reading “[HOW TO] Convert tabs to spaces in Eclipse and File (in Linux)”

[HOW TO] Convert tabs to spaces in Eclipse and File (in Linux)

ECHO or PRINT or ANYTHING – Can you tell me which is FASTER in PHP?


The PHP logo displaying the Handel Gothic font.
Image via Wikipedia

ECHO or PRINT which is faster? – You can see this kind of questions a lot in every PHP blog-space and most of the interview questions ;-). Most of us must be known the answer, Google it, you will ;-).

Yes you can say “ECHO” but how sure are you? We blindly believe on our experts, I agree I do a lot. But it feels something different when you see it on your naked eyes, don’t you? I do.

Recently while surfing (reading obviously) over the internet on various topics, I came across a nice tool which will exactly tell us WHO (language construct or pre-defined function) is GOOD in PHP.

Continue reading “ECHO or PRINT or ANYTHING – Can you tell me which is FASTER in PHP?”

ECHO or PRINT or ANYTHING – Can you tell me which is FASTER in PHP?

[TIPS] – How To Open a PORT NUMBER in IPTABLES – LINUX


An illustration of how a firewall works.
Image via Wikipedia

In my good old days with LINUX I struggle quite a bit to understand what is a port number & how it works, what is firewall & why the hell it is blocking, etc. You have to understand port number when you work with tomcat server (remember server.xml 🙂 – man it sucks), it works in 8080 but not in 8090 or you name it, it just doesn’t work at all :-).

Today I think I should publish this tip, because if you are asking me about IPTABLES I will say it is a nightmare :-), any small mistake you do with it’s conf file then you are gone. Continue reading “[TIPS] – How To Open a PORT NUMBER in IPTABLES – LINUX”

[TIPS] – How To Open a PORT NUMBER in IPTABLES – LINUX

[TIPS] – Upload BIG (very large) file in PHP using HTACCESS


 

Logo of the Apache Software Foundation
Image via Wikipedia

 

This blog should have been the first one, but somehow slipped through :-). In my early days of coding I found a nice tip to upload a large (really big) files to server with the help of .HTACCESS.

By default, PHP.INI configuration is configured to upload a max size of 2MB (security concern?), I know you can say it just mater of modifying the value in PHP.INI file and restart the server. Yes I agree, but you can do this when you own the server machine, think of a shared hosting server. Continue reading “[TIPS] – Upload BIG (very large) file in PHP using HTACCESS”

[TIPS] – Upload BIG (very large) file in PHP using HTACCESS

Amazon EBS VOLUME – Attach/Detach – Mount/UMount – device is busy [SOLUTION]


Unix filesystem
Image via Wikipedia

I always want to share some of the quick-tip like the one below.

Recently when I was working with Amazon Cloud for one of our client I faced a problem when umount (dismount) a volume (EBSElastic Block Storage) (OR) detaching from an EC2 instance. I could not dismount the volume, whenever I try to dismount, it throws “umount: … device is busy“. I was like not sure what is going on, why the device is not dismounting from the machine ???.

Dismounting a particular device forcefully, especially a storage volume can cause a serious damage you will end-up losing some important data. I was not sure what should I do, on the other end, the PRESSURE, I have to dismount the volume and re-create another machine.

Continue reading “Amazon EBS VOLUME – Attach/Detach – Mount/UMount – device is busy [SOLUTION]”

Amazon EBS VOLUME – Attach/Detach – Mount/UMount – device is busy [SOLUTION]