Thursday, 19 March 2015

Hack your way to learn.

"The best way to learn a new skill is to HACK - BREAK - FIX it. And fix it before you are in trouble"



These days i am busy learning and getting acquainted with new technologies and codes. I have been reading many white papers, research papers and hanging out at places like stackoverflow, stack exchange and other developer and community forums. Hanging out here is like walking into a party. There are days where you are greeted with many dazzling perfect solutions that work like a piece of cake, And then, there are the other days, the dry ones, when you are left alone to tackle the army of warnings and errors marching from your neatly maintained code.




When in this situation,

Do you feel isolated? helpless?
Do you know the solution, yet withdraw yourself?

As a newbie, one tends to be very curious and at the same time doubly cautious in working with codes and machines. I usually double check with the installation guide and read other peoples experiences with the same software/errors/solutions before i get my hands to fire the commands. It is quite a risk. I know. I have been there, Kid.

But, is it worth the risk? Is it worth breaking?

Well, what is life without risk. Jokes apart. My answer is yes.

Become Rajinikanth, take the risk. But do it with precaution. Before breaking, make sure you can reverse the effects, if it goes wrong. Keep a copy of the original files. Keep a log of our actions. Use scripts if your making an installation. Ask for expert advice from your colleagues and seniors. Do a safe trial. Make sure no one else is affected. Be cautious. But, break.

Cos only when you break and fix can you learn.



Hack-break-fix-learn is the mantra.

Happy Learning!




Tuesday, 17 March 2015

How to add a native user to the Xeon Phi Co-processor ?

In this post I will be discussing on how to add a new user to the Xeon Phi Co-processor. While using the offload programming model of the Xeon Phi co-processor system, a new user account is not essential for running programs. Offloaded programming model uses a default user called as micuser to execute the programs on the Xeon Phi. But, while running native programs, a programmer might have to get a new user account to do so, inorder to login/ ssh into the co-processor itself.

The  system administration guide by Intel  for Xeon Phi states that, "Users will automatically be added to the /etc/passwd file for the coprocessor if they have an entry in the host’s /etc/passwd file, the user authentication method is set to local and their user id falls in the range specified in the /etc/sysconfig/mic/default.conf file.
(See “User Access” in Intel® Manycore Platform Software Stack (Intel® MPSS) Boot Configuration Guide.)
At the same time, a home directory will be created for them in the disk image used to make the co-processor’s RAM file system"

However, in my case it was not so. And i had to try the other methods suggested.

Since the first method didnot work, i tried the second suggestion which says users can also be added to the co-processor’s /etc/passwd file using the micctrl --useradd command.

micctrl --useradd=<username> --uid=<uid> --gid=<gid> [--home=<dir>] [--comment=<string>] [--app=<exec>] [--sshkeys=<keyloc] [MIC list]


The user name, user ID and group ID must be supplied. If home is not set to the home directory of the user, then /home/<name> will be used.  If a comment is not entered then 'User Account <name>' will be entered in this field.  The default start application is /bin/sh if no other is entered.  The 'sshkeys' parameter allows the specification of a directory to find the users ssh keys.

example :  micctrl --useradd=tejeswini  --uid=10058 --gid=10058 --home=path/to/home/dir/ mic0

Note: The gid and uid can be obtained by typing "id" on the terminal. 


You ought to reboot the system by typing

service mpss stop 
micctrl --reboot mic0
service mpss start


however it didn't allow me to ssh into xeon phi after this. I, also tried micctrl --passwd=<username> mic0 to change the password and unfortunately, nothing changed.

The next method we tried was logging into xeon phi as root by

$ ssh root@mic0
password: *******
[root@<hostname>-mic0 /]# useradd tejeswini
New password : *******
Retype New password: *******
[root@<hostname>-mic0 /]# su - tejeswini
$~
[root@<hostname>-mic0 /]# exit
[tejeswini@<hostname>]$ ssh tejeswini@mic0
password for tejeswini@mic0 : *******
$~

This worked. And it was that simple!! I am still trying to figure out how to make the first two methods work. Do leave a comment if you  have any suggestions.




Tuesday, 17 February 2015

Breaking the fear!

