Sunday 29 March 2015

Sharing Address book/Contacts from Mac Server in Private network.

Many of us might be interested to create there own shared contacts on personal network. here is the way,i created own privately shared contacts/address information with in the family members.
It gave me great deal of advantage of making sure, that all member in my family has the details of every common family friend, relatives we know. 

Operating System (Server)

OS Yosemite (10.10.2) Server connected to home network
Apple server cost only $20, and it has good support to CardDAV protocol.


Steps:

1. Create User Account
2. Set Contacts server 
3. Add internet account
4. Configure the sharing account to Address book
5. Configure iPhone contacts


1. Create Shared User Account

Create an user account as "Sharing Only", this account will be used to sync contacts between all iPhone of the family members.

To create an "Sharing Only" account 
System Preference ---> Users & Groups 


Click on + (Add user account).
in User & Groups window make sure to select "Sharing Only" and enter the required info "Full Name", "Account Name" and Password.



On successful creation of sharing only account you can see, newly created account in list of users. The account i created - ContSharingAcc.
later in the below steps the same account has to be added to Internet Accounts


2. Set Contacts server 

To switch on the contacts server, from the launch pad select Server app and login to server. 
From the list of Server, select Contacts and switch on the server.



3. Add account to Internet sharing

Make sure that the Sharing only account created above is shared as internet account. To do so
select Internet Accounts from the system preference and click on Add Others account




A list of supported account type window will popup, select Add a CardDAV account 


On clicking on "Create" account creation window is displayed, enter Sharing Account details (which was created in first step)

User Name - ContSharingAcc (This is the sharing account, which is created in step one)
Password - ******* (Password of sharing account created)
Server Address : Host Name (example for local machine - myMac.local





On Successful creation of the account - it will be listed in list of accounts on left.


4. Configure the sharing account to Address Book

To configure address book, click on Configure in Address Book.. 




We are good to go....
Shared address book can be accessed to iPhone cross the family members.

5. iPhone setting

Settings -> Mail, Contacts,Calender->Add Account

Add Account screen on iPhone will be listed with existing templet for iCloud, Exchange, Yahoo, Google and Other which is the last one.
By clicking on "Other" the screen will navigate to Other screen.

On CardDAV screen enter the required details

Server         : the format of the mac local server name - servername.local
User Name : ContSharingAcc (This is the sharing account, which is created in step one)
Password   : (Password of sharing account created on mac)

Clicking on the next will verify the account info (this process will take some time)

After successful verification of the account you should see below screen.
VERY IMPORTANT - Make sure you keep existing local contacts on your iPhone


Hope this will help you.


Sunday 5 January 2014

Arduino LCD 16x2 - JHD 162A

After a few hiccup i was able to bring-up my LCD display on new yr holidays.

Here is what i have

  • Arduino Board
  • LCD 16x2 - JHD 162A
  • 7k Potentiometer

LCD Pin details-

12345678910111213141516
VSSVCCVEERSR/WEDB0DB1DB2DB3DB4DB5DB6DB7LED+LED-

Circuit

LCD Arduino Pins
LCD 1 GND + PT3
LCD 2 +5v + PT1
LCD 3 PT2
LCD 4 pin 12
LCD 5 pin 11
LCD 6 pin 10
LCD 11 pin 5
LCD 12 pin 4
LCD 13 pin 3
LCD 14 pin 2
LCD 15 +5v
LCD 16 GND


Source Code


Output


Saturday 5 November 2011

Checkout Source code and Build - using perl script

The below perl script code is to chk-out the source code from the SVN and build the project (IDE MS Visual Studio) .
This script is to make sure that the source code on SVN  is, in, good shape (no compilation error).
If more info is needed or if you see any errors, feel free to ping me.

This is what the code does.
1. Initialize the variable for SVN path and local machine path
2. Open the log file
3. Check-out the source code from SVN - chkOutSourceCodeFromSVN
4. Build the source code - buildProject
5. Close the Log file

# Code start
use strict;
use warnings;
use POSIX;


my $LogFilePath = "D:\\BuildLog.txt"; # Log file path
my $SVNServerPath = "http://svn"; #SVN path
my $LocalSourceCodePath = "D:\\Source"; #Local source code path

# SVN path of the branches
my $SVNProject1 = $SVNServerPath."/branches/Project1";
my $SVNProject2  = $SVNServerPath."/branches/Project2";

# Local path on machine
my $LocalProject1Path = $LocalSourceCodePath."\\Project1";
my $LocalProject2Path  = $LocalSourceCodePath."\\Project2";

# Project 1 .sln, used for building projects.
my $Proj1SLNFile = $LocalProject1Path."\\Prj1.sln";

# Project 2 .sln file name
my $Proj2SLNFile  = $LocalProject2Path ."\\Prj2.sln";

#Log the result
open LOG, ">>".$LogFilePath;
  
#Chk out the source code from the SVN server
if( &chkOutSourceCodeFromSVN( $SVNProject1, $LocalProject1Path ) == 0 )
{
   #Release mode Encodjiro project.
  if( &buildProject($Proj1SLNFile) == 0)
   {
     print LOG = "Build Successful";
   }
   else
   {
      print LOG = "Build FAILED";
   } #End of building the project

} #End of SVN Chk out condition

#================================================
#Function name - chkOutSourceCodeFromSVN
#Checkout all the branches to local path
#Arg: [0] SVN path.
#     [1] Local machine path.
#================================================
sub chkOutSourceCodeFromSVN
{
   # SVN command to checkout the source code, 0-svn path 1-localpath
   my $ChkOutFromSVN = "svn checkout ".$_[0]." ".$_[1];
   my $CmdLineOutput= system( $ChkOutFromSVN ); #! Execute the command.
   if ( $CmdLineOutput == 0 )
   {
print LOG "\nCheckout successfully Return code = $CmdLineOutput\n";
   }
   else
   {
print LOG "\n\nFailed to checkout from SVN Return code =  $CmdLineOutput\n";
   }
   return $CmdLineOutput;
}#End chkOutSourceCodeFromSVN

#================================================
#Build the project solution - build
#Arg: [0] Project Name.
#================================================
sub buildProject{
    my $ProjectName = $_[0];
    my $BuildCmd;

    # Execute the command
    $BuildCmd = "devenv $ProjectName /build \"Release\"";
    
   # Execute the command
    my $cmdOutPut = system($BuildCmd);

    if( $cmdOutPut == 0 )
    {
        print LOG "\nProject Build successfully = $ProjectName";
    }
    else
    {
    print "\nFailed to build = $ProjectName\n";
    }

   return $cmdOutPut; #Successfull is zero
}#End of buildProject


#close the log file
close LOG;


The above code is posted to help other who are willing to automate the source code building process, be causes while using the scripts on SVN.