Web Programming, Linux System Administation, and Entrepreneurship in Athens Georgia

Author: Brandon (Page 27 of 29)

RoundCube Webmail interface ready for Prime Time?

I’ve been working with RoundCube, which is an Ajaxy webmail interface to an IMAP server. The software is still in beta, but I’ve been impressed with it so far.  I’ve integrated into hooah.com‘s site, so that it matches the rest of their site and had to hack it up a bit to add some dynamic content.  I’ve also just installed it for testing on another mail server that I use to see if I can find any bugs in it.

There are a couple features I’d like to see implemented.   It would be nice to be able to change your email account password from the preferences section.   Also, I’d like to set up a more transparent way to have it look up the backend server based on your email domain.  Guess I’ll subscribe to their dev list and see if I can contribute any code.

Replacing routers

I’ve just spent the last week or so replacing the core networking infrastructure where I work. It involved plenty of late-night work to avoid disrupting service during peak hours. We ended up replacing two of our major routers and implemented a simple tiered architecture which should allow the company to grow much bigger than they are currently.

Since starting work here, I have been the Cisco expert, because I had my CCNP certification (which has since expired). Although I did well on the exams, I had very little practical experience working on live routers. In the couple years that I have been working here, I have learned a lot about configuring routers and switches, and setting up BGP and OSPF routing.

I’ll probably won’t get into a job where these are my primary functions, but I think that its good to understand how networking and routing works. It makes debugging and troubleshooting much easier

Technology in books and movies

I recently finished reading “Digital Fortress” by Dan Brown. The story was actually pretty good, and I would recommend it to others, but I have got to complain about the technology described in the book.

Essentially, the book is set around the NSA’s supercomputer called TRANSLTR. This machine is described as a multi-billion dollar, multi-million core computer that is used to brute-force encryption keys on encrypted documents. Supposedly this machine can crack most encrypted documents in minutes, and it has been stumped for as long as a couple hours on the most complex jobs.

Now, when the bright minds at the NSA try to decrypt the latest ‘unbreakable’ code with their fancy machine, it just works on it for hours and hours. The only interface that all of the technicians have though, is this ‘run-time monitor’ that says how long it’s been working on the latest code. The main character who supposedly did most of the programming on this machine doesn’t have any better debugging tools available than the single clock? Come on…

Equally annoying is the fact that TRANSLTR also has some built-in access into the NSA’s super-secret database of highly classified information. Therefore when TRANSLTR becomes exploited, its conveniently able to modify the firewall and access controls to the NSA’s secret database. Well, the NSA deserves it if they allow an outside system control like that.

There are a whole bunch of other little things (like the only manual power-off button is six stories beneath ground) that are annoying about this book. But the worst is near the very end where is supposed to be suspenseful. The final code is the ‘prime difference between Hiroshima and Nagasaki’). It takes the main characters (who are supposedly math geniuses) 20 pages to figure out that this is a numeric answer, despite the words ‘prime’ and ‘difference’. And another few pages to figure out that the the difference between 235 and 238 is three. Amazing

Cacti stops updating graphs after upgrade to version 0.8.6j

It turns out the latest update to Cacti, the popular SNMP and RRDTool graphing program, has a bug that makes it so graphs based on SNMP Data aren’t updated after upgrading.  The problem has to do with using the PHP “snmpgetnext” function, which is unimplemented in PHP 4. 

There is a discussion on Cacti’s forum at https://forums.cacti.net/about19199.html  where a developer posts a new ping.php that will resolve the problem.

Internet Explorer Oddities

I spent about an hour debugging a dumb behavior of Internet Explorer.  The problem site is one that stored some session data in PHP’s $_SESSION variable for display later.  The form would use parameters from the GET request to populate some data in the users $_SESSION.  Upon trying to retrieve the data in a subsequent page though, it was missing or incorrect.. but only in Internet Explorer.

