Contents tagged with Productivity

  • GmailSync - Free automated backup solution using Gmail

    Source Code for GmailSync is now available from CodePlex Gmailsync

    Update ** Now with support for sub-directories and uploading files > 10 MB. See What's New.

    What is GmailSync?
    In short, GmailSync is "Blat" for "Gmail". Blat ( is a win32 command line smtp client.
    GmailSync is an automated backup tool to synchronize files on your computer to your gmail online storage. By using this, you can theoretically use almost unlimited amount of free space available on your gmail account.

    Just imagine:
    2.7 Gb * 99 (invites) = 267.3 Gb.

    This tool is inspired by the article written on LifeHacker.

    How It Works?
    GmailSync is little more than a simple email client. It uses another third party (free) program called Stunnel to wrap SMTP packets in SSL because Gmail SMTP server uses secure connections. For some reason, I am unable to get the EnableSSL property on SmtpClient to work. Stunnel is bundled with the download therefore you don't need to install or setup another other component before running GmailSync. GmailSync keeps track of the backed up files and only does differential backup the second time you run it.

    Setting up GmailSync:
    Setting up GmailSync is really really easy.

    1) Download: Get GmailSync and extract it in any directory. This is developed with .NET Framework 2.0 therefore you may need to download the 2.0 runtime.

    2) Installation: After extracting the contents from the zip file, just run the Install_Setup.bat file to register the stunnel service and start running it. It'll only take a second or two and then you'll see a little black computer in your taskbar tray.

    3) Configure & Run: After installation, the only thing required is to configure the application. The common configuration parameters are source directory, Gmail username, Password.
    The configuration settings are saved in the application configuration file, i.e. GSyncConsole.exe.config . Just open this file in notepad and there you can see all the configuration parameters and their default values.

    -- Configuration File: GSyncConsole.exe.config
    <?xml version="1.0" encoding="utf-8" ?>

     <!-- The source directory for the backup -->
        <add key="SourceDirectory" value="C:\Data"/>
     <!-- Gmail dont' accept some extensions such as .exe or .chm. This parameter
      is used to identify such extensions and then use the ValidExtension property
      to rename the file before sending it to Gmail -->
     <add key="InvalidExtention" value=".exe|.chm"/>
     <!-- See the comments on InvalidExtension property -->
     <add key="ValidExtension" value=".pdf"/>
     <!-- GmailSync will automatically move the file to this directory after sending
      it to Gmail. If you don't specify this directory then the file remains in
      its original directory -->
     <add key="DestinationDirectory" value=""/>
     <!-- Used in the Subject of the email. It can be helpful in setting up a filter
      on Gmail -->
     <add key="EmailFilter" value="[backup]"/>
     <!-- The sender of the email message -->
     <add key="EmailFrom" value=""/>
     <!-- The receiver of the email message -->
     <add key="EmailTo" value=""/>
        <!-- Smtp Server: Leave it as it is as we are using Stunnel as the SMTP gateway -->
     <add key="SmtpServer" value=""/>
     <!-- Smtp Port: Leave it as 465 -->
     <add key="SmtpPort" value="465"/>
     <!-- The username to authenticate with Gmail smtp server.
      For most cases, it is same as EmailFrom address -->
     <add key="SmtpUser" value=""/>
     <!-- The password for the SmtpUser -->
     <add key="SmtpPass" value="yourgmailpassword"/>

     <!-- Ignore the following fields -->
     <add key="CheckAndRunStunnelOnStartUp" value="true"/>
      <add key="StunnelServiceName" value="stunnel"/>

    <!-- Changes for Version 0.2 . If you are urgrading then only
     copy the following configuration settings to preserve your old
     settings -->
        <!-- Set this to true if you would like to include sub directories -->
     <add key="ScanSubDirectories" value="true"/>
     <!-- Splits the file into following size if greater than 10 MB -->
        <add key="SplitFileSize" value="5"/>  <!-- In MB -->
     <!-- Include the directory information into Email subject to distinguish between
     same name files in different directories -->
        <add key="FullDirectoryPathInSubject" value="true"/>
        <!-- Allows you to run multiple instances for different directories.
     If you set this, then you wont be able to preserve your
        settings if you move the directory. -->
        <add key="AllowMultipleInstances" value="true"/>
     <!-- End of Changes for Version 0.2 -->


    Scheduling GmailSync for regular backups:
    Currently there is no scheduling capability built into GmailSync therefore you may need to use Windows Task Scheduler to automate regular backups. The following script registers a task to run everyday at 1:00 am. You may want to change this file to run on any other time.

    schtasks /create /tn "GmailSync" /tr "GSyncConsole.exe" /sc DAILY /st 01:00:00

    More documentation on Scheduling tasks using Command line

    Download GmailSync (Latest Version)

    Digg this

    What's Next?
    In the next release, I am planning to add few more features like,
    - GUI instead of command line and configuration file.
    - File filters
    - Any other requested feature??

    Old Versions:
    Only download this if the newer version is not working for some reason and you have overwritten your copy of GmailSync.
    Download GmailSync 0.2
    Download GmailSync 0.1

    Vista update for "GmailSync - Free automated backup solution using Gmail" by: marc1990

    The problem with vista is that it has to install service as administrator. And by run the script as administrator: he wil start in a other dir(C:\windows\system32).
    The solve is simple:
    1. You wil need administrator permissen
    2. Then you have to edit Install_Setup.bat.
    cd stunnel -> cd C:\autobackup\stunnel
    3. Run the script with administrator permission


  • BookNotes I - Refactoring Workbook (Willian C. Wake)

    For future reference, here are few things to look for during refactoring the source.

    -          Lots of comment explaining a piece of code -> Extract the code in a separate method
    -          When comment explains preconditions -> Use Assertions

    Long Method
    -          Look for comments to extract methods
    -          Extract methods semantically

    Long Class
    -          Extract class if there are too many responsibilities
    -          Extract interface if you can identify subset of features that clients can use

    Long Parameter List
    -          See if the method is being used to do more than 1 action and the logic is controlled by the parameters ( eg. Add/Update in a single method )
    -          If the parameters come from a single object, pass the object or extract an object out of parameters

    -          Avoid Hungarian notations
    -          Name the method so that it communicates to other people ( Avoid One or Two Character names, Numbered variables, Odd abbreviations, Misleading names )

    Unnecessary Complexity
    -          Dead code
    -          YAGNI principle ( avoid unnecessary generalization )

    -          Magic Number -> Replace numbers inside code body into symbolic constants
    -          Extract Methods to pull duplication code and put it inside the most appropriate class. Otherwise, extract a class and use it.
    -          Combine classes if two classes are doing mostly similar stuff.


  • "WinFS Junior" :: A Poor Man's File System

    "WinFS Junior" is a small utility which will help you organize your downloads into categorized folders. It is really good for people who don't want to manually organize their files into folders. "WinFS Junior" does your task automagically :).It is built on a concept application developed for the article "Building an Automatic Pattern-Based File Router" by Arian Kulp.

    Try it out yourself. It is free along with the source code.


  • WinFSJunior :: A Poor Man's File System

    "WinFS Junior" is a small utility which will help you organize your downloads into categorized folders. It started when I completely fed up with saving all downloaded files in a single folder. Don't think that I didn't start with organizing my stuff. Although I get bored with browsing to the most appropriate folder and saving the file there. What I needed is a solution which could work automatically without having to save/sort each file individually.


  • RssMix - The De-Bloggers List

    I recently discovered RssMix, which looks like an interesting service to combine similar feeds in a single feed. I'm not sure whether this feature is available in Squeet otherwise I'd used that instead. Although it is now possible to get the mixed Rss feed through Squeet in your email.


  • A Technique for Producing Ideas

    We consider an idea as something which comes to our mind as magic. What we don't realize is the process that every one have gone through before producing an idea. In this book, James Webb Young describes this process as five easy steps. It is a very thin book and a very enjoyable reading.