May 192010
 

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.

May 072010
 

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

May 052010
 

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.