Change of pace, my garden.
It is tough living in a duplex, with no lawn. My dream of a garden seemed to die with the purchase of the house. But never fear, where there is a will, there is a way.
I got six fish trays filled with dirt. Then added the veggies, two with carrots and four with potatoes. I placed these on the second tier of rock wall in our back yard. This allows the veggies to get reliable sun throughout the day. The height makes weeding and watering quite easy.
Take a look at the pictures below taken last month. Notice the potatoes on the far right. It was the first potatoes I planted, and by far grew the fastest (the other trays had a 1 day disadvantage). However, it was pure top/potting soil, while the other 5 trays also contained a mixture of peat moss. Over the summer, all of the other trays over took the potatoes planted first. There was a 2 to 3 week period before the other 5 trays even started growing. The 5 trays did end up with a lot of weeds, but once the veggies took hold, they really took off.
I’ll let the pictures speak for themselves. I’ll post more pictures toward harvest time.
Hesk Enhancements for Version 2.2
I’ve ported my popular (that means more than one person is using it.
) hacks from version 2.1 of Hesk to the new 2.2. You can read the whole tutorial on my wiki: http://wiki.cornempire.net/hesk/hesk22/
For those upgrading, you will need to reapply the hack to the new files. The differences were pretty minor between 2.1 and 2.2. I’ll outline the differences here:
- The line numbers are different for the files
- The function print_add_ticket_start that you need to add needs a few additional lines to bring in the global stylesheets. This was not required in 2.1
- I also made a small tweak to this function so that there is no category selected by default, allowing you to select the default category via the dropdown box. Previously, this would have been unselectable.
I’m working on a screencast of applying this hack for those who are more visual learners. So stay tuned for that.
To take a look back at my previous post, and learn more about Hesk, click here.
Desktop GUI Programming (Python (PyDev, pygtk) and Glade)
I recently decided to get back into desktop applications. Since about 2000 I’ve focused on developing for the web using Perl and PHP (mostly PHP). But sometimes it is nice to write a desktop app, instead of having to write a web app for everything. I’ve written some applications using the PHP CLI option, but that isn’t quite the same as a gui. My motivation was to write a GUI that controlled ffmpeg and would allow me to capture screen casts for tutorials I needed to make.
I started my adventure looking at a GUI frontend for PHP. And ran across PHP-GTK+. I installed it, and looked at some tutorials on it, but the more I looked, the more it looked like the community was inactive and stale. I also couldn’t find any way to package my application to share with others. They would need to install PHP, compile GTK+ (which wasn’t all that easy), reconfigure PHP and then run my application. Although most of the programs would be for my eyes only, it would be nice to have the option to share from time to time. So that was the end of the road for my PHP adventure.
I then decided to look at other languages for developing the application. I considered some of the options out there, Java, C, Ruby, Python, but decided to give Python a try. I’ve coded Java before, and I wasn’t a fan. Always seemed like overkill for everything I wanted to do. I’ve heard lots of good stuff about Python, and it is usually installed with most Linux installations, so this was my language of choice.
I then began looking for a good IDE for Python. Being a big fan of Eclipse, I ran across pydev for Ecplise. A simple install into the software manager in Eclipse, and I was off to the races. You will need to configure the location to your python binary, which for me (Ubuntu 9.10) was in /usr/bin/python2.6 Enabling this, gives you all the fancy code completion which I love so much. If you need to set it up, you need to visit (In Eclipse) Window -> Preferences -> Pydev -> Interpreter – Python -> New… and browse to your python binary. (If you do not have python available, you may need to install it first using apt-get or Synaptic Package Manager. Just search for python, and it should install everything you need to get started.) Here are some tutorials for getting started with Python:
I’ve used Glade once before, very briefly just to figure out what it was. It is a GUI drawer. Similar to the GUI drawer in Visual Basic, it allows you to layout your interface without using code. It creates XML files which can be imported by your application (and it has bindings for many languages) that create your interface. You just need to connect your code to the signals in the GUI, and you can make magic happen. You will need to install Glade via Synaptic Package Manager. The current version is the 3.6 series. Here are some great tutorials to get you started with Glade:
- GTK+ and Glade3 GUI Programming Tutorial
- Writing a GUI app with Python & Glade
- A Beginner’s Guide to Using pyGTK and Glade (older, but still useful)
So, my first dabble in GUI desktop programming in a decade, and my first taste of python. About 5 hours later I had written the application I wanted. It is an 84 line python script binding to one glade file for the interface. It allows me to select a window, and using a pre-set configuration, launch ffmpeg and record a screencast. Still a lot of work to do before it is ready to be shared, but it is a great start. Using pydev via Eclipse for the Python coding, and Glade for the interface design, you should be able to turn out some simple desktop apps in a matter of hours.
This is probably just the beginning of my python coding, so you may see more here on that in the future.
The Director! is Complete!
Announcement
At long last, The Director! is complete. This is the URL redirection php/apache script that I mentioned early last month. Had a few minor things to fix up, which I finally did last night, and now it is available to all.
It is a very rough looking piece of software, true to my views that admins shouldn’t care what the software looks like, provided it works correctly, and it looks pretty to the public. Since I suck at UI, AND The Director! has no public face, this is the perfect project for me!
So what does The Director! do?
The Director! is a URL shortening/redirection service similar to tinyurl and others that allow you to point one web address to another (presumably a short one to a longer one). Currently it does some simple stat tracking (if you want) on the URLs, and allows you to manage your redirects. More information and a download can be found here: http://www.cornempire.net/go/director (this shows The Director! in action as I have it installed on my site now).
Requirements and Cost
The Director! is a free download, available under an undetermined licence at this time. You are free to use it, just don’t take the code and sell it. If you make any modifications, feel free to share them back to us (submit an issue to the bug tracker and attach your code). We provide no support or guarantees/warranty for the code, if you choose to use it, you are on your own. Later, I’ll enumerate that into some sort of formal licence.
In order to make use of The Director! you will need:
- A webserver
- PHP running on the webserver
- A domain name of some sort
- A rewrite module for fancy redirects (instructions provided for apache and mod_rewrite)
You will need access to edit your webserver config, or .htaccess file if you are on shared hosting.
If you run into any issues, make a note below and I’ll do my best to help. But again, no formal guarantees or warranty come with the application.
Screenshots
Certainly nothing to be proud of…but here are some screenshots of The Director! in all of it’s ugly orange glory:




Credits
Other then me, many thanks to Pat for his help in writing The Director!. As well as credit to Mark James for the Silk Icons which I don’t think I’ve actually put to use yet, but when I redesign the GUI, I will.
CBC Play On Hockey Tournament
This past weekend, me and a few friends played in the National CBC Play On street hockey tournament. It is a 3-on-3 tournament with a goalie. We played in the Adult Beginner division, and we had a pretty good go of it. Ended up finishing in second place, losing the championship game after a tough string of games to get that far.
I played defence most of the time as did Stefan, while Pat and Matt played forward and Chris played goal.
In the round robin we finished in 3rd place, tops of the teams who suffered a defeat:
Game 1: Hawk’s Heroes vs Doom’s Crew: 2 – 1 win. (8 AM)
Game 2: Hawk’s Heroes vs Johnsons: 8 – 5 loss. (Noon)
Game 3: Hawk’s Heroes vs GFW Shockers: 14 – 6 win. (6:40 PM)
In game 3, we only had 3 players, so we had no substitution. Stefan played goal in Chris’ absence. We played an exhausted Shockers team and ended up doing quite well (I even scored 2 goals).
Sunday was a different story. Starting at around 11 (they were late starting the game..as usual), we had a rematch with sixth seeded Doom’s Crew. Another hard fought 2-1 victory.
This win saw us playing at 12:40 against the undefeated Dark Park Destroyers. This was our hardest game yet. The game was tied at ones after the first half. The second half of the game, we could hardly get the ball out of our end. We had no solid chances to score, and defencively we were scrambling to stay alive. Late in the second half, Matt took a nasty fall on his chest as he went hard to the net and got tangled up with the goalie. Chris played awesome in goal, and managed to get us to a shootout. Pat, Stefan and Matt were our three shooters, and Matt managed to score on our final shot, and Chris shut the door to preserve the win. So we punched our ticket to the championship game at 2:40.
By this time we were all starting to get pretty beat up, and very exhausted. We were facing the number one seeded team who had only played one other game that day. This game started on time, and we managed to make it out of the first half with a 2 – 1 lead, but that is when the wheels fell off. It started to rain, and the street got very slippery, especially where the buses stop, as that pavement was full of oil. Our earlier games caught up with us, and we didn’t have much run left in us. They racked up a few quick goals with some great passing and ended up 6 – 2. We got one back, at 6 – 3, but they finished off 7 – 3.
So we ended up in second place. It was a great weekend, and we did better then we all thought we would, especially since most of us only play once a month or so. Hopefully we will be able to play again next year, and win it all. Attached is the playoff bracket.
Did you play in one of these events across the country? If so, leave a post below.
Art, with ASCII, Asciio and ditaa
Art…with ASCII you say. Well yes I do. Anyone from back in the day will appreciate ASCII art. Better yet is the ability to create ASCII art and diagrams easily. Enter the players:
asciio is a tool that allows you to easily make ASCII diagrams.
ditaa is a tool that converts ASCII art diagrams into rendered images suitable for webpages or publications.
These tools allow you to make nice rendered images and ASCII diagrams. As some have put it, ASCII Visio.
I’ve created a tutorial an how to modify asciio to better create ditaa diagrams. You can view this tutorial here: http://wiki.cornempire.net/asciiart/start Soon, many of these changes will be integrated with the package available with Debian Sid (and by extension, any Debian based Linux distribution).
The ideas for the modifications came from here: http://strawp.net/archive/geeking-out-with-diagrams-in-ascii/ and those ideas lead to the more expansive tutorial linked above. Thanks to David Paleino at Debian who has packaged Ditaa and asciio and may integrate some of these changes into the packages in the future.
If you use, or have interest in ASCII diagrams, leave a comment below.
New Project: The Director!
Just a quick announcement that I’m working on a new programming project called The Director!. It is essentially a url redirection/shortening service written in PHP and utilizing the apache rewrite module to do the really cool stuff.
Those in the know realize that creating such a service is just a few lines of code in the vhost entry for apache, and then a few lines of code in a php script to do the redirection, but the goal here is to make it easy to use management interface with a bit of simple stat tracking.
Hoping to have version 0.1 out this weekend (depending on how my fence construction goes this weekend).
You can view more information here: http://wiki.cornempire.net/thedirector/start
Useful Database Commands
Here are some neat database commands I recently came across while I was trying to get statistics and status information on some mysql and postgres databases.
Postgres
This will give you a list of all of the databases in the server.*
select datname from pg_database;
* If you don’t know how to connect to postgres from the command line, don’t fear (well fear a little). What I had to do was su to the user that is a DB user, and then run /usr/local/pgsql/bin/psql This launched a command line client (without needing a password), that let me query the server. I can’t provide a better understanding then that, as this is the first time I’ve ever interacted with a postgres server.
This tells you how big a particular database is.
SELECT pg_size_pretty(pg_database_size('xythosdocs'));
The output is like this:
pg_size_pretty
----------------
2834 MB
(1 row)
Mysql
Get all database sizes:
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema;
Produces output like this on the command line:
+--------------------+----------------------+------------------+
| Data Base Name | Data Base Size in MB | Free Space in MB |
+--------------------+----------------------+------------------+
| blogadmin | 0.35750008 | 0.00098896 |
| blogs | 90.60342026 | 27.73141003 |
| information_schema | 0.00781250 | 0.00000000 |
| musicschedule | 0.00548172 | 0.00020599 |
| mysql | 0.54032421 | 0.00000000 |
| phpflash | 0.77745819 | 0.00000000 |
+--------------------+----------------------+------------------+
Get some status information on the sever. Run this from the command line:
mysqladmin -uroot -p status
Phpmyadmin also provides a lot of process status information if you have that installed.







