Monday, October 27, 2008

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

I'm currently using lampp-1.6.6 as my php/mysql server in my ubuntu 7.10.

It's very easy to use.. especially when I want to use mysql database server. I just go to their phpmyadmin to create database, import, view, insert, etc..

But the lack is when I want to using import facilities..it has maximum file size to uploaded, that is 2,048 KiB

So, what I must to do when I have to import more that 2MB file size is using mysql from terminal/console..

It seems simply to just use this command:
# mysql -u [username] -p [password] [database_to_restore] < [backupfile]

but it always returned this error:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

what's wrong...??

I search in google to find out if there anyone have the same problem like I have...

yes there are so many people have that problem..


I try one by one solution they recommended but it still fail..

Then, I go to directory /opt/lampp-1.6.6/bin
then I repeat my command one more time.. but it still failed..

Then I change the command just to add ./ that is:
# ./mysql -u [username] -p [password] [database_to_restore] < [backupfile]

then it worked???

My analysis is when I type command:
# mysql -u [username] -p [password] [database_to_restore] < [backupfile]

without "./" it will refer to default mysql server which it not currently installed.

SO, of course it will failed...

Bu when I added "./" and I do that in lampp directory it will refering to mysql in lampp..

Hmm I don't know yet how to make mysql in lampp being default mysql database server

Saturday, October 18, 2008

Sony Ericsson w200i GPRS Telkomsel Modem in Ubuntu

Basically I just want to maximize the functionality of my cell phone Sony Ericsson w200i which I bought in last March. Yes I have that pc suite for windows OS. But unfortunately, i'm using Ubuntu in my (office) laptop.
SO, I asked to Mr Google and I got this blog
In my first trial, it tutorial could'nt worked for my cell phone. I don't know why, maybe I just make a mistake in entry the phone number or etc.
Then I remember that my friend had ever successfully using my cell phone as modem in a PC Ubuntu. But, I just forgot to asked him how to do that.
Then I try to find in his blog and finally I got a complete but simple step to do that.

Here, I rewrite its steps:
1. Plug the USB Cable of your Sony Ericsson w200i (sew200i) and choose phone mode
2. Of course make sure that your phone still credit on it.
3. Make sure that phone detected in your PC with doing this command in your terminal

mawaddah@mawaddah-laptop:~$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 002 Device 003: ID 062a:0000 Creative Labs Optical Mouse
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0fce:d090 Sony Ericsson Mobile Communications AB
Bus 001 Device 001: ID 0000:0000


You can see that device "Sony Ericsson Mobile Communications AB" has been connected

4. Do automatically configuration with this command

mawaddah@mawaddah-laptop:~$ sudo wvdialconf


which will resulting in last line like this:

Found an USB modem on /dev/ttyACM0.
Modem configuration written to /etc/wvdial.conf.
ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyACM1: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"


5. Command in no 4 will also creating configuration file wvdial.conf in /etc/
Adjusting that file to needs your gprs spesification.
mawaddah@mawaddah-laptop:~$ sudo vi /etc/wvdial.conf

For telkomsel use this configuration:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Phone = *99#
Modem = /dev/ttyACM0
Username = wap
Password = wap123
Baud = 460800

Just make sure you enter the username, password and phone with the valid configuration.


6. Dialing with this command
mawaddah@mawaddah-laptop:~$ sudo wvdial

with that command will resulting this line in the end:
WvDial<*1>: local IP address 114.121.151.189
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: remote IP address 10.64.64.64
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: primary DNS address 202.3.208.10
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: secondary DNS address 202.3.210.10
WvDial<*1>: pppd: ��[06][08]��[06][08]


7. Then your cell phone will give you information that you have been connected to internet.
Just try to test with doing ping
mawaddah@mawaddah-laptop:~$ ping www.google.com
PING www.l.google.com (74.125.95.104) 56(84) bytes of data.
64 bytes from iw-in-f104.google.com (74.125.95.104): icmp_seq=1 ttl=242 time=774 ms
64 bytes from iw-in-f104.google.com (74.125.95.104): icmp_seq=2 ttl=242 time=853 ms
64 bytes from iw-in-f104.google.com (74.125.95.104): icmp_seq=3 ttl=242 time=777 ms
64 bytes from iw-in-f104.google.com (74.125.95.104): icmp_seq=4 ttl=242 time=873 ms



Yeahh... it worked...
But unfortunately tariff of telkomsel gprs still expensive Rp.5/KB
So, when I just open this blog, my friend blog, YM, and my office webmail in just shorttime. It has use Rp.11.385 for 2.277KB...
I'm bankrupt..... :((

Ohyaa, btw I try one more time the steps ini this blog.
Then it worked...

So, thanks for this blog and my friend

Tuesday, October 14, 2008

enable remote access PostgreSQL

In default, for security reason, postgreSQL doesn't allow to be accessed remoted.
But, we can configure it so it can be accessed remotely.

Below is the step to do that with follow the steps I done with postgreSQL8.2 in Ubuntu OS
1. Login as postgres
# su - postgres
2. edit configuration file (pg_hba.conf)
# vi /etc/postgresql/8.2/main/pg_hba.conf
append below line to that file:
host all all 192.168.1.0/24 trust

where 192.168.1.0 is IP configuration in your network
3. edit configuration file: postgresql.conf to allow TCP/IP socket
# vi /etc/postgresql/8.2/main/postgresql.conf
find line:
listen_addresses='localhost'
and change into
:
listen_addresses='*'


4. restart postgreSQl with:
# /etc/init.d/postgresql-8.2 restart

Finisih

openbravo

Convert ogg file to mp3

In last friday, I bought an original CD "Laskar Pelangi"... for the first time I bought with my own money !!!! yippi..

Then the problem is the files in that CD can't copied easily like I bought an pirated cd. It can use software "Alcohol" in windows OS..
But because I used "ubuntu" I use sound juicer to copied all the content of CD. And it worked.

But, it produced files with "ogg" extension. not with "mp3" extension which familiar with my ears. and it not suitable for some music tools.

So, I asked my friend how to convert "ogg" to "mp3". Then I got an answer that is used software "ffmpeg"

I do this steps:
mawaddah@mawaddah-laptop# sudo apt-get install ffmpeg
mawaddah@mawaddah-laptop# ffmpeg -i fileinogg.ogg -ab 128 fileinoggtomp3.mp3

and it worked.. =D