The last time I was on a small learning adventure was when I was solving challenges at  http://hax.tor.hu, and I managed to finish it in couple of months. Then back to boring life without learning anything new. Then, life was the usual, 5 movies a week and regular work without real use of brain.

Then, I remembered Flute, one of my teamies was a big fan of one site named Project Euler. The site is a community of people solving a bunch of math problems. Fun part, problems are challenging. To add little more to fun, you can compare your logic to others. What adds even more to fun is, those guys are crazy. Few guys solve those tough math problems in Assembly language. Yes. Assembly. And to make things even worse, for few problems, for which my code takes around 15 to 20 seconds to solve, there are logics, which solve the problem in half a second.

So, I decided to start solving the problems, with couple of aims. First, solve atleast 100 problems in next 3 months (I’ve solved around 50 in the last week, but problems get tougher after that). Second being, try to solve them with logics that take as less time as possible rather than brute-forcing everything.

Now, there is another site, which runs on similar basis, called RoseCode. There are few nice problems there too. If you enjoy solving Project Euler, you will probably enjoy this too.

Just few moments before, I thought I will create a github repository with all solutions and later changed my mind of making them public and indexable. But anyway, if you happened to start solving Project Euler or Rose Code and want to compare your solutions with mine, I’m a tweet away to send you my codes.

By the way, you might want to register WeChall, if you start solving RoseCode. WeChall is a global ranking site, which can let you fight with few nice coders/hackers etc. Also, my nickname in all the sites is [108, 97, 122, 121, 105, 100, 105, 111, 116]

Of course India. So, the latest rumour is that Mukesh Ambani is behind YSR’s chopper accident. Now, let’s go through the story.

  • One Russian website tells that that Larry Summer’s ex-boss’s enemy is dead in Chopper crash. This article links to another article which tells ..
    • Larry Summer’s ex-boss’s brother (Anil Ambani) chopper’s gearbox was tampered.
    • Anil’s mechanic was killed in an accident.
    • Anil suspected business rivals to have planned for the assassination.

Mechanic who found that gearbox was tampered died in an accident two days later.

Now, what Indian media made out of it.

  1. Larry Summer’s ex-boss is Mukesh Ambani
  2. Mukesh Ambani and YSR had few differences
  3. So, Mukesh must be reason for YSR’s death

Now, this is my take -

  • One Russian Online Newspaper named “The Exiled” had an article written on 3rd September 2009, that YSR died in a mysterious accident.

Seriously ???? Indian media is digging a column in Russian newspaper, written by Mark Ames (an American Journalist, who use to write articles for Playboy) after 4 long months.

  • YSR had differences with Mukesh, Anil as well as their mother over gas deposits from Krishna-Godavari basin

Yeah, YSR had differences with both the brothers who were fighting over price, and their mother, who was trying to settle it. It’s not like he took someone’s side. He was neutral, and he wanted central govt. to take decisions on the price.

  • There was an assassination attempt on Anil, the medium was a helicopter. And Anil thought some “business rivals” planned this.

So, the business rival was his own brother. How about the word “coincidence” ?

These are the references from Exiled Online[1][mirror], [2][mirror]. Both articles attack Mukesh Ambani. Its obvious that none has any proofs till now and the author of article is just deducing stories by reading news items from other sources[1][2][3][4].

And the result of the above mess - Congress workers attack “Anil” Ambani’s offices in Hyderabad. Seriously ??? Anil Ambani, himself was a victim in the above story, and his offices are being attacked.

So, TL;DR - One wannabe fiction writer, creates a conspiracy based on various articles. Hungry for sensation - Indian Media sensationalize the story after three months. Work-less political party workers attack younger brother’s offices even though the villain in the conspiracy is the elder brother.

So, Landmark, a famous book/music/movies store in India is on the net at LandmarkOnTheNet.com. I was there to check whether they sell 3D glasses, even though there are some cheap paper glasses on ebay.in, but I want better quality. As usual, the bad habit of checking for SQL Injections and XSS tingled in my brain.

Apparently, LandmarkOnTheNet has both the problems.

and for SQL Injection, I didn’t try much, just give a single quote as input in search, the server choked with an error in the SQL Query (it actually told what the error is and where the error is; what a away to configure the production server)

So, there are many things you can have fun with above two, these are the keywords - My Account, Session Stealing, Gift Cards, SQL Injection, PIN Numbers, Free Shipping.

If I were a landmark website user, I would ensure that my browser is Firefox with NoScript addon installed. If I were a landmark webmaster, I would buy a book on Web Security right now, ah nevermind, I would just search in Google for tips of fixing XSS and SQL Injection vulnerabilities and fix them ASAP. I might also feel very bad for using so many tables in my markup.

And … Good Luck for that.

Filed ↓ New Year2010

Etherpad is a lovely app which is bought by google and was opensourced 10 days before. Now, just to add a drop of water to the ocean.

