Pages

Friday, 19 July 2013

Build your own private cloud with Ubuntu - II

Some rights reserved by ErinOfEarth


Continuing from...

Build your own private cloud with Ubuntu - I

  Create node for your MAAS server. You must have atleast 2 nodes before going ahead with juju setup. Go to the webpage for maas server and Click on Add nodes.
We left all the other information fields there blank except for the MAC-ADDRESS. You can get the mac address of your computer by ipconfig on windows and ifconfig on Ubuntu - Ubuntu users can do: 
ifconfig | grep hwadrs

Then we went to
http://maas.ubuntu.com/docs/juju-quick-start.html
Thereafter we created ~/.juju/environments.yaml
vim ~/.juju/environments.yaml
Added the following details to this file

juju: environments
environments:
  maas:
    type: maas
    maas-server: 'http://localhost:5240'
    maas-oauth: '${maas-api-key}'
    admin-secret: 'nothing'

Got an error default-series: missing

Added this line to the above file
    default-series: 'precise'
Error Gone

juju status
New error
Juju INFO Connecting to environment... Unhandled error in Deferred: Unhandled Error

Investigated, result:
Juju packages needs to be installed from ppa:juju/pkg

Went to
https://juju.ubuntu.com/docs/
removed existing juju
sudo apt-get update
            sudo apt-get install juju-core (error no package)


sudo add-apt-repository ppa:juju/devel
            sudo apt-get update && sudo apt-get install juju-core

Configuring Juju
juju generate-config -w   
previously written environment.yml was moved and the changes were added to the new yml file.

error: environment has no access-key or secret-key

changed default: amazon to default: maas
juju bootsrap
error:no tools
sudo juju -v sync-tools

roshan@ubuntu-cloud:~$ sudo juju bootstrap
error: cannot start bootstrap instance: cannot run instances: gomaasapi: got error back from server: 409 CONFLICT

CONFLICT from maas means that it doesn't have any nodes available for juju to acquire (juju bootstrap needs to boot a node).
It's not the best error unfortunately, juju needs fixing to show all the text. You need the server edition of 12.04

Nodes were disconnected for sometime...
Next article should have the addition of nodes...

Creating an exactly similar snapshot of your existing running EC2 ami instance

Some rights reserved by Martin Fisch


Everything was going pretty well on the existing EC2 instance, when the developers offshore came up with another version of the existing CMS, which needed to be tested along with the existing CMS. One way was to have another virtual host created for the new CMS but there were some existing resources that could not be shared between the two CMSs.

The only way out of this was to have another instance with the new CMS version. Installing the same applications in the new instance was surely time consuming, this would take another day for sure. So we came up with the idea of creating a snapshot of the existing instance.

Caution: If you only try to create a copy of the existing instance you will only get the Instance along with the OS not the applications along with it. To create the exact similar copy of the instance the steps are slightly different.

Steps to create an exact similar copy are as follows:

  1. Create an EBS volume using the web interface. You may use Amazon Documentation for this.
  2. Attach this volume to your existing instance. note down the volume and the device id. (Vol -123456, /dev/sdg) Documentation
  3. Next you would need is a file system to work on, on the attached volume. Log in to your instance, and use the commands below
    • mkfs.ext3 /dev/sdg
    • tune2fs -c 0 /dev/sdg
  4. Now mount this disk
    • mkdir /mnt/data
    • mount /dev/sdg /mnt/ebs
  5. Now you can copy all the data to your EBS volume but before you do that, shutdown the running services that may harm the data, I stopped MySQL Apache, ElasticSearch etc on my instance. To copy all data use rsync : This will sync all the data in your present volume to the new volume.
    • rsync -avx --exclude /mnt / /mnt/ebs //you may use --exclude <directory name> to exclude any directories
  6. This should take long time depending on how big the data is. Once the copying is done, Unmount the volume by:
    • umount /dev/sdg
    • You may want to check the volume space by df -h
  7. Detach the volume for the present instance from the console. Documentation
  8. Right click on the volume and click on create AMI image. When the image is created. Right click on it and click on Launch Instance.

