Sunday, May 10, 2009

Fix mysql database permission on OSX

just run

chmod -Rf 775 *

it will fix the mysql db permission
Compiling bind dlz
=============

I got problem when compiling bind with dlz + openssl

./configure --prefix=/usr/local/bind-zs/ --with-openssl=/usr/local/bind-zs/ --enable-threads=no --with-dlz-mysql=/Applicatioampp/xamppfiles/

Its return these errors during make:

gcc -g -O2 -I/usr/include/libxml2 -o named \
builtin.o client.o config.o control.o controlconf.o interfacemgr.o listenlist.o log.o logconf.o main.o notify.o query.o server.o sortlist.o statschannel.o tkeyconf.o tsigconf.o update.o xfrout.o zoneconf.o lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o dlz_drivers.o sdlz_helper.o dlz_mysql_driver.o unix/os.o ../../lib/lwres/liblwres.a ../../lib/dns/libdns.a /usr/local/bind-zs//lib/libcrypto.a ../../lib/bind9/libbind9.a ../../lib/isccfg/libisccfg.a ../../lib/isccc/libisccc.a ../../lib/isc/libisc.a -L/Applications/xampp/xamppfiles//lib/mysql -lmysqlclient -lz -lcrypt -lm -L/usr/lib -lxml2 -lz -lpthread -licucore -lm
ld: library not found for -lcrypt
collect2: ld returned 1 exit status
make[2]: *** [named] Error 1
make[1]: *** [subdirs] Error 1
make: *** [subdirs] Error 1


The solution, compile with this command first:

./configure --prefix=/usr/local/bind-zs/ --with-openssl=/usr/local/bind-zs/ --enable-threads=no

without --with-dlz-mysql=/Applicatioampp/xamppfiles/

do make

than

reconfigure with

./configure --prefix=/usr/local/bind-zs/ --with-openssl=/usr/local/bind-zs/ --enable-threads=no --with-dlz-mysql=/Applicatioampp/xamppfiles/

rgds
Amir Haris@domainregistry.my

Thursday, April 23, 2009

I already test the usb random number generator Araneus Alea I with OSX (unix bsd).

After compiling the i found errors as below:

root:/Users/amir/linux$ make
cc randomfile.c -lusb -o randomfile
randomfile.c:16:17: error: usb.h: No such file or directory
randomfile.c: In function 'main':
randomfile.c:74: error: 'usb_busses' undeclared (first use in this function)
randomfile.c:74: error: (Each undeclared identifier is reported only once
randomfile.c:74: error: for each function it appears in.)
randomfile.c:74: error: dereferencing pointer to incomplete type
randomfile.c:75: error: dereferencing pointer to incomplete type
randomfile.c:75: error: dereferencing pointer to incomplete type
randomfile.c:76: error: dereferencing pointer to incomplete type
randomfile.c:77: error: dereferencing pointer to incomplete type
randomfile.c:84: warning: assignment makes pointer from integer without a cast
make: *** [randomfile] Error 1

I need to configure libusb to generate usb.h and other related header files.

I edit the Makefile and alter the parameter as below:
randomfile: randomfile.c
cc -I/opt/local/include -L/opt/local/lib \
randomfile.c -lusb -o randomfile

After that make it again:

cc -I/opt/local/include -L/opt/local/lib \
randomfile.c -lusb -o randomfile
randomfile.c: In function 'main':
randomfile.c:99: warning: pointer targets in passing argument 3 of 'usb_bulk_read' differ in signedness

Phew, ignore the error. Basically its no error, but warning. After successcully compile the .c file, one binary file generated called randomfile

Let test the tools:

./randomfile 1000 > random.hex

one file generated random.hex with these:

