Thoughts about coding and books

sh: 2: Syntax error: newline unexpected

Error happened when running perl script on Ubuntu machine after coping it from another. Issue must have been caused by different encodings and was resolved by removing newline in the middle of the command.         # Monthly Backup         system(“$MYSQLDUMP –user=$DB_USER –password=’$DB_PASS’ $db_name > $BACKUP_DIR/$db/${db}_monthly_$datestamp.sql”); Changed to         # Monthly Backup system(“$MYSQLDUMP –user=$DB_USER –password=’$DB_PASS’ $db_nameRead more about sh: 2: Syntax error: newline unexpected[…]

How to hire a freelancer – 10 lessons learnt

These days everybody are full of ideas but no time to make these happen. Same here, I have great business ideas every a few weeks but while working full-time on my day job I have hard time to implement these on my own and all my friends are also very busy.

I decided to try out the www.getacoder.com service to find affordable quality help to my projects and so far I have not been disappointed while following the below steps.

1. Write down IN DETAIL what you want to be done.

Before posting a job to www.getacoder.com make sure you have as detailed as possible overview of your requirements. This is called BRD – Business Requirement Document. This must list everything like, user must be able to register, user must be able to login etc. Programmers can take this doc and can implement every feature step by step. Read more about How to hire a freelancer – 10 lessons learnt

Add Facebook login to PhoneGap/Cordova Android app Easiest way – UPDATED

First ensure that you have Basic PhoneGap application running on your android. Check this tutorial if needed. Official tutorial is not so good but might help you out if Phonegap Facebook tutorial here fails. For additional information go to https://github.com/davejohnson/phonegap-plugin-facebook-connect/blob/master/README.md.

  1. Download PhoneGap Facebook plugin from https://github.com/davejohnson/phonegap-plugin-facebook-connect/tree/master/www
  2. Move cdv-plugin-fb-connect.js into your android phonegap webroot assets/www
  3. Include it in index.html <script type=”text/javascript” charset=”utf-8″ src=”cdv-plugin-fb-connect.js”></script>
  4. Add <plugin name=”org.apache.cordova.facebook.Connect” value=”org.apache.cordova.facebook.ConnectPlugin” /> into res/xml/plugins.xml Read more about Add Facebook login to PhoneGap/Cordova Android app Easiest way – UPDATED

Basic PhoneGap Android app from scratch step-by-step

This tutorial assumes that you have eclipse which is set up for regular android development and you can create new android projects. Phonegap files are now named cordova

  1. Create new Android project in eclipse.
  2. Download package and extract cordova-2.6.0.jar  from zip file from http://phonegap.com/download/
  3. Add cordova-2.6.0.jar to your projects build path. In eclipse open project properties > Java Build Path > Add Jars
  4. Change main Activity superclass to DroidGap
  5. Replace setContentView(R.layout.main); with super.loadUrl(“file:///android_asset/www/index.html”);
  6. Create folder xml into the project res folder. Add there plugins.xml and cordova.xml from the package you download before.
  7. Add into AndroidManifest.xml <uses-permission android:name=”android.permission.INTERNET” /> and     <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” />
  8. Create folder www into projects assets folder.
  9. Add index.html file into assets/www. File content is regular HMTL.

By now you can already run the program. Next steps are starting to use PhoneGap special HTML5 features and try accessing hardware. If It fails to run then make sure you have logcat view activated in eclipse or try in linux commandline: Read more about Basic PhoneGap Android app from scratch step-by-step

Promote keyword in website – Learn from proffessionals

DISCLAIMER If you are looking for help against DDOS look here. This page describes how to promote keywords in webpage.

Recently one of my friend had Spam attack in his rather small website. It happened on 20th of December and by 25th, when it was discovered, Google webmasters tool keywords top was full of unwanted sexual oriented words and one keyword was way above others.

Best webmasters struggle promoting keywords like that. I analyzed the situation and here is what I can say about the technique that was effective:

  • Just repeating keyword in after every a few words works.
  • Keywords are in sentences that kinda makes sense.
  • Keywords are in link titles.

If you worry about your pagerank then try linking to high pagerank pages. In long run this technique does not pay and it it much more reasonable to write original and useful text that readers are expecting and looking for.

This is example how promoting keyword DDOS might look like:

Read more about Promote keyword in website – Learn from proffessionals