Virtualization

Step by step installing VirtualBox in Windows XP

vbox Step by step installing VirtualBox in Windows XPVirtualBox is another virtualization products for i386 family, from official site :

Presently, VirtualBox runs on Windows, Linux and Macintosh hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows 3.x, Linux (2.4 and 2.6), and OpenBSD.

If you get confuse what VirtualBox do, then you can think vmware or virtualpc, this software working like vmware and virtualpc. Hardware requirement for VirtualBox, you need :

  • Reasonably powerful x86 hardware. Any recent Intel or AMD processor should do.
  • Memory. Depending on what guest operating systems you want to run, you will need at least 512 MB of RAM (but probably more, and the more the better). Basically, you will need whatever your host operating system needs to run comfortably, plus the amount that the guest operating system needs. So, if you want to run Windows XP on Windows XP, you probably won’t enjoy the experience much with less than 1 GB of RAM. If you want to try out Windows Vista in a guest, it will refuse to install if it is given less than 512 MB RAM, so you’ll need that for the guest alone, plus the memory your operating system normally needs.
  • Hard disk space. While VirtualBox itself is very lean (a typical installation will only need about 30 MB of hard disk space), the virtual machines will require fairly huge files on disk to represent their own hard disk storage. So, to install Windows XP, for example, you will need a file that will easily grow to several GB in size.
  • A supported host operating system. Presently, we support 32-bit Windows (primarily XP) and many Linux distributions. Support for Mac OS X and 64-bit operating systems is currently in the works.
  • A supported guest operating system. Besides the user manual (see below), up-to-date information is available at “Status: Guest OSes“.

Today, I’ll show how to install VirtualBox in my Windows XP

1. Download latest release from VirtualBox site, put in any location followed by double click to start installation process.

 Step by step installing VirtualBox in Windows XP read more »

Cisco

Cisco simulator using dynamips

During waiting period for cisco router arrive in the lab, I’m looking for software which is able simulating cisco for student and myself like vmware that provide computer inside the computer.

I’m lucky to find very interesting software : Dynamips

From author site :

The goals of this emulator are mainly:

  • To be used as a training platform, with software used in real world. It would allow people to become more familiar with Cisco devices, Cisco being the world leader in networking technologies ;
  • Test and experiment the numerous and powerful features of Cisco IOS ;
  • Check quickly configurations to be deployed later on real routers.

Of course, this emulator cannot replace a real router: you should be able to get a performance of about 1 kpps (depending on your host machine), to be compared to the 100 kpps delivered by a NPE-100 (the oldest NPE model). So, it is simply a complementary tool to real labs for administrators of Cisco networks or people wanting to pass their CCNA/CCNP/CCIE exams.

great, this tool will guide me to learn cisco.

Then I found other usefull software : Dynagen

From author site :

Dynagen is a front-end for use with the Dynamips Cisco router emulator. It uses an INI-like configuration file to provision Dynamips emulator networks. It takes care of specifying the right port adapters, generating and matching up those pesky NIO descriptors, specifying bridges, frame-relay, ATM switches, etc. It also provides a management CLI for listing devices, suspending and reloading instances, determining and managing idle-pc values, performing packet captures, etc.

Available on the Downloads page is a Windows installer package that includes Dynamips and Dynagen. The only dependency is Winpcap 4.0.

Wow, this make learning process become easy.

Still in need for basic question :

How do I get started ?

Google very generous, guide me to this usefull site, video for beginner like me icon smile Cisco simulator using dynamips
BlindHog, provide many video tutorial, for cheap price you can get very detail video on specific subject, awesome site icon wink Cisco simulator using dynamips

Good enough for starting point, I’ll write my experience using this tool in this directory.

Cisco, I’m coming icon smile Cisco simulator using dynamips

Linux

Show php error with ini_set()

Even experience php programmer can make mistake, since most of them are typo php error message then become valuable resource for debugging.

