Application Setup on Google App Engine


Hits: 4537  

Run your web apps on Google’s infrastructure.
Easy to build, easy to maintain, easy to scale. https://cloud.google.com/console#c=l

1) Register a free account here https://appengine.google.com/.
2) Create an Application here https://appengine.google.com/start/createapp.
3) Download Google App Engine SDK for Java from here http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Java.
4) Unzip appengine-java-sdk-1.4.2.zip in your favorite drive like “D:\appengine-java-sdk”
5) Now download apps svnmedia.zip “D:\appengine-java-sdk\demos” and unzip here “D:\appengine-java-sdk\demos”
6) Edit application XML file “D:\appengine-java-sdk\demos\svnmedia\war\WEB-INF\appengine-web.xml” to the name of the application like “svnmedia”.
7) Run below commands to upload your application, make sure JDK in system classpath variables 🙂

D:\appengine-java-sdk\bin> cd D:\appengine-java-sdk\bin
D:\appengine-java-sdk\bin> appcfg.cmd update D:\appengine-java-sdk\demos\svnmedia\war

8) Finally you can check your application here http://svnmedia.appspot.com/

Note: The ‘php’ runtime is only supported for apps using the High Replication Datastore.

Please check features for Google App Engine: http://code.google.com/p/googleappengine/issues/list

As of May 10, any organization that signs up for a new account will be required to use the paid Google Apps for Business product in order to create more than 10 users. Google honor our commitment to all existing customers and will allow you to add more than 10 users to your account for svnlabs.com at no additional charge…

Reference:
http://www.builderau.com.au/blogs/
http://www.liventerprise.com/tool/Google_Apps/
http://images.google.com/

GIT – Cheat Sheet


Hits: 2071  

Git is a free distributed revision control, or software source code management project with an emphasis on being fast. Git was initially designed and developed by Linus Torvalds for Linux kernel development.

Reference Links:

http://zrusin.blogspot.in/2007/09/git-cheat-sheet.html
https://git.wiki.kernel.org/index.php/GitCheatSheet
http://www.lornajane.net/posts/2012/git-cheat-sheet
http://ndpsoftware.com/git-cheatsheet.html

How to clean malware from website?


Hits: 3605  

Malware, short for malicious software, is a software designed to secretly access a computer system without the owner’s informed consent. The expression is a general term used by computer professionals to mean a variety of forms of hostile, intrusive, or annoying software or program code.

Sucuri SiteCheck is a free & remote scanner. SCAN Website

You have seen above warning many times when you want to browse website using web browsers. This is the warning from search engine bots like Google for website is affected from malwares or viruses. If you still want to access website, it can affect your system or system resources.

Most of times websites are hacked or unauthorized accessed from hackers or cross-site scripting (XSS) or cross-site request forgeries (CSRF).

There may be lot of “holes” in website security that invite hackers to play their game.

The possible HOLES may be:
1. File/Folder permissions
2. Poor authentication for application
3. Cross-Site Scripting
4. Cross-Site Request Forgeries
5. Anti-Virus Software
6. File formats
7. Network “Firewalls/Filters”
8. Shell access & Logs

Please check some link to make web application secure and safe 😉
* http://www.cyberciti.biz/tips/php-security-best-practices-tutorial.html
* http://advosys.ca/papers/web/61-web-security.html
* http://www.claymania.com/safe-hex.html
* http://shiflett.org/articles/foiling-cross-site-attacks
* http://www.ehow.com/how_6804695_remove-malware-website.html
* http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/

You can review online Virus & Threat Scanner for cleaning malwares & viruses. These softwares are designed to run on your web server and scan your public web files for malicious code.

Google Safe Browsing Tool
http://www.google.com/safebrowsing/diagnostic?site=yoursite.com

Norton Safe Web
http://safeweb.norton.com/

You can search for more tools like…
Security Pro | SiteMonitor | IP trap | htaccess | AntiXSS | Check Permissions | KISS FileSafe

If you are running PHP website under Apache & MySQL, make sure file and folder should not be access public. You have to check PHP function’s security for more secure access.

PHP Functions may be used in hacking:
1. file_get_contents()
2. base64_decode()
3. eval()
4. exec()
5. preg_match()
6. gzuncompress()
7. urldecode()
8. error_reporting()
9. shell_exec()
10. setcookie()
11. chmod()
12. is_writable()
13. move_uploaded_file() and copy()

disable_functions:

disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source

The above functions can be used by hackers to write malicious code to your files. The malicious code executed using eval() that will execute every run of website. So, disable eval(), file_put_contents(), file_get_contents(), exec() etc. You can check safe_mode in php.ini for disabling shell access 😉

