FamousPhil.com -- Home My Calendar Youtube LinkedIn Facebook MySpace Twitter RSS Blog Feed

Blog Navigation

Partners

Latest Activity

Another way to stop the unwanted calls even when you’re on the Do Not Call list

Phil explains how to use the old telephone tones to wane off telemarketers!



Posted on: June 11th, 2011 by Famous Phil

Here is a relatively short blog for a change!  A client came to me today to have PDFLib installed onto the Matthouse CPanel server.  PDFLib allows you to create PDF files programatically (in this case, PHP), so I can see a lot of uses for this extension.  As expected, CPanel wasn’t able to install this extension through PECL without a little help, so below is the procedure that I used.

#get latest pdflib lite 7 from http://www.pdflib.com/download/
#http://www.pdflib.com/download/pdflib-family/pdflib-lite-7/

cd ~
wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5.tar.gz
tar xzf PDFlib-Lite-7.0.5.tar.gz
cd PDFlib-Lite-7.0.5
#java isn't installed on the server, compile without java
./configure --prefix=/usr/local/pdflib --without-java
make
make install
pecl install pdflib 
#when asked for a path, enter "/usr/local/pdflib" then hit <enter>

I opted to install the lite version of PDFLib since its free and my client didn’t need all of the features that the program includes.  I installed pdflib to its own directory that isn’t included in path since I don’t anticipate anyone actually using this via other languages on the server (besides PHP).  Once PDFLib is installed, we will need to use the command line (as root) to install the pecl extension and tell it where to find the compiled version of pdflib.  Note that CPanel’s PECL installer will not be able to install this extension since there is no way to enter the path (and I’d prefer to not add this to the global PATH variable on my server).  The extension is now installed, in order to test the extension, make a PHP file for the below code and execute it in a web browser, you should see “Hello World” as a PDF document.

<?php

try {
$p = new PDFlib();

/*  open new PDF file; insert a file name to create the PDF on disk */
if ($p->begin_document("", "") == 0) {
die("Error: " . $p->get_errmsg());
}

$p->set_info("Creator", "hello.php");
$p->set_info("Author", "AUTHOR");
$p->set_info("Title", "Hello world (PHP)!");

$p->begin_page_ext(595, 842, "");

$font = $p->load_font("Helvetica-Bold", "winansi", "");

$p->setfont($font, 24.0);
$p->set_text_pos(50, 700);
$p->show("Hello world!");
//$p->continue_text("continue text");
$p->end_page_ext("");

$p->end_document("");

$buf = $p->get_buffer();
$len = strlen($buf);

header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=hello.pdf");
print $buf;
}
catch (PDFlibException $e) {
die("PDFlib exception occurred in hello sample:n". $e->get_errnum() ." " . $e->get_apiname() . " : " .$e->get_errmsg() . "nn");
}
catch (Exception $e) {
die($e);
}
$p = 0;
?>

Source: I used the guide at http://www.supportfacility.com/blog/cpanel/install-pdflib-php-on-cpanel-dedicated-server/ to write an updated version for my blog.  I’d like to thank them for blogging about this topic!

Tags: , , , ,
Posted in Hosting / Server Administration, Programming
|| 3 Comments »

Posted on: June 3rd, 2011 by Famous Phil

There are many reasons why you might be reading this post, but likely, you’re trying to figure out how to install this complex heap of code (that has its root node removed, no doubt, ha ha).  If you didn’t get my last joke, I feel sorry for you, but the show must go on.

Gitorious is an open source repository management system similar to Trac on SVN.  The software looks really nice (gitorious.org), and it has a lot of built in features for managing git repositories.  For those of you who are not familiar with coding, code repositories are often set up to enable many coders to work on the same project simultaneously (different portions of course).  Repositories also enable versioning so that you can easily revert to an older copy of your code base if something breaks along the way.  Repositories are often centralized so that only a single location has to be backed up, in this case Gitorious centralizes git repositories.