By default, error message will show depend on error made, but in specific environment where tweaking in php.ini  has been made by system administrator. Such free hosting will do it for good.

With assumption that php_ini not included in list of “disable_function” then php_ini will help icon smile Show php error with ini set()

<?php
ini_set(‘error_reporting’, E_ALL);
ini_set(‘display_errors’, ‘On’);
ini_set(‘display_startup_errors’, ‘On’);

$first_name      = trim($_GET['first_name']);
echo $first_name;
?>

If there is no parse errror, the above enables “Notice: Undefined” error on screen.

If the code for an error the “Parse error” as follows, the error isn’t defined as should be

echo $first_name);
) will be error source, running it then you’ll get this error message

Parse error: parse error, unexpected ‘)’, expecting ‘,’ or ‘;’ in a.php on line 7

now, what you get for this ?
eho $first_name; // should be echo

parse error or …..

Blog PHP

Different days Auction Ads keyword with php

aa Different days Auction Ads keyword with phpIn my previous post about randomize keyword with php, shoemoney tell me that function already built in AA program, just use ; to separate your keywords icon smile Different days Auction Ads keyword with php I’m still research how sales made on daily basis, what people buy on Sunday, Tuesday till Sunday

The idea is pick good keywords and integrate it in AA code.

Here’s php script to do that :

  1.  
  2. <?php
  3. $day[]="laptop;gadget;notebook";// sunday
  4.  
  5. $day[]="books;flower;song;diet";// monday
  6.  
  7. $day[]="shoe;tie";// tuesday
  8.  
  9. $day[]="toy;video game";// wednesday
  10.  
  11. $day[]="golf;fishing";// thursday
  12.  
  13. $day[]="cd;dvd";// friday
  14.  
  15. $day[]="camera;webcam";// friday
  16.  
  17. $key2=rand(’0′,count($day));
  18. ?>
  19.  

at Auction Ads code :

auctionads_ad_kw = <?php echo $day[$key2];?>;
then you get different targeted keyword every day icon smile Different days Auction Ads keyword with php

Good keyword is relative, a few idea :

Cosa, has proven that keyword from ebay pop can increase the sales

Techtites, show how to make contextual Auction Ads keyword

Auction Ads blog, show some usefull link for drupal, wordpress and vbulletin integration.

PHP

Randomize your Auction Ads keyword with php

aa Randomize your Auction Ads keyword with phpAuction ads is simple program that display auction ads from ebay, live in your website

different from adsense, auction ads need specific keyword to display properly

I use simple php rand() function to help me randomize my auction ads keyword.

Here’s my code :

<?php

$keyword=array(‘computer’,'laptop’,'handphone’);

$key2=rand(’0′,count($keyword));

?>

For example :

read more »

Database

Insert time in mysql using now()

Simple way to insert time information in mysql is using now()

now() will automatically insert appropriate depends on type, let say we have field in mysql database in these format :

1. birth (date), now() will insert current date, ex: 2007-05-02

2. birth (datetime), now() will insert current date + current time, ex : 2007-05-2 22:54:30

3. birth (time), now() will insert only time information, ex : 22:54:30

this snippet will get same result with now()

$birth=date(‘Y’).’-’.date(‘m’).’-’.date(‘d’); // will be same as 2007-05-02

example in mysql command line :

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>cd c:\appserv\mysql\bin

C:\AppServ\mysql\bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.� Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.24-nt

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

mysql> create database test;
Query OK, 1 row affected (0.03 sec)

mysql> use test;
Database changed
read more »

Unix

cvs, cvsup, portsnap and csup

Progress in *BSD world is very fast, everyday patch released, program update etc

to get that update via internet FreeBSD provide a few tools :

  • cvs, not so familiar for beginner
  • cvsup, very famous in FreeBSD, can update ports, source even for backup purpose
  • portsnap, only for port update, in FreeBSD tree since 6.0
  • csup, cvsup alternative, already integrated in 6.2 tree, no need to install, compatible with cvsup

