Posts Tagged ubuntu

Postgre mess up in Ubuntu

Linux is like cocaine syringe, if you share your laptop with some one, you are bound to feel the consequence. Thats what happened to me, I share with one who is noob to Linux, I asked to install postgresql , but then it was fucked up. I had to correct it in  a very hard way. Say if your postgre is not running properly, if the cluster does not exist or some stupid thing like not responding in port 5432,  follow these steps and it should be fixed

$ ps -C postgres

You will get an number then do this

$ kill that-number

This should stop Postgre, now we will remove it completely and install it, just type these commands

$ apt-get --purge remove postgresql\*
$ sudo rm -r /etc/postgresql/
$ sudo rm -r /etc/postgresql-common/
$ sudo rm -r /var/lib/postgresql/
$ sudo userdel -r postgres
$ sudo groupdel postgres
$ sudo apt-get install postgresql
 

And now connect to post gre using this command

$ sudo -u postgres psql postgres

Now change the password

postgres=#\password new_password

Enjoy life!

Advertisements

, , , ,

Leave a comment

Is the server running locally – Postgres Ubuntu

I Installed postgres on my Ubuntu machine and when I gave the command to connect with it, I got the following error


$ sudo -u postgres psql postgres

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"?

The fix seems to be this


$ sudo -u postgres psql postgres -h localhost

All you need to do is to append -h localhost or just postgres that its running on localhost or your local system. Thats it.

, , ,

Leave a comment

Atom catching up fast with Sublime

Atom on my Mac themed Ubuntu.

Atom on my Mac themed Ubuntu.

In 2006, a day arrived when I no longer need to touch Windows and I shifted to Linux unless and until compelled by huge corporations that has no brains.  Now today I have ditched Sublime Text editor and chosen Atom. For me its another proof that free software model works. Sublime is closed source and Atom is not, its source code is available, you can read it, know it, modify it and give it to others. You will not live in a dilemma that your software is tracking you or not, doing some malicious job as you type the code.

I just love the way it shows shortcut help in its start screen, though simple its an ingenious idea (see pic above). None like to read a huge manual, these tidbits of information is make me learn this editor really well. That too showing it in huge fon’t is making me not to miss it., at the same time its not intrusive.

Atom in my machine is getting updated almost twice a week, and its great to use and i haven’t found any big issues yet. It closely matches sublime and its a drop in replacement. So how to install Atom on your Ubuntu or Debian machine. Put these lines in your terminal:


$ sudo add-apt-repository ppa:webupd8team/atom
$ sudo apt-get update
$ sudo apt-get install atom

Enjoy life!

If you are wondering how I themed my Ubuntu like mac, see the tutorial here http://www.noobslab.com/2014/04/macbuntu-1404-pack-is-released.html

, , , , ,

5 Comments

Postgre / pg gem throws error

Sometimes pg gem does not get installed on Ubuntu because some libraries are missing and throws an error. So solve this, just give the following command in terminal

$ sudo apt-get install libpq-dev

And them bundle or give gem install pg . All should work well.

, , , , ,

Leave a comment