Archive

Archive for the ‘technology’ Category

Useful Git Commands

January 25, 2015 Leave a comment

As our project migrated from SVN to GIT repository, I thought of writing a post of the usual git commands which I find helpful where I could easily refer to.

**Set up Local Repository

#clone a repository into a new directory locally

git clone <SSH key>

#checkout a branch or path to the working tree

git checkout <branch name>

**Working with Branches

#display all the available branches in your local, highlighting the active branch

git branch

#download all/new branches

git fetch

#switch working branch

git checkout <branch name>

#create new branch locally

git checkout -b <branch name>

#push newly created branch to remote

git push -u origin <branch name>

**Committing Local Changes to remote

#show staged files for commit, not staged files for commit and untracked files.

git status

#include what will be committed, stage the changes

git add <file>

#discard changes

git checkout — <file>

#to add message for commit

git commit -m “message here”

#take latest commits on the mentioned branch

git pull origin <branch name>

#push local changes to the remote

git push origin <branch name>

Advertisements
Categories: technology Tags:

Useful RubyMine Keyboard Shortcuts

September 14, 2012 Leave a comment

Meet my new colleague, Jetbrains RubyMine “The Most Intelligent Ruby on Rail IDE” sounds big huh! Since he will be my new companion / buddy for the next months to come, I decided to know him better and build a good rapport. 🙂

Here are some of the keyboard shortcuts I find to be friendly and useful:

Shortcut Description
Ctrl+Alt+S Go to Settings
Ctrl+N Open a class
Ctrl+Shift+N Open a file
Ctrl+B Go to declaration
Ctrl+Space Code completion
Ctrl+E Show recent files
Ctrl+K Commit changes
Ctrl+G Go to line
Ctrl+T Update project
Alt+Left/Right Navigate through the editor tabs
Ctrl+Slash Make a block comment
Ctrl+F Find from current file
Ctrl+Shift+F Find from current folder
Categories: ruby, technology Tags: ,

Error installing Nokogiri in Ubuntu 10.10

June 26, 2012 Leave a comment

Following Nokogiri Installation for Ubuntu I run below #nokogiri requirement in my terminal:

sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri

Running “sudo gem install nokogiri” displays the following error:

