Capturing Internal Traffic with Virtual Loopback & Wireshark on XP

Create Loopback Interface on Windows XP

  1. Select “Start”->“Settings”->”Control Panel”

C:\dev\wireshark\images\Image-0000.png  C:\dev\wireshark\images\Image-0000.png

Continue Reading »

Network Monitoring
Networking

Comments (0)

Permalink

Menu Selection Problem in Joomla Module Manager

I was having trouble with my Joomla Menu Assignement on one of my Joomla site. The problem was that the Menu Assignment in Module Manager displayed the Menu Selections list incorrectly.

The Menu selection list showed not only incomplete list of menu items, but it also displayed the menu items that I have deleted. Running out of idea, I delete a menu that was empty but its menu items still showed in the menu selection list.

This did the trick. After the deletion, the menu selection list showed the correct list of menu items. I still don’t know how this problem occurred but I hope this helps someone.

Joomla

Comments (0)

Permalink

Turn on Code Highlighting in Joomla CodeCitation Plugin

Just got CodeCitation to work on my Joomla site and here are the steps I took:

1. Download CodeCitation Plugin

2. ENABLE the new CodeCitation plugin with the Joomla 1.5 backend plugin manager.

3. Change the plugin’s order to the value greater, then the order of “Content – Pagebreak” plugin (for example, 10002)

4.To keep the tab space, change JCE Editor’s Cleanup options so that Cleanup HTML is “Yes”, and Entity Encoding is “named”.

5. Change my text editor so that tab is replaced with space.

So that now whatever code I’ve typed in my local editor can be copied and pasted to Joomla JCE Editor with the right indentation.

Here is a java example

{codecitation class="brush:java"}JAVA_CODE{/codecitation}

Joomla

Comments (0)

Permalink

Create Custom Widgets using InkScape and NetBeans Visual Library

This blog entry shows one how to create a special widget using InkScape and NetBeans Visual Library.  This is part of my effort to create a Java-based implementation of MIT’s Scratch, which is implemented in Squeak Smalltalk.

Step 1 Create JScratch Block Graphics:

First I created the image using Inkscape (steps to follow), import the image to IDE, then create two LayerWidgets, one transparent, and another opaque. Add the image to the background LayerWidget, adn the Swing component to the front LayerWidget. Finally, use the BorderFactory.createEmptyBorder function to limit the size of the swing component at the front layer.

To create the Scratch blocks, I used InkScape, the Open Source SVG editor. Here are the steps I took to create the graphic:

Continue Reading »

Java Programming
My Projects

Comments (2)

Permalink

Interview questions

I was asked to filled out a questionnaire that contains the following 10 questions. I post my answers just in case someone is interested.

1. Name three open source projects you are familiar with. Briefly outline significant advantages and disadvantages of each project.

2. What do you consider the most important of agile development methodologies?

3. Do you think test-driven development is productive? Why, or why not?

4. What, if any, are the disadvantages with C++? What would you do to change it if you could?

5. What, if any, are the disadvantages with Java? What would you do to change it if you could?

6. What, if any, are the disadvantages J2EE? What would you do to change it if you could?

7. What, if any, are the disadvantages with object-oriented design? What would you do to change it if you could?

8. What do you imagine are the main problems of working in a geographically distributed team?

9. Which work-related books and/or magazines have you read in the past three months?

10. Which work-related web sites do you visit regularly?

Continue Reading »

Uncategorized

Comments (0)

Permalink

Build OpenCV on Snow Leopard

OpenCV (Open Source Computer Vision) is “a library of programming functions for real-time computer vision”.

It took me whole day yesterday to build OpenCV for my Snow Leopard. I still need to add the FFMPEG support but for now, it is turned off. I’ve followed the Mac OS X OpenCV Port doc.

svn co https://code.ros.org/svn/opencv/trunk opencv

cd opencv mkdir opencv/build cmake ..

ccmake .

Hit ‘t’ to toggle advanced mode. Set CMAKE_CXX_COMPILER=”/usr/bin/g++-4.0″ and CMAKE_C_COMPILER=”/usr/bin/gcc-4.0″. I also need to turn off FFMPEG and LIBDB1394, because I could not get them to install properly yet on Snow Leopard. Turn on the BUILD_EXAMPLE. Hit ‘c’ to configure and then ‘g’ to generate the config files and exit ccmake. make -j8 su make install To build the example, I need to change the opencv/sample/c/build_all.sh to the following: (change gcc to gcc-4.0 and g++ to g++-4.0, and also add “-arch i386″)

