Time Until Wedding
Days
Hours
Minutes
Seconds
 
Navigation
 
Search
 
My Usable Projects
 
Reading...
 
Listening...
 
Random Image
ROGERS__0529.jpg
 
Archives
 
Me. Elsewhere.
 
Feeds and Such

Google Reader or Homepage
Add to My Yahoo!
Add to Technorati Favorites!
Bookmark del.icio.us
Bookmark Furl
Bookmark Spurl
 
Darcy
 
Things I Like
boingboing
 
License
 
Scott Scholar Dinner

Had the Scott Scholar Dinner out at “the barn” tonight. It was about as akward as the last two years. This time I decided to just forget about that whole “socializing” thing and just hang around with Joe, Mike, and Bill.

I had a good time and lots of Coca-Cola, though I ate most of my tasty dinner without chewing much, I had a dental appointment earlier today. Anyway, here are three cell phone snaps from the Scott’s place. They’re actually from last year, but whatever.

The Barn The Flame Thingy Me and The Half-Horse

P.S. I was sad that Dave wasn’t there this year, but at least I got a high-five from Leland.

Posted October 31st, 2006 - Permalink
Categories: School
2 Comments »
 
PHP/Cron Based IP Tracker

I connect to my home machine from work and school fairly regulary, I’d say at least three times a week, often more. The problem is, COX runs DHCP and every once in a while my lease expires and I get a new IP. It’s not too often, but when I can no longer get to my machine it’s frustrating.

No more comrades. I wrote this little PHP script to handle the problem, and the really neat part (I think) is that it uses itself for the data storage. Slick, I know. It’s an idea much like the no-ip and dyndns services. Anyway, here it is, you can just hook up a cron job to keep it up to date.

If you wanted to you could add simple authentication, though if a script-kiddie wants to waste his time flooding the thing with incorrect IP’s, what do I care? It should fix itself in (insert the time spacing of your cron job here) anyway.

P.S. One caveat here is that thanks to some weird bug or combination of bugs in WP I can’t post PHP code that has fopen, fgets, fclose in it. Thus everywhere you see // HERE in the code I’ve added a space to one of those function calls that needs fixing. It’d probably be easier just to grab the source at this link.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
  $curIP = "0.0.0.0";
  $newIP = $_SERVER['REMOTE_ADDR'];
  // This should be this file
  $filename = "iptracker.php";
  if($_GET['set'] == 1 && $curIP != $newIP)
  {
    $handle = f open($filename, "r"); // HERE
    // These throw away the first two lines
    f gets($handle); // HERE
    f gets($handle); // HERE
    // Put the rest of the file into a buffer
    while (!feof($handle))
    {
      $buffer .= f gets($handle); // HERE
    }		
    f close($handle); // HERE
    // Write it back
    $handle = f open($filename, 'w+'); // HERE
    $buffer = "
<?php
    \$curIP = \"$newIP\";
    ".$buffer;
    f write($handle, $buffer); // HERE
    f close($handle); // HERE
    print "Updated.";
  }
  else
  {
    print "Current IP: $curIP";
  }
?>

Update (11/01/06)
I didn’t check the operation of this script enough and it turns out there was a bug, at least in my implementation. It was adding a newline and not removing the old IP address, so it was essentially not working. Easily fixed, and my new source has replaced the old at the link (though it has not been changed above).

I also realized that I didn’t throw in the cron part of this in the first posting. I use lynx for the job, though wget works too. Here’s my command, I cron it every hour.
lynx -dump http://www.example.com/iptracker.php?set=1 > /dev/null

Posted October 27th, 2006 - Permalink
Categories: Linux - PHP - Programming
No Comments »
 
Sunchips and Mountain Dew

The lunch of champions.

Posted October 27th, 2006 - Permalink
Categories: Uncategorized
No Comments »
 
Ozma Show

I saw Ozma at Knickerbockers in Lincoln last right. Awesome show. They played for a long time, and we got them to play an encore of Battlescars and Rocks as well. Those guys are so awesome.

With them were “Everybody Else”, who I liked. They were, in Adam’s words, “Rooney meets the Beach Boys”. Good band, though it took forever to get them set up so they didn’t play as long (I think).

Also there was an amazing band from Lincoln that I have once again forgotten their name. Wilson, or something. Good bar band, the guitarist could really make his firebird scream.

Update (10/25/06)
The Lincoln band’s name is Willis and they are delicious.

Posted October 25th, 2006 - Permalink
Categories: Concerts - Music
No Comments »
 
Javascript Password Generator

Wrote this for a page at UNO. Simple, quick password generator.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<script type="text/javascript">
  var passwordElements = new Array(36);
    passwordElements[0]="0";
    passwordElements[1]="1";
    passwordElements[2]="2";
    passwordElements[3]="3";
    passwordElements[4]="4";
    passwordElements[5]="5";
    passwordElements[6]="6";
    passwordElements[7]="7";
    passwordElements[8]="8";
    passwordElements[9]="9";
    passwordElements[10]="A";
    passwordElements[11]="B";
    passwordElements[12]="C";
    passwordElements[13]="D";
    passwordElements[14]="E";
    passwordElements[15]="F";
    passwordElements[16]="G";
    passwordElements[17]="H";
    passwordElements[18]="I";
    passwordElements[19]="J";
    passwordElements[20]="K";
    passwordElements[21]="L";
    passwordElements[22]="M";
    passwordElements[23]="N";
    passwordElements[24]="O";
    passwordElements[25]="P";
    passwordElements[26]="Q";
    passwordElements[27]="R";
    passwordElements[28]="S";
    passwordElements[29]="T";
    passwordElements[30]="U";
    passwordElements[31]="V";
    passwordElements[32]="W";
    passwordElements[33]="X";
    passwordElements[34]="Y";
    passwordElements[35]="Z";
 
  var RandPassword = "Z";
  var rightnow = new Date();
  function generatePassword(firstInput, secondInput)
  {
    for(x = 0; x < 7; x++)
    {
      RandPassword += passwordElements[Math.floor(Math.random(rightnow.getSeconds())*36)];
    }
    document.getElementById(firstInput).value=RandPassword;
    document.getElementById(secondInput).value=RandPassword;
    RandPassword = "Z";
  }
</script>

Update (10/25/06)
I suppose it would be useful to suggest popping an alert box to let them know what their “random” generated password is. We actually use the handily insecure method of emailing it to them, but throwing up an alert would work nicely. Though if you aren’t on SSL why bother with trying to be secure anyway? *sigh*

Posted October 23rd, 2006 - Permalink
Categories: JavaScript - Programming
No Comments »
 
More Posts
« Older
Newer »