4968550d1a5de37609488a881d8252
1bbb383cc5505e8fff079bf9544f810da2a91e949c1980e70609de23d7296d0fdf51c602c08cba2e2badc91a3584516f40bfdc22c63776b1526be3ee6efe04
104671ad00e778778e652943d2bbb6969bce1fbfa72d68d3418e0ff6e331c105f6363bfa7db2c2d37f38000e31ccd332f646586f5f94d0ec87c050febe143f1e3403ed3133458950354f271475b6
ecde36645bfd64d4f9e9fdd86a2ebe2c317604bc8c10932f7fb18818443e110fd7411a20a0a474065f6b87ea3da8aace8879c2a036f18dc1562084f509c432e7aa550a433743f36632c51af83264
9569cff8b3ab2176763d72ae3b5a4086eff4066c3f006a3cfe20597e5d69825f34a25a0a56c1535582dc4ad7e9645b39b70f59e39514a27cc07fb9695d10f3bc11d82be107857691ce9605d0b1f0
c7098540611067253ea2cef2ef047594ca57b5aeda1a2e14d5586af6f1833bc7b8c4b7567029817b51bdc08467dc5ae0d35d91f449ad9da481b4a901e8d1500156e8a8541085773588694d8e4339
de635f5af7176f49cabe700ef516a2d5c7b7446e85c0736da35b9bd2eab4ef5817d5a3e17bb8ca0f1af89a27c2b45e229f3797561424fa69aba463864aafc1a68c5f3e6631b262ab613a6af615d4
990ced11a45f316e89c1c5d76210a01dfa93a9ebea3c447176757b43032abab7963a101dc0a8b668b173ae69e3c92f6d2ca0e6748b9e43e9e33953877813b8ff30989e5bfad3df86790ab49441ed
1ff02581a88b769af61f453d8055dd565c9279d4bd040b6e1d903461c39fe8c5c65f9c5d160245351f8f63c346dc0350a8a35a99e4a7d9e0b7a16f13631896f394533895fbc2412f5917642377bf
9ee741a231b796a3455d38b539089448cdac66c538f751f44edc28b64a70e5fbe0539a3f65877394c81298d194881f964858e8c6ac220e69cc1a057ebf7d6aaa3e4abe2f786151ca77a7c9ebfe3e
8a56a6e2fbe33e981905ef071f564157318a9304b3b42d4cdf1a8bf5f55bc7363f0000690fc7b43b829891d4fa31a9ace36701f92b3ddbd4342937d2376c9e74fcb6b8e0221e9e6d5b6bfce1de7a
d6a1b398e8b90ae4907d7bca30e1a33bed715573074325107d24d8dda122c631d4f7eaf16571c6ee30a18a62abfbbcfd8311229671e4fac2341e9a00526c39576967349ae2238f170f1647d88851
ae691d968c1acaac4997c124bf24e33ccaa248506f901003d5e549c01b16d9ac0a4e330d2f6f767ffabb2a488f294e7698f4c62d7995f766ef2efdff1eff96eaecb27b22eddbcb7a61af4cb2df4d
b19f6f91b71003bbe9ff3316300bb76bcf679e02dfd9b3aa37c2720f9bb51275ca157faef5e0302748ebb0d34f7d5573343dd23b5cdce514becf26bc8f862723

rgds
Amir Haris Ahmad

Monday, April 20, 2009



The simplest way to integrate the Alea I with dnssec-keygen is to use the "randomfile" program which is provided as C source on the Alea I driver CD, and pipe its output into the standard input of the dnssec-keygen program. For example, this command will generate a 2048-bit RSA zone key for the "my" TLD:

sudo randomfile -b | dnssec-keygen -r /dev/fd/0 -a RSASHA1 -b 2048 my.

Here, the "-b" causes the randomfile program to output the randomness in binary form (which is what dnssec-keygen expects), and the "-r /dev/fd/0" causes dnssec-keygen to read randomness from standard input instead of /dev/random. Note that the randomfile program needs to be run as root unless you set up specific udev rules to give non-root users permission to access the Alea I USB device.

amir@domainregistry.my

Friday, April 17, 2009

After a while:

