Eager to Code, Enjoy to Debug ~ Embark into Each Stage with Your Heart

Configuring MySQL without Password on Ubuntu

Posted by: Chyne on: November 3, 2009

Everytime when I access to mysql database that is installed in my laptop, I need to perform the following command in order to get the access:

sudo mysql -hlocalhost -ppassword

I feel frustrated and tedious to do that everytime when I need to access to the database. If I try it with the command ‘mysql’, I will get the following error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Finally, I got the trick and found the solution from the following blog:

Solutions

  1. Edit the my.cnf located in /etc/mysql directory (If you don’t know where it locates, you can perform a command: locate my.cnf):

  2. # sudo gedit /etc/mysql/my.cnf

  3. Add the following lines into the file:
  4. [mysql]
    #no-auto-rehash # faster start of mysql but no tab completition
    user=root
    password=password
    [mysqladmin]
    user=root
    password=password

    Note: If you wish to know which user that you are going to add on, you can follow the following steps:-

    1) Access to the mysql database (#sudo mysql -hlocalhost -ppassword)
    2) Run the command: use mysql
    3) Perform the sql query: select * from user;
    You can check the user/username that you want to add based from the ‘user’ table.

  5. After adding those lines into the file, whenever you just type the command ‘mysql’, you can access the database right away.

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 125
Server version: 5.0.75-0ubuntu10.2 (Ubuntu)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

Note: It’s not recommended if you are considering about security issue.

Installing Java on Ubuntu

Posted by: Chyne on: November 2, 2009

Some commands that you need to know during installing Java on Linux environment:

1) Get the installation package from this command:

sudo apt-get install sun-java-6-jdk

2) Check java version

java -version

3) Check location of installed jdk

sudo update-java-alternatives -l

4)Set default java

sudo update -java-alternatives -s java-6-sun

5) Set JAVA_HOME based on location

export JAVA_HOME=/usr/lib/jvm/java-6-sun

6) Set all the environment path in /etc/environment

JAVA_HOME=/usr/lib/jvm/java

7) Set in the /etc/bash.bashrc

JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

8 ) Check the environment path

env|grep PATH

If possible, requires restart the pc.

After performing an update in Firefox, whatever searches that I tried in google will shows popup with the following error message:

ASSERT: *** Search: _installLocation: engine has no file!
Stack Trace:
0:ENSURE_WARN(false,_installLocation: engine has no file!,2147500037)
1:()
2:()
3:()
4:epsGetAttr([object Object],alias)
5:()
6:SRCH_SVC_getEngineByAlias(http://www.google.com.au/search?q=how+to+include+user+as+a+root+in+Ubuntu%3F&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a)
7:getEngineByAlias(http://www.google.com.au/search?q=how+to+include+user+as+a+root+in+Ubuntu%3F&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a)
8:getShortcutOrURI(http://www.google.com.au/search?q=how+to+include+user+as+a+root+in+Ubuntu%3F&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a,[object Object])
9:canonizeUrl(null,[object Object])
10:handleURLBarCommand(null)
11:anonymous(textentered,null)
12:fireEvent(textentered,null)
13:onTextEntered()
14:handleEnter(true)
15:onPopupClick([object MouseEvent])
16:onxblmouseup([object MouseEvent])

Affect
Whatever URL links and pages will not be able to opened up and will be prompted with a pop-up that consists of the errors.

Root Cause of the Problem
This issue occurs when you already perform an update or upgrade in Firefox and you didn’t restart the browser.

Solution
In order to resolve this problem, you need to restart the Firefox browser to get rid of the error.

Further Research

Fixing Firefox ASSERT: *** Search: _installLocation: engine has no file!

Tags:

Browsing History Defines Your Gender?

Posted by: Chyne on: October 6, 2009

I just remembered that I had read an interesting site few months ago that uses Javascript to guess the user’s gender based on the browser URL history.

Although the idea sounds interesting but the thing that more attracts my interest is how to make it happens. The author has done a research for the most visited sites based from the poll and each site will be given a ratio of male and female users.

This is the result from the analysis for my browsing history (nothing to hide :P )

Likelihood of you being FEMALE is 72%
Likelihood of you being MALE is 28%

Site Male-Female Ratio
yahoo.com 0.9
youtube.com 1
wordpress.com 0.98
download.com 1.27
hotmail.com 0.83
popcap.com 0.41

I’m wondering is there any Javascript to detect someone’s personality or even age based on browsing history and I really interested about the calculations for the estimation. So, have fun with this site and check how accurate is your “gender” ;)

Installation of Subversion 1.6.5 on Ubuntu 8.10

Posted by: Chyne on: October 1, 2009

In order to install Subversion on Ubuntu 8.10, you will need to perform this command:

sudo apt-get install subversion

The default version of the Subversion at the current moment that you will get installed is Subversion 1.5. You can check the version with this command:

svn --version

And it will display the following message:

svn, version 1.5.1 (r32289)
compiled Aug 7 2009, 01:15:13

Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles ‘http’ scheme
- handles ‘https’ scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles ’svn’ scheme
* ra_local : Module for accessing a repository on local disk.
- handles ‘file’ scheme

However, if you wish to install the latest Subversion (1.6.5), there are few steps that need to be done:
1. Add the following lines in the sources.list which is located inside the /etc/apt directory.

deb http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu intrepid main
deb-src http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu intrepid main

You can open the file with any editor or with the command:

sudo gedit /etc/apt/sources.list

2. In order to start installing and using software from a Personal Package Archive (PPA), you need to add the key signature so that you can tell Ubuntu where to find the PPA and how to verify the authenticity of its software.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 413576CB

3. Do an update to get the sources:

sudo apt-get update

4. Reinstall or upgrade the installed subversion

sudo apt-get --reinstall install subversion

5. Check the latest version with the command: svn –version

svn, version 1.6.5 (r38866)
compiled Sep 2 2009, 05:15:17

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles ‘http’ scheme
- handles ‘https’ scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles ’svn’ scheme
* ra_local : Module for accessing a repository on local disk.
- handles ‘file’ scheme

As specified in the launchpad page that discussed about installing Subversion in different Ubuntu version, you need to choose the correct source list entries that suitable for your Ubuntu version else you will encounter broken packages error as bellow (which I had configured with Jaunty that should be work for Ubuntu 9.0.4 and not Ubuntu 8.10):

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
subversion: Depends: libsvn1 (= 1.6.5dfsg-1ubuntu1~jaunty1~andersk1) but 1.5.1dfsg1-1ubuntu2.1 is to be installed
Depends: libsqlite3-0 (>= 3.6.10) but 3.5.9-3ubuntu1 is to be installed
E: Broken packages

References:

Friday’s Java Snack


In Java, "thread" means:

  • An instance of class java.lang.Thread
  • A thread of execution


An instance of Thread is just an object that has variables and methods, and lives and dies on the heap.
 
A thread of execution is an individual process that has its own call stack (one thread per call stack).

 

November 2009
M T W T F S S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Archives


  • Polprav: Hello from Russia! Can I quote a post in your blog with the link to you?
  • Alex: Huge Thanks! This bug has annoyed me for a long time.
  • Donnieboy: Just wanted to drop you a line to say, I enjoy reading your site. I thought about starting a blog myself but don't have the time. Oh well maybe one

StatCounter

free hit counters