Building native extensions.  This could take a while...
 ERROR:  Error installing nokogiri:
 ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
 extconf.rb:5:in `require': no such file to load -- mkmf (LoadError)
 from extconf.rb:5
Gem files will remain installed in /var/lib/gems/1.8/gems/nokogiri-1.4.3.1 for inspection.
 Results logged to /var/lib/gems/1.8/gems/nokogiri-1.4.3.1/ext/nokogiri/gem_make.out

Was able to resolve the issue by installing ruby1.8-dev and reinstalling the nokogiri gem:

sudo apt-get install ruby1.8-dev 
sudo gem install nokogiri 

exist@exist:~$ sudo gem install nokogiri
 Building native extensions.  This could take a while...
 Successfully installed nokogiri-1.4.4
 1 gem installed
 Installing ri documentation for nokogiri-1.4.4...
Categories: ruby, technology, ubuntu Tags: ,

Setup OpenVPN Client in Linux

April 23, 2012 4 comments

I needed to install OpenVPN(open source virtual private network) in my Linux machine to be able to access our staging server. OpenVPN allows you to establish a secure point to point  access to network resources and services.

OpenVPN can be used in two ways – Server and Client. OpenVPN server is the system that you wish to use as VPN end-point or the one you want to access. In my case what I needed to do is to install OpenVPN as client or the one making a service request.

1. Install OpenVPN using terminal:

sudo apt-get install openvpn

2. Create client configuration file in /etc/openvpn

sudo cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf /etc/openvpn

3. Setup client config file, server keys and certificates in /etc/openvpn folder (in my case our client sent these files generated from the server)

/etc/openvpn/client.conf
/etc/openvpn/keys/ca.crt
/etc/openvpn/keys/hostname.crt
/etc/openvpn/keys/hostname.key
/etc/openvpn/keys/ta.key

4. Edit client configuration file (client.conf) based on above directory

# example client config file
client
remote [server] 1194
dev tun
proto udp

ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/hostname.crt
key /etc/openvpn/keys/hostname.key
ns-cert-type server
tls-auth /etc/openvpn/keys/ta.key 1

comp-lzo
keepalive 10 60
ping-timer-rem
persist-key
persist-tun

verb 3

5. Go to /etc/openvpn folder and start the OpenVPN

exist@exist:/etc/openvpn$ sudo openvpn client.conf
Mon Apr 23 13:44:43 2012 OpenVPN 2.1.0 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jul 12 2010
Mon Apr 23 13:44:43 2012 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
...
Mon Apr 23 13:44:50 2012 [server] Peer Connection Initiated with [AF_INET]xxx.xxx.xx.xxx:1194
Mon Apr 23 13:44:52 2012 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
...
Mon Apr 23 13:44:53 2012 TUN/TAP TX queue length set to 100
Mon Apr 23 13:44:53 2012 /sbin/ifconfig tun0 10.8.1.190 pointopoint 10.8.1.189 mtu 1500
Mon Apr 23 13:44:53 2012 /sbin/route add -net 192.168.3.0 netmask 255.255.255.0 gw 10.8.1.189
Mon Apr 23 13:44:53 2012 /sbin/route add -net 10.3.0.0 netmask 255.255.0.0 gw 10.8.1.189
Mon Apr 23 13:44:53 2012 /sbin/route add -net 10.8.1.1 netmask 255.255.255.255 gw 10.8.1.189
Mon Apr 23 13:44:53 2012 Initialization Sequence Completed

There you go! By this time, you should be able to access the application you want to test 🙂 However in our case we needed to setup the IP address of the server that we are trying to gain access in our hosts file. From the terminal, we type:

[user]@exist:~$ sudo su -
[sudo] password for [user]: [input password]
root@[user]:~# vi /etc/hosts

Then input the IP address and the corresponding name of the web server we are trying to access at the end of the line.

Install Testlink in Windows machine

March 6, 2012 2 comments

Testlink is an open-source management tool which includes test specification, planning, reporting, requirements tracking and collaborate with well-known bug trackers.

System Requirements:

• MySQL 4.1.x and higher
• php 4.3.x and higher
• Webserver (Apache 1.3.x or 2.0.x and higher, IIS 3 and higher, etc.)

Installation:

1. Download XAMPP for windows here. Latest version of xampp includes the following, one package that caters to the system requirements of Testlink.

  • Apache 2.2.21
  • MySQL 5.5.16
  • PHP 5.3.8
  • phpMyAdmin 3.4.5
  • FileZilla FTP Server 0.9.39
  • Tomcat 7.0.21

2. Double click xampp-installer.exe to start installation. From the installation wizard, under Service Section, install Apache, MYSQL, Filezilla as service

3. Select Testlink version to dowload here

4. Unzip testlink.tar file to your desired folder

5. Rename the folder to ‘testlink’ and copy it to your \xampp\htdocs folder (e.g. C:\xampp\htdocs\)

6. In your browser access http://localhost/testlink/install/index.php

7. Select New Installation

8. Provide Testlink admin and Database admin login creadentials

Testlink admin login/password – admin/admin (or whatever login/password you like)

Database admin login/password – root/<empty> (this is the default login/password of MYSQL for xampp)

9. After completing the installation, you can now access http://localhost/testlink/login.php and start using Testlink by logging in as admin/admin or creating a new user

2010 in Review

November 9, 2011 Leave a comment

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads Wow.

Crunchy numbers

Featured image

About 3 million people visit the Taj Mahal every year. This blog was viewed about 36,000 times in 2010. If it were the Taj Mahal, it would take about 4 days for that many people to see it.

In 2010, there were 4 new posts, growing the total archive of this blog to 43 posts. There were 3 pictures uploaded, taking up a total of 530kb.

The busiest day of the year was March 18th with 201 views. The most popular post that day was Creating Firefox profile for your Selenium RC tests.

Where did they come from?

The top referring sites in 2010 were luhman.org, google.co.in, codebetter.com, google.com, and passionatetester.com.

Some visitors came searching, mostly for selenium firefox profile, selenium rc firefox profile, firefox profile selenium, selenium profile, and jmeter proxy.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

Creating Firefox profile for your Selenium RC tests February 2009
49 comments

2

JMeter 101: Using HTTP Proxy to Record your Test March 2009
19 comments

3

Jmeter: Add “Cookie Manager” June 2009
8 comments

4

JMeter: Run scripts from the console October 2009

5

Jmeter: Statistics Aggregate Report January 2010
4 comments

How to live before you die –Steve Jobs

October 7, 2011 Leave a comment

Most of us have benefited from the brilliance and countless innovations made by the Apple man itself Steve Jobs.

Jobs, former chief executive officer and co-founder of Apple died on October 5, Wednesday (October 6 in the Philippines ) at the age of 56. He was first diagnosed with an unusual form of pancreatic cancer in 2004 and needed to undergo liver transplant in 2009.

Today as we mourn on Jobs’ death,  I was reminded by his memorable 15-minute commencement address delivered on June 12, 2005, at the Stanford University in Palo Alto, California.

Thank you Steve Jobs for making our world a better one.

Here is the full transcript of Jobs’ speech:

I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories.

The first story is about connecting the dots.

I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?

It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: “We have an unexpected baby boy; do you want him?” They said: “Of course.” My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.

And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents’ savings were being spent on my college tuition. After six months, I couldn’t see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn’t interest me, and begin dropping in on the ones that looked interesting.

It wasn’t all romantic. I didn’t have a dorm room, so I slept on the floor in friends’ rooms, I returned coke bottles for the 5¢ deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:

Reed College at that time offered perhaps the best calligraphy instruction in the country. Throughout the campus every poster, every label on every drawer, was beautifully hand calligraphed. Because I had dropped out and didn’t have to take the normal classes, I decided to take a calligraphy class to learn how to do this. I learned about serif and san serif typefaces, about varying the amount of space between different letter combinations, about what makes great typography great. It was beautiful, historical, artistically subtle in a way that science can’t capture, and I found it fascinating.

None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, it’s likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.

Again, you can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.

My second story is about love and loss.

I was lucky — I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation — the Macintosh — a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.

I really didn’t know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down – that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me — I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.

I didn’t see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.

During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I returned to Apple, and the technology we developed at NeXT is at the heart of Apple’s current renaissance. And Laurene and I have a wonderful family together.

I’m pretty sure none of this would have happened if I hadn’t been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don’t lose faith. I’m convinced that the only thing that kept me going was that I loved what I did. You’ve got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven’t found it yet, keep looking. Don’t settle. As with all matters of the heart, you’ll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don’t settle.

My third story is about death.

When I was 17, I read a quote that went something like: “If you live each day as if it was your last, someday you’ll most certainly be right.” It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: “If today were the last day of my life, would I want to do what I am about to do today?” And whenever the answer has been “No” for too many days in a row, I know I need to change something.

Remembering that I’ll be dead soon is the most important tool I’ve ever encountered to help me make the big choices in life. Because almost everything — all external expectations, all pride, all fear of embarrassment or failure – these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.

About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn’t even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor’s code for prepare to die. It means to try to tell your kids everything you thought you’d have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.

I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form of pancreatic cancer that is curable with surgery. I had the surgery and I’m fine now.

This was the closest I’ve been to facing death, and I hope it’s the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:

No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma — which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in Menlo Park, and he brought it to life with his poetic touch. This was in the late 1960’s, before personal computers and desktop publishing, so it was all made with typewriters, scissors, and polaroid cameras. It was sort of like Google in paperback form, 35 years before Google came along: it was idealistic, and overflowing with neat tools and great notions.

Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: “Stay Hungry. Stay Foolish.” It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.

Stay Hungry. Stay Foolish.

Thank you all very much.

Categories: technology Tags: ,