Thursday, April 29, 2010

My guide on how did I able to use autoconf

In my experience, it seems that autoconf  needs and

How did I do it, I run
autoreconf -i -v -f
then I did run
to create then afterwards, I was able to run

./configure successfully.

Wednesday, April 28, 2010

Scons Add Prefix Before Install

For my knowledge and guide,
sudo scons prefix=/home/hachico/local -j 4 sdl=1 install
then this will put the libraries, docs, and bin accordingly into that drectory.

Some CentOS/RHEL/Fedora rpm repositories for yum that would be helpful

I got the repository from remi for my CentOS. By issuing the following commands:
su -
cd /etc/yum.repos.d

 For webtatic,
rpm –import
wget -P /etc/yum.repos.d/
 where I got my latest versions of PHP.

For EPEL and remi,
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

Some warned to discourage using the RPMForge because of some conflict with the repository under EPEL. EPEL is known for the repository project for Fedora.

For RPMForge,
rpm -Uhv

This repos might help you fixing problems on looking for available repository packages.
This repositories are well applied for RHEL and CentOS as well as Fedora.

Links that might be useful also on configuring or getting this repositories are

Tuesday, April 27, 2010

tesseract compile with libtiff

I just stumbled upon with this tesseract where I wasn't able to figure out what's the problem with libtiff since my libtiff, during configure, always says disabled, so I did able to fix it thru
./configure --prefix=/usr --with-libtiff=/usr/lib
I tried to let --with-libtiff only, not giving the specific path, but it fails. So specifying the right path, makes the problem fixed.

The current version of 2.04 of tesseract, is what I am compiling for this stuff. My libtiff is, indeed, updated using the current version from

Remember to have the required librarires installed, and these are


which all of them are separate libraries that you need to install. Leptonica does image analysis and image processing, which is really cool. tesseract use this as it helps them to OCR images.

Hope this helps!

Awk and Bash: Print Linux/Unix User Accounts

There are ways how to do this:
awk -F':' '{ print $1 "\t"  $3 }' /etc/passwd
That would  print the username and the UID. You can also add the sort command at the end like
awk -F':' '{ print $1 "\t"  $3 }' /etc/passwd | sort
and this will sort alphabetically.

To add filter in the result, you can
awk -F':' '$1 == "hachiko" { print $1 "\t"  $3 }' /etc/passwd | sort
where hachiko is a username you wanted to print with its UID.

Hope this helps!

Monday, April 26, 2010

MySQL: Create user and grant a user

To create a user, do

create user 'myuser' identified by 'iampassword';

To grant a user, do
grant select, alter, alter routine, create, create routine, create temporary tables, create user, create view, delete, drop, execute, file, grant option, index, insert, lock tables, process, references, reload, replication client,replication slave, show databases, show view, update, usage on *.* TO 'ipyrusc'@'localhost';

The strings "select, lock, alter, alter routine, etc..." are privileges that you can select to what privilige you want the user created to have. Note that the 'myuser' is specified when granting the priviliges.

To assure this user exist, you can do query by
select user,host from mysql.user;
to show the users of MySQL.

To know more about this, check the page about granting and adding a user at MySQL website.

Just a Quick Guide For iptables

For adding a chain entry:

    iptables -A INPUT -p tcp --dport 80 -j ACCEPT
    iptables -A INPUT -p tcp --dport 443 -j ACCEPT
    iptables -A INPUT -p tcp --dport 21 -j ACCEPT
    iptables -A INPUT -p tcp --dport 22 -j ACCEPT
    iptables -A INPUT -p tcp --dport 110 -j ACCEPT
    iptables -A INPUT -p tcp --dport 143 -j ACCEPT
    iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
    iptables -A INPUT -j DROP
    iptables -I INPUT 8 -p tcp --dport 9999 -j ACCEPT

First entry, adds port 80 (http) to be accepted, port 443 (https), port 21 (ftp), port 22 (ssh,scp, sftp), port 110 (pop3), port 143 (imap), port 3000 (custom set port for thin server--a ruby web server).

iptables -A INPUT -j DROP
 will drop everything that would connect to the server.

The last entry
iptables -I INPUT 8 -p tcp --dport 9999 -j ACCEPT
will insert into the list at the 8 row of the entry, this is useful when you will be setting a specific priority of filtering a port.

To delete an entry, you can do,
 iptables -D INPUT 2
 to delete the second row of the list, list can be viewed by issuing the command
iptables -L
 To flush all the result, you can do
iptables -F

To add a chain that would only be specific to port intervals, let say, ban all the port that goes from port 20 - port 80, you can execute or add
iptables -A INPUT -p tcp --dport 20:80 -m state --state NEW,ESTABLISHED -j REJECT

where --dport specifies the 20:80 (colon as the delimiter), and -m for extended match and may load extension (here the state), and --state for specifying the states (valid states are INVALID, NEW, ESTABLISHED), and -j to reject the attempt of opening a connection.

 To save your rules, you can execute
iptables-save > /etc/sysconfig/iptables
if your iptables config is in that directory path.

Sunday, April 25, 2010

CentOS "apxs" command not found

apxs is an Apachec extension tool.

I realize that this tool, is by default, not installed under CentOS (or perhaps even RedHat).
To fix this, just install it using yum by:

yum install httpd-devel.i386
where apxs is installed under "httpd-devel" package.

Hope this helps.