Bitnami + Virtualbox – Host Only Network

Bitnami Stacks are a convenient way to get quick VMs to test out some piece of code or another and with Virtualbox, it works out great as you get a free quick pre-installed stack to develop / test your application.  Recently I downloaded a few of these to help me out in my classes and development

Great thing about these stacks is that with pre-configured VMs, you can quickly test a certain app out there that you are thinking of using and play with it a bit.

Getting these stacks on the network is an issue.  After importing them in virtualbox (using version 4.3.8 at the moment) and running the stacks, I realized getting them to communicate with Windows 7 host so that I could access the application being tested was going to be a little bit of a problem as I’m sitting at work, behind a proxy.  At home it worked absolutely great, a bridged ethernet adapter with a quick and easy setup, picked up a DHCP address from my host’s wireless adapter and both guest and host OS communicated fine.  Problem at work was that there’s a proxy, and to get an IP for a device, you had to open the browser and login with your employee credentials.  These stacks are all command-line Ubuntu 12.04 VMs.

So how do I communicate with my app?
Solution: Setup two adapters on the VM: One on NAT to allow the VM to connect to the net, and the other in “host-onlyave access to the application running on my stack.

You can have a look at the host-only network setup on your virtualbox.  Go to File > Preferences > Network and you will see it.

post1

Click on the little tool icon on the right side and you can see the settings of this ethernet adapter in the Virtualbox preference settings.

post2Simply ensure that DHCP server is enabled, this way, you won’t have to setup the network interface manually once you start up your virtual machine.

Now, once this is good, in the network settings of your virtual machine that you are looking to modify, setup two adapters:

Right click on the name of your VM, select Settings and then click on “Network”.  You will see four tabs for four adapters.  Modify the adapter number 1 to NAT as in the image below:post3 post4And then select “Adapter 2″ from the Network tabs, click on the checkbox “Enable Network Adapter”, change the “Attached to” setting to “Host-only Adapter” and make sure the name of the adapter matches the one we noticed earlier when we checked out the virtualbox preferences.

Now start up your VM and let’s configure it.
Again, my VM (the bitnami stack VM) is on Ubuntu 12.04, once you are logged in, have a look at what adapters you have.  There are several commands that will let you see them:

All of these commands will show you the network interfaces on your VM.  For example on my particular VM, these commands showed that I had three interfaces, the “lo”, “eth1″ and “eth2″.   The “lo” interface is the loopback, “eth1″ was on NAT and “eth2″ was the host-only adapter.  Now let’s set these up.  Using your favorite text editor (vi, etc.) edit the /etc/network/interfaces file and set it up

Now once this is ready, let’s restart networking using the command above.

if you do ifconfig again, you will see that your eth2 interface will have an address such as 192.168.56.101  (in my case, I ended up with DHCP giving this particular VM 192.168.56.102 IP)

Point your browser to this IP (if that’s what you are trying to setup) and voila, you can now talk to your VM.

post5

 

Source: http://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in

[Arch Linux] Root device mounted succesfully but /sbin/init does not exist

So I decided to install Arch.  Installation was relatively straightforward following this EXCELLENT beginners installation guide. Had no issues whatsoever as I wasn’t going for anything fancy, no dual boot, removed windows all together and just did a simple partition of the harddrive, though left Dell’s recovery drive in there and made two new partitions, SDA2 for / (root) and SDA3 for /home mount points.

Once everything was done, I rebooted and got this cryptic message:

That didn’t look like fun.  Used my best friend, “Google” and did some research on the issue.  I was using syslinux as my bootloader and not grub.  The indications were pointing to /bin/systemd not being there.  Suggestions included:

add

to the kernel parameters on boot.

So when the menu came up

Pressing TAB here, brings you to the kernel parameters that can be modified.  I added the above line and continued the boot process.  Didn’t work.

Next suggestion said add:

Using the same technique above, I tried that as well.  Didn’t work.

Then I decided to boot from the installation media and see what’s going on.  Upon boot, I mounted the installed drive, chroot into it and installed systemd with the following commands.

Once all was done.  Another reboot and things still weren’t better.  Arch just kept on leaving me on my own and kept bailing out!

Then I found another thread on archlinux.org that pointed me in a different direction:

/new_root is where your root filesystem gets mounted. If there’s nothing in there, you’re mounting the wrong one. Fix your bootloader config.

As this was the only thing I hadn’t checked yet, I decided to boot using the installation media again, chroot into it and view the content of the syslinux.cfg file.

So the config file resides at:

The content of the file made it obvious what the problem was.

And that’s it.  root was pointing to sda3, that wasn’t right, it should have been pointing to sda2 where the root (/) actually was whereas sda3 was the partition where /home was mounted.

A simple fix from sda3 to sda2 on both, a reboot and a voila, I booted into my fresh arch installation.

Thanks to Google and the helpful folks in all these opensource communities, one more problem solved.  Time to dive into the world of Arch Linux.

Geeta Saar (The essence of Bhagwat Geeta)

The Bhagwat Geeta Saar is the essence of Shrimad Bhagwat Geeta, the song of the God that included the teachings of Lord Shri Krishna to Arjuna on the battlefield of Kurukshestra during the Mahabharata.

As Arjuna dropped his weapons upon seeing the plethora of relatives, friends and family members that he was to wage war against, Lord Krishna instructed him on what he was fighting for, reminded him of his dharma, his karma and ultimately provided him with true insight on the nature of things.  His teachings were embodied in Shrimad Bhagwat Geeta (the song of the God).  Bhagwat Geeta is a treasure of Hindu metaphysical teachings.   What follows below is a short summary of these teachings, emphasizing what is important to understand.

Short version in Hindi (Roman Script):

jo hua vah acchhaa hua
jo ho rahaa hai vah acchhaa ho raha hai
jo hogaa, vah bhi acchhaa hoga
tumhaara kya gayaa jo tum rote ho?
tum kyaa laaye the, jo tumne kho diya?
tumne kya paidaa kiya, jo nashT ho gayaa?
tumne jo liya, yahiiN se liyaa;
jo diyaa, yahiiN par diyaa;
jo aaj tumhaaraa hai, kal kisi aur ka tha,
kal kisi aur ka hogaa….
parivartan hi sansaar ka niyam hai

English translation 

Whatever happened, happened for the good
whatever is happening, is happening for the good
whatever will happen, will also happen for the good only.
what did you lose that you are lamenting about?
what did you bring with you that you have lost?
what did you produce (gave birth to) that got destroyed?
whatever you have, you received from here
whatever you gave, you gave it back here
what belongs to you today, belonged to someone else yesterday
and will belong to someone else tomorrow
Change is the law of the universe

Longer version In Hindi (Roman Script):

  1. kyoN vyarth chintaa karte ho? kis se vyarth Darte ho?  kaun tumheiN maar saktaa hai?  aatmaa na paida hoti hai, na marti hai
  2. jo hua, vah acchhaa hua, jo ho raha hai, vah acchhaa ho rahaa hai, jo hogaa, vah bhi acchhaa hi hoga.  tum bhoot ka pashchaataap na karo, bhavishya kii chintaa na karo. vratmaan chal rahaa hai.
  3. tumhaaraa kyaa gayaa jo tum rote ho? tum kyaa laaye the jo tumne kho diyaa? tumne kyaa paidaa kiyaa thaa jo naash ho gayaa? na tum kuchh lekar aaye, jo liyaa yahiiN se liyaa, jo diyaa yahiiN par diyaa.  jo liyaa isii (bhagwaan) se liyaa, jo diyaa isii ko diyaa. khaali haat aaye aur khaali haath chale. jo aaj tumhaaraa hai, kal aur kisi ka tha, parsoN kisii aur ka hoga.. tum ise apna samajh kar magn ho rahe ho, bas yahii prasannataa tumhaare dukhoN kaa kaaran hai
  4. parivartan sansaar ka niyam hai.  jise tum mrityu samajhte ho, vahi to jeevan hai. ek kshan meiN tum karoRoN ke swaami ban jaate ho, doosre hi kshan meiN tum daridra ho jaate ho.  mera-tera, chhoTaa-baRaa, apna-paraayaa, man se miTaa do, phir sab tumhaaraa hai, tum sab ke ho.
  5. na yah shareer tumhaaraa hai, na tum shareer ke ho.  yah agnii, jal, vaayu, prithvi aakaash se banaa hai, aur isi meiN mil jaayega.  parantu aatmaa sithar hai – phir tum kya ho?
  6. tum apne aapko bhagwaan ke arpit karo.  yahi sab se uttam sahaaraa hai.  jo iske sahaare ko jaanta hai, vah bhaya, chinta aur shok se sarvada mukt hai.
  7. jo kuchh bhi tu karta hai use bhagwaan ko arpan karta chal, aisa kar ne se sada jeevan-mukt ka aanand anubhav karega

English Translation

  1. Why do you worry without a reason? Whom do you unnecessarily fear? Who can kill you? The soul is neither born, nor does it die.
  2. Whatever hapepend, happend for the good.  Whatever is happening, is happening for the good, whatever will happen, will also happen for the good only.  You should not regret the past, should not worry about the future.  The Present is happening.
  3. What did you lose that you lament? What did you bring that you lost?  What did you produce that got destroyed? You did not bring anything, whatever you have, you received from here, whatever you gave, you returned it back here. Whatever you took, you took from God, whatever you gave, you gave it back to him. You came empty handed and you will leave empty handed.  What belongs to you today, belonged to someone else yesterday and will belong to someone else tomorrow.  You are happy with the misunderstanding that it’s yours. This false happiness is the root cause of your sorrows.
  4. Change is the law of the universe.  What you think of as death is actually life.  In one instance, you can become a millionaire and in another,  you can fall in poverty.  Yours and mine, big and small, erase these ideas from your mind, then everything is yours and you belong to everyone.
  5. This body is not yours, neither are you of the body. The body is made of fire, water, air, earth and ether, and will disappear into these elements. The soul is permanent – so who and what are you?
  6. Dedicate your being to God. He is the one to be ultimately relied upon. Those who know of his support are forever free from fear, worry and sorrow.
  7. Whatever you do, dedicate it to God. By doing so, you will experience bliss that only freedom from life can bring.

Some useful Sublime Text 2 Plugins

I have been trying different setups and IDEs to do some python development work and while Eclipse remains my favorite for Java, I decided to start using Sublime Text 2 for proper python/ruby development.  These are the plugins that I have been using so far that make ST2 even better than what it is.

Package Control 
You can’t do without this one.  This has to be your first plugin installed and the installation has to be done manually.  Follow the installation instructions on it’s website and from there on, installing plugins will be a breeze: All you need to do is press ctrl-shift-p (on Windows/Linux) or cmd-shift-p (on mac) and type “install” in the box that pops up and press enter on Package Control: Install command, search for the desired plugin and voila, it’s ready to go. 

All Autocomplete
This excellent plugin extends the built-in autocompletion to find matches in all open files.  If you are working inside a project, this is extremely helpful.

Bracket Highlighter
Ever been stuck in a source code with a huge amount of brackets, braces, tags… and you are trying to find where the heck does that curly brace closes?  Bracket Highlighter will help you figure that out.  Bracket Highlighter matches a variety of brackets such as: [](){}""''<tag></tag>, and even custom brackets.

Case Conversion
Case conversion plugin helps you convert your functions/variable naming style in different versions that exists, convert from camel case (camelCase) to snake case (snake_case) with just a press of the correct key-binding! check it out. 

Emmet
Previously known as zen-coding, this plugin will help you improve your workflow if you are doing a lot of HTML and CSS coding. Get support on their site: http://emmet.io/

Git
What this does goes without saying but I’ll say it anyway: integrate git with ST2

Sublime CodeIntel
This is a Full-featured code intelligence and smart autocomplete engine and you definitely need it.

Sublime Linter
SublimeLinter is a plugin that supports “lint” programs (known as “linters”). SublimeLinter highlights lines of code the linter deems to contain (potential) errors. It also supports highlighting special annotations (for example: TODO) so that they can be quickly located.

Sublime REPL
This plugin will help you run an interpreter inside ST2 and if you are doing python or Ruby programming, it will be of great help.

Sublime Rope
This plugin will add Python completions and some IDE-like functions to Sublime Text 2.  You do need to turn your project into a Rope project for it to work like an IDE, to accomplish that, you can press Ctrl-Shift-P and type rope and then select “New Project” from the list.  Look at the bottom of the screen and enter the project details.  Now Rope should be able to find the modules in your current project as well.  There is more documentation for Rope at : http://sublimerope.readthedocs.org/en/latest/

Sidebar Enhancements
This one will help you add more functionality to the sidebar and the menus that come with the sidebar.

Modific
M
odific helps you get a look at what changes were made since the last commit by highlighting the lines, helping you see diff in ST2, preview changes, revert changes, and see uncommitted files.  Handy plugin for those active projects.

Ruby Tests
Run Ruby tests from ST, unit tests, cucumber tests, RSpec tests.  Another handy plugin for Ruby devs out there.

For Ruby, also have a look at Sublime-guard, Sublime-ERB, Beautify Ruby and a few more useful plugins that I haven’t used or tested but seems like a good thing to keep in mind at this nettuts link

These plugins will definitely enhance the ST2 experience.  For those looking for plugins for ST3, keep in mind that Sublime CodeIntel is not yet available on ST3… I’ll be keeping my eyes on that one.  I hope this post helps someone or the other out there.

rahi haiN daad-talab unkii — Ghazal – JaaN Nisaar Akhtar

A lovely Ghazal by JaaN Nisaar Akhtar

rahii haiN daad-talab unkii shauKhiyaaN ham se
adaa shanaas bahut haiN, magar kahaaN ham se
[daad-talab = wanting praise, adaa-shanaas = those who can appreciate beauty]

sunaa diye the kabhi kuchh Ghalat-salat qisse
voh aaj tak haiN usi taraH bad-gumaaN ham se
[bad-gumaaN = mistrustful]

ye kunj kyoN na ziyaarat-gah-e-muhabbat ho
mile the vo inhiiN peRoN ke darmiyaaN ham se
[kunj = corners (streets) ziyaarat-gah-e-muhabbat = a place of pilgrimage of love]

hamiiN ko fursat-e-nazzaaragi nahiiN varna
ishaare aaj bhi karti haiN khiRkiyaaN ham se
[fursat-e-nazzaaragi = the time to look]

har ek raat nashe meiN tire badan ka Khayaal
na jaane TuuT gayiiN kaii suraahiyaaN ham se

na lafz hai, na kinaayah, na saut hai na sadaa
sakoot-e-shab ki na pooochhe koi zabaaN ham se
[lafz = words, kinaayah = nod, signs, saut = sound, noise, sadaa = voice
sakoot-e-shab = silent night]

hamaari qadr karo aie suKhan ke matvaalo
Ghazal ko kal na mileiNge mizaaj-daaN ham se
[suKhan = poetry]