BLAG Ramblings of a crazy old fool

14Feb/120

Squeeze easiest upgrade ever? Perhaps.

debian

So I finally got around to upgrading my Linode. It's been...840 days since I last did that. Whoops. Turns out there were a few hundred security updates, and I was pretty far behind on Apache, and PHP versions. I also accidentally upgraded MySQL during the process...didn't mean to do that. Would have been nice if I had gotten the chance to do a full export before hand. However, it was Linode that saved my bacon today! I realized that with my track record, doing a system upgrade was one of the more dangerous things I could try. So, rather abitiously, I set out to make it happen. But before I did that, I took a Linode backup snapshot. You know, just in case. As it turns out, the folks at Linode were ahead of the game, and provided an excellent guide to upgrading to Squeeze. About the only problem I had was with MySQL after the upgrade was complete, but an apt-get install mysql took care of that.

But perhaps a bit of backstory is needed. I've started working recently on a framework to rapidly build and deploy social-oriented web applications.  It's still a work in progress, like many of my other projects, but it certainly made my life a bit easier. I was able to adapt the platform from its current implementation on Fitness Tracker, and take a design/idea in my head, prototype, and build it in less than an hour. Now granted the core of the application still isn't built, but all the basics are there; Analytics and tracking, theming/templating, and SSO/Facebook integration. It's not as polished as I want it of course, I'd like to implement a lot more in the way of object-oriented programming, but it is coming along. I'm hoping someday to have it available to go from prototype to beta testing in less than a day.

After I added the new site to the framework, I started to think about how I wanted to structure the data for this particular application. At some point I'd like to have an integrated database that could scale to fit all my applications/ideas, but for the moment it's just not there yet. But as I started to build out the schema in MySQL, I realized it just wouldn't cut it. I've been working a lot recently with MongoDB and JSON data formats, so my mind is still kind of stuck in that mode. But it was pretty apparent, even for the small scope of my project, that a flat row structure like MySQL just wouldn't be scalable enough to do what I want. So I decided to add mongo to my server to play around and see if that would do more of what I want. But unfortunately for me, I didn't have PECL, so I couldn't use the MongoPHP driver. Hence, the PHP upgrade, and then the Debian upgrade.

There were a few tense moments during the upgrade when I dithered on whether to use the new config files or see if the old ones would still work (in the end the old ones won out), and then the suprise MySQL upgrade that I didn't seem to have a choice on. But now I'm at 5.1 and everything seems to be working after a few REPAIRs, so I guess in the end you could call it a win.

Work still continues on the eminence online roll-out; working on building in news feed scraping for content generation, and then integrating that with WordPress. It's proving...difficult.

At the end of the day though, I still don't have MongoDB installed, nor have I made any progress on the DB schema for myCollections...but I still feel like I accomplished something. I guess that's all that counts!

9Mar/110

Mmpf

Sick days are always the worst. Especially when they are unpaid. I woke up this morning with the worst migraine I've ever had (I blame Erin and Dani playing ChronoCross all night), and decided I needed to stay home; there's no way I'd make it through the day like this. So now I have the day to myself, but I can't even enjoy it because everything feels like a bad acid trip with a robot elephant standing on my head. Worked a bit on the site, made the media section work sortof; built a dinky foreach/scandir/lightbox dealie for a nice gallery view. Toying with the idea of playing with mod_rewrite today.

Erin and Dani are off to see Dani's therapist; apparently she wanted to meet Erin. Guess I'm just not important enough to want to meet. Whatever. Dunno what I'm gonna do for the next couple hours. I watched the Blizzard 20 year video, and it yet again reaffirms my want to make my business happen. I love video games, and I'd love to work for a video game company. Blizzard, in particular, would be fantastic. I love everything about the company, from it's history and culture, to the games it makes. Perhaps someday.

24Sep/090

I’m Back, Baby!

Website's back up! I found a style I liked and played around with it a bit. Still needs some work, but its good enough for me at the moment! Lets see, roommate got a job, so I don't/shouldn't have to cover all of the bills. Should mean I'll start having some extra cash soon. No more ramen perhaps!