example for cvs :

cvs -z3 -d :pserver:anonymous@cvs.freesbie.org:/cvs co -P freesbie2

will fetch freesbie2 and located in current directory where command issued

example for cvsup :

cvsup -g -L2 ports-supfile -h cvsup12.freebsd.org

will update ports information

example for portsnap :

portsnap update

will update ports data, faster than portsnap extract

csup example :

cvsup -g -L2 stable-supfile -h cvsup12.freebsd.org

will update stable source

P.S :

make sure port 5999/tcp open for cvsup and csup

portsnap will use port 80

Linux

find your program with “whereis”

Many linux distro build nowadays, each distro came with spesific purpose, server, workstation or desktop orientation but still not forget to give access to shell icon smile find your program with whereis

people who run “ifconfig” in mandriva will get confuse when run same command in fedora or maybe slackware

“command not found” is common message

just use “whereis” command for this purpose :

whereis ifconfig

whereis perl

whereis sh

answer will show up for full path of program

type full path in shell to get same result, not easy but always work icon smile find your program with whereis

Unix

Recreate FreeBSD ports build option

As big fan of FreeBSD ports, I like to play around with ports option, like when installing php4 I was prompted with a lot of build options :

kongja# whereis php4
php4: /usr/ports/lang/php4
kongja# cd /usr/ports/lang/php4

then this ncurse option will popup

 Recreate FreeBSD ports build option

===> Found saved configuration for php4-4.4.6
===> Extracting for php4-4.4.6

read more »

Unix

View crontab entries of entire user in FreeBSD

Cron is special utility that process command in periodic time such ;

  • doing regular backup every night
  • email special report every week
  • etc

cron access can be usefull but sometime not, depend on the command issued.

As super user we can list all of entire user crontab entries using log locate in /var/log

su-2.05b# tail -f /var/log/cron
Apr 30 20:30:00 erau /usr/sbin/cron[81893]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:30:00 erau /usr/sbin/cron[81894]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:35:00 erau /usr/sbin/cron[84459]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:35:00 erau /usr/sbin/cron[84462]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:40:00 erau /usr/sbin/cron[87061]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:40:00 erau /usr/sbin/cron[87062]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:45:00 erau /usr/sbin/cron[90181]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)
Apr 30 20:45:00 erau /usr/sbin/cron[90180]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:50:00 erau /usr/sbin/cron[93304]: (root) CMD (/usr/libexec/atrun)
Apr 30 20:50:00 erau /usr/sbin/cron[93305]: (root) CMD (/usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null)

pay attention on (root) entries, that mean user who run that command in this case generate data for cacti.

You can run the command as root or sudo, otherwise you’ll get “permission denied” message

-bash-2.05b$ tail -f /var/log/cron
tail: /var/log/cron: Permission denied
-bash-2.05b$ su
Password:
kongja# tail -f /var/log/cron
Apr 30 20:36:00 kongja /usr/sbin/cron[81442]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:37:00 kongja /usr/sbin/cron[81504]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:38:00 kongja /usr/sbin/cron[81567]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)
Apr 30 20:39:00 kongja /usr/sbin/cron[81631]: (root) CMD (/usr/local/bin/pfstat -q >>/var/log/pfstat)

happy viewing icon smile View crontab entries of entire user in FreeBSD

P.S :

other usefull place to check for cron entries

/var/cron/tabs
/var/cron/atjobs
/etc/crontab

PHP Web Server

Hide php extension for social engineering purpose

First thoughts when see these url :
http://www.mydomain.com/about.pl

this site use perl

http://www.mydomain.com/about.cfm

this site use cfm

http://www.mydomain.com/about.htm

or

http://www.mydomain.com/about.html

then you might think about ordinary htm/html file

is it true?

read more »