Virtualbox Virtual Bridging

November 22nd, 2008

I’ve been using VMWare for the last couple of years. What I really liked about it was that when you ran the vmware-config.pl script, it would automatically set up interfaces for the virtual machine to interact with the host OS. What I didn’t like was that the guest OS was so slow. I heard about Parallels, and from what I’ve seen, it’s a very slick and had a great feature that allowed you to switch to seamless mode. In this mode, you could run applications with the illusion that you were running the application within the guest OS, in my case Linux.

Since I was running Linux, Parallels was not an option for me. Instead I dug in and found a Virtualbox. This VM also had the seamless mode feature which I’ve grown to really love and has become a key feature that I look for. Another great advantage of the VM is that it’s fast, really fast! It seems so fast, that it’s almost like running Windows XP (for example) right on my hardware. Plus, booting Windows XP is so much faster than if I were to install it and load it right from disk.

Enough about Virtualboxes feature. What I’m really doing is describing how to get the guest OS to access the host OS file system through samba.  By default, Virtualbox uses the IP of the host OS to get online. This is fine and dandy, but what if you wanted to access shares on the host from within the guest OS? This is how you do it:

  1.  Make sure that the kernel has 802.1d Ethernet bridging and that Universal TUN/TAP device driver support is either compiled into the kernel or as a module.
  2. Login as root
  3. create the device. The output will tell you that the device has been created and the ID of the person who owns it:
    # tunctl -t tap0 -u username
    Set tap0 persistent and owned by uid 500
  4. Change the permissions of /dev/tun to 666 (tun may be in /dev/net)
    # chmod 0666 /dev/tun
  5. Create the bridge
    # brctl addbr br0
  6. Add the real interface to the bridge
    # brctl addif br0 eth0
  7. Add the tunnel interfaces to the bridge
    # brctl addif br0 tap0
  8. Bring up the bridge
    # dhcpcd br0

The last part is modifying some of the guest OS’ settings. Start VirtualBox, select an OS, click on Network, make sure that the network adapter (or at least one of them) is enabled.  Change Attached to so it says Host Interface then type in tap0. Finally click OK and start the virtual machine.

If you need to add more than one interface for running multiple Virtual Machines at once,

Auto Connect in Win2k and XP

July 26th, 2008

While working at my last job I’ve come across this a lot. Windows simply stops connecting to the internet when you try to open IE (Internet Explorer) or Fire Fox. This really isn’t an issue anymore since most people have broadband internet.

Under the Control Panel:

  • Double Click ‘Administrative Tools
  • Double Click ‘Services
  • Double Click ‘Remote Access Auto Connection Manager
  • In the Startup type: pull down menu, select ‘Automatic
  • Click the Start button.

The next step is to make sure that you have a connection already configured and that it’s set to autodial:

  • Start->Settings->Network and Dial-up Connections
  • Ensure that there is a dialer or create one if there isn’t
  • Select the Dialer
  • Click the ‘Advanced‘ pull down menu
  • Select ‘Dial-up Preferences…
  • Under the Autodial Tab, enable the ‘Enable autodial by location‘ checkbox

Optionall, if you sometimes connect to a network and use dialup:

  • Start->Settings->Network and Dial-Up Connections
  • Click the ‘Advanced‘ pull down menu
  • Select ‘Advanced Settings…
  • Under the Adapters and Bindings tab, in the Connections: window, choose the order for DNS to use (LAN or dialup adapter)

Perl and Apache on Mac OS X

July 22nd, 2008

The other day while I was modifying a client’s site I saw that his contact form was in PERL. Recently I just got a Mac Book Pro. I’ve set up XAMPP and Eclipse on it to do my PHP programming, but I didn’t count on getting into any PERL. As a challenge I thought it would be fun to do some PERL programming.

I first installed XAMPP. Right out of the box I was able to do PHP programming and access MySQL databases which saved me some time configuring and trouble shooting issues. Or so I thought. I’ve written PERL scripts before, but never done anything that would run on a web server. When it comes to writing pages in PHP, just write the code and it works. That’s because the headers are sent for you. As a test I put the following into my script:

#!/usr/bin/perl

print(”Hello!”);

Expecting it to work. However I would get an error message saying Error 500. I looked at the log file /Applications/xampp and saw that the script was ‘exiting prematurely’ which did not make any sense at all. I could run the PERL script just fine on the command line.