You now have an exact copy of your old instance running.

Monday, 8 July 2013

Local Drupal Setup

Some rights reserved by Gabor Hojtsy


Drupal is a CMS (Content Management System) written in PHP and is distributed under GNU public license. It is used as a backend for most of the websites world wide. Many organizations as well as individuals are switching there websites to a CMS based website for one reason: Easy management. The other important reasons follow thereafter.

So here's how to setup Drupal locally on your machine.

You would need two things to setup Drupal.

1. Drupal's  latest version from the Drupals website
2. A WAMP(Windows Apache MySQL PHP) server setup. Linux users (LAMP) from wamps website

Steps to install:
1. Install Wamp
This will be fairly simple, Once you execute the wampserver.exe all you do is press next until its successfully installed.
2. Unzip the Drupal's zip file downloaded to the wamp/www folder in your C: drive OR whichever drive has the wamp's www directory.
3. The directory name at present is Drupal-x.y(version number), Rename it to drupal.
4. If you have Skype installed and running note that skype uses the same port as that of WAMP so WAMP may give up problems. Close Skype and Run WAMP from the system tray start the service.
5. In your  browser, type localhost and press enter, You should see WAMPs page, Select PHPMYADMIN on the page.
6. Next we need to create a database for Drupal. In the create new database field enter you drupal db name and press create.
7. Drupal database is not created.
8. On you browser go to localhost/drupal this should prompt you for drupal install
Database type: mysql
Database name: <drupal_db_name>
Database username: root
Database password:blank
Save configuration.
9.  Create an account enter you details, you may get a mail error, ignore for now. Save it.
10. Click on home link and you should see your drupal home page.
11. Click on rebuild permissions on the home page if you see it. It should remove any errors in the permissions in file system.
12. From the tabs above find the configuration tab and if you see any errors it should be marked in red in the configuration page in the status report. The solution to any error is usually available in the same area. SO you are good to go in.

You now have a local copy of your Drupal Installation available and ready to use.

Setting up your own FTP server (Ubuntu)

Some rights reserved by Blake Patterson


Only after i did it i learnt, things aren't as difficult as they seem to be. I recently got a chance to set up my own FTP server. Not only that, i also made people use it. That was a real win.

So here's the thing, Due to some technical problems my company's FTP server was non-functional or i would say, it didn't give the results as per expectations. So i started looking for alternatives. Since the QA team tests mostly on a Windows machine i was looking for a Windows FTP server setup. I am not sure if any FTP server setup software is available for free, but after some research i only found some paid FTP server softwares for Windows which i didn't really want.

The project requirement was such that the, the application will be continuosly monitoring the FTP server. A cronjob will be setup which will look for some XML files in the FTP servers xyz directory. The found XMLs will be auto-ingested into the application by a POST and the Database will be updated accordingly.

So i needed an FTP. Obviously, i was looking for a free one. Ubuntu came for my rescue. I would rather say, i got another reason for why i prefer Linux over Windows.

vsftpd - Very Secure File Transfer Protocol Daemon

vsftpd is an ftp server for Linux and Unix machines distributed under GNU public license. It supports almost all Linux systems and it is fairly easy to install as well. You can customize a welcome message for people logging in to your server. And all the required changes just needs to be done in a configuration text file. That was awesome!!!

More about vsftpd can be read from Wikipedia

Steps to install and have your own vsftpd

I would say 4 simple steps (on Ubuntu Linux) and you have you FTP server started.

  1. sudo apt-get install vsftpd
  2. Open the configuration text file vsftpd.conf in your favorite editor  "vim /etc/vsftpd.conf"
  3. Make the required changes and save the file (Changes are discussed below)
  4. Start the vsftpd service by sudo service vsftpd start OR /etc/init.d/vsftpd start
