Pages

Google Ads

Saturday, December 06, 2008

Address already in use:8009

If when you are running you jboss application you see in the log the message:

Address already in use:8009

It is probably because the address is in use.

You're already running an instance of your servlet engine, or another service is running on its port. Make sure the other service is fully stopped before launching another one.

In my case it happened when I started Pentaho the message was:

Protocol handler initialization failed: java.net.BindException: Address already in use:8009

To solve it:

# ps -a

It will show something like that:

caio@coruja-mobile:~$ ps -a
PID TTY TIME CMD
8345 pts/0 00:00:00 su
8370 pts/0 00:00:00 bash
21804 pts/0 00:00:00 sh
21806 pts/0 00:00:00 sh
21812 pts/0 00:02:48 java
28213 pts/2 00:00:00 ps
caio@coruja-mobile:~$

So kill the java process

# kill -9 21812

If it does not work try:

# ps -ef | grep tomcat

In my case my wmware-server was using port 8009 because the 2.0 version is a web-based version and it uses tomcat.

See the process and kill them all.

To see if the port is still opened use the command:

# nmap your_computer_ip

That's it!!! It worked for me.

MySQL Backup and Restore

Restoring a MySQL Database using command line:

mysql -u user_name -p database_name < file_mysql.sql

Backup a MySQL Database using command line:

mysqldump -u user_name -p database_name > file_mysql.sql

Installing PostgreSQL and PGAdminIII on Ubuntu Server or Desktop

PostgreSQL is a good open source database so you probably would like to install it on your Ubuntu Server or Desktop.

Folow the steps and enjoy it:

$ sudo apt-get install postgresql postgresql-client postgresql-contrib
$ sudo apt-get install pgadmin3

This installs the database server/client, some extra utility scripts and the pgAdmin GUI application for working with the database.

Now we need to reset the password for the ‘postgres’ admin account for the server, so we can use this for all of the system administration tasks. Type the following at the command-line (substitute in the password you want to use for your administrator account):

$ sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD 'password';
template1=# \q

That alters the password for within the database, now we need to do the same for the unix user ‘postgres’:

$ sudo passwd -d postgres
$ sudo su postgres -c passwd

Now enter the same password that you used previously.

Then, from here on in we can use both pgAdmin and command-line access (as the postgres user) to run the database server. But before you jump into pgAdmin we should set-up the PostgreSQL admin pack that enables better logging and monitoring within pgAdmin. Run the following at the command-line:

$ sudo su postgres -c psql < /usr/share/postgresql/8.2/contrib/adminpack.sql

Finally, we need to open up the server so that we can access and use it remotely - unless you only want to access the database on the local machine. To do this, first, we need to edit the postgresql.conf file:

$ sudo gedit /etc/postgresql/8.2/main/postgresql.conf

Now, to edit a couple of lines in the ‘Connections and Authentication’ section…

Change the line:

#listen_addresses = 'localhost'

to

listen_addresses = '*'

and also change the line:

#password_encryption = on

to

password_encryption = on

Then save the file and close gedit.

Now for the final step, we must define who can access the server. This is all done using the pg_hba.conf file.

$ sudo gedit /etc/postgresql/8.2/main/pg_hba.conf

Comment out, or delete the current contents of the file, then add this text to the bottom of the file:

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database
# super user can access the database using some other method.
# Noninteractive
# access to all databases is required during automatic maintenance
# (autovacuum, daily cronjob, replication, and similar tasks).
#
# Database administrative login by UNIX sockets
local all postgres ident sameuser
# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5

# Connections for all PCs on the subnet
#
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all [ip address] [subnet mask] md5

and in the last line, add in your subnet mask (i.e. 255.255.255.0) and the IP address of the machine that you would like to access your server (i.e. 138.250.192.115). However, if you would like to enable access to a range of IP addresses, just substitute the last number for a zero and all machines within that range will be allowed access (i.e. 138.250.192.0 would allow all machines with an IP address 138.250.192.x to use the database server).

That’s it, now all you have to do is restart the server:

$ sudo /etc/init.d/postgresql-8.2 restart

Friday, November 14, 2008

Ubuntu Theme like Windows Vista, but much better...

Would like to have your Ubuntu ( a Linux System) running a Theme like Windows Vista?

If yes, click on the link below:

http://xibex.blogspot.com/2008/08/extra-ubuntu-themes-with-emerald-theme.html

Some good terminal commands to MySQL

Some good terminal commands to MySQL are:

Type on terminal to:

Change root password:
/usr/bin/mysqladmin -u root password "new_password"

Log without password
# mysql

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

That shows that mysql does not allow access as root without password.

If you log without a password it is good to put a password, use the same command to change root password.

Log with root user
# mysql -u root -p

Show databases
# show databases;

Choose a database
# use name_of_your_database;

Show tables;
# show tables;

Show MySQL users;
# select * from mysql.user;

Run a script
# source your_script.sql;

Give all privilege to a user
# grant all privileges on *.* to 'user'@localhost identified by 'your_password' WITH GRANT OPTION;

# flush privileges;

More infos visit http://www.mysql.com/

A good step by step Ubuntu 8.10 tutorial

Below there is a link to a step by step tutorial about installing Ubuntu 8.10, the author called it as "The Perfect Desktop - Ubuntu 8.10 (Intrepid Ibex)".

I think that's a good tutorial for someone who is starting to use Ubuntu and you can use it to install Ubuntu 8.10 without having problems, of course you do not have to install all the programs he likes but I think that a lot of programs he likes is good to have on a linux desktop.

Have fun!!!

http://howtoforge.com/the-perfect-desktop-ubuntu-8.10

Quais são os 10 profissionais de TI mais procurados pelas empresas

Para os que estão pensando em mudar de emprego ou área ou até mesmo para quem apenas deseja saber quais são os 10 profissionais de TI mais procurados pelas empresas veja o link abaixo:


http://info.abril.com.br/professional/carreira/quais-sao-os-10-profissionais.shtml

Thursday, November 13, 2008

How to convert DivX/XviD/MPEG to DVD with menu using manDVD

Hi guys,

ManDVD is a tool for generating video DVDs and it is really good.

If you want to know about "How to convert DivX/XviD/MPEG to DVD with menu using manDVD" please read the blog below.

http://www.dvd-guides.com/content/view/208/59/

Convert .rpm files to .deb files

Hello guys,

Not everytime we will find programs .deb, so if it happened to you and they have .rpm you can convert it to .deb.

It is easy and it works.

Install Alien ( The program that will convert to deb)
$ sudo apt-get install alien

Convert to .deb file:
$ sudo alien --scripts program_name.rpm

Install .deb file:
$ sudo dpkg -i <.deb file generated>