Tuesday, December 7, 2010

Multi-Threaded Socket programming using C# : first step for a chat application

Just arranged some code to create a server and a client application that can talk over separate threads. The code  is not that efficient, yet, the programs can be used as the very basic for writing your own chat servers and clients (I din try though :P)

Download and play with the code by yourself and feel free to comment.
[The code is in VB.Net; I'm no more a VB coder though :S I had to prepare it for one of my cousins.]

Saturday, November 20, 2010

Liferay : Installing on Tomcat as a non-root webapp context and using MySql

Started playing with liferay. Want to create an intranet application for a group of companies.

Liferay : Quoting from the liferay website,"Liferay Portal is an enterprise web platform for building business solutions that deliver immediate results and long-term value. Get the benefits of packaged applications and an enterprise application framework in a single solution."
Liferay portal includes :
  • Content & Document Management 
  • Web Publishing and Shared Workspaces 
  • Enterprise Collaboration 
  • Social Networking and Mashups 
  • Enterprise Portals and Identity Management 
Here I am going to share the resource and procedure I followed to setup Liferay community edition locally on my PC. [BTW, I am using windows 7]

Requirements :
Procedures :
  1. Unzip Liferay 6.0.5 WAR bundle file and copy all content into %TOMCAT_HOME%/webapps/liferay folder.[certainly you'll need to create the liferay folder within webapp folder :)]
  2. Unzip and copy all Liferay Portal dependencies 6.0.5 to %TOMCAT_HOME%/lib/ext [if the ext directory is not there, please do create it]
  3. Include the ext in your catalina properties ; update the following line on %TOMCAT_HOME%/conf/catalina.properties : 
    common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/lib/ext/*.jar
  4. Copy the two libraries (jta.jar and mail.jar) to %TOMCAT_HOME%/lib/ext
  5. Create liferay.xml file into %TOMCAT_HOME%/conf/Catalina/localhost folder. It looks like this:

    <Context path="/liferay" crossContext="true">

    <Resource
    name="jdbc/LiferayPool"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/liferaydb?useUnicode=true&amp;characterEncoding=UTF-8"
    username="root"
    password=""
    maxActive="20"
    />

    </Context>

    In my case, DB user is “root” with empty password. You must create an empty DB in MySQL, for example “liferaydb”. Please also note the bold text.
  6. Create portal-ext.properties into %TOMCAT_HOME%/webapps/liferay/WEB-INF/classses folder. It looks like this:

    jdbc.default.jndi.name=jdbc/LiferayPool
    portal.ctx=/liferay


  7. If you are using MySQL as database server instead of HSQL, you must copy mysql jdbc lib into %TOMCAT_HOME%/lib/ext folder.
  8. Run startup.bat/sh, you will see in console when liferay creates and populates the portal database automatically. Now, you can open browser window and enter the folow URL http://localhost:8080/liferay. Use test@liferay.com and test as user and password respectively.
Resources :

Tuesday, October 5, 2010

Surf the net anonymously

In my office I am 'protected'(!) under a firewall and I can't access even the forum post that I think might contain the solution of the problems I am stuck to for hours.
I asked the network guy and he seems to be not interested leaving me 'unsafe'.
So I had to find my own way. I looked for some proxies like the most widely used one from ultrasoft or else. But I failed with them. Finally, I got two of them that are open source projects and helped me breath properly :

TOR: " Tor is a system intended to enable online anonymity, composed of client software and a network of servers which can mask information about users' locations and other factors which might identify them. Use of this system makes it more difficult to trace internet traffic to the user, including visits to Web sites, online posts, instant messages, and other communication forms. It is intended to protect users' personal freedom, privacy, and ability to conduct confidential business, by keeping their internet activities from being monitored. The software is open-sourceand the network is free of charge to use."
How TOR Works :





[Picture Courtesy: TOR web site]













                                                                          




JAP/JonDonym : "Java Anon Proxy, also known as JAP or JonDonym, is a proxy system designed to allow browsing the Web with revocable pseudonymity. It was originally developed as part of a project of the Technische Universit├Ąt Dresden, the Universit├Ąt Regensburg and Privacy Commissioner of Schleswig-Holstein. The client-software is written in the Java programming language."
Still I am quoting from wiki.
How JAP Works :





[Picture courtesy: JAP website]








As both of them are FREE. you can DOWNLOAD them from their websites and can start using them instantly  :

Monday, March 8, 2010

Agile Tool Hacking

I was looking for some straight forward tool guide for the Agile development. And I have got the light in the following presentation.

Thursday, January 28, 2010

Sending Valid Emails from Website



E-mails are one of the key elements of a website/web application. They are used in contact forms, sign-ups, notifications, newsletters, etc.

It is a common experience that sometimes e-mails sent from websites go to the junk folders or never reach.

Although it is not always possible to detect the reasons for this, there are several things that we can do to minimize the risk. Here they are:



  • Send E-mails Through A Valid E-mail Server With Authentication

This is the most important one which you may be automatically offering all the tips below.

It is mostly a good idea to send website e-mails through the e-mail server that will require authentication rather than the web server's SMTP server. Servers that are specifically set to send e-mails generally have Reverse DNS & SPF records, support greylisting ,etc.

Every scripting language offers methods to send e-mails with authentication.

On the other hand, sometimes, using e-mail servers are not enough as you may need to send lots of e-mails but the hosting provider may be applying limits, etc. In such cases, if you'll be sending e-mails through your web server, make sure to check these all:

  • Reverse DNS (rDNS)

As every domain resolves to an IP address, optionally, IPs can resolve to domain names which is called reverse DNS.

Many spammers use non-existing or dynamic e-mails without reverse DNS records. E-mail servers generally check if the sender IP has a reverse DNS record or not.

How to add reverse DNS records?: reverse resolving uses the pointer DNS record type (PTR record) which you should be asking your hosting provider to create it (check if it exists).

  • SPF Records

Sender Policy Framework is being used by more & more e-mail providers everyday (Gmail, Hotmail & Yahoo uses it) as a criteria to detect if a message is spam or not.

It simply allows the owner of a domain to specify their mail sending policy, (like which mail servers they use to send mail from their domain).

SPF records are DNS TXT records which an online setup wizard can help you creating it (you'll need to create new DNS records).

  • Using A SMTP Server That Supports Greylisting

A very powerful spam prevention method used by mail servers is called greylisting.

When you send an e-mail, the server receiving it can say to your SMTP server: "send it to me again in x minutes" which is mostly not supported by the methods spammers use.

So, you need a smart SMTP server who can understand this command (IIS SMTP can not) that will re-send the e-mails when requested.

  • No Bulk Mailing

Both the SMTP server you'll be sending e-mails & the servers that will receive them generally have rules to define an IP/e-mail as spammer who sends x number of mails in y seconds.

So, if you have a large userbase to send e-mail, it will be a good idea to send them in intervals.

  • No Sending Of E-mails In Alphabetical Order

Again, if you'll be sending e-mails to a large userbase, don't send them in alphabetical order of e-mails as mail servers can mark them as a dictionary attack.

  • Check If The Server IP Is Blacklisted

Blacklists are systems, that are used by most of the e-mail service providers, that has bot or human e-mail accounts which analyze the common e-mail traffic & can blacklist IPs according to e-mails sent from them.

The server you're using to send e-mails can be shared by many other users. And, a spam that is sent by anyone on that server can lead to a "blocking" by e-mail blacklists which will damage the communication of every account on it.

You can check if you IP is blacklisted from different resources.

I'll be updating if I get and experience any other tips for it.

Sunday, January 17, 2010

Open Source Twitter/Microblogging script

Website Cloning is not new thing for us, we have seen many website clones become visible after original concept becomes popular. ne of the most popular trends on the web today is something called "Micro-Blogging". Made famous byTwitter.com, Micro-blogging is the best and most simple solution to answering the everyday question, "What are you doing?".

Many people are trying to create Twitter clone websites. I have seen people asking on forums and websites for Twitter clone scripts. in this post we roundups the 8 best and free Open Source Twitter clone scripts build your owner micro blogging platform.

1. Laconica twitter clone | Demo | Download

Laconica is a open source twitter clone. It's not full published yet but it will work like twitter and you're able to run it on your own site. There's already a version running: http://identi.ca/

Laconica twitter clone


2. Jaiku micro-blogging client goes open source | Demo | Download

JaikuEngine is a social microblogging platform that runs on AppEngine. JaikuEngine powers Jaiku.com. For the mobile client source, see: Jaiku Mobile client

Jaiku micro-blogging client goes open source


3. Jisko open-source microblogging platform | Demo | Donwload

Jisko


4. PageCookery | Demo | Download

Pagecookery Microblog tag and list of Pagecookery Microblog sites.

PageCookery


5. Mini Twitter Private | Demo | Download

Your business needs a private twitter. You can add several twitters account and use this twitter as a buckup of all your twitter accounts, and as a private twitter for all the members of your business. Sometimes you wont show all the things you are doing.

Mini Twitter Private


6. Echowaves - Twitter Clone | Demo | Download

Ruby on Rails Open Source Twitter Clone Script. This is a group chat social network application. You can start conversations and connect wih other users while discussing it. It is possible to make a conversation read-only for presenting a content too.

Echowaves - Twitter Clone


7. Floopo Free Twitter Clone | Demo | Download

Floopo enables to to create a micro blog (or what some would call a twitter clone) in just minutes. It comes with all the features you would expect but also includes some very cool features. For more details on the full list of feature see Micro blog features.

Floopo Free Twitter Clone


8. sweetter Better Implementation of Twitter | Demo | Download

Sweetter is an opensource Twitter-like service (or Twitter clone, might better describe the service). It’s microblogging combined with Pligg style voting. So you can write whatever you want—about that pie you ate, or about a new site you found—however, if the crowd doesn’t like your posts, you can lose karma points.

sweetter
9. Sharetronix| Demo | Download

Sharetronix Twitter Clone Script is the newest Twitter clone script that I have come across. In the past, I had discussed about 24 twitter clone scripts both free and paid using which you could make a Twitter like site yourself. This a new addition to the 24 which makes it now 25 twitter lone scripts on the blog. As Twitter grows more and more we will be seeing more such kind of scripts. I will surely keep you all updated.
Sharetronix open source twitter clone script
Sharetronix Opensource is a multimedia microblogging platform. It helps people in a community, company, or group to exchange short messages over the Web. Very similar to Twitter, users can easily connect with each other with open or private threads.


10.Yonkly – Open Source Twitter | Download
Yonkly is build on Asp.net MVC framework is another Free Open Source Twitter Clone and Microblogging script as well as web service.
Features of Yonkly :Based on ASP.net MVC framework makes it really fast;Very Easy to setup and take very less time;Supports Timeline and Groups;Message Search like many other features;Active Developer community.

Yonkly Twitter Clone Script

Size of Yonkly Twitter Clone script is Just 1.3MB


11. Motion : Download
TypePad Motion
TypePad Motion enables publishers and marketers to create vibrant, branded communities that deepen loyalty and increase page views while giving you total control of your brand.
It is based on Pownce & MovableType Motion and built with Django.
12. Blur.it : Download:

Blurt
Blurt.it is a fresh microblogging application that requires PHP/MySQL to run.
Very similar to Twitter, users can easily connect with each other with open or private threads.


If you are interested in creating a complete social networking web space you can choose any of the Opensource scripts from the following list :