The failure of PHP Sessions is typically a server-side problem, so it didn’t make sense that the browser was causing a problem. I spent a while verifying that the sessions were, in fact, working properly in all different browsers, but that still didn’t explain the problem.

The odd behavior comes, though, when the page had an image tag with a blank “src” parameter. This causes most browsers to try and fetch the current page. But Internet Explorer tries to fetch the parent directory.

For example, if your page is a https://www.somesite.com/somedirectory/somepage.php, most browsers will try and fetch that URL for images with a blank src parameter. Internet Explorer, though will try to fetch https://www.somesite.com/somedirectory/

Either case is really not what one would expect. I would think that without a destination, it wouldn’t try to fetch anything. Attempting to fetch the page that called it (obviously not a graphic) or the parent directory (why would it do that) doesn’t really make any sense.

In this case, fetching the parent directory hit my problem script since it was the DirectoryIndex (index.php). Calling the script without any parameters erased the saved variable that I was looking for, so the subsequent page that I hit was missing this variable.

I guess the moral of the story is to not leave images with a blank src parameter, because it will do weird things.

Link building and PageRank stuff

My friend, Kevin, over at www.utahsysadmin.com has a much better grasp of PageRank than I do. He recently noticed that his sites got a PageRank assigned finally, which prompted me to re-look at some of my own sites. GamePriceWatcher.com has just increased from a PR of 2 up to a 3 finally. Google’s index now shows a few more of the links pointing at me too, which is nice.  I’ve been spending time recently, trying to get some links to my sites, which is evidently paying off.

Poor PHP Programming

Lately, I’ve been working on numerous projects where I’m debugging or updating other people’s code.  I’m constantly amazed at the poor programming that goes into a lot of these sites.  They are filled with SQL injection vulnerabilities, confusing file structures, even remote code execution problems.

Properly escape database queries – By including a user provided variable directly into a query, you are opening yourself up to SQL injection problems.  For example this code:

mysql_query(” SELECT * FROM sometable WHERE somecolumn = ‘”.$_POST[‘somevalue’].”‘);

is just plain bad! You are allowing the user to insert arbitrary data into the query without sanitizing it first.    Always sanitize your variables before using them in a query, or better yet, use a database abstraction layer like PEAR::DB that does the escaping for you.

Don’t store user passwords in clear text!   I hate it when sites do this.  Combined with SQL injection attacks, this could allow hackers to view all of the usernames and passwords in your database.   At the very least, you should store the password as an MD5 hash, preferably with some salt so that even if an attacker manages to read the values of your table, they are much more difficult to use.   Since most users tend to re-use passwords, it also allows hackers to potentially use stolen user credentials to access other accounts not even associated with your site.

Poor file structures can be extra confusing.  One of the site’s I’m working with now has no less than three copies of most of the code spread between a half dozen directories with no clear association between them.   Files in one directory are including library files in a completely unrelated directory.   In this case, a development branch was using a combination of production and development usernames to access a remote resource, causing extreme amounts of confusion, and destroying the integrity of the data.

I’ve also recently become converted to using Subversion to track code changes over time.  I used to keep multiple copies of a file (include.php.OLD, include.php.1, OLDinclude.php, you know the drill) but Subversion makes it far easier to keep backup coies and refer back to them if something breaks.

The future of Television

This recent story on Wired caught my attention

https://www.wired.com/news/wiredmag/0,72506-1.html?tw=wn_story_page_next1

It’s about a new company called Joost that has plans to reinvent the television market as we know it today.

Essentially, the designers of Kazaa and Skype are applying a lot of the concepts that they have learned with those ventures to the Television marketing where they could announce any kind of product no matter what. Encrypted 10 second video clips, will be streamed from peers and assembled back into a full program.  Their design also adds a lot of modern social networking concepts, like inviting others to view your show, and applying tags to clips.
Television will be huge for marketing but expensive.

It will be interesting to follow how this technology develops.

« Older posts Newer posts »

© 2025 Brandon Checketts

Theme by Anders NorenUp ↑