Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Friday, August 11, 2017

PostgreSQL on Ubuntu

Installing PostgreSQL on Ubuntu
To install both client and server with the newest version of Postgresql (the newest one on Ubuntu's repository), we can do it by apt-get

apt-get install postgresql

Setting up PostgreSQL
Installing via apt-get, everything (all configurations) has been set up, and Ubuntu's user 'postgres' will be created. We can access the database as this postgres user. Some tutorial talks about initdb command to create database cluster (database location on file system) but I can't find this command. However, database cluster has been created already after the installation.
There is a database has been created after install, the name is postgres. We can access this database to give the password of our postgres user.

sudo -u postgres psql postgres
\password


Start using database
We can create database with createdb command.

sudo -u postgres createdb mydb

To access it, use psql command. psql -h localhost mydb postgres

References
https://help.ubuntu.com/community/PostgreSQL

Wednesday, March 26, 2008

my x comed back.

about my report last time, now i can fixed it. i copy x config file from live cd. i ran ubuntu live cd and copy file "xorg.conf" from /etc/X11 and replaced the old one. (for do that, you must have root authorized.)

after replaced it, the resolution was better and the position of screen come back at the middle of the monitor except log in screen. it's still shift left for a littel. but when i enabled desktop effect, it became normal everything. i don't know why. but now i have normal screen ubuntu.

and the last one problem that i found is i can't use thai on my keyboard. i will solve it soon. when i can solve it, i will report agian.

Monday, March 24, 2008

try to config x server and make bad result.

hi. i didn't write this blog for long time but now i come back to write it.

i'm reading book for linux newbie. it's very old book and i bought it when it on sale. after read it, i tried to config x server from example from the book. in this book present 3 commands(programs) to config x server. these commands is
  1. XF86Setup
  2. Xconfigurator
  3. xf86config
but my ubuntu(7.10 - gutsy gibbon) don't have these. so i search the google for the way to config it. and found very long command that is
  • dpkg-reconfigure xserver-xorg
so i used it by don't have knowledge about this command. i don't think that it is text mode. oh. but that time i think that i will always enter and enter to make it finished quickly and return normally. but i thought wrong. when finised it, i found that my screen is shift left for a little and less resolution!!! i'm make exclamation. i don't know to restore it.

i tried to config it for many time and used another choice for brought it normally. but until now i can't do it yet. how should i do? i don't have knowledge about x server before. but i think if config save value in file, i will find the normal config file and replace the old. but how can i find normal file. i don't know it. maybe i will copy it from live cd. i don't know this will work? but i must try or reinstall ubuntu again.

if i'm not lazy, i will write the result in this blog. see you

Tuesday, January 15, 2008

ubuntu again with problems

i had installed ubuntu on my computer again. it was third times that i installed it. why i installed it again? i think my old ubuntu is dirty so i think i will install it again for new version, 7.10 (my old one is 7.04).

after i had finised it, i restart computer and found the problem. "video mode not supported". and it not boot my new ubuntu. i searched the internet and think that the new ubuntu don't support my vga card. but when i press ctrl + atl + f1 for use command line, it can boot my ubuntu and can use it regularly. so i tryed to install nvidia vga driver.
  • sudo apt-get install nvidia-glx
but it couldn't install. why? why? why? i didn't know. so i went to look my repository(sourecs.list) with "software sources" application and i found that nothing was selected. so i selected it all. now i can use "apt-get install".

but i don't sure that command "sudo apt-get install nvidia-glx" is correct so i go to system -> prefernces -> apperance -> visual effects, i remember that if i choose to use visual effects and my computer doesn't have vga driver it will install automatically.

so i have vga driver. i restart my computer with happy but it still have same problem, "video mode not supported" : (. and i had no idea how to fix this problem so i decided to post my problem on ubuntuclub and pantip

next day, there was man answered my question(thank you very much). solution is that i must change /etc/usplash.conf to become 1024x768 and add "vga=791" after kernel in /boot/grub/menu.lst and use command
  • sudo update-initramfs -u -k `uname -r`
so my problem was solved. and i can use ubuntu happily