Most of the time websites are hacked using file_get_contents(), eval(base64_decode()), urldecode(), include() or iframes.

You can search infected file on web server “/var/www/” using below command:

# grep -iR ‘eval(base64_decode(‘ /web-root
# grep -iR ‘ # grep -iR ‘urldecode(‘ /web-root
# grep -iR ‘file_get_contents(‘ /web-root
# grep -iR ‘exec(‘ /web-root

As soon as infection found, you have to backup all application running on web server, now you have to remove infected files manually or using scanner.
Now all up to you how you can manage your web server more securely…

I’ve found that luck is quite predictable. If you want more luck, take more chances. Be more active. Show up more often. 😀

Kites – Happy Makar Sankranti


Hits: 7855  

Happy Makar Sankranti

“Imagination is the highest kite that one can fly.”

“A certain amount of opposition is of great help to a man. Kites rise against, not with the wind.”

Kagaz apni kismat se udta hai, aur patang apni kabiliyat se… isliye kismat sath de ya na de lekin kabiliyat jarur sath deti hai. 🙂

Be a Kite, is Right!

json_add for php


Hits: 2772  

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

1. Easy for humans to read and write.
2. Easy for machines to parse and generate.
3. Collection of name/value pairs.
4. Used for C, C++, C#, Java, JavaScript, Perl, Python, and many others.
5. Compatible with universal data structures – array, vector, list, or sequence.

json_decode — Decodes a JSON string
json_encode — Returns the JSON representation of a value
json_add — Review below code 😉

<?php
function json_add($old, $new) {  // function to add json strings  $old, $new are arrays
        $old_arr = json_decode($old, true);
        if(is_array($old_arr)) {
            $new_arr = array_merge($old_arr, $new);
            return json_encode($new_arr);
        }
        else {
            // it means first column updation
            return json_encode ( $new );
        }
    }

/*
here $json_str is json formated string in which we have to add new $array
*/
json_add($json_str, $array);    
    
?>

Every opportunity is trouble… Every trouble is opportunity 😉

Image Map in FBML


Hits: 2302  

Facebook FBML application does not support hotspots in an image map using dreamweaver.

<div style="position: relative;">
<!-- Hot Spots - Image Map -->
<div id="svnlabs1" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 72px; left: 460px; z-index: 99; padding: 10px;"></div>
<div id="svnlabs2" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 11px; left: 635px; z-index: 99; padding: 10px;"></div>
<div id="svnlabs3" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 170px; left: 632px; z-index: 99; padding: 10px;"></div>
<div id="svnlabs4" style="background: none repeat scroll 0% 0% transparent; cursor: pointer; outline: medium none; text-align: center; vertical-align: middle; position: absolute; top: 78px; left: 887px; z-index: 99; padding: 10px;"></div>
<!-- Main Image -->
<img src="http://blog.svnlabs.com/wp-content/uploads/2009/06/svnlabs.jpg" border="0" alt="" align="absbottom" /></div>

We can use above code to map image using DIV elements on main image.
It is quite useful to insert hotspots on Images in FBML 😉

Maturity is not when we start speaking BIG things But..Actually it is, When we start understanding small things.

Web scraping using firefox & jQuery


Hits: 7299  

Hello Friends,

Today we will scrape HTML from any web page using jQuery and firefox firebug console. This is useful when you want to grab HTML of web page dynamically created by JavaScript or Ajax.

This example is quite useful when you want to extract any web content based on HTML Tag element ID or Class like ‘<div id=”svnlabs”></div>’ or ‘<img src=”svnlabs.jpg” id=”svn_labs”>’

See the code in action here… scraper.txt

jQuery(“body”).append(‘<textarea id=”svnlabs” cols=”70″ rows=”20″></textarea>’);

jQuery(“#svnlabs”).val(jQuery(“body”).html());

OR

copy and paste below code in browser address bar….

javascript: jQuery(“body”).append(‘<textarea id=”svnlabs” cols=”70″ rows=”20″></textarea>’); jQuery(“#svnlabs”).val(jQuery(“body”).html());

You have to post above code in firefox firebug javascript console. The latest jQuery library must be included on that web page you want to scrap 😉
Above two JavaScript lines will add a new textarea in body of same web page to set content of any HTML element. Please make sure after copy the above code; no illegal character in it.

Keep blogging……… 😉

Wishing you a very HAPPY DIWALI!


Hits: 2858  

The happiest of wishes for a Deepawali, that will be happy in every way for someone like you.

 

 

Fortunate is the one who has learned to Admire, but not to envy.
Good Wishes for a joyous Diwali and a Happy New Year with a plenty of Peace and Prosperity.

Happy Diwali