gcc-4.0 -arch i386 -ggdb `pkg-config opencv –cflags –libs` $base.c -o $base
g++-4.0 -arch i386 -ggdb `pkg-config –cflags opencv` -o `basename $i .cpp` $i `pkg-config –libs opencv`;

To build the c sample, just type:

./build_all.sh

Next step for me would be to build the universal library for OpenCV from Snow Leopard.

If you would like to use OpenCV with Java on Linux, check out this Walk into the Future article.

iPhone and MacOS Dev

Comments (0)

Permalink

MacOS: glibtool and glibtoolize

A typical autogen.sh (for Linux and Unix systems) script uses auto tools such as aclocal, libtool, and automake to generate necessary files for building a project. For MacOS, just replace libtool with glibtool and libtoolize with glibtoolize
#! /bin/sh
# a quick hack script to generate necessary files from
# auto* tools.
#
# WARNING: if you run this you will change the versions
# of the tools which are used and, maybe, required!
        touch Makefile.am configure.ac
{
        echo "running glibtoolize" >&2
        glibtoolize --force --copy --automake
} && {
        echo "running aclocal" >&2
        aclocal
} && {
        echo "running autoheader [ignore the warnings]" >&2
        autoheader
} && {
        echo "running automake" >&2
        automake --force-missing --foreign -a -c
} && {
        echo "running autoconf" >&2
        autoconf
} &&
        echo "autogen complete" >&2 ||
        echo "ERROR: autogen.sh failed, autogen is incomplete" >&2

iPhone and MacOS Dev

Comments (0)

Permalink

Build OpenCV for iPhone

If you are interested in building OpenCV (http://opencv.org ), Open Computer Vision Library for iPhone, follow the instructor on this great blog entry by Yoshimasa. Make sure to download his test project first. The test project contains a configure tool that helps configure the build scripts based on the SDK and OS version. I started out reading this infodan blog entry, but could not get it to work and finally had the success building OpenCV for my 3.0 device.

I am still working on the simulator.

iPhone and MacOS Dev

Comments (0)

Permalink

Connect to SQL Server in Perl and in VBScript

Say my database name is Jessica_DB, my user name is jessica, and my password jessica_pwd.

Perl

To connect to Microsoft SQL Server using Perl with Win32::ODBC module

use Win32::ODBC;
my $dsn = "DSN=Jessica_DB;UID=jessica;PWD=jessica_pwd;";
my $DB  = Win32::ODBC->new($dsn);
$DB->Sql("SELECT f1, f2, f3 FROM MyTable");
$DB->FetchRow();
($f1, $f2) = $DB->Data("f1", "f2");
print "f1 = ". $f1;
$DB->Close();

VBScript

To connect to MS SQL Server using VBScript

Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open _
        "Provider=MSDASQL.1;Data Source=Jessica_DB;" & _
              "Trusted_Connection=Yes;" & _
                     "User ID=jessica;Password=jessica_pwd;"
objRecordSet.Open "SELECT * FROM MyTable", _
          objConnection, adOpenStatic, adLockOptimistic

objRecordSet.MoveFirst
Wscript.Echo objRecordSet.RecordCount

Python

To connect in Python, check out pymssql

Uncategorized

Comments (0)

Permalink

Connect PC to Cisco Switch or Router

To connect a PC which has two network interfaces (one Ethernet and another wireless) to a LAN, you will want to create a default route to the wireless interface, assuming you are using the wiressless network to get to the Internet (WAN). Here is a link on how to set up a default route on a Windows machine:

Here is the command to add a default route(assume 192.168.201.1 is your WAN gateway)

route add 0.0.0.0 mask 0.0.0.0 192.168.201.1

You will also need to add a static route so that all traffic going to LAN are directed to the LAN gateway, instead of to WAN. Here is how:

route add 10.100.0.0 mask 255.255.0.0 10.100.0.1

Useful links:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx?mfr=true

Networking

Comments (0)

Permalink