You have your own FTP server setup.
 Important changes in the configuration file:

listen=YES
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
# Uncomment this to allow local users to log in.
local_enable=YES
# Uncomment this to enable any form of FTP write command.
write_enable=YES
# Directory which you want to be the root FTP directory
local_root=/srv/ftp/
  # Activate directory messages - messages given to remote users when they
 # go into a certain directory.
 dirmessage_enable=YES
  # If enabled, vsftpd will display directory listings with the time
 # in  your  local  time  zone.  The default is to display GMT. The
 # times returned by the MDTM FTP command are also affected by this
 # option.
 use_localtime=YES
  # Activate logging of uploads/downloads.
 xferlog_enable=YES
  # Make sure PORT transfer connections originate from port 20 (ftp-data).
  connect_from_port_20=YES
 # You may fully customise the login banner string:
 ftpd_banner=Welcome to Roshan's FTP service.
 # This option should be the name of a directory which is empty.  Also, the
 # directory should not be writable by the ftp user. This directory is used
 # as a secure chroot() jail at times vsftpd does not require filesystem
 # access.
 secure_chroot_dir=/var/run/vsftpd/empty
 # This string is the name of the PAM service vsftpd will use.
 pam_service_name=vsftpd
 # This option specifies the location of the RSA certificate to use for SSL
 # encrypted connections.
 rsa_cert_file=/etc/ssl/private/vsftpd.pem

This is all you need to do to have a personal FTP.

To login to your ftp server you need to do the following in a Linux or Windows Terminal.

ftp <your_ip_addres>
Username: <for_ur_machine>
Password: <for_ur_machine>
 logged in

all the transfer operations can now be performed

Sunday, 30 June 2013

Build your own private cloud with Ubuntu - I

Some rights reserved by ErinOfEarth


I recently tried building my private cloud with my System Administrator Chaitanya. While we both were successful we both were new to it and are still exploring. Since ages I was looking for this concept of private cloud, but then thought, unless i get a feel of it i wont know what it is. We found this page online http://www.ubuntu.com/cloud/private-cloud which helped us go with it.

We downloaded 12.04 for we read this in the link :

For extended support,choose Ubuntu Server 12.04.2 LTS, Ubuntu 12.04 LTS is a long-term support release, and has support guaranteed until April 2017.

while 13.04 was only to be supported for 9 months.

We could write the image on a CD or USB disk, we chose USB disk, used Startup Disk creator for this purpose on an Ubuntu machine. The image was booted on a machine with 250 GB space HDD and a 4 GB RAM which was mentioned in the specification on some link. Anyone who has already installed Ubuntu or any other linux, the installation wont be a big deal for them. Its as usual and regular like any other linux installation. First you see a boot screen with booting options. You need to select MAAS as a server in the boot menu. Next screen should ask you to define a hostname for the system. Next select the keyboard (US). Select the location (India). Next screen asks for the Network Interface, I selected one out of two i had(Realtek). Next was Set up users and Passwords for non adminitrative privileges, then full name, next username, choose a password, reenter password, encrypt ur home directory -> no
timezone kolkatta yes. 

Next you will see the partition screen, Since it was a private cloud installation we were unaware of the kind of partition that we should go for. We chose a manual partition since we wanted to specify the 250 GB space on the machine and not loose other important data on the disk. We selected the free 250 GB space and since we were unaware of the partitions that it would need we chose Automatically partition the free space. We noticed, it automatically created a swap of 4.2 GB and the entire disk on / ext4 file system. Next finish partitioning  and write changes to disk, confirm changes made ->yes.

Now http proxy information on the next page, since we did not have any we left this one blank. Updates -> No automatic updates, Download Language Support -> Yes.