Truthfully, there are three memorable software programs that have been notoriously difficult to install and configure in my experience, these are as follows:

  • Shibboleth- I never did successfully install this myself, this was because I was asked to help a friend install it over the phone.  I don’t work well when I can’t see the problem and play with stuff, I test hunches, and doing it with this method would have taken way too long.  From what I’ve seen of Shibboleth, I would rate this as worst of the worst programs to install.
  • Gitorious – This is probably the second worst application I’ve ever installed.  It required a lot of research and resources since it is poorly documented and requires a lot of Ruby Gems to operate successfully.  Of course, I will hopefully document it a little more today!
  • Exchange – I wish I would have documented the install of my Exchange server internally so I could have shared it here.  Exchange isn’t awful to install, but the configuration of Exchange is very tricky and there are many gotchas.  This is why I place it as the best of the worst software programs to install.

With all of the above said, the installation process of gitorious isn’t for the leisure system administrator to install.  This took me approximately 3 days of research to successfully install and understand.  I installed it on a separate system only because I didn’t want it hurting any of my existing production systems.  In the end, I’m glad I did this because I learned that Ruby isn’t very memory efficient and this application easily eats up most of the 1GB of ram allocated to it in a VPS (Virtual Private Server).  And with this said, I invite you to continue reading if you really want to know how to install this software.

Update 6/14: After a few requests, I’ve decided that I will provide a Gitorious installation service on your CentOS server.  I will be happy to install Gitorious and make it work (as described below) for a one time paypal payment of $100.  For details, contact me directly (see my contact page).

LAST UPDATE: 6/8/2011 – Suggestions from Gitorious Discussion Group

Read the rest of this entry »

Tags: , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Technology
|| 33 Comments »

Posted on: May 31st, 2011 by Famous Phil

I’m still working on other blogs for my site, but my other projects have sort of been put on hold because I don’t have all the information / tools / research I need to write them.  So today I thought I’d write a short reference on .htaccess redirects for a problem I started researching yesterday and failed to get a quick answer to.

Using .htaccess, I wanted to force a website URL to always goto https://www..com no matter what part of the URL was entered.  In order to do this, simply create a .htaccess in the main www / public_html directory of your website (files with a . preceeding them are hidden files in Linux and aren’t served by Apache).  The code that can be placed in the file is (Replace with your website):

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.<DOMAIN>.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

All .htaccess files start with turning the RewriteEngine on.

RewriteCond is similar to an if statement, if the condition is true, run the next line.   With that said, the second line checks to see if the website is being access via SSL  / HTTPS (secure method).  If it isn’t, the third rule takes whatever the url is and changes it to https://www..com/? where ? is any trailing information that was attached to the original non-SSL URL.  R means return a Redirect status code to the client’s browser, 301 is a permanent redirect, meaning the page was permanently moved.  If you change this to 302, it means the page was moved temporarily.  This status code helps for SEO on websites (Search Engine Optimization).  The L is “Last Rule” and this tells Apache to stop processing rules in the .htaccess file for the current page load.  The fourth line checks to see if the URL doesn’t have a www in front of the domain, if www doesn’t exist, the fifth rule adds the www.

Today was interesting because I didn’t know the 301 and 302 status codes off the top of my head, but now I have a good self-reference for the future :)  That is all I have for now.  Hopefully I can get some Hadoop code posted in the near future that I promised a few blogs ago!

Tags: , , , ,
Posted in Hosting / Server Administration, Programming, Technology
|| No Comments »

Posted on: May 26th, 2011 by Famous Phil

On August 30, 2009, I made a blog post about my x10 home automation system, but I didn’t really cover it in depth enough to satisfy myself.  Therefore, I decided to revisit the topic from that blog (which is here).  This blog contains a video detailing the system that I ended up with during my University experience.  I expect that my future home will be much more automated than this video shows.  In order to appreciate the video, I decided to write some content to supplement what I talk about in the video, which is below.

In 2009, I came up with the first version of my light control system.  This consisted of a clapper, a set of cheap computer speakers, and an audio recording of my clapping.  My original system used a web interface to have the speakers (connected to the web server / site) clap when I wanted the lights to come on.  This quickly became unmanageable since I couldn’t monitor the states of the lights without a webcam monitoring my room (and I wasn’t thrilled about securing a webcam in my room that could be hacked into).  This lead into X10 which has done wonders for me over the course of the past two years.

