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.