A small how-to on deploying Etherpad

The package

How to compile, run and test

  1. Grab the code from my github repository
    $ git clone git://github.com/karteek/etherpad.git
    You can optionally do a diff -r to above created clone with original clone to see the changes I’ve made to the code.
  2. Set up the environment to compile the code. Open the provided env.sh, and look at the needed variables. Existing values are values from my MBP, and they most probably won’t work for you
    $ source env.sh

  3. Create a database “etherpad” on your MySQL database. Same time, create a user “etherpad” with password “password” and grant him all privileges on the database “etherpad”

  4. Update etherpad.SQL_JDBC_URL, etherpad.SQL_USERNAME, etherpad.SQL_PASSWORD and etherpad.adminPass in the file etherpad/etc/etherpad.localdev-default.properties

    • etherpad.SQL_JDBC_URL is the jdbc URL of your database (in our case, its jdbc:mysql://localhost:3306/etherpad )
    • etherpad.SQL_USERNAME is the username to connect to database (in our case, its etherpad)
    • etherpad.SQL_PASSWORD is the password to connect to database (in our case, its password)
    • etherpad.adminPass is the password needed to login to admin panel of Etherpad instance
  5. Change directory to etherpad, compile the jar, and start the server
    $ cd etherpad
    $ bin/rebuildjar.sh
    $ bin/run-local.sh
  6. Now, fire up your browser, and visit http://localhost:9000 to play with your instance

File Imports

  1. File Imports depend on com.oreilly.servlet (cos.jar found at http://www.servlets.com/cos/)
  2. Check their license @ http://www.servlets.com/cos/license.html. If you are fine with their license, download cos.jar and copy it to infrastructure/lib folder
  3. Search for locations where file upload related code is commented, and uncomment the code.
    $ grep -r “REMOVED_COS_OF_COS” *
  4. Recompile the package
    $ cd etherpad
    $ bin/rebuildjar.sh

File Exports

  1. File exports depend on Openoffice.org for conversion
  2. You need to start Oo.org as a service
    $ /path/to/openoffice/soffice.bin -headless -nofirststartwizard               -accept=”socket,host=localhost,port=8100;urp;StarOffice.Service”
  3. Just make sure that etherpad.soffice has some value in etherpad/etc/etherpad.localdev-default.properties
  4. Check infrastructure/com.etherpad.openofficeservice/importexport.scala for more information

How to deploy the same on example.com

  1. Wild card dns for your domain. Point *.example.com to same server where example.com resides. This is the server where you are deploying this instance.
  2. Make sure that your SMTP is working. Activation of Pro accounts happen over email, so its important.
  3. Open etherpad/src/main.js, and update domain in line #273
  4. Open etherpad/src/etherpad/globals.js and change the domain in variable  SUPERDOMAINS found at line #30
  5. Open etherpad/src/static/crossdomain.xml and add your domain to crossdomains.xml
  6. Look into etherpad/src folder and search for etherpad.com. You will find many locations, where your instance will be coded to mail from an @etherpad.com account. Update all of them to your domain.
    $ grep -ir “etherpad.com” *
  7. Open etherpad/etc/etherpad.localdev-default.properties and update
    • devMode to false
    • etherpad.isProduction to true
    • listen to example.com:80
    • etherpad.isPNE to true (only if you want to run in PNE mode)
    • And ofcourse, change etherpad.adminPass
  8. As long as you din’t change anything in infrastructure folder, you need not recompile the jar. So, just go ahead and start the server. For starting a server on port numbers less than 1000, you will need to have root access on OS X.

Running the instance behind Apache using mod_proxy

  1. Do the same as above from steps #1 to #7.
  2. In step #7, rather than changing listen to example.com:80, change it to localhost:9000 or just 9000
  3. Start the server using bin/run-local.sh
  4. Your apache configuration might look like -
    <VirtualHost *:80>
    ServerName www.example.com
    ServerAlias *.example.com
    ServerAdmin admin@example.com
    ErrorLog /var/log/apache2/etherpad.error.log
    LogLevel warn
    CustomLog /var/log/apache2/etherpad.access.log combined
    ServerSignature Off
    ProxyPass / http://localhost:9000/
    ProxyPassReverse / http://localhost:9000/
    ProxyPreserveHost on
    <Proxy *>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    </Proxy>
    </VirtualHost>
  5. This might or might not work for you. Anyway, I guess you got the idea. Check manual for more information

Well, the patch I wrote for enabling file exports so as this tutorial come with no warranty. Don’t ask me even if it breaks your bones. This is what I did, following it is completely your choice. Code from Etherpad is under the license they specified. The file import part depends on MultipartWrapper and MultipartFilter. If you don’t like their license, its better to write your own code for doing their work.

Feel free to ask any doubts and/or fix my bugs. There is a great tutorial on installing Etherpad by Nuba Princigalli. Do check it, if you find any problems with my post.

Page 1 of 33