Saturday, June 28, 2014

Location on App Engine SDK in Mac OSX

I use PyCharm to develop Google app engine python application. I updated it to newer version recently. After the update it started showing me this:
"error: please specify a valid app engine SDK folder"
This PyCharm error came up whenever tried to launch the application.
I tried finding the location of Google app engine SDK and it took me some time to figure it out. If you are also looking for fixing the same, here is where you should point PyCharm to:

/usr/local/google_appengine 
that's a symlink that links to the Google App engine SDK.
Hope this help.

PS: If you are find its broken after updating app engine app to newer version open the app as it requires setting it up again after updating.

Sunday, June 8, 2014

How to clear php session files via ssh

My linux vps was giving problem and I found it’s because php was saving all the session files and now thousands of session files were causing the trouble.
To get it fixed I needed to remove/delete the session files.

To remove session files first I located the path where php is saving session files using this command
php -r 'echo session_save_path(), "\n";'

When I tried to remove the files by using the usual file/directory removing command
$ rm –r /session-path/*

It gave me following error
bash: /bin/rm: Argument list too long

After some googling I found this command that worked for me
$ rm -r /session-path/

Nothing special in this command just ‘*’ is not typed in the end but it does the trick.
It deletes the directory and all the saved session files.

Remember to recreate the directory or you will have login errors.
To do that use this command:
$ mkdir /session-path/

I hope it help.

Locate php session files via ssh

There are times when you need to know where php is saving session files in your Linux file system. If you try to find it by opening all directories one by one it becomes very irritating.

Here is simple ssh command that will get you the path on session files.

php -r 'echo session_save_path(), "\n";'

I hope this will help few.

Saturday, March 22, 2014

How to Format Internal Hard Drive in exFAT

I built a Hackintosh and enjoyed using mac OS X but there are few times I needed to use windows to get things done. And using my laptop to do that seem far slower as it has a older configuration compared to my new Intel i7 powered 8 GB RAM desktop. I wanted to install windows 7 on my desktop and ordered a new 1 terabyte WD hard disk from Flipkart as I used 120 GB Samsung SSD while building the hackintosh. 120 GB seems small to have partitions and and installing 2 operating systems.
I partitioned the new WD hard disk and installed windows on it. I planned to use the bigger partition to use it as storage with both windows and mac.
When I formatted partition as NTFS it worked fine with windows and I can access the files from Mac OS X  but I could not write to it from OS X. So I formatted it as FAT32 and I could read/write to it from both windows and mac. But still I found a problem.
The new windows installation needed drivers for Ethernet, sound and other hardware and I had those on DVDs. I did not installed a optical drive in my desktop as I have 2 laptops with optical drives and I can share the DVD drive of these laptops with my desktop. As the Ethernet driver was missing I could not connect to the laptops/network to use their drives.
I needed to copy the drivers from DVD to Desktop via my laptop. I made ISO images of the disks using powerISO (free version is fine for that). Booted my desktop in mac as it can connect to the network. I accessed the laptop from it and tried to copy the iso image which are more than 4 GB in size to the newly formatted bigger partition on my WD hard disk. There I found the problem. I saw an error that I can not copy file this big in the drive.
I googled why this error and I found that I can not copy files more than 4 GB in a disk that is formatted in FAT32. DAMN!
After some googling I figured to use disk in both mac and windows and also to have it store files >4 GB I needed to format it in exFAT format. exFAT format will work both in windows and mac, and also in Linux as well. Now a new problem
When I tried to format it with mac there was no option for exFAT and same goes with the windows 7.
I new windows command prompt can do the trick.
I opened the command prompt and typed:
format /?
This showed me the options to format disk. And the final command that did the trick for me was:
format d: /FS:exFAT
Here "d:" is the drive I was trying to format. Change it accordingly. 
It took a long time to get formatted but finally I have a disk that I can use with both mac and windows and also store large files.
Hope this help few

Thursday, January 30, 2014

Traffic Gone!

Now this was a big break. My last post here was in October 2013 and now January 2014 is ending. I guess I need to kick my ass hard this time.
As the wise men said we should learn from all mistakes I tried to find something and managed to locate this very old known thing but very important when it comes to blogging.
“Post regularly or you are gone from Google.”
This actually did happened this time. I went through the stats and as expected the traffic was at the bottom but what’s interesting is that the post that were showing up earlier in Google search results are now nowhere to see in first few pages. Now good.
I admit that am not writing very good posts here and I am not making any money from it either but few visitors here and there are really nice. Loosing that sucks and I will try to write something more often and hope I will get back some of the guys.
Ok enough for today. Now let me try to kick my ass as I said in the first paragraph ;)

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.