After doing some digging around, about an hours worth I finally found what I was looking for. I needed to print the headers. In order to get my PERL script to work with Apache I needed to add the following:

use strict;
use CGI;

my $cgi = new CGI;

so now the script looks like:

#!/usr/bin/perl

use strict;
use CGI;

my $cgi = new CGI;

print $cgi->header . $cgi->start_html . “hi” . $cgi->end_html;

The key to this script is the $cgi->header function call. With out it, you will get an internal server error. There are other functions associate with the CGI class. The start_html and end_html are the beginning and closing HTML tags.

Miramar Theatre Milwaukee

July 4th, 2008

Back in May I joined the Southern Wisconsin Paranormal Research Group. This group, unlike so many other groups relies heavily on scientific data. In the case of EVP, we don’t just use one recorder that we’ve been running around with, but we use multiple recorders while sitting down. When we believe we have an EVP, we go back and look at the data that we collected for the night to try to explain it away before labeling it an EVP.

Last night, the group hosted a public event at the Miramar Theatre in Milwaukee. We normally don’t run around in the dark, but since it was a public event and we all wanted to have a little fun and break from tradition, we had most of the lights off. Anything that we catch will be in question as the Lemon Lounge was open until approximately 2 in the morning.

Even though I can not prove to you my personal experiences, I can at least share them with you. At 21:25, I was sitting in the theater listening to the presentation that we were giving the public. My location in the seats was the South East corner of the theater. I heard a womans voice talking, thinking that there was someone behind me, I turned around but saw no one. I then waited for someone to come out of the bathroom that was right outside the door. After a few minutes of waiting I went into the Lemon Lounge to talk to the bartender and ask if anyone left. To my surprise it was just the bartender. The only people that were in there before I came in were the owner and his girl friend. Yet they left by using the door of the Lemon Lounge.

Around two, two of our guests said that while they were on the second floor passing two dry erase boards, one of the guests saw a dry erase board fall back to the wall and make a bang while the other actually saw the board come away from the wall and fall back.

Three other investigators and myself were doing an EVP session in one of the sound rooms when all of a sudden my hand felt really tingly. Also upstairs, in another one of the sound rooms, I felt particularly drawn to a corner. I grabbed an EMF meter and found that the heater was giving off a 2.4 milligauss reading.

While doing another EVP session in the basement, 4 investigators and myself were standing around while in complete darkness. During the session, I felt the presence of someone standing next to me. I asked the question if anyone was next to me, and when the session ended, another investigator asked why I asked that question. He too, also felt as if someone was behind him, which would have been next to me.

Around four in the morning, while everyone was in the theatre watching videos on the projector two lights suddenly turned on. We all got excited but after some playing around with the controls for the lights, we found that contacts were bad and were able to recreate the event. Our EVP specialist was in a room sleeping on a couch while this happened. During the time while we were trying to figure out the lights we heard foot steps upstairs. Some of us ran upstairs to check it out. Our EVP specialist also heard the sounds and also checked it out

The decision was made to do one file EVP session. Everyone but myself and two other investigators took part in the EVP session in the theater while we all sat in a room that over looked the theater. While we were sitting there watching the session, we all heard a banging on a drum. We couldn’t figure out what it was, until we came to two dry erase boards, the same boards that two of our guests had an experience with.

We have a lot of video to go over. We had four IR cameras running for 12 hours, I don’t even know how many voice recorders were running and for how long. I personally have an hours worth of audio and video.

I had a blast at the Miramar Theatre and look forward to going over the video and audio.

Disabling iSight Built in Mac Web Cam

June 28th, 2008

I’ve never been a fan of Web Cams, but my Mac Book Pro did not come with the option of not having one. Since I’m a bit on the paranoid I want a way to disable the camera.

The easist way, but not the best way is to move or rename a file. The file that we’re looking for is the QuickTimeUSBVDCDIgitizer.component file. This file is located in the /System/Library/QuickTime folder.

What I did to disable my iSight was move the file up a directory. When any application tries to access the camera, it will say it’s in use.

Right now I’m not aware of any other way to disable the camera, but I will continue to look into it. I’m also looking into disabling the internal microphone.

Search Engine Marketing Notes

June 26th, 2008