We got a message that maas server configured 10.10.10.125/MAAS. We tried accessing this from a different machine in the network, unfortunately this did not work. Reason being server was still not started. We need to restart the machine for this. Next we need to enter the following command in the terminal 
sudo dpkg-reconfigure maas-region-controller
Install grub loader and then the installation was complete....
Reboot
Once restarted the boot screen looks similar to any other grub loader screen. Its plain text based OS which was expected anyways. After restart when we access the http://10.10.10.125/maas URL we found the maas login screen there.
Maas can be installed with the following link as well.
maas.ubuntu.com/docs/install.html

As mentioned in the above URL we found an error message on top of the login webpage.  "The region controller does not know whether any boot images have been imported yet ... blah blah...

We had no superuser yet created for the page so that was the 1st thing to do on the command line use the following command for the same.

sudo maas createsuperuser

I will prompt you to enter a new username password. Once you are done you can login to the webpage with the credentials you just created.

The import boot images however still remains there, this is because we dont have any boot boot images present with us. MAAS checks for and downloads new images every week however you need to download manually for the 1st time using

sudo maas-import-pxe-files

This takes a long time to complete so you can grab a coffee for yourself :)

PXE : Preboot Execution Environment
Its and environment to boot computers using a network interface independently of data storage devices like HDD or installed operating systems.

More in next part...

Wednesday, 15 May 2013

Do's and Dont's for a Fresher Resume

Some rights reserved by woodleywonderworks


Although i am no expert, nor do i belong to the HR or recruiting dept. by any chance, A few days ago, i got an opportunity to filter a few resume and select only those fresher candidates  who were good enough for the position. It was only then i got how difficult it might be for a recruiter to set a filter to select only a few candidates out of a bunch of resumes in his/her inbox. Initially since i was myself a beginner i started going through the resumes one by one and later figured it out that i could not really go through all the 100+ resumes i had. What next? There were few things i noted about the people who used to send their resumes. Some of them knew how to sell their resumes while some didn't. Here are some key impressive points i feel that a fresher could include while sending a resume. Please let me know if i get wrong anywhere.
  • A catchy subject-line which mentions his most suitable quality for the position.
Some candidates mentioned some certifications, or some course relevant to the position in the subject line or some other outstanding performance of themselves in the subject line this made their resume look different. I didn't even bother to see inside a lot and i shortlisted them for the one quality that they had. They knew how to sell themselves.
  • A side headline of the resume mentioning their best skills or skills relevant for the position.
I am not sure if this is a part of a good resume writing etiquettes but i did see that some people did not necessarily update their resume for each company they apply for, All they do is mention a separate side headline to the resume, and in one line either mention their best skills, distinguished quality, or any other skill relevant to the position. But dont do this everywhere!! Surely, if u have mentioned in the Subject-line of the mail any of these things, you don't need to be repeating this on the resume too.
  • Skills at the 1st page, next to the basic personal details.
Some resumes looked really boring and i didn't even feel like going to the next page. Reason being, their was unnecessary self description which obviously yields me nothing. While few resumes were to the point and right after looking at the 1st page anyone could make out that the person was suitable for the position. So, if the skills possessed are mentioned on the 1st page a recruiter knows what should he be looking for in the resume.
  • Mentioning common skills in a different manner is surely advantageous
Almost all the resumes had the skills section say "C, C++, JAVA". So, how does one differentiates him from others? Why should i hire/shortlist him? I think its better that when a fresher writes his resume he needs to ask himself this question and write it. "C,C++,JAVA" is something the 100 people who have applied for the job with you already know. What different do your know? Answer: I know it better!! Obviously one must mention his/her proficiency in them based on which he could get selected. Besides, presenting this in a different manner could be great as well. e.g listing a link for a JAVA based project.
  • Mentioning achievements in academics or co-curricular in college. (Relevant to the position can be a plus)
When a fresher, you don't really have much to mention in your resume in terms of experience. Achievements at school or colleges could really count here. Achievements surely need to be recent. Something you achieved in high school may not really be your interest now. A participation in a Programming competition or any technical activities could really mean a lot. Besides, participating in online communities discussion forums, Technical blogs could also be a plus and would surely make your resume look different.
  • Position for Academic qualifications and Marks