I've started playing Aion: The Tower of Eternity, a Korean/Chinese-style MMORPG. The graphics are amazing, the gameplay is fun, and it's a lot more challenging than any other MMO I've played recently. Up to level 16 right now on my Templar, hopefully finishing out 20 by the end of the week. I'm not rushing anything, I'd prefer to enjoy the game up to end-game, rather than burn out leveling and hate it. Still can't really decide between the Templar and Chanter classes, but the Templar is further along at the moment ;)

I haven't quit WoW exactly.. closer to taking a break. I don't really enjoy playing anymore except on my 49 Warror; WoW's endgame just sucks. There's no point in getting gear, it will just be replaced in a month by a new tier. PvP is unbalanced and not nearly as fun as it used to be. I find that I only login on the weekends, because my guild needs me to tank progression content. Content that we haven't progressed anywhere in for months. I love all my friends in WoW, but I've been playing less and less recently. I don't want to quit playing, because of the social aspect, but I can't very well demand that everyone play the game I want to play now can I? :)

There are several people from the guild playing Aion though, along with the roommate and couple friends. I suppose if I do decide to quit WoW it won't be cutting off from everyone, but still...I don't know.

Well, back to working on the website. Most of the data is being pulled from MySQL correctly, except for the stuff with # links...They don't work exactly. /at all. Once that's all dynamic, I get to figure out how to build an admin piece, integrate uploading photos, etc. Then sanitize it, and repackage for hosting. Ya know, I've been trying to sanitize and repackage a blogging solution for...years? now, and I never seem to finish.

Perhaps this time will be different...

14Oct/080

Blog Fail!

Well, I've gotten the PHP side of it down. As it stands, I just need to build the admin backend. However, redirects have stopped working. But only in that directory. Same code, same URL, doesn't work there. WTF. So, I'm going to bed. Screw wow, screw PHP, I'll deal with it all tomorrow. Maybe. Or I'll just put it off and use phpmyadmin. At least I can depend on it to work. >.>

23Feb/080

LDAP/eDirectory

So, this week I developed a PHP authentication schema using the LDAP functions. This was designed as a modular component, to be reusable throughout further web applications. Also means it's nice and portable. I don't have the code here at the moment, but when I do I'll release. Basically, our script connects to your NDS eDirectory server, and binds anonymously. To incorporate context-less logons, we then search for the provided username (cn) in your organization's tree.

Due to the nature of ldap_search(), you can also use this to require users from a certain tree; aka only your staff (no students), etc. This is just done by specifying OUs. eDirectory requires a TLS connection for encryption between the webserver requesting the LDAP info and the eDirectory server itself. This is nice; provided that you have an SSL connection to the page where your authentication sits, your security is already done for you! passwords will not be sent in plaintext between the NDS and web servers.

This script would be especially useful to those building web applications for use in a Novell environment, but with a few modifications it could work with other LDAP schemas too, including MS Active Directory.

In other news, I reapplied to join Indy Powerplant, and I'm planning on going to the Stompfest LAN Party on Mar 29-30.

Tagged as: , , No Comments
7Feb/080

I hate winter.

I love the snow and all, but to hell with getting sick. I've been messed up a bit for a couple weeks now, and yesterday it all just kicked my ass. Ended up taking two days off from work just to sit around on meds to try and clear it up. I hate meds almost as much as I hate being sick. Figures, vicious circle and all that. Well, I've also used these few days to work on a few projects.

In work life, my company is forming a new department, a Web Apps Team, to design, build, and integrate in-house and open source web applications into our existing management infrastructure. Sounds fun right? Well except for the fact that they still haven't figured out what kind of server they're going to give us, sure. I'll post the code to the Transportation thing here in a bit, it's a good example of how to build a basic ASP/MSAccess Database system running on IIS. They've got a few projects in mind for us, so it will be interesting. I haven't heard anything about a pay-raise, but who cares at this point--it's going to look fantastic on my resume: From Desktop Technician to Web Application Developer in less than 5 months? Beautiful.

