Wednesday, October 16, 2013

GetResponse Discount Offer

As usual whenever some new deal or discount come in I get excited and this time the discount offer is coming from one of the well know newsletter service provider GetResponse.

GetResponse is celebrating their 15th anniversary this month and they want to enjoy this with all their new customers. They are giving away a lifetime discount of 15% to all the new customers who are going to signup to their services on or before 31st October 2013.

Ahh.. and one more thing they are also giving a cute(?) monster toy to all their new customer. Don’t ask me why the monster I don’t know and don’t want to think about it either.

getresponsediscount

So where to go to get the discount?

Click here and signup.

Friday, October 11, 2013

Focus

The legendary cricket batsman Sachin Tendulkar  declared his retirement day yesterday. His 200th test is going to be the last cricket match of his career.
Everyone can learn a lot from him. One important advice he has for all the youngster is “Focus”.
Focus you energy to achieve one thing and do not get distracted by every other thing that attracts.
I always have this problem with me. I keep on jumping form one thing to other not focusing on any one thing. I have written about this here many times.
Let me remind myself what I have done
  • Built blogs with thousands of visitors per month
  • Built Coupon India
  • Built a forum with 60,000+ members and deleted it.
  • Developed android apps with few thousand downloads.
  • Learnt HTML, CSS, PHP-MySQL, JAVA(workable)
  • Done MBBS and became doctor
  • Worked as Lecturer  and taught Human anatomy then left medical field.
  • Danced decently and won prizes at various level.
  • Learnt some electronic stuff. Currently assembling a Hackintosh (Running Mac OS on non apple computer) .
  • Learnt to Draw sketches (and attaracted a lots of girls ;) )
  • Lots of other things.
Doing all this took away a big amount of time out of my life. I am not saying that I wasted all that time, I enjoyed every bit of it (except the MBBS stuff, that was boring like hell). The problem is bottom line where I have not reached any place that can make me feel satisfied or at least proud.
Now look at Sachin he is 40 year old and what he did is to play cricket since he was eleven and he made every Indian proud.
That is what focus do!!
I seriously need to figure out where to focus.

Tuesday, June 25, 2013

Website Building Tutorials

I have been making websites for many years now and helped lots of people get started with their own websites and blogs.

People with less knowledge about web stuff tend to believe that building website is a very difficult job. Believe me now it has become a child’s play if you know about the right tools.

I own this domain websiteown.com for quite a while. I thought I should start a blog about building websites and blog on it.

If you are interested you can follow it.

I have already written a post regarding how to build a website for free.

Tuesday, June 11, 2013

How to add swap to amazon ec2

Like me if you are using amazon free tier to host your websites then you must have learnt that hosting any decent traffic website on the amount of RAM ec2 micro provides is very risky. specially mysql keep on eating the RAM. I use amazon RDS it also comes  under amazon free tier. But if you like to keep you mysql instance on your ec2 instance than you can add some swap space to it.

Here is  how to add swap space to amazon ec2 instance in step by step guide.

You need to be root to perform these commands. To do this issue this command

$ sudo su

Type the following command with count being equal to the desired block size:

dd if=/dev/zero of=/swapfile bs=1M count=1024

Setup the swap file with the command:

mkswap /swapfile

To enable the swap file immediately but not automatically at boot time:

swapon /swapfile

To enable it at the boot time, add the following entry into /etc/fstab:

/swapfile swap swap defaults 0 0

 

Remember last line is not a command. You have to add this line to the file /etc/fstab.

You can do this by

nano /etc/fstab

then paste above line right clicking.

hit control+x

type ‘y’

hit enter.

Tuesday, June 4, 2013

Redirect directory to root .htaccess

Simple of the things sometimes waste too much time. Recently I needed this simple htaccess script to direct one of the subdirectory to the root. I needed same url other than the directory part.

This htaccess code did it for me

RewriteEngine On
RewriteBase /
# redirect stores to root
RewriteRule ^stores/(.*)$ /$1 [R=301,NC,L]

This code redirected all the content of the stores directory to root directory.

I placed this code in the root htaccess and removed the htaccess file from stores directory.

Monday, April 15, 2013

Relaod/refresh page with Javascript Jquery

$('#something').click(function() {
location.reload();
});
the reload() function takes an optional parameter that can be set to true to reload from the server rather than the cache. The parameter defaults to false, so by default the page reloads from the browser's cache.

Saturday, April 6, 2013

Installing Ioncube

1. Download ioncube:

wget http://downloads.ioncube.com/loader_down...x86.tar.gz

2. Extract ioncube
tar zxvf ioncube_loaders_lin_x86.tar.gz


3.move file ioncube_loader_lin_5.3.so
mv ioncube/ioncube_loader_lin_5.3.so /usr/lib/php5/20090626/


4.create file called ioncube.ini (I use nano, you pick your editor)
nano /etc/php5/conf.d/ioncube.ini

5.copy and paste this line
zend_extension = /usr/lib/php5/20090626/ioncube_loader_lin_5.3.so

6. Restart Apache
/etc/init.d/apache2 restart


7. check if installed correctly
php –v

You should have working ioncube installation now. If not check what you missed.

Switching to worker mpm from prefork apache 2 on ubuntu


I'm on ubuntu and according to some tutorials, the following lines would do all the tricks:
apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php5-gd
a2enmod actions fastcgi alias
Then you setup configuration in /etc/apache2/conf.d/php5-fpm.conf:
<IfModule mod_fastcgi.c>
                AddHandler php5-fcgi .php
                Action php5-fcgi /php5-fcgi
                Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
                FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization</IfModule>
After all these, restart:
service apache2 restart && service php5-fpm restart
 
Done! 

PHP files downloading instead of executing

When you open your site php files are downloading instead of executing follow these simple steps and you will be good to go again.

first, install libapache2-mod-php5

sudo apt-get install libapache2-mod-php5

Then enable it

sudo a2enmod php5

Restart apache

sudo service apache2 restart

Clear your cache on your browser, and re-load the page.

Your php files should start executing again and you will see your site.

Thursday, February 21, 2013

Jquery date picker z-index issue

In your css use

'.ui-datepicker{ z-index: 9999 !important;}'

Here 9999 can be replaced to whatever layer value you want your datepicker available.

Neither any code is to be commented nor adding 'position:relative;' css on input elements. Because increasing the z-index of input elements will have effect on all input type buttons, which may not be needed for some cases.

Thursday, February 14, 2013

Install phpmyadmin

This is how we install phpmyadmin is LAMP stack

apt-get install phpmyadmin

nano /etc/apache2/apache2.conf

and add following code

Include /etc/phpmyadmin/apache.conf

then restart apache

service httpd restart

or

/etc/init.d/apache2 restart

 

access at

localhost/phpmyadmin

or

ip address/phpmyadmin

or

domainname/phpmyadmin

Tuesday, January 1, 2013

Breaking the shell

My biggest weakness has always been my inability to express myself. It happens often that I know much more than the people in front but I say nothing even if he is wrong. People think I know nothing and I think why to waste time arguing. But now I need to break this shell I have built around myself. I need to share more what I have learn.