Pages

Sunday, 31 January 2016

Changing hostname in vagrant!

                                                 hostnames in ubuntu/trusty64 are quite long like shown in the image below!


hostname in above pic is vagrant-ubuntu-trusty-64 and i fucking hate this long hostname so all you can do is run the command as shown in the pic below to change the hostname.


After doing this restart the terminal and this is what you get


and yes if you like my agnoster theme then check here how to do this.

EDIT:-> above method temporarily adds hostname for permanent changing the hostname you have to edit the hostname file present in the /etc/ directory.. just open it and remove the old hostname and add the new hostname. 

Wednesday, 27 January 2016

[Solved] Error installing pg, ERROR: Failed to build gem native extension.

                                                             If your are facing this kind of error as shown in the picture below!



Then maybe libpq-dev is missing from your system install it as shown in the picture below


Then try to install pg gem it will install this time without any problem! That's  it.

Tuesday, 26 January 2016

Connecting pgAdmin3 to Postgresql(Running on a Vagrant server)!

                                              So, i thought this tutorial is worth making a video so i made a video on connecting pgAdmin3 to postgresql which is running on vagrant and i'm embedding the video in this post!



I think this video will help you in connecting pgAdmin3 to postgresql server running on a vagrant machine. Thank you!

Changing the password of postgres user

                                      So to change the password of postgres run this command in terminal as shown in the picture below.


This will open the file pg_hba.conf... now try to find this line as shown in the pic below


And change the peer at the last to trust and save it!

After doing this restart the postgresql server by typing the command "sudo service postgresql restart"
after that login as postgres user and run the following command to change the password as shown in the picture below!


Press Enter and that's it your password is changed ... now just go back to the pg_hba.conf file and undo the change i.e. change the trust to peer that's it!



****************************EDIT --- june 16 - 2016 *****************************

I found one more way to change postgres user password in postgresql

Just enter the following command and this will log you in as postgres user so now you can acess the psql.



After this enter the psql by simply typing psql in terminal like this.


Now just enter the command \password postgres as in the image below

and voila ... we changed the postgres password. That's it :D 

Installing postgresql in Ubuntu/Trusty64 vagrant box!

                                                   So to install postgresql in vagrant ubuntu/trusty64 it's quite simple first of all run this command in terminal like this ...


This file will basically create a file in /etc/apt/sources.list.d/ directory which we name pgdg.list and will open this file in nano text editor .. so all you gotta do now is add the following line as shown in the pic below


after saving this run this one more command in the terminal[note :- i forgot to add this step when i was actually writing this post now i use babun so terminal may look different :p only for this step ]



Now all you gotta do is update the system using "sudo apt-get update" after this just add the following command to get this latest version of postgresql


As you can see it's postgresql 9.5 which is latest at the day i'm writing this blog! That's it!

Friday, 22 January 2016

Music Player in Kali Linux Terminal ..!

                                                          So in this post i'm gonna show you how you can install a music player in Kali Linux Terminal as show in the terminal!


So all you need is to run the following command in terminal as shown in the pics below


This actually installs the moc player now we need ffmpeg-plugin for moc player. run the following command shown in the pic below


That's it ...you can launch this player using the command "mocp" in terminal... one more thing it has many themes and then are present in /usr/share/moc/themes directory as shown in the picture below


So to use any theme(transparent-background in my case) provided in the directory use the command "moc -T transparent-background" in terminal and that's it. if you like this then let me know in the comment section :D

Vagrant on Kali Linux!

                                              Hey guys in this post i'll show you how you can start with vagrant on kali linux! So first of all you need is virtual box, virtual box dkms and linux headers of kali linux so for that purpose run the following command in terminal.


Linux headers for kali linux is a dependency of virutal dkms so it will automatically install! After running this go to this Link and download vagrant for debian systems! After this go to the downloads folder and run the following command to install vagrant!


this will go and install vagrant in your kali linux! :D Awesome isn't it ?
So now just type "vagrant -h" in the terminal to see vagrant!


Now as you can see vagrant is working properly in kali linux! So now you can just add ubuntu/trusty vagrant box into vagrant or also you can add your own custom box!

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.