In the world of IWM Entertainment, the wheels of profit turn slowly. Actually they don't turn at all since I've not done any real work for a while. I had been working with a client for a design piece, but had to drop it because of time constraints. There are currently two projects at IWM that are under some form of development; phpMyBlog which will either be released to soruceforge or sold retail, and phpMyCMS [fuegoCMS]. fCMS is a retail product, and varying versions have been under development for a couple years (I can't seem to stick with the base code and end up rewriting it.) Anyone who wants to help develop on these projects (and thereby split the profits), send an email to admin[AT]intarwebmachine[DOT]com with a resume, or list of skills and sample of your work. We are looking for HTML, CSS designers, experienced PHP/MySQL coders, and platform-level C/C++ developers.

Since I've been physically incapacitated, I figured I'd do some shopping:

  • Corel Paint Shop Pro X2 I figured it was about time I upgraded from Jasc PSP7; Nothing wrong with it, but you can always use new software. That and I can't buy a new license for it anywhere.
    Price: $ 49.99 @ BestBuy.com
    Corel Paint Shop Pro X2
  • Lot of 7 Star Wars Books How can I go wrong? $9 for 7 great books, plus shipping. Now at least I'll have something fun to do in my free time aside from loitering around on the Internet.
    Price: $ 9.00 @ eBay.com
  • Foxconn G31MX-K Motherboard Cheap board for my new PC. Dunno if its value is any good, but it was only about $70. Supports my Core2Duo 2.6gHz and my Celeron 3.6gHz, whichever I decide to use. More info below.
  • LiteOn DH-20A4P-08 DVD Burner Cheap burner for my new PC. More info below.

And that's about it, except that I started playing Counter-Strike: Source again. You can find me on Indy Powerplant's GunGame server if I'm on, or my local Iceworld DeathMatch Box.

Happy Fraggin'.

17Jan/080

In-House Development

Don't ever try this if you work in education. Well, I take that back. Don't try this if someone above you would shit biscuits if you ran an unauthorized webserver on a workstation in your building. :)

It's not that I deliberately antagonize our network staff, its just more like...testing borders? Anyway, in two days I learned ASP, Access, and IIS; and created a full-featured web application solution to solve a problem at our building.

Network did not like this solution. At all. eventually they got overruled by the IT Manager, because none of them could create a better solution in the time he gave them (which was what, like 4 hours?). Anyway I would have preferred to create in PHP/SQL and sit it on the linux box, but there's no way I could ever touch that. :P

Anyway, in the end we now have a solution to our problem. However, I won't go on another Dell rant here, but suffice to say that the workstation I put this on got /.'d by ~40 users. Still dunno how that's possible. We're in week one of debug/live testing internally, and no major problems so far now that it's on a different box. I'll add a link to the code whenever I get around to uploading it.

Tagged as: , , , , No Comments
25Nov/070

Christmas List

Click here for my 2007 Christmas List

So here is my Christmas present to you, intarwebs: The source! This is PHP/MySQL and can be easily included in any PHP page. Get your list started early (late?) this year with new code!