I  was recently watching a Tedx Talk that discusses on how one can learn a new subject in less than a days time, well in 20 hours, he says. (Impressive isn't it?)

 One particular discussion caught my attention. The speaker emphasis that the most important aspect of learning something new is to first overcome the "fear of the unknown". I have often found myself in a situation wherein i fear and self-doubt before i get acquainted with a new skill. I bet, most of us have been in this position. Many of us get discouraged, while some of us manage to overcome the fear and move on to master the skill.


                                     


The trick is in the first 20 hours. Dedicate your time to the topic for the first 20 hours and you are good to master it in the coming days or weeks or even years, depending on what skill you wish to master. I tried this trick and it seems to be working! The fear of the unknown is what pulls us back. It is like a rock tied to your leg. Once you cut loose from the rock, you are free to run around and explore more. So guys, dont wait here. Book 20 hours on your calendar and get sailing.

 For those of you who wish to watch it, it is called  'The First 20 Hours: Mastering the Toughest Part of Learning Anything', by Josh Kaufman. I have attached the video below:



Happy Learning!



Saturday, 17 January 2015

Use command line in windows 8/8.1 to create a wifi hotspot.

Hey Guys.

This post is dedicated to the girls in my hostel who asked me how to go about it. So while i was staying at the hostel i found this simple hack very useful to connect all my devices to the Internet, by creating a hotspot on my laptop. This article will save you from installing connectify and other unnecessary software  on your PC.

Steps to be followed:
  1. Click windows button. Type cmd. Command Prompt will open up as a search result. Right Click on Command Prompt and select Run as administrator option.
  2.  A dialog box asking permission to make changes to the computer appears. Click Yes.
  3. To check if your computer supports hotspot feature or not type :
    • netsh wlan show drivers 
  4.  If you see Hosted Network Supported : Yes then your PC supports     hotspot and you can continue.
  5. Now type 
    • netsh wlan set hostednetwork mode=allow ssid=wifiname key=typepasswordhere 
    •  ssid is the name of your hotspot and key is the password for your hotspot
  6. Click Enter.
  7.  If you will get a message saying " The hosted network mode has been set to allow. The SSID of the  hosted network has been successfully changed. The user key passphrase of the hosted network has been successfully changed", you are good to go.
  8. To turn on the hotspot anytime later, all you have to do is enter
    • netsh wlan start hostednetwork
    • you will get a message saying "The Hosted network started"
Thats how easy it is! 






How to Partition your Hard disk in Windows 8/8.1 ?

This post is dedicated to my cousin who asked me how to go about partitioning a hard drive for his newly bought laptop.

The prerequisites to partition a hard-disk is that you ought to be logged in as an administrator and have free space in your hard-disk.


Steps to be followed:
  • Start button -> Control Panel -> System and Security ->Administrative Tools ->Computer Management
  • On the left side of the window you will find Storage. Click on Disk Management under Storage. A new window will open up.
  • Right click on a free unallocated-drive on your hard-disk and click new simple volume.
  • Click Next.
  • You can either select the default size or type the size of he volume you wish to create. It is in megabytes (MB) and not gigabytes(GB). 
  • Click Next.
  • A format partition dialog box appears. Click next if you wish to format with the default settings, else click on do not format option.
  • Click Finish after reviewing your choices


Thats how simple it is. :)

Friday, 16 January 2015

My yet-another-bucket list

Hey Guys :)

I have recently shifted my base to Bangalore, India for a six months period. I am here for my undergraduate final year project work. I will be working as a research intern at SERC Dept, Indian Institute of Science, Bangalore.

While i am at it, I devised this list of few things i wish to do during my stay here.

List of fun stuff:
  • Visit the Bangalore Palace.
  • Go cycling to Cubbon Park for starters, and then aim for Nandi Hills.
  • Become a member of the best state central library in India a.k.a Seshadsri Iyer Memorial Library in Cubbon Park if permitted, else just visit!
  • Have appam and stew/omelette at Koshy's.
  • Have masala dosa and filter coffee at MTR.
  • Have filter coffee in Brahmin's Coffee Bar, Basavanagudi.
  • Learn swimming. ( No postponing this time! )
  • Volunteer/Donate at a blood bank or hospital. 
  • Start a weekend club with friends. 
  • Discover a new interest, any interest. 
  • Have dosa at 99 varieties dosa shop and visit vv puram food street.
  • Go parasailing at Jaguar.
  • Play Paintball and laser tag.
  • Go on an adventurous trek.
  • Dress up and go for a fancy sunday buffet with friends.
Goals:
  • Take the GRE and TOEFL
  • Update github
  • Resume work on the winter school project ( link to report )
  • Use LATEX instead of MS Word
  • Complete my website
  • Work around Scikit-learn, Caffe etc
  • Do some fun weekend projects in machine learning
  • Learn Django framework
  • Learn Ruby on Rails

Do let me know if any of you wish to join me. :) Lets do this!


Links for further reading of Intel Xeon Phi Coprocessor

The following links and documents contain good examples and guidelines for a novice when programming for the Intel Xeon Phi.

http://software.intel.com/sites/default/files/article/335818/intel-xeon-phi-coprocessor-quick-start-developers-guide.pdf


http://software.intel.com/en-us/articles/building-a-native-application-for-intel-xeon-phi-coprocessors


http://www.drdobbs.com/parallel/programming-intels-xeon-phi-a-jumpstart/240144160


http://www.prace-project.eu/IMG/pdf/Best-Practice-Guide-Intel-Xeon-Phi.pdf


http://software.intel.com/sites/default/files/article/366893/offload-runtime-for-the-intelr-xeon-phitm-coprocessor.pdf


http://research.colfaxinternational.com/file.axd?file=2013%2F5%2FColfax_Static_Libraries_Xeon_Phi.pdf


https://hpcforge.org/plugins/mediawiki/wiki/pracewp8/images/6/68/XeonPhi.pdf


http://software.intel.com/en-us/articles/getting-started-with-openmp
 
http://d3f8ykwhia686p.cloudfront.net/1live/intel/An_Introduction_to_Vectorization_with_Intel_Compiler_021712.pdf