April 27, 2006: 3:30 pm: LokkjuCrazyness

I have a friend, relatively computer literate, but definately not a “geek”, who was taking a low level computer course at a community college recently. After taking his first exam, he came to me, asking about some of the questions.

Well, I thought, ok, I’ll take a look, and explain to him why some of the answers he gave were wrong - until I saw the questions.

after the break are the worst of the questions on the test, and you can get the whole test here. The “correct” answers are designated by an asterisk

For reference, the community college in question is Portland Community College, the course was BA 131, and the instructor’s name was Bill Bruno.

(more…)

April 13, 2006: 9:28 pm: LokkjuProjects

I needed a lits of all the asterisk functions, in a html list format, so I whipped up this:

CODE:
  1.  
  2. sudo -u www-data asterisk -rx 'show functions'|grep \(|awk '{print $1}'|while read line; do sudo -u www-data asterisk -r -n -q -x 'show function '$line''|perl -0777 -ne "\$f = \$_;\$f = s/\033\[(?:\d+(?:;\d+)*)*m//go;if (/function\s'(.*?)'.*?\[Syntax\]\n(.*?)\n.*?\[Synopsis\]\n(.*?)\n.*?\[Description\]\n(.*?)\n/sg) {print '<li>' . \$1 . '<span class="informal"><span class="syntax">' . \$2 . '</span><span class="synopsis">' . \$3 . '</span><span class="description">' . \$4 . '</span></span></li>' . \"\\n\";}" ; done
  3.  

and for all applications, xml format:

CODE:
  1. sudo -u www-data asterisk -rx 'show applications'|grep :| awk -F : '{gsub( /^ +| +$/, "", $1 ) ; print $1}'|sort|while read line; do sudo -u www-data asterisk -r -n -q -x 'show application '$line''|perl -0777 -ne "\$f = \$_;\$f = s/\033\[(?:\d+(?:;\d+)*)*m//go;\$f = s/\</&lt;/go;\$f = s/\>/&gt;/go;if (/application\s'(.*?)'.*?\[Synopsis\]\n(.*?)\n.*?\[Description\]\n(.*?)\n(.*?)\n\n/sg) {print '<application><name>' . \$1 . '</name><synopsis>' . \$2 . '</synopsis><usage>' . \$3 . '</usage><description>' . \$4 . '</description></application>' . \"\\n\";}"  ; done

Obviously, replace the www-data username with your asterisk username. Also, if you want to change the output details, just change the last bit, where perl outputs the results of the regex.

Have fun.

March 27, 2006: 7:16 pm: LokkjuProjects

Check out the new project at GMPrice.com

Well, I'm still doing more work on the GMaps Widget (I wish they would stop changing their code), and on the dnsEditor, but in the meantime I have a some project I recently put into alpha phase.

Please, don't pass this new service around too much - still in very alpha, and I would prefer to keep it light on the bandwidth.

At any rate, GMPrice (Grey Market Price) is a simple little tool for finding the average sold price of an item on ebay - this is very specifically just a "search proxy" - you type the query, it does the search, calculates some results, and returns them to you.

Next steps:

  • Right now it only looks at sold items with at least one bid - soon it will count "buy it now" sold items as well.
  • It will also eventually display a sold/unsold ratio

Oh yeah, I do need a logo for the Grey Market Price project, so... ideas/submissions are welcome

February 8, 2006: 8:13 pm: LokkjuProjects, Javascript

UPDATE:Source is now available!

So I finally found some more time to work on the dnsEditor interface - and I think I've done most of what was needed for now.
Demo: http://www.lokkju.com/projects/dnsEditor2/dnsEditor.php

Screenshot:
dnsEditor2: Ajaxified

Fixes/Additions:

  • Replaced all the +/- links to add/delete items with image buttons
  • Implemented Add/Delete Zones
  • Added a Refresh Zone List button
  • Added a hover tip box
  • Implemented multi-server update (through mysql) of modified records. (disabled in demo)
  • Automatically update the SOA serial with epoch time on changes

Still to possibly do:

  • Add TXT (and perhaps CNAME) abilities, this is actually very quick to do.
  • Add SPF generator to TXT records editor.
  • Add as you edit help - for instance, describe what the rules are for the feild you are currently in.
  • Add a verification function, to verify either a specific zone, or all zones in your DB, and generate a report (similar to dnsreports.com).
  • Add authentication, on a per zone, and possibly fine grained control of which records in a zone are allowed to be updated. Would most likely require seperate permissions table.
  • Add a database abstration layer for both different RDBMS and different table layout - I would love some suggestions on this. (MAJOR)

More suggestions are always welcome.

Original Post Here

January 26, 2006: 9:16 am: LokkjuProjects, Google Maps, Widgets

This is the unofficial Google Maps viewer for the OSX Dashboard.
Current version is 0.9c

Download

Version 0.9c Screenshot:
Gmaps 0.9a Screenshot
     Upcoming Version 1.0a Screenshot:
Gmaps Widget 1.0 Alpha

    Future Features:

  • Pop-out sidebar for directions support.
  • Print Functionality - options include new safari window, handle it within the widget, etc?
  • Some sort of route following function be of use (in directions mode)?
  • Support for loading your own xml/xsl mapping files.
  • Support for google's satellite maps (this is already done, just not enabled).
  • Support for TerraServer satellite mapping data - allowing better resolution, though with older photographs, for the satellite view.
  • Much better GUI - with design by Daniel Burka of SilverOrange

Update:
Still working on the bug fiexes, as google has switched to a new API - see the newest post on the subject here

    Current Bugs

  • It will not show the content in the popup pin windows.

I am always open to suggestions and improvements, so feel free to post in the comments section, or email me directly at lokkju@lokkju.com

January 12, 2006: 2:55 pm: LokkjuProjects

Normally, when using DB9 Modular ends, you use them with a "standard reversing" Cat5(e) cable - which is really only standard to a very small subset of people. If, like me, you are one of those people who always have the real "standard" Cat5(e) cable around - the stuff used for normal computer networking - then this pin diagram will show you how to create modular ends to turn it into a null modem cable. It is, after all, easier to carry a couple ends then it is a whole seperate serial cable. The other advantage, and the reason I do this, is because this makes it east to have double ended female, or double ended male serial cables - which are hard to find.

Anyway, the table:

Null Modem Cable End "A"

DB9 Pin # DB9 Signal Cat5(e) Color DB9 Connector Wire Color
9 RI (1)Orange-white (1)Blue
5 SGND (2)Orange (2)Orange
7 RTS (3)Blue-white (3)Black
8 CTS (4)Green-white (4)Red
4 DTR (5)Green (5)Green
6,1 DSR,DCD (6)Brown-white (6)Yellow
2 RD (7)Brown (7)Brown
3 TD (8)Blue (8)White

Null Modem Cable End "B"

DB9 Pin # DB9 Signal Cat5(e) Color DB9 Connector Wire Color
9 RI (1)Orange-white (1)Blue
5 SGND (2)Orange (2)Orange
8 RTS (3)Blue-white (3)Black
7 CTS (4)Green-white (4)Red
1,6 DTR (5)Green (5)Green
4 DSR,DCD (6)Brown-white (6)Yellow
3 RD (7)Brown (7)Brown
2 TD (8)Blue (8)White
January 10, 2006: 2:21 pm: LokkjuProjects, Javascript

Bind-DLZ (Dynamically Loadable Zones) is a patch for BIND version 9 that simplifies BIND administration and reduces memory usage and startup time. DLZ allows you to store your zone data in a database. Unlike using scripts, the changes in your database are immediately reflected in BIND's response to DNS queries, so there is no need to reload or restart BIND. You see, BIND "dynamically loads" the "zone" data it needs to answer a query from the database.

Though DLZ is the best thing to happen to DNS (and Bind specifically), it has one major flaw - there is no suitable front end for managing the database that DLZ uses.

Over the past few weeks I have been working on a front end for DLZ, and I think I finally have a decent one. Please note, this is a beta, and demo, only, and the code is for you to look at, not to use, as I am not sure on my licensing yet for this.

At any rate, here is a link to the demo:
http://www.lokkju.com/projects/dnsEditor/SampleEditInterface.php

It currently edits against a mysql database of sample data, which has the exact same table structure as the version I use for production (live) editing of our DNS records.

The two things that currently do not work right are adding and deleting actual domain names (only because I have not figured out the method I want to use, in terms of the GUI), and the SOA record layout is a little funky.

January 9, 2006: 3:18 pm: LokkjuProjects

BAStats is a statics package for tracking visitors to Wordpress enabled sites. Though in beta stage, it works great in both WP 1.5 and 2.0, however it has a flaw in being able to store ip addresses where the initial quad is greater then 127. There have been a few ideas for fixes posted in the comments of the BAStats blog announcement, but not none of them seem to be effective.

After looking into the code for a while, I think I found the problem, and a simple fix. The stats package is attempting to write a signed integer value into an unsigned bigint database field (mysql only supports unsigned bigints perhaps?). The simple solution is to wrap all calls to the php function ip2long() in a sprintf function, converting the signed int into an unsigned one before writing it to the database.

Here is a unified diff patch for fixing this bug:

BAStats patch for fixing the 255.255.255.255 Bug

January 5, 2006: 10:11 pm: LokkjuProjects, Google Maps, Javascript

About 6 months ago, when the Google Maps API first came out, I did some major work with it, both in providing functions to make it run better, and in extending it. Based on the idea by David Schuetz's TerraServer functionality for the old style of Google Maps hacking, I wrote a simple library to enable TerraServer maps through the Google Maps API (you can still get it here). I released it through the newsgroups, and then prompty forgot about it.

Well, today I was looking into some more Google Maps stuff (I use it on and off in many of my projects), and I found that there are quite a few sites out there using my library. Needless to say, I was pleasantly suprised. The two best are below:

AccuTracking - http://www.accutracking.com/
Weather Quality Reporter - http://weather.gladstonefamily.net/site/C0506

: 2:18 pm: LokkjuProjects, Javascript

Demo:

Filter:

States
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming

So I was working on my DNS Editor back end last night, while using iTunes - and I decided I want the same type of filtered list that iTunes has. About 4 hours later, I came up with this, so here it is. It really only takes two lines of code, and one class statement, to add:

HTML:
  1. <script charset="utf-8" language="javascript" type="text/javascript" />
  2. <input type="text" maxlength="10" size="8" id="filterable_filter" name="filterable_filter" />

then, in your table, just make sure your class name includes "filterable". The input box ID must be the table id plus "_filter". In addition, if you want to make a row that never gets filtered, you can include "nofilter" in the td's class name.

If you want to get the library right now, you cen grab it here. You will find the code for the demo down further.

Right now, I am filtering on the inputbox value being anywhere in each cell's text - however, since I am using a regex, it would be very easy to modify to only match at the start of the string, etc. Here within the next few weeks, I hope to mature this library to the point of have some way of specifying (perhaps based on the class) what type of match you want, as well as specifying which columns in the table you want to match against.

Thanks go to Stuart Langridge, over at Kryogenix, for ideas on handling tables unobtrusively, in his sorttable library (here). In fact, I wrote this library to be compatible with his - so you can have sortable tables, that are also filterable.

Sample code after the break

(more...)

« Previous PageNext Page »

Make payments with PayPal - it's fast, free and secure!

lapsnorkel lapsnorkle