A few months a go I took a position at a company where my job was to help Account Managers with optimizing their clients web sites. I’ve been doing web pages for years, and have been working with PHP for the last four years. Just last year I started working with ASP.NET 2.0. I must say that I do like ASP for the sole reason that it’s extremely easy to pound out a good looking web site in little time. My skills as a PHP and ASP programmer have helped out a lot. While I have been helping out with the optimizations I’ve learned a great deal of what goes into increasing rankings in the major search engines.
Keywords play an important part when a person is searching for something. The best way to search for anything is type in the unique words in what you’re looking for. When people are building a website they look into specific key words that describe what their site is about. Some tools that are used in determining what key words one should go after are:
•    GoogSpy
•    SEODigger
•    Compete
•    KeyCompete
•    Word Tracker
•    Key Word Discovery
Content
Having unique content is not only common sense, but it’s essential for your site. Not only should you have unique content you should also not repeate your content. By repeating content the search engines will see it as spam. If the search engine sees the page as spam then it will decrease your ranking. There is a tool called Copyscape that will check for duplicate content on the web. Just go to www.copyscape.com and type in the content you are looking for. When a site has dynamic content, that is always up to date, the site will get high rankings. Using a Blog, bullentin board, or having people write reviews will help your site get higher rankings for specific keywords.
In order to keep your site up to date, on method is using an RSS feed to import into your site that is directly related to your site. However, remember that duplicate content will get you penelized. In addition to the RSS feeds that are imported into the site that you post a news article of your own once in a while.
Some content aggregation systems are:
•    Google News
•    Yahoo News
•    YelloBrix
As search engines get more advance not only do they read html files, but they can also read MS Word, MS Excel, MS Power Point, Rich Text, and PDF files. It would be wise to optimize those files as well for keywords.
•    Unique content - This is just common sense. You don’t want to keep saying the same thing over and over again. If you keep replicating the same thing over and over again, you’re not going to advance in the ranks at all because the search engines will catch on to your little plot.
•    Content that is always up to date and changes often gets higher rankings. A Blog or Bulletin Board helps as this allows people to interact with your site ultimately changing the content of the site.
Linking
•    Having links from other sites is a good thing as it shows that you have relivant content, especially if the sites that are linking to you are related to the target keywords. Links inside user comments don’t count or devalue your site in ranking.
•    Having a site map helps the search engine pick up your site. This is a central location where all pages can be indexed and made searchable to potential people.
•    Meta descriptions should be used. Sometimes the search engine uses the description in the search results.
•    Meta keywords tag aren’t used as much as they were back in the early days of the internet. It’s still a good idea to use them to point out to the search engine that it should be looking for specific keywords on the page.
•    Create a company profile and Privacy page to help build trust with the users.
•    The higher links appear on the page, the more it affects your ranking.
•    Links in blocks of content are more relevent than individual links.
•    Avoid using images when possible. If you have to use an image, use the alt property.
File Name
•    Hyphens and Underscores are treated as spaces in the file name. No more than 2 or 3 spaces should be used.
•    File names should be associate with both the title and keywords.
Title
•    Title has heavy weight, especially when the key words that are in the page are found in the meta descriptions, meta keywords, and page are very important.
•    The first 65 characters are used in the search results.
Robots
There is a robots tag which have been replaced with the robots.txt. However, these tags are still usable. There are some additional meta tags that you can use in conjunction with this. Instead of the old “<meta type=”robots” contents=”noindex” /> there are googlebot and msnbot. In addition to the standard index, noindex, follow, and nofollow googlebot offers noarchive and nosnippet. Where as msnbot only offers noarchive. Noarchive will tell the search engine to not cache the site. Nosnippet tells the search engine to not display any description below the title in the search results.
Keywords
There’s a balance between having too many keywords and not having enough keywords. The rule of thumb would be the words should not repeat more than four to six times per 350 words. Target keywords should be placed in the title, and the title should not include more than 2 keywords or phrases. Webuildpages.com has a keyword density tool that will tell you the word or phrase, count, and density. The tool can be found at http://www.webuildpages.com/seo-tools/keywords-density By repeating keyword too much you stand a good chance that the search engine will see your page as spam.
Using keywords is a easy way of getting high rankings in google. In the future this idea tactic may no longer be valid. Latent Semantics are the use of words that are associate with other words. For example, Apple would return ipod, mac, and imac. Microsoft would return Windows, Zune, and Media Player. Latent Semantic indexing looks at the whole profile of your site and takes into account all your links. If you have only links that are related to a specific topic then you will get penilized for not being natural.
•    Should not have more than 10 key words or phrases.
•    Keywords or phrases should not repeat or else a penelty will be given.
Description
•    Description is sometimes used in the search results.
•    Include keywords in the description.
•    255 characters max.
Link Building
•    Link to the home page from each page.
•    Don’t dilute the theme of the site by linking to other pages that aren’t related. If you need to, use the ‘nofollow’ rel attribute.
<a href=”unrelated.html” rel=”nofollow”>