Next week(24 April 2009 until 1 May 2009) I will be in Sabah & Sarawak. I will represent MyNIC BHD. as presenter to talk about Domain Name System Security Extention (DNSSEC). The audiences will be government and educational institution. See you all there. For more info please visit http://rnd.domainregistry.my

Monday, April 13, 2009

Command to check duplicate entries in mysql

SELECT DISTINCT(cource_code) AS cource, COUNT(cource_code) AS Count FROM kursus_psmb GROUP BY cource_code HAVING Count > 1

Thursday, April 09, 2009

Remove all .svn folders in a directory

find
. -name ".svn" -type d -exec rm -rf {} \;

Sunday, March 08, 2009

Installing Berkeley DB on Debian.
========================

1. wget http://freshmeat.net/redir/berkeleydb/694/url_tgz/db-4.7.25.tar.gz
2. tar vxfz db-4.7.25.tar.gz;cd db-4.7.25/build_unix
3. ../dist/configure --enable-cxx --enable-diagnostics --prefix=/usr/local
4. Install perl BerkeleyDB from CPAN.

Testing by using perl Code
==================
use strict ;
use BerkeleyDB ;

my $filename = "fruit" ;
unlink $filename ;
my $db = new BerkeleyDB::Hash
-Filename => $filename,
-Flags => DB_CREATE
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;

# Add a few key/value pairs to the file
$db->db_put("apple", "red") ;
$db->db_put("orange", "orange") ;
$db->db_put("banana", "yellow") ;
$db->db_put("tomato", "red") ;

# Check for existence of a key
print "Banana Exists\n\n" if $db->db_get("banana", $v) == 0;

# Delete a key/value pair.
$db->db_del("apple") ;

# print the contents of the file
my ($k, $v) = ("", "") ;
my $cursor = $db->db_cursor() ;
while ($cursor->c_get($k, $v, DB_NEXT) == 0)
{ print "$k -> $v\n" }

undef $cursor ;
undef $db ;

Saturday, February 21, 2009

2009 Certification Planning

I'm planning to take:
1. CISSP Certified Information Systems Security Professional
2. GIAC Certified Unix Security Adminstrator (GCUX)

As now I'm enrolling in Master programmer at UiTM. Master Sc.(Computer Networking).

Hope everything goes fine.

rgds


My working area

Tuesday, January 06, 2009

Failed test: 1
Non-zero exit status: 255
Parse errors: Bad plan. You planned 2 tests but ran 1.
Files=14, Tests=60, 1 wallclock secs ( 0.11 usr 0.02 sys + 1.42 cusr 0.17 csys = 1.72 CPU)
Result: FAIL
Failed 12/14 test programs. 27/60 subtests failed.
make: *** [test_dynamic] Error 255

Lockfile removed.
plateau:/home/amir/Net-DNS-SEC-0.15# perl Makefile.PL
Warning: prerequisite Crypt::OpenSSL::Bignum 0.03 not found.
Warning: prerequisite Crypt::OpenSSL::DSA 0.1 not found.
Warning: prerequisite Crypt::OpenSSL::RSA 0.19 not found.
Writing Makefile for Net::DNS::SEC

Solution for debian
===================

apt-get install build-essential
apt-get install libc6-dev
apt-get install libssl-dev

cpan[1]> install Crypt::OpenSSL::Bignum Crypt::OpenSSL::DSA Crypt::OpenSSL::RSA

Sunday, December 28, 2008

Perlcc error
============

After running perlcc on my debian box. I got these errors:

Note (probably harmless): No library found for -lperl
pccXqkni.c: In function âperl_init_aaaaâ:
pccXqkni.c:421: warning: this decimal constant is unsigned only in ISO C90
/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status

To solve the problem.

simply

apt-get install libperl-dev


Net::DNS::SEC - DNSSEC extensions to Net::DNS
=============================================

Use CPAN to solve the dependencies prob.
Crypt::OpenSSL::Bignum
...

Solve the vrfyerrstr problem.

For further question email amir@localhost.my