Its funny remembering back to when I first got an x10 system, because the x10 website doesn’t look like your average store, it looks more like an adult site with lots of flashy banners (ha ha).  I do have to admit, with x10, the initial impression was very deceiving for me, since their products are really good!  Anyways, moving on, My x10 system consists of a USB transceiver module (CM15A located here) which connects to my windows server that runs a WAMP (Windows, Apache, MySQL, PHP).  In addition, I have several lamp modules, appliance modules, and remote control wall switches (which wirelessly communicate to the CM15A).

As for the software, I installed the ActiveHome software onto my server (that came with the CM15A).  This software installs a few application libraries (dlls) which enabled programmatic access to the CM15A to send and receive x10 commands over the power lines ran in my apartment.  Using this api, I wrote a quick program that makes a command line based program that can run certain commands.  I have to note that ActiveHome includes a default command line executable, but this didn’t have all the functionality that I wanted, most notably output in HTML for my web interface.  With the executable I wrote, I simply have the apache web server run the command as a local user which sends the x10 signals over the power lines ran in my apartment.  I should note that I considered using ASP.net which could interface with the API directly, but at the time I wasn’t very familiar with ASP.net and I wanted to use PHP.  I didn’t use IIS because I didn’t have the time to go permissions hunting to figure out why PHP wasn’t allowed to run programs as a local user on the web server through IIS.  Luckily a standard WAMP install that included Apache and PHP worked out of the box with little configuration.  The WAMP that I used was Vertrigo.

For the IR receiver that controls my projector, I use a USB-UIRT that I found on Ebay (I didn’t feel like waiting the estimated 6 weeks at the time for a new one).  Fortunately, the executable program that was included could send and receive signals from the USB-UIRT that I required, so I wrote some PHP that invokes it for the commands I used.

In 2009, I mentioned that voice control would make its way into my system.  I have to admit that it did!  Unfortunately, it didn’t last long because of all the bugs that I ran into.  I used the Microsoft speech libraries with a program called SmartButler, which could listen for speech commands and run commands on my server.  I initially used a cheap computer microphone, but quickly found that the interference in the audio made commands very inaccurate, and furthermore, if I held a conversation in the room, my lights would act up!  I figured that a USB professional Condenser Microphone would fix the problem, so I quickly ordered one and integrated it into my system.  This did significantly improve the quality of my system, but normal conversations would still occasionally trigger some of my web control panel controls inaccurately.  The final straw that broke the camel’s back (and caused this system to get removed) was when my RA (resident advisor), Stephanie came into the room, said hello to me and my lights went out of control (since I didn’t train it for a higher pitched, female voice, I’d assume).  I’d like to approach this problem in the future when I get the time to do it properly, but until then, I’ve been satisfied with web control panels that both my smartphone and computer can access.

Finally, at the very end of my video, I took a moment to show my Linksys PAP Adapter (VoIP, Voice over IP).  This works through a service from voip.ms.  Voip.ms is a prepaid service for VoIP adapters that allows you to buy a phone number for a very reasonable price (even 800 numbers).  They also have really reasonable rates and really good control for those phone numbers.  I thought I’d provide a plug for them since they are really good.

I would like to add that the Linksys adapter required an unfirewalled IP address to work properly (for incoming calls) in my experience.  It does have a NAT mode for this situation, but the university firewall constantly crushed this mode.  To get around this problem (and allow my web server for x10 to work properly), I implemented OpenVPN on my network and pulled in several public IP addresses and left them unfirewalled.  This solution worked well for me at UB, and I documented it fairly well in my OpenVPN post.

With nothing more to mention on the topic, here is the video that details my light control system and some other stuff.

Of course, I made many bloopers in this video (I improvised a lot!), so I thought the bloopers video would be appropriate.  Warning, there is a little language in it and the audio isn’t exactly balanced.

Disclaimer: I was not paid to endorse any of the products above (and I’m never paid to do that!).  I like to think that when I make a recommendation, it carries a lot of weight with it, which it should!