If it’s an external link

<a href=”http://www.otherdomain.com/page.html” rel=”external no follow”>
•    Avoid broken links: http://home.snafu.de/tilman/xennlink.html
•    Google asks that any paid links have the no follow attribute.
Site Maps
•    Search engines reward for site maps. Xml-sitemaps.com
•    Place a link to the site map on the home page.
•    The file name should be either sitemap.html or sitemap.php.
Robots.txt
•    mcanerin.com/en/search-engine/robots-txt.asp
•    USER-Agent: *
Disallow: /imgaes/
Disallow: /directory/file.htm
Sitemap: http://www.example.com/sitemap.html
http://www.htaccesstools.com
Re-writing URLs
•    Rewrite old page to a new one
RewriteEngine On
RewriteRule ^old\.html$new.html
•    Rewrite dynamic page
RewriteRule ^([^/]*)\.html$ /viewproducts.php?category=$1 [L]
Will rewrite the url from www.example.com/viewproducts.php?category=sports to www.example.om/sports.html
Redireting Non-WWW to WWW
If search engines crawl over example.com and www.example.com, this can be seen as duplicate content, and if other sites link to example.com and www.example.com then the links are spread out over two different entities. This issue is referred to as non-ww/www canonical issue. This can be solved by a simple redirect.
Rewrites non-www to www
RewriteEngine ON
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Rewrites www to non-www
RewriteEngine ON
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule (.*) http://example.com/$1 [R=301,L]

SimpleTest

April 10th, 2008

A while back I was working on a site, and as I was writing the back end and making sure that it works properly I thought to myself “If .NET has nunit, and Java has junit, does PHP have phpunit, or something similar?” After some digging I found the answer. The answer I found was yes! In addition to finding unit frame works for PHP I also found some for other languages like ada, haskell and so on:aunit - for Ada
hunit - for Haskell
ant-junit - Apache Ant’s optional tasks depending on junit
dbunit - DBUnit is a JUnit extension targeted for database-driven pr
ojects.
tagunit - for testing custom JSP tags
xmlunit - for XML
and so on. If you want a complete list, on the command prompt, if you’re using Gentoo, just type:

Read the rest of this entry »

Eclipse, PHP, and XDebug

April 10th, 2008

In the past I’ve written how to use Eclipse with phpdbg and ZendDebugger. The phpdbg was short lived as it was replaced with xdebug. According to Zend’s website, they say that there are no serious limitations of xdebug. However, there may be some limitations when working with other Zend modules.

This is not going to be a problem seeing as all I want to do use it to debug web pages. This will work on either Windows, Linux, and possibly MacOS X.

Since posting about Eclipse and Zend, it has gotten much easier to get Eclipse and configure it for PHP. Go to Eclipse’s homepage. On the front page there is a link to download the IDE for other languages; click on that and get the one for PHP.

Read the rest of this entry »

Java Doc

April 3rd, 2008

Documentation is key when programming. There is the documentation in the code itself such as what the heck you’re trying to do there. There is also the documentation that describes the functions and objects and how to use them. Luckily there is a tool that helps the programmer create nice HTML documentation based on the comments within the code. This knocks out two birds with one stone. Javadoc is the tool to use for this task. There is also PHPdoc as well for, you guessed it PHP.

For this entry we’ll only be concerned about Javadoc.

Read the rest of this entry »

Asus Eee PC, Wine, IE

April 2nd, 2008

The other day my General Manager came to me to ask if I could install Wine on the Eee PC. I thought “It’s Linux, why not?”

I’m working with the 701 model. The first we need to install wine. The Eee PC uses Xandros which uses the Debian Package system. Under Settings there is what looks like a program that you can use to install additional programs. Unfortunately all this is used for is updates. In order to get to where we need to be, the terminal, we need to hold ctrl+alt+T.

Read the rest of this entry »