Thursday, February 28, 2013

WINDOWS GROUP POLICY



Group Policy is a Windows feature that contains a variety of advanced settings, particularly for network administrators. However, local Group Policy can also be used to adjust settings on a single computer. Group Policy isn’t designed for home users, so it’s only available on Professional, Ultimate, and Enterprise versions of Windows.



Fig1: Local Group Policy Editor

Centralized Group Policy

If you are using a Windows computer in an Active Directory environment, Group Policy settings can be defined on the domain controller. Network administrators have one place where they can configure a variety of Windows settings for every computer on the network. These settings can also be enforced, so users can’t change them. For example, using group policy, a network administrator can block access to certain sections of the Windows control panel, or set a specific website as the home page for every computer on the network.
This can be useful for locking down computers, restricting access to specific folders, control panel applets, and applications. It can also be used to change a variety of Windows settings, including ones that can’t be changed from the control panel or require registry tweaks to change.

  

                                                  Fig2. Restrictions Windows

Many Group Policy settings actually change registry values in the background. In fact, you can see which registry value a group policy setting changes. However, Group Policy provides a more user-friendly interface and the ability to enforce these settings.

Local Group Policy (LGP)

Group Policy is not only useful for network of computers in businesses or schools. However, if you’re using a Professional version of Windows, you can use the local Group Policy Editor to change Group Policy settings on your computer. Using Group Policy, you can tweak some Windows settings that aren’t normally available from the graphical interface. For example, if you want to set a custom login screen in Windows 7, you can either use the Registry Editor or the Group Policy Editor – it’s easier to change this setting in the Group Policy Editor. You can also tweak other areas of Windows 7 with the Group Policy Editor — for example, you can hide the notification area entirely. The local Group Policy Editor can also be used to lock down a computer, just as you would lock down a computer on an enterprise network. 



Fig3: LGP Editor’s Screen


This can be useful if you have children using your computer. For example, you can allow users to run only specific programs, restrict access to specific drives, or enforce user account password requirements, including setting a minimum length for passwords on the computer.

Using Local Group Policy

To access the local Group Policy Editor on your Windows computer (assuming you’re using a Professional edition of Windows or better, not a Home version), open the Start menu, type gpedit.msc, and press Enter.



                                                            Fig4: gpedit Screen


If you don’t see the gpedit.msc application, you’re using a Home edition of Windows. Group Policy settings are broken up into two sections – the Computer Configuration section controls computer-specific settings, while the User Configuration section controls user-specific settings.

  
Fig5: Local Computer Policy

 For example, Internet Explorer settings are located under:

 Administrative Templates -> Windows Components -> Internet Explorer.

  

                                                 Fig6: LGP Settings Windows


You can change a setting by double-clicking it, selecting a new option, and clicking OK.

 

Fig7: Tabbed Browsing Window

BigTable used by Google

In the world of cloud computing and many web based applications, the most essential is a database that can accommodate a large number of details of large numbers of users. Traditionally relational databases present a view that is composed of multiple tables, each with rows and named columns. And the queries mostly performed in SQL allow one to extract specific columns from a row where certain conditions are met. In traditional database, ACID properties i.e. atomic, consistent, isolated and durable are the main aspects. But many times it is impossible to guarantee consistency. So the ACID properties of database make uncomfortable for highly distributed environments. So the alternative storage system that highly distributed environments like Google used is BigTable.
 
BigTable is a distributed storage system that is structured as a large table that may be petabytes in size and distributed among thousands of machines. BigTable is described as a fast and extremely scalable DBMS (database management system). BigTable is a compressed, high performance and proprietary data storage system built on Google File System, Chubby Lock Service, SSTable and a few other Google technologies. But it is just used by Google and is not distributed outside Google although Google allows access to it as a part of Google App Engine.
 
                                                  Fig 1: Google BigTable