<?php

  //
  // christmaslist.php
  // Chistmas List script for weblog
  //
  // Author: Joshua Worden, IWM Entertainment
  // Released Nov. 2007 under GPL
  //
  // Usage: Designed to be included on a page.

  /*
     --
     -- Table structure for table `christmaslist`
     -- 

      CREATE TABLE `christmaslist` (
       `id` int(11) NOT NULL auto_increment,
       `image` text NOT NULL,
       `title` text NOT NULL,
       `description` text NOT NULL,
       `price` float NOT NULL default '0',
       `date` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY  (`id`),
    FULLTEXT KEY `description` (`description`)
    ) TYPE=MyISAM AUTO_INCREMENT=5 ;

    --
    -- End table structure
    --
  */

  // Definitions 

  $_site['sql-host']      = ""; // MySQL Host (localhost)
  $_site['sql-user']      = ""; // MySQL Username
  $_site['sql-pass']      = ""; // MySQL Password
  $_site['sql-data']      = ""; // MySQL Database

  // Functions

  function DisplayItems($B_SORTED, $T_SORTMODE) {
    if($B_SORTED) { $Q_SQL1 = mysql_query("SELECT * FROM christmaslist ORDER BY ".$T_SORTMODE." ASC;");}
    else          { $Q_SQL1 = mysql_query("SELECT * FROM christmaslist ORDER BY date ASC;"); }

    echo "<div style=\"width:100%; text-align:center; margin:0 auto;\">\r\n";
    echo "<div style=\"width:100%; clear:both;\">\r\n";
    echo "<div style=\"width:20%;float:left;position:relative;\"><a href=\"?sort=image\"><b>Category</b></a></div>";  // [Image]
    echo "<div style=\"width:20%;float:left;position:relative;\"><a href=\"?sort=title\"><b>Title</b></a></div>";     // Title
    echo "<div style=\"width:20%;float:left;position:relative;\"><b>Description</b></div>";                           // [Description]
    echo "<div style=\"width:20%;float:left;position:relative;\"><a href=\"?sort=price\"><b>Price</b></a></div>";     // Price
    echo "<div style=\"width:20%;float:left;position:relative;\"><a href=\"?sort=date\"><b>Date Added</b></a></div>"; // Date Added
    echo "</div>";
    while($T_SQLRESULT=mysql_fetch_array($Q_SQL1)) {
      echo "<div style=\"width:100%; clear:both;\">\r\n";
      echo "<div style=\"width:20%;height:100px;float:left;position:relative;\"><img src=/images/thumbs/".$T_SQLRESULT['image']." /></div>";
      echo "<div style=\"width:20%;float:left;position:relative;\">".$T_SQLRESULT['title']."</div>";
      echo "<div style=\"width:20%;float:left;position:relative;\">".$T_SQLRESULT['description']."</div>";
      echo "<div style=\"width:20%;float:left;position:relative;\">$".$T_SQLRESULT['price']."</div>";
      echo "<div style=\"width:20%;float:left;position:relative;\">".$T_SQLRESULT['date']."</div>";
      echo "</div>";
      }
    echo "<div style=\"width:100%; clear:both;\"> </div>\r\n";
    echo "</div>\r\n";
    }

  function Error($T_ERROR) {
    // Show error
    echo "<div style=\"width:400px; height:150px; clear:both; background:#FF0000;\">\r\n";
    echo "\t<h4><font color=#FFFFFF>MySQL Error:</font></h4>\r\n" . $T_ERROR . "\r\n";
    echo "</div>\r\n";
    die;
    }

  // Connect to MySQL

  $B_SQLCONN = @mysql_connect($_site['sql-host'],$_site['sql-user'],$_site['sql-pass']);
  $B_SQLDATA = @mysql_select_db($_site['sql-data']);
  if(!$B_SQLCONN || !$B_SQLDATA){Error(mysql_error());}

  // Check for sort mode

  if(isset($_GET['sort'])) { DisplayItems(TRUE, $_GET['sort']); }
  else { DisplayItems(FALSE,"date"); }

?>
18Nov/070

[PHP|MySQL] Image Gallery

Short and not-so-sweet, an Image Gallery! I needed something for the site, and 4images just seemed too bloated for what I needed. And, being lazy, I didn't really wanna go and look for one that badly. So I wrote one. I'll be testing this later tonight, I'll post any fixes as they come up.

<?php

  // images/index.php
  // MySQL/PHP Image Gallery
  //
  // Author: Joshua Worden, IWM Entertainment
  // Released Nov. 2007 under GPL
  //
  // Usage: Designed to be used as index file in a subdirectory, or to point to a subdirectory

  // Definitions 

  $_site['sql-host']      = "";
  $_site['sql-user']      = "";
  $_site['sql-pass']      = "";
  $_site['sql-data']      = "";
  $_site['sql-table1']    = "";
  $_site['sql-table2']    = "";

  $_sql['select_gallerylist'] = "SELECT id,title from $_site['sql-table1']";
  $_sql['select_gallery']     = "SELECT * FROM $_site['sql-table2'] WHERE gallery=$id";
  $_sql['select_image']       = "SELECT * FROM $_site['sql-table2'] WHERE id=$id LIMIT 1";

  // Functions

  function Display_GalleryList() {
    echo "<div class=galleryblock>";
    echo "<div class=title>My Galleries</div>";
    while($sqlresult = mysql_fetch_array(mysql_query($_sql['select_gallerylist']))) {
      echo "<div class=thumb><a href=?Display=Gallery&id=$sqlresult['id']><img src=gallery.jpg alt=\"$sqlresult['title']\" /><b>$sqlresult['title']</b></div>";
      }
    echo "</div>";
    }

  function Display_Gallery($id) {
    echo "<div></div>";
    }

  function Display_Image($id) {
    echo "<div class=imageblock>";
    $count=1;
    while($sqlresult=mysql_fetch_array(mysql_query($_sql['select_gallery']))) {
      if($count\5=0) { echo "<br />"; }
      echo "<div class=title>$sqlresult['title']</div>";
      echo "<img src=$sqlresult['filename'] class=centered alt=$sqlresult['title'] /><br />";
      echo "<div class=description>$sqlresult['description']</div>";
      $count++;
      }
    echo "</div>";
    }

  // Connect to MySQL

  @mysql_connect($_site['sql-host'],$_site['sql-user'],$_site['sql-pass']);
  @mysql_select_db($_site['sql-data']);

  // Check to see what we're displaying

  if(isset($_GET['Display'])) {         // Check for correct info
    if($_GET['Display'] == "Image") {   // If displaying an image
      Display_Image($_GET['id']);
      }
    elseif($_GET['Display'] == "Gallery") {
      Display_Gallery($_GET['id']);
      }
    else { Display_GalleryList(); }
    }
  else { Display_GalleryList(); }

  ?>