A good enough grade/marks/percentage should always be mentioned on the 1st page no doubt. But, when you know your marks could make your resume look bad its wise to hide in a way that it doesn't look too bad. e.g instead of mentioning 48% i would just say 2nd class grade. Does that sound really bad? Next, if the marks are not competitive enough post it to the next page. Let it not be the reason for not being shortlisted if you have good enough skills/qualities.
  • Dirty and Negatively catchy fonts and unnecessary bold tags.
May be this should have been the 1st point. A resume that is not wisely made and doesn't look neat isn't something that will get much of an attention in terms of selection, although it may become a matter of example for Dont's of a resume. Wise selection of fonts is surely a must. Some of the resume were seen with Comic Sans and were seriously Comic ones too. When you don't know what to choose, i would recommend a KISS (Keep it short and simple) Times New Roman is fine if you don't want to be too choosy.
  • Certifications, images on right place.
I have seen people with certifications add an image of the company which as well looks good and counts for sure. e.g the OCJP certified candidates have the Oracle image on the resume, but make sure you position it correctly. Placing it in some corner of the resume will only make it look bad or dirty. Either have it at the top corner of your resume or have it next to the mentioned certification. Don't make the image look like the only good thing of your resume, cos some people practice making the logo the header or the footer of the resume making it appear on every page of the resume, which i don't think is a good practice. Although this statement of mine may need an expert clarification.

Saturday, 26 January 2013

Git versioning system, How to use Git?

Some rights reserved by Sean MacEntee


Git

Its been months i used Git. I thought i should write about it. Probably because i shouldn't forget what is it all about... :P.
Git is a software version control and source code management(SCM) system developed by Linus Torvalds. What is version controlling? Every software has versions in it. How could you possibly keep all the versions in the same system and develop, modify, test and use all of them together is done by version controlling. And Git helps in achieving this (I could be wrong...this is just my understanding of Git...) So how does it work. Git works on a tree based structure where the developers can branch their codes in and make versions or builds accordingly.

For instance consider a repository which has a master node. The master node will contain all the actual code of a particular software. The participants or developers here are not all reliable so the project manager explain them the requirements and asks them to do whichever module they want as per their choice and add a branch to the main tree. Say there are 3 developers Tom, Dik and Harry. All of them plan to do the same module. The Project Manager(PM) evaluated the code after all three of them were done with the module. They all are supposed to push their code to their respective branch. Unless and until the PM evaluates the code they cant commit the code to their respective branches. Till then a push is fine. While committing you need to add certain details as to why are you committing or whats the change in it, etc. The commit can be done only after review has been done. Tom, Dik and Harry here will have their own versions of software that's downloaded locally by each one of them. If their are any changes in the master branch you can >git pull and get only those changes that don't match with your current local repository and check the changes accordingly. The changes if any to any of the file are informed file by file and line by line. So the developers are automatically updated of where the code was changed. > git add . will add all the local changes to the git repository. you are allowed to add only specific files.
After committing an add with a > git commit you have to add a flag -m and specify what changes you did etc. Changes can be uploaded to the server with a > git push. Accordingly Tom , Dik and Harry can do a > git pull and repeat the procedure. Check for other functionality on Git's website. There are many more cool features as well.

JIRA issue tracking.How to use JIRA?

Some rights reserved by Yuko Honda


JIRA

Those who are new to JIRA start reading from "What is JIRA?"

I have been learning Administration of JIRA lately after using it for more than 4 - 5 months as a user, after i believed that now i got to know it to the best of my knowledge. Thanks to Atlassians!!! they came up with a free trail for 30 days. Not only did i use it to learn JIRA administration but also i passed it to my friends who were new to it and wanted to know and understand JIRA at least at a user level. Here's my JIRA Atlassian account by the way https://roshannagekar.atlassian.net (if you access it after Feb 2013 i might have deleted it as well cause my free trial would be over by then.... :P.