Tags: , , , , , , , , , , ,
Posted in Hosting / Server Administration, Mobile Technology, My Site, Personal, Programming, Student Life, Technology
|| 1 Comment »

Posted on: April 5th, 2011 by Famous Phil

This is a video blog continuation of week 3 (see 2 posts ago).  Its the final video in my 4 lecture series.  The site this corresponds to is http://famousphil.com/websp11/

This video covers a lot of demos including how to make a crude content management system work on your site, as well as an introduction to wordpress as a content management system.

Background: I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.  Anyways, here are the videos from Lecture 4.  There will be a fourth and final lecture next week.  As always, thanks for reading!

Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: March 31st, 2011 by Famous Phil

First, I’d like to wish you a happy April Fools day!  I’ve never really been into the pranks that most people do on this day, and the idea I had fell through due to the lack of time (go figure).  The good news is that there is always next year!

For a project I had to do in a Distributed Computing class, I ended up having to configure a Tomcat 7 server running on CentOS 5.5 (a Redhat Linux derivative).  I always document my actions when I charter into unknown waters, so I thought I’d post my documentation for the public to see.

Before I begin, this project required the use of Amazon Web Services for deployment.  Being previously unfamiliar with AWS, I thought I’d outline some pros and cons to the service compared to traditional VPS hosting.

I like AWS because I can quickly create servers and delete servers on the fly without having to pay up front or rely on a support member who can only work so fast.  AWS also has the ability to expand dynamically for the load to a server.  For example, if you are hosting a site on AWS, and they detect your site is under a high load that the server can’t handle, more servers will be deployed on the spot to handle the increased traffic through an automatic load balancing mechanism.   Also, unlike most VPS providers, AWS provides a physical firewall that is in front of your AWS server, so you don’t necessarily have to worry about configuring a software firewall which might not always work perfectly.  Finally, the AWS servers are very fast, I have never seen any kind of a speed issue with them.  On other providers, this isn’t always the case, especially if the server is virtualized using OpenVZ (where the provider can oversell the server resources easily).

The biggest disadvantage of using AWS in the long term (for hosting) is the pricing scheme.  AWS uses a simple pricing scheme that charges you for every hour your server is running and is active.  This adds up to roughly $5-$100/month depending on what you get.  Then on top of that, AWS also charges for bandwidth by the GB.  Although this pricing scheme is fine for very little traffic or a lot of traffic, for the average amount of traffic (about 1-2TB / month), this pricing scheme isn’t the best compared to other providers.  For example, the virtual server that hosts my website costs me $20 per month, it has so much disk space and bandwidth (2TB included).  If I were to ask AWS for the same thing, I’d pay $10 for the server, and then roughly $100 for the bandwidth every month (if I were to use it all). Read the rest of this entry »

Tags: , , , , , ,
Posted in Hosting / Server Administration, Technology
|| 2 Comments »

Posted on: March 30th, 2011 by Famous Phil

This is a video blog continuation of week 2 (see the previous post).

Background: I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.  Anyways, here are the videos from Lecture 3.  There will be a fourth and final lecture next week.  As always, thanks for reading!

Part 1:

Part 2:

Part 3:

Part 4:

 

Tags: , , , , , , , , , , , , , , , , , , , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: March 23rd, 2011 by Famous Phil

This is a video blog continuation of week 1 (see the previous post).

Background: I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.  Anyways, here are the videos from Lecture 2.  As always, thanks for reading!

Part 1:

Part 2:

Part 3:

Part 4:

Part 5:

 

Tags: , , , , , , , , , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: March 10th, 2011 by Famous Phil

It seems like its been a while since I last posted to my blog.  As usual, the mid semester grind is hitting my time hard, so I don’t have the resources to write here as often.  Thankfully this is my last semester as a Masters student, *yay*.   So coming up soon, I will be writing a blog on regular expressions, I’m still in the process of making it, so it might take a while.  I’ve also got a great blog for April fools day, so stay tuned for that!

Now onto the topic of this blog.  This is a video blog (go figure, right?).  Actually, I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.