Tagged as: , , No Comments
17Nov/070

[PHP|MySQL] Voting with IP Authentication

Here's another tasty morsel; I was working on a voting script for Sano and figured Ah what the hell I'll clean it up and release it. As usual it's GPL, with or without a link back. Here ya go,

<?php

  // votepoll.php
  // MySQL/PHP Voting script with IP Authentication
  //
  // Author: Joshua Worden, IWM Entertainment
  // Released Nov. 2007 under GPL
  //
  // Usage: Designed to be called within a webpage using include_once().

  // Functions And Definitions

  $_site['sql-host']      = "";
  $_site['sql-user']      = "";
  $_site['sql-pass']      = "";
  $_site['sql-data']      = "";
  $_site['sql-table']     = "";
  $_site['options_num']   = ""; // Number of options in your vote
  $_site['options']       = array();
  $_site['options'][0]    = "Sample Question 1";
  // ...

  $_site['script-uri']    = $_SERVER['PHP_SELF']; // Don't change unless using this externally.
  $_sql['select_all']     = "SELECT * FROM " . $_site['sql-table'];
  $_sql['insert_new']     = "INSERT INTO " . $_site['sql-table'] . " (vote, ip) VALUES (`" . $vote . "`, `" . $_SERVER['REMOTE_ADDR'] . "`);";
  $_sql['select_auth']    = "SELECT ip FROM " . $_site['sql-table'] . " WHERE ip=" . $_SERVER['REMOTE_ADDR'] . " LIMIT 1;";

  function Display_Basic () {     // Display voting page
    echo "<form action=" . $_site['script-uri'] . " method=post>";
    for($count=0, $count++, $count<$_site['options_num']) {
      echo "<div style=clear:both;><option name=$count>" . $_site['options'][$count] . "</option></div>";
    }
    echo "<div style=clear:both;><input type=submit></div>";
    echo "</form>";
    }

  function Display_Results() {    // Display results page
    // I didn't get around to doing this part.
    }

  function Display_AuthFail() {   // Display results/vote error
    echo "Sorry, a vote was already recorded for this IP Address.";
    }

  function Do_Vote($MyVote) {     // Process vote, go to results.
    $bool_query = @mysql_query($_sql['select_auth']);
    if(!$bool_query) {
      $bool_query = @mysql_query($_sql['insert_new']);
      }
    else { Display_AuthFail(); die; }
    }

  // Connect to MySQL

  @mysql_connect($_site['sql-host'],$_site['sql-user'],$_site['sql-pass']);
  @mysql_select_db($_site['sql-data']);

  // Check for correct referring mode

  if(!isset($_POST['DisplayMode'])) { Display_Basic(); die; }

  // Get DisplayMode

  $_page['DisplayMode'] = $_POST['DisplayMode'];

  // Call correct function due to DisplayMode

  if($_page['DisplayMode']=="Vote")         { Do_Vote($_POST['vote']); }
  elseif($_page['DisplayMode']=="Results")  { Display_Results(); }
  elseif($_page['DisplayMode']=="AuthFail") { Display_AuthFail(); }
  else { Display_Basic(); }

  ?>

Enjoy.