Pages

Monday, 18 January 2016

How to make a vagrant box from an existing one.

                     

In this article i'm gonna show you how to make a vagrant box from an existing one .... Packaging a vagrant box helps us not doing the same sysadmin stuffs all the time. For this example i'll be using ubuntu/trusty64. So all you need to do is set the development environment properly in the ubuntu/trusty64 vagrant box and then run this command.


So now you can easily save that swapnilrailsbox.box vagrant box to your vagrant box collection and whenever you need that same kinda development environment you can just add it like shown in the pic below.


Now you can use it in which ever project you want. Awesome!

Sunday, 17 January 2016

Mysql installation in linux via command line.

                So to install mysql via command line just enter the following command and it will setup everything related to mysql.


That's it. This will go and install mysql for you.

Wednesday, 23 December 2015

rbenv, ruby remote interpreter, rubymine, vagrant => Everything you need to know!

                                                      So guys all i was doing when working with laravel, django or rails with vagrant is i have to configure both my host as well as guest environment to work with software(python(Django), PHP(Laravel), Ruby(Rails)) and things become pretty shitty when railsinstaller incase of windows doesn't supporting new versions of Ruby as well as Rails .... Django-python & Laravel-php doesn't have these problems as they have better support on windows as well as on Trusty64 guest machines.

So incase of ruby all you have to do is set the remote interpreter instead of the local interpreter installed in windows. So open the setting and search for interpreter and add the remote interpreter by clicking on the '+' sign. then search for ruby interpreter it will give path to shims directory in .rbenv but you have to go into the versions directory and mark my words select "irb" instead of ruby as it wants ruby interpreter(irb) instead of ruby. This will solve the whole problem. Thats it!

P.S. => Software_Devs@JETBRAINS are doing awesome job! It's really time to say gudbye to sublime(no offence) :p 

Saturday, 28 November 2015

clearing screen & pasting using "CTRL + v" in windows command prompt.

Things become quite frustating when you just migrated from linux desktop world to windows world!
Specially tasks which uses terminal or command prompt(in windows) ... So, today i found these two awesome script's of autohotkey.. todo these tasks same as we do in linux world.
Simply download autohotkey from https://autohotkey.com and make two scripts with .ahk extension for example for pasting in terminal make copypaste.ahk and for clearing screen make clearingscreen.ahk and add the following code in both the file

;-----------------------------------------------------------------------------------------------------------------
;for pasting data

#IfWinActive ahk_class ConsoleWindowClass
^V::
SendInput {Raw}%clipboard%
return
#IfWinActive.
;-----------------------------------------------------------------------------------------------------------------

;for clearing screen in command prompt
; -------------------------------------------------------------------------
; Cntr-L should clear screen
; -------------------------------------------------------------------------
#IfWinActive ahk_class ConsoleWindowClass
^L::
Send cls{Enter}
return

#IfWinActive
;---------------------------------------------------------------------------------------------------------------------

After making these two files just double click and run 'em! thats it.
WARNING:- Things will easily break and become serious pain in head if you run vagrant ... so tip is suspend them from the arrow(in TASKBAR). Thanks!

Thursday, 19 November 2015

[Solution] Vagrant can't mount shared folder in VirtualBox in Windows 8.1 OS!

                                    So to fix this problem all you need to do is install a plugin vagrant-vbguest using vagrant and the problem will be fixed. If you face troubles will installing vagrant-vbguest then go to this LINK=>[Solution of Vagrant plugin installation failure problem] and then just run the following command in command prompt as shown in the pic below.


after installation halt the vagrant using command vagrant halt and then run vagrant up and after that shared folder will mount in both windows and linux, fixed!

[SOLUTION] Vagrant Plugin Installation failure in Windows 8.1 OS

                                             The problem exist in ruby for windows ... it has some issues related to space in folder names and by default vagrant home is the C:/users/your user name/.vagrant.d all you need to do is to set the environment variable VAGRANT_HOME to something like C:/Vagrant/Home .... so to do it first make the folder Vagrant in C drive and then make another folder in Vagrant directory i.e. Home ... So you have something like this C:/Vagrant/Home
                                                                                   After making the folder run the following command in windows command prompt as shown in the pic below


After running this command RESTART windows and then vagrant plugins will install and the problem is fixed!


Friday, 16 October 2015

Solved! mysql2 (0.4.1) ain't working on rails 4.2.4!

                                   


                                      So, guys you have worked with rails with mysql and everything worked great untill you upgraded your version of rails to 4.2.4 and you got stuck connecting rails to mysql ... following error pops up "Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile(and ensure its version is at the minimum required AciveRecord)."

and the patch i applied is i downgraded the gem mysql2 from version 0.4.1 to version 0.3.18.. and it worked!

to downngrade mysql2 add the following line in the Gemfile in place of gem 'mysql2'  like this

gem 'mysql', '~> 0.3.18'

and after that simply run bundle install !! Bundle will pull the dependencies and so in the Gemfile.lock file you will see the mysql2 version downgraded from 0.4.1 to 0.3.18! fixed.