Being the kind of person who likes to share knowledge, I agreed to give the lecture series with updated information.  John suggested that I video tape the lectures and post them to my blog, which I thought was a great suggestion.  So in the next 5 to 6 weeks, I will be posting youtube 720p HD recordings of the lecture series to here.  Feel free to watch it and make comments about my presentation skills.  I know that I’m not perfect, so I’m always open to suggestions!

As always, thanks for reading!

Part 1:

Part 2:

Part 3:

Tags: , , , , , , , , , , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: February 4th, 2011 by Famous Phil

Yesterday, February 3, 2011, the Internet has reached a new milestone in growth, one that is both very positive (the internet is very successful and has grown out of its own bounds) and also very negative (the Internet has grown too big for itself).

The IANA (Internet Assigned Numbers Authority) assigned the 38/8 and 106/8 blocks to APNIC (Asia Pacific Network Information Centre) who controls IPs allocated in countries such as Austrilia.  A /8 block of IP addresses contains approximately 16 million addresses.  This left 5 /8 blocks of IPs left and as per the IANA exhaustion policy, the final 5 blocks of IP addresses were given to each of the IP management organizations that manage IP addresses for each region of the world.

NOTE: Think of an IP address like a telephone number or a mailing address.  Computers use IP addresses to locate other computers and give computers homes on the internet.

Although the blocks have been alocated to regional organizations that manage the IP address pool, this doesn’t mean the Internet has broke or actually ran out of IP addresses.  The allocation organizations are constantly assigning and reassigning IP addresses to corporations and end users, and these organizations have not completely assigned / used up all of the available addresses yet, but its going to happen soon.

To delay this day, many big corporations have given up many of their massive IP allocations (that are mostly wasted), and more IP addresses will likely be returned to the pool.  Unfortunately, this will only delay the true exhaustion of IPv4 so a solution needs to be in place now.

It is quite funny, but many technologists have seen this day coming for a long time.  Back in the mid-late 1990′s, IPv6 was born.  Unlike IPv4 which contains roughly 4 billion total addresses, IPV6 contains trillions of IP Addresses.  It has been rumored that IPv6 could address every grain of sand on our planet, so I seriously doubt that IPv6 will ever have to be replaced.

With a solution in place, why the heck aren’t we using it?  Well, IPv6 has some backwards compatibility problems with IPv4 and this means that both IPv4 and v6 need to run simultaneously (typically configured as a dual stack on routers).  Additionally, much of the hardware that powers the internet today also needs to be upgraded, and many providers are slow at brining up IPv6 connectivity.  Fortunately, most new operating systems and computers support both IPv4 and IPv6 so that when the switch is done by ISPs, most users will be ready.

I’ve personally been keeping a close eye on the IPv6 deployment.  Since I have several servers in datacenters, I will be one of the first people migrating to the new internet since servers have to be reachable on IPv6 for a transistion by end users to work.  I’m quite confident that I will be ready in the next 4 months to announce that FamousPhil and Matthouse have supported IPv6 connectivity!

To see if you have IPv6 connectivity, I’d suggest trying to load http://ipv6.facebook.com.  If this loads, you have IPv6 connectivity, otherwise you don’t.  If you don’t, it is possible to use a tunnel broker from Hurricane Electric that is free.  This tunnel broker works by inserting a few commands into a command prompt since IPv6 tunneling is built into Windows 7 and Centos 5.5 (and probably other OS’s).  I’ve been playing around with it, but there really isn’t much on the IPv6 internet to see yet (only about 8% of the Internet is IPv6 compatible).

Finally, do you remember the DTV days when America would run tests where everyone would only broadcast in the new digital television format?  The same thing is going to happen for the internet.  On June 8, 2011, IPv6 test day will happen when all the major providers turn off IPv4 connectivity for 24 hours to test IPv6 connectivity.  With this and the exhaustion of IPv4 yesterday, I’m very hopeful that everyone begins quickly moving to IPv6 so that the internet doesn’t come to a screetching halt in respect to growth.

Tags: , , ,
Posted in Hosting / Server Administration, Technology
|| No Comments »