What is JIRA?

So whats is JIRA was the 1st question that came to my mind. As a typical Indian would think its one of the spices we use in the curry's here... :D. Well this is not the one.  JIRA is a proprietary issue tracking system developed by Atlassian commonly used for bug tracking, issue tracking and Project Management. Many companies use it and i feel its the best tool used for communication between any teams in any organization.
To learn JIRA administration go to Atlassian's website they provide a free 10 users based JIRA hosted by them, not only that they also send you tutorials for how you could be a Pro JIRA user. They call it JIRA ninja black belt (both at user and administrator level) thankfully i completed that easily.

Their are some other products that come along with it integrated called Bonfire, Confluence, Crucible, GreenHopper, Bamboo, FishEye and Crowd. which i didn't use as of now.

JIRA is used for communication between the development, testing, analyst, and the client team as well. e.g. in Agile methodology and Practices, when developers post a particular build for the testers test. The testers would file issues on JIRA accordingly the developers will verify it immediately if that's an issue. An analyst or any one else from the team as well can confirm it and accordingly developers can work on it. Issues can be closed or reopened based on if solved or still been reproduced. Issues can be assigned priorities based on how severe the issue is and how early it needs to be solved. The management can even post suggestions on how to solve a particular issue.
Issues can be assigned to a particular person or team for him to look over it. A graph or chart can be generated based on how many issues are assigned to you and how many are open or closed. A pie diagram can be generated to check which issues have priority. Also queries can be fired to generate reports on specific project to find a specific filtered issue. Thus JIRA solves many problems of communication in an Agile atmosphere. Earlier many companies used Excel sheet for this purpose which was a headache for sure.

Thanks to JIRA!!

Google Analytics. How to use Google Analytics?

Some rights reserved by Search Engine People


Google Analytics

I recently used Google Analytics in one of my Projects for testing purpose, and boy!!! i was so impressed. I never know Analytics could be this strong and could yield this result. I thought i should share my experience, not only this i could relate my (whatever little) knowledge of Big Data to each and every report i generated. I was initially confused on how to use it for the project. I was unable to understand what was the client really interested in after reading the JIRA issue. So i implemented the Google Analytics (GA) code onto my personal blog. I purposely posted my blog links on my gtalk account in order to temporarily increase the number of visitors to my blog. And then i kept track of the visitors. Within a day or so i kind of understood how it's used and what you could do with it.

Of Course Wikipedia always helps as well.

GA is Google offered web tool to keep a track of visitors to your website. This way you can keep a watch on what your customers really look for, you can accordingly increase your sales rate. Later i also gotta know that this can also be used as a SEO(search engine optimization tool) Its a must know tool for any Business Development person in any organization most probably a startup organization. The basic service for GA is available free of cost. The premium user although is charged i believe(although Wikipedia says its free i dint try it!!!)

GA also tracks all referrers e.g Search Engines, Pay-per-click ads etc.

This is what happens and how it works. I will discuss how i kept track of my site(the one your are a visitor currently to)!!

1. You 1st need to have a Google account to access GA
2. Now you need to generate a code from your GA account that needs to be pasted in your website HTML code so that you can keep a track of it.
3. You can generate and paste the code to as many pages you want and keep a track of all of them.
4. You can keep a track at real time using the real time option on GA
5. You can also generate a report using the Custom Report Generation tab
6. This report can then be sent to as many people you want.
7. The report can be generated based on any criteria e.g devices used to access the website, location of the visitor, browser used, Operating system used and many more.
8. You can also generate a Graph based on reports generated in the same report
10. You can select the duration of which you would want the report for.
11. Real time report generation however is not possible for some reason, However real time tracking can be done, which is fair enough
12. Google Analytics is used by many organizations to keep a track of visitors and their interests in order to increase their business

Must for all, not only startups but also for individuals like me who want to know their blog visitors.... ;)