BigTable development was started in 2004 and now it is widely used by the Google applications such as web indexing, Google Reader, Google Maps, Google Book Search, Google Earth, Blogger.com, Orkut, YouTube, Gmail etc.
BigTable maps two arbitrary string values (row key and column key) and timestamp, hence three dimensional mapping into an associated arbitrary byte array. There can be multiple versions of a cell with different timestamps. In order to manage the huge tables, BigTable splits the tables at row boundaries and saves them as tablets. Each tablet is around 200MB, and each server serves about 100 tablets. This set up allows tablets from a single table to be spread among many machines. It also allows for load balancing, because if one table is receiving many queries, it can move the busy table to another machine that is not so busy. Also if some machine goes down, tables may be spread to other machines so that performance of all given machine is minimal. Tables are stored as immutable SSTables and logs of all the machines. When machine’s system memory is full, it compresses some tablets by using Google proprietary compression techniques such as Zippy and BMDiff. The locations of BigTable tablets are stored in cells. The particular tablet is handled by three-tiered system.
                                                                                                                                                                                     
                       
                                                     Fig 2: BigTable Architecture
BigTable is not like a relational database and can be defined as a sparse, distributed multi-dimensional sorted map.

Sparse:  The table is sparse which means that different rows in a table may use different columns, in which many of the columns that are used may be empty for that particular row.

distributed: BigTable’s data is distributed among many independent machines. As in Google, BigTable is built on top of Google File System.

sorted: In BigTable, a key is hashed to a position in a table. BigTable sorts its data by keys. This helps to keep the related data close together on the same machine.

Google has built its own database storage system for the reason of scalability and better control of performance characteristics.

 

Monday, February 25, 2013

GnuNify 2013s

Day I:-
It was really an awaiting moment to all techies of Open-Source World to be at GnuNify 2013.It was held at Symbiosis Institute of Computer Studies and Research (SICSR). After an Inauguration Ceremony of GnuNify at day 1, six sessions were scheduled parallel with respect to domains such as Jump Start, FOSS General, Web-Technologies, Programming, Wikipedia, Mozilla Meetup, Cloud Computing, Sys Admin, Mobile-Tech and Localization. I attended the Jump Start Session by Oyunbileg Baatar on “Screencasting Demos and HowTos”. It was practical Hands On Session on How to create a video tutorials and upload it on web by using open-source tools like recordmydesktop and pitivi. Parallely, Prof. Tushar Kute attended the session of Cloud Computing on “Introduction to Open Stack Project” By Atul Jha. Further he also attended the session of “Storage as a Service and Cinder” by Sajid Akhtar and “Introduction to Open Stack Quantum” by Vivek Raghuvanshi. All the three sessions elaborated an Idea of Open Stack to him. Whereas Prof. Amol Kute attended his first session of Sys admin on “Open SSL Architecture Interface and Internals” by Saifi Khan. After my first session I attended the Programming Session on “TC to GCC Transfer Certificate” by Shakthi Kannan. It was a Practical session which covered a various topics of gcc compiler.                                        
 In afternoon session me and Prof. Tushar Kute had attended the session on “Translations for Wikimedia made easy” by Siberland Mazeland and Niklas Laxstrom. While Prof. Amol Kute had attended a Practical Hands on session on “PHP-MySQL Connectivity” by Gaurav Pant. The last Session of Day 1, we all had attended a practical session by Aditya Godbole on “Introduction to Ruby”.
 Thus Day 1 Conference was really informative with great Talks.
Day 2:-
On the day 2 of the Conference, I attended the first session of Soumya Deb (debloper) on “Introduction to Git Hub”. Then second session of the day, me and Prof. Tushar Kute attended a practical session on “Introduction to Python” by Ramkrishna Yekulla (Ramki). While Prof. Amol Kute attended “Gen Open Youth in Open Source” by Sayak Sarkar and “Introduction to Mozilla community involvement Programs” by Vineel Reddy Pindi. Then me and Prof. Tushar attended the “Getting Started with Mozilla development Projrcts ” by Soumya Deb (Debloper). Then we all attended the session of Dipen Chaudhary on “How to start on Drupal and Drupal Ladder “. Then we attended as a representative of Marathi Wikimedia in Wikimedia Meetup in presence of all other language representatives from India and Foreign countries.
So Day 2 of the Conference was too really amazing with the talks of Speaker
Day 3:-
Day 3 was a meet-up day, two meet-ups one of Mozilla India Community and other of Wikipedia was scheduled, we participated in Mozilla Meet-up and met the many Mozillians across the world. We also introduced SnashLUG in that meetup and we got a great response and guidelines from the Mozillians.
Overall GnuNify Open Source Conference was the hub of Tech Talks. We were able to know various technologies and Technocrats.
Thanks a lot GnuNify and PLUG for organizing such a wonderful event.

Sunday, February 24, 2013

Socket Programming in JAVA

Socket is a logical entity in a computer system which provides communication mechanism between two computers using TCP (transmission control protocol) or UDP (user data-gram protocol), but in this blog we will be studying communication over TCP. Socket is combination of IP address and port. The java.net package contains classes that provide all of low level communication for you. To create socket there is Socket class available in java.net package and the java.net.ServerSocket class provides a mechanism for server program to listen for client and establish connection between them.

Steps to establish communication using socket over TCP:

1.Server initiate Server socket object indicating on which port communication will take place i.e. server decides port on which communication takes place.
2.The server invokes the accept() method of the ServerSocket class. This method waits until client connects to server on the given port.
3. Then client initiate socket object specifying IP address or name of server and port number on which communication will takes place. Communication will takes place only when server is listening to same port.
4.After this it can be possible to communicate on a socket.

After following above steps communication can be done using I/O streams. TCP is a two way communication protocol. Both client and server has input and output stream. Client output stream is connected to input stream and Client output stream is connected to server output stream. There are various socket primitives available in ServerSocket class.

Socket primitives:-

There are a lot of primitives available but we will be discussing only two which is required to establish simple communication over socket.

      public ServerSocket(int port):

This primitive in server decides on which port communication will take place. We can say that it binds the port address by creating socket. Sometime this primitives throws I/O exceptions.

       public Socket accept():

This primitive in server continuously waiting for client to get connect on the specified port in above primitives. This method also throws I/O exceptions.
           
Example :-

For client:
import java.net.*;
import java.io.*;
public class socketclient {
public static void main(String[] args) {
                        Socket s=null;
                        try
                        {
                                    s = new Socket("localhost",30000);       
                        }
                        catch(UnknownHostException uhe)
                        {
                          uhe.printStackTrace();
                        }
                        catch(IOException ioe)
                        {
                                  ioe.printStackTrace();   
                        }
                        System.out.println("Connected Successfully");
                        BufferedReader in = null;
                        PrintWriter out = null;
        try
        {
             in=new BufferedReader(new InputStreamReader(s.getInputStream()));
             out=new PrintWriter(new OutputStreamWriter(s.getOutputStream()));
             System.out.println("Start Communication now -->>");
             while(true)
             {
       BufferedReaderreader=newBufferedReader(newinputStreamReader(System.in));
             String name=reader.readLine();
             out.println(name);
             out.flush();
             System.out.println("Server says:->>"+in.readLine());
             if(in.readLine().equals("exited") | in.readLine().equals(null))
             {
                         s.close();
                         break;
                         }
             }
        }
        catch(IOException ioe)
        {
        ioe.printStackTrace();          
        }
           
            }

For server:
import java.net.*;
import java.io.*;
public class socketserver {
            public static void main(String[] args) {
                        ServerSocket ss=null;
                        Socket server = null;
                        int port=30000;
                        try
                        {
                                    ss=new ServerSocket(port);
                        }
                        catch(IOException ioe)
                        {
                                    ioe.printStackTrace();
                        }
                        System.out.println("listening 0n "+ port);
                        try
                        {
                                    server=ss.accept();
                        }
                        catch(IOException ioe)
                        {
                                    ioe.printStackTrace();
                        }
                        BufferedReader in = null; 
            PrintWriter out = null;
        try
        {
            in = new BufferedReader(new InputStreamReader(server.getInputStream()));
            out = new PrintWriter(new OutputStreamWriter(server.getOutputStream()));
           while(true)
            {
            String clientCommand = in.readLine();
            if(clientCommand.equals("exit"))
            {
                        System.out.println("Connection is disconnected from the user Messege :EXIT");
           out.println("exited");out.flush();
                        server.close();
                        break;
            }
             System.out.println("Client Says :-->>" + clientCommand);
             System.out.println("Server Says:-->>");
       BufferedReaderreader=newBufferedReader(newInputStreamReader(System.in));
             String name=reader.readLine();
             out.println(name);
             out.flush();
            }
       }
        catch(IOException ioe)
        {
            ioe.printStackTrace();
        }
}
}

Thursday, February 21, 2013

Move up Your Text SMS to Your Gmail Account



Backing up your text messages from your Android phone to your Gmail account is so simple there’s no reason to not back them up and make them search-friendly in the process. Read on to see how you can turn your Gmail account into an SMS vault.
Fig1: Gmail with Android

Prerequisites:

It’s easy to lose your text messages. Backing up your SMS messages to your Gmail account is so simple, however, there’s no good reason not to do it. For this tutorial you’ll need three things:
  •  Your Android phone
  •  A free copy of SMS Backup+
  • A Gmail account

Configuring Your Gmail Account for IMAP Access: 

SMS Backup+ requires IMAP access to your Gmail account to function. Let’s take a moment and hop over to the Gmail account we’re planning on using with the application and check the status.

 

 Fig2: IMAP and POP label

Login to your Gmail account and navigate to Settings –> Forwarding and POP/IMAP. Check Enable IMAP. Scroll down and click Save Changes. That’s the only configuration you’ll need to do within your Gmail account.

Installing and Configuring SMS Backup+:

Fig3: Installing SMS Backup+


With our Gmail account IMAP features toggled on, it’s time to install SMS Backup+. Hit up the Google Play Store and download the app. After the application is installed, it’s time to get configuring. Launch the application. The first screen you’ll see will look like the following:

 

Fig4: Launch Screen

The first step is to set up the connection to your Gmail account. Tap Connect. The default browser on your Android phone will launch and you’ll be prompted to login to the Gmail account you want to use for backing up your messages. After you login you’ll need to authorize SMS Backup+ to utilize your Google account like so:


Fig5:Google Permission Screen

 The first step is to set up the connection to your Gmail account. Tap Connect. The default browser on your Android phone will launch and you’ll be prompted to login to the Gmail account you want to use for backing up your messages. After you login you’ll need to authorize SMS Backup+ to utilize your Google account like so:

Click Grant Access. You’ll be prompted to begin a backup immediately or skip the initial backup:
  Fig6:Backup option Screen 

Click Backup,we didn’t come all this way not to back things up! If you hit Skip then all the messages on your phone will be flagged as already backed up and will be ignored.
The backup process will start, and depending on how many messages you have, will take anywhere from a minute to a half hour to complete. It clips along at about a message per second:




 Fig7: Back-up Progress Screen


You don’t even have to wait until the process is finished to jump over to the Gmail account and check the progress. Login to your Gmail account from a web browser. You’ll see a new label in the sidebar, SMS. Click on it:



Fig8: Gmail Inbox Screen


Cool…! SMS Backup+ automatically backs up your SMS messages as well as your MMS messages. Not only are all of our text messages there but the pictures we’ve sent back and forth are backup up to Gmail along with the messages. Now that we’ve got everything humming along, let’s look at some advanced options.

From the main screen tap Auto backup to turn it on and then tape on Auto backup settings to configure the frequency. The default configuration is a bit aggressive. You may wish to, as we did, decrease the frequency of backups and even set it to only backup one Wi-Fi if you’re backing up a lot of MMS and don’t want to burn through your mobile data quota.


After you’ve set up the automatic backup, return to the main screen and head into advanced settings. There you can change the settings for backing up, restoring, and notifications. Under Backup there are some useful settings you may wish to toggle include turning off MMS backup (again, to save on data consumption, and creating a white list of contacts you want backed up (instead of the default where every single message is backed up).


 Fig9:Gmail Inbox Screen


There isn’t much to look at under the Restore settings, but you can take advantage of a handy Gmail-centric trick. When SMS Backup+ stores your messages in Gmail it creates a thread for each contact. You can tell SMS Backup+ to only restore the contacts with starred threads which allows you to quickly select which conversations are important enough to restore via the star system in Gmail.
So there you have it! All your text messages (including multimedia attachments) are backed up within Gmail where you can easily search them and restore them to your handset should the need arise.