Archive for the ‘Informative’ Category

XMind: The Diagram Tool For “Real” Men

Sunday, October 11th, 2009

I’ve used a Mac for quite a long time now. I used to need to diagram out database schematics and software charts, and recently I’ve gotten into business process charts. For a long time, the only tool I could find that was decent was Concept Draw. I’ve tried Omni Graffle, but found it sloppy. Concept Draw was easy to use, had the icons I wanted, and produced nice looking diagrams too. Unfortunately, it’s very expensive. Also, it ha sa major bug where sometimes when editing the text of an object, if I hit delete (backspace), it erases the whole canvas (the whole canvas actually disappears), and if I save it to save my changes, when I reopen it, the canvas is still gone. I.e. the bug is saved to the document, meaning I lose my work completely. This means that I can’t save my document when this bug occurs, and I lose the changes I’ve made since last save. It’s really annoying. Also, the program is huge, both in terms of resources and the size on the HDD.

Often I browse to look for a replacement. I’ve just discovered that X-Mind is now free. I spent about 30 minutes learning to use it, and learning to get it out of the mindset of “I only do mind maps” and have it producing nice looking flow charts. They actually look better than Concept Draw I think. Also, the relationships (connectors) between the objects (nodes) are much more flexible. The auto-routing is smarter, but when it fails, it’s very easy and intuitive to move the lines around. It uses curvey lines where appropriate too!

IPCop and pfSense

Friday, August 7th, 2009

I recently decdided to replace my Netgear FVX538 Modem / Router with a PC based firewall / router. The Netgear keeps crashing, dropping the ADSL link, and “forgtting” the WiFi password on reset. I’ve tried upgrading the firmware, and nothing seems to make it any better.

Anyway, the two PC distributions I decided to deploy for testing on real hardware were IPCop (1.4.20) and pfSsense (1.2.2). pfSense is incredibly slick and full featured. It really is an enterprise firewall OS in my view. The reporting options are great, and making changes / advanced configuration is sensible and easy (relative to the difficulty of performing the same changes on a normal *nix OS or a consumer firewall / modem device).

IPCop lacks a bunch of the features of pfSense, but none that affect me. The main difference is in the web interface. It’s just not as nice. It’s a little sloppier to use, and it looks a lot sloppier. It’s not terribly ugly, but it doesn’t look like something that would be produced by a commercial outfit, while pfSense does. The IPCop interface is relatively easy to edit though, it’s mainly just CGI files and a single CSS file.

There are a couple of other major function differences between the two distributions however. Firstly, pfSense is FreeBSD based (actually, based on m0n0wall), and IPCop is Linux based. I’m sure that’s the result of the practical differences that I found. What I’m talking about is the hardware support offered by the two operating systems. I had *a lot* of trouble getting pfSense to even boot from CD on Pentium hardware. Pentium 2 hardware was ok however. Even Pentium 1 MMX chips failed though. I’m sure it’s a minboard problem, as I’ve experienced the same issues with FreeBSD as well. Basically, some sort of incompatibility with the mainboard chipset causes the bootloader to fail to boot. Sometimes an immediate reset occurs, sometimes it crashes, and sometimes it fails with an error message. I tried more than half a dozen board / CPU combinations for Pentium grade hardware, and none worked with pfSense. Additionally, pfSense regused to acknowledge the presence of my Realtek chipset cards. I understand that they are cheap cards and will not offer the performance of a 3Com or Intel Pro card, but to not detect at all? That’s weird. FreeBSD has support for them, but it’s as if the kernel that pfSesnse compiled for their OS doesn’t include it. Weird.

I only tried IPCop on 2 Pentium grade systems, because that’s all I needed to try it on. I tried on a P120 and it failed to boot. I then tried it on a P90 and it worked fine. The system has a lot of RAM for a Penitum, 96MB, but it was nice to see it boot!

As to the performance, pfSense complains about having less than 128MB of RAM, and quite rightly so. It eats 64MB without doing anything. It also spikes my Pentium 2 350 CPU up to 80% load without network traffic. By spike, I mean when the OS is doing “housekeeping” activities.

On the Pentium 90 with IPCop, RAM usage didn’t exceed 32MB when not under network load, and the CPU didn’t exceed 20% usage without load. That’s a big difference; the numbers are smaller even on a ratio, so they are *much* smaller when taking into account the fact that it was running on a system that is 4x slower than the pfSense system.

What about stats for operating with load? I don’t know; I already decided to go with pfSense. Yes, it needs more hardware resources, and is more fussy, but it *is* better. I’m tired of compromising with routers. I’ve been through about 8 routers in the past 10 years, and I’m just tired. I’m 95% confident I can do everything I need to in pfSense right now, and have future support in it. With IPCop, I can probably do what I want in it now, but I’m not confident about future support, and I don’t like using the web interface.

PCI GFX FTW!

Thursday, August 6th, 2009

I recently redeployed my main desktop computer to be a virtualisation hub. I’m going to run a headless VirtualBox setup on Ubuntu with it. It’ll only be using CLI. At the moment the specs of the desktop are:

  • 3G DDR2
  • 2.66Ghz Core2Duo
  • Asus P5K
  • ATI Radeon 2900XT

Now, when idle, Core2Duo’s are quite power efficient. And I’m going to be merging 3 physical boxes into this one, but none of them do continuous work (hence why I’m merging them). For some reason, when sitting idle (I haven’t installed the real OS yet, it’s just a testing version of Debian Lenny on there with no services), the machine was still spewing out heat.
It turns out that even on a CLI, the Radeon card gets quite toasty. I mean, not hot by gaming standards, but hot compared to say, an entry level card. I happened to have an entry level card around: an ATI X1300. So I thought, I’ll quickly swap them out, ensure that it was indeed the GFX card, and go merrily on my way. No such luck. The X1300 was a dud. Sometimes the PC would get to the POST if I wiggled the card, only to complain that it didn’t have a card, and other times it just wouldn’t POST at all.
Now, this is a 2008 model system. I mean, it’s early 2008, but it was top of the line. But it has PCI cards. And I figured I had a TNT2 PCI version around somewhere, or something. The “or something” turned out to be a generic PCI card. I also had an S3 trident, but I wanted to see if the generic card worked. It looked older than the S3. That means it’s about 20 years old now. I didn’t even know if recent motherboards are able to detect and boot with a PCI graphics card only. I do now. They can. Mine did. Sweeeet! It makes _no heat_. There’s not even a heat sink on the card. It doesn’t display the BIOS graphics splash screen properly (the whole “powered by Intel” image), but it displays the actual text fine, BIOS is fine, VESA images is fine (i.e. the Linux boot splash screen). It’s so cool. It also takes up a fraction of the space that the 2900XT did.

Now my system runs cool and uses less power, I’m happy[ier] :)

Debian Crontab Fun

Saturday, August 1st, 2009

I have a couple of entries that I added into my system crontab file a while back that I noticed immediately working. I’ve been running the command manually for a while because I couldn’t be bothered invetigating. When I did sit down to investigate, I found that running:

crontab /etc/crontab

Makes crontab echo the output to STDOUT. Including errors. It’s kind of annoying how those errors don’t appear in my system message log normally, but at least I found the error! The error - what looked like wordwrap wasn’t, and so crontab was seeing a syntax error ;)

Jailbreak & Unlocking an Iphone 3G w/ 2.2.1 FW

Friday, July 10th, 2009

How to do this EASILY via software using Mac OS X?

I spent a long time trying to figure this out. Ziphone doesn’t seem to do it (it doesn’t brick the iPhone, it just forces a restore). Some of the others are too hard (SSH’ing to the iPhone, come’on really…script it or something!). Sure, I understand the reason why 2.2 works and 2.2.1 doesn’t for the unlock (the baseband upgrade), and honestly, I don’t care. I just want to be able to click a button and follow some on screen instructions ;)

My final (working) solution? Don’t. Upgrade to 3.0 and do it with that.

Basically, get a copy of redsn0w to jailbreak the 3G 3.0 firmware and install Cydia, then add the Ultrasn0w repository and install ultrasn0w. Complete! I also did this on an un-activated iPhone by doing the install via Wifi instead of 3G.

Complete instructions for obtaining and installing redsn0w are available at iClarified.

Complete instructions for the jailbreak + unlock technique are available at Quickpwn (obviously, using the instructions above for the jailbreak…it really doesn’t matter how you jailbreak your phone, only that it /is/ jailbroken to enable the Cydia install).

Alternating Colored Rows in Open Office Calc 3

Monday, June 22nd, 2009

You’ve probably seen spreadsheets produced using Microsoft Excel that have this kind of look. You might have seen files produced using OpenOffice Calc that look like this. Excel 2007 comes with many (and I mean lots) of styles for the tables, many of which include alternating row colors. Calc comes with about 10 styles in total, 3 of which use alternating styles, none of which look very “professional” in my opinion (I’d never use them), and all of which are unwiedly and unconfigurable. So, aside from selecting the rows individually one by one and setting the alternating colors (then inserting a cell and having to redo it all over again, ugh), does OO Calc 3 provide an easy way to do this?

Not so far as I can tell. Google showed up a couple of options, all of which were either too hard to setup or too difficult to change once it was setup. I have to conclude that OO3 doesn’t provide a pre-built function for this. But it does give the tools necessary to create one. I’m talking about the conditional styling. Here’s what I do.

We want to apply a conditional style that says “If this cell is even then make it color 1, if it is odd then make it color 2″. Conditional formatting relies on styles being defined. You can’t just tell the Conditional Formatting box that you want the cell to be color 1. You have to tell it that you want the cell to be style1. No problem, all we need to do is create a style based off the default that has a different background color.

If you’re styles window isn’t showing, just go up to the Format > Styles and Formatting option from the menu and it will. In my window I already have the styles defined, but you want to right click in the window and select “New”. Set the name of the style (as you can see, I’ve given mine obvious names for what I used them for). Go to the Background tab and select your desired color.

Click ok to exit the dialogue box. You’ll probably want to create 2 styles like I have, one for your “light” row and one for your “dark” row. Once you’ve done that, we’re ready to setup the alternating row colors in the actual table. Select the cells that you want to apply the alternating row color to and go up to Format > Conditional Formatting like I’ve done below.

Once you’re in the Conditional Formatting dialogue box, we need to set 2 conditions. The first one is “if cell is even” and the other one is “if cell is odd”. Every cell falls into one of these two categories in an alternating fashion. By default the dialogue box asks for “Cell Value”. You need to drop that box down and select “Formula”. You also need to tick the 2nd condition box and drop that down to “Formula” as well. It doesn’t matter what order you enter these in, but the formula for the odd cell is:

MOD(ROW();2)==1

And the formula for the even cell is:

MOD(ROW();2)==0

Then select the appropriate style for each i.e. you’re newly created styles.

Click OK to apply the settings and your rows should be alternating with the colors you set in the styles. Woohoo! :)

Some notes:

  • To edit the colors that are applied, just edit the styles. Click on your style then click on “Edit” and just go change the background color.
  • Conditional formatting is applied on a per-cell basis just like when you make the text in one cell bold. If you copy a cell from somewhere else in the sheet that is not part of the alternating rows, and paste it into the sheet (overwriting some other data perhaps), the pasted cell will not have the conditional formatting and thus will probably not have the right color. The easiest way  I have found to fix this is to re-select the cells in the alternating colored table, and re-apply the conditional formatting. This is easy because when you go into the conditional formatting dialogue box, the formulae should already be there, and clicking OK will apply it to the new cell.
  • The formatting is dynamic. That is, as you insert rows, the numbers of the rows change, and so the table automatically re-adjusts for the correct alternating row colors.

FreeBSD 7.2 & Eclipse Installation Problems

Tuesday, June 16th, 2009

I compiled Eclipse from ports in PCBSD, which is the FreeBSD ports. I have updated them, so they are current. Upon running Eclipse, it bails and dumps the log file:

java.lang.UnsatisfiedLinkError: no swt-gtk or swt-gtk in swt.library.path

Along with a bunch of other referencing errors as to why the file is needed. The solution? Remove Eclipse:

pkg_delete eclipse-3.4.2

Then reinstall it as the package:

pkg_add -r eclipse

Why didn’t I do this originally? I did, it failed to install for some reason or other. Incidentally, when I installed it from the package system, it installed 3.4.1. Not that it really matters, it runs, and that’s what matters! *And* because it build the dependencies from source (I only removed the Eclipse program), I have an optimized version of the JDK woo!!!

PCBSD and Mencoder

Monday, June 15th, 2009

Recently I wanted to rebuild the index of an AVI file in PCBSD. I know AVIDemux will do this if you open the AVI and set the audio / video encoding to copy, and save it. This is good, because AVIDemux is available as a PBI installation package for PCBSD. Unfortunately, AVIDemux failed to open the AVI file (probably because the index was bad and it got confused). Anyway, I know that mencoder (the encoder part of MPlayer) will also do this. It’s command line based, and not included in PCBSD. So, I built it from ports. It wouldn’t build with x264 support, but that’s ok, I got it to build with the ‘normal’ codec selection.

My first attempt to run it yielded:

[spanky@zen /usr/home/spanky]$ mencoder
/libexec/ld-elf.so.1: Shared object “libtwolame.so.0″ not found, required by “mencoder”

Bu in the build process it had stated that the TwoLame libraries were found. I don’t know where it found them, but *I* found them in the VLC directory. Because PCBSD uses isolated installation files (i.e. the installation file includes all “shared” libraries required by the program for execution), and it is possible to uninstall those programs, all libraries that a program needs are kept in that programs directory. That means, if you install 2 programs from a PBI that use the same library, you will have 2 copies of it on your system. This isn’t unusual, Windows does this as well. Anyway, I happened to have VLC installed from a PBI, and VLC uses the TwoLame library also. So, it was simply a matter of linking the VLC version to the normal library search paths so that mencoder would execute:

[root@zen]/lib(85)# ln -s /usr/Programs/vlc0.9.9a/lib/libtwolame.so.0 /usr/lib/libtwolame.so.0

And then everything was peachy and I could [M]Encode!

PC-BSD 7.2 Ports Error

Sunday, June 14th, 2009


When building ports in PC-BSD 7.2 I often get this error:

autom4te: need GNU m4 1.4 or later: /usr/local/bin/gm4

The actual cause is that /usr/local/bin/gm4 does not exist in PC-BSD. PC-BSD places it in /PCBSD/usr/local/bin/gm4. All you need to do is symlink it, and everything should build fine:

ln -s /PCBSD/local/bin/gm4 /usr/local/bin/gm4

More SSH Problems

Sunday, June 7th, 2009

I seem to get problems with SSH every now and then, and they are always a little obscure. I guess it’s just because I use it so much. Here’s my latest one.

spanky@spanky:~$ ssh admin@jenny
ssh_exchange_identification: Connection closed by remote host
spanky@spanky:~$

Ok so we have a Windows style error message - it tells us the connection was closed, but no indication of why. I also tried SSH’ing from multiple different boxes which normally work, and all yielded the same error. Jenny is a FreeBSD 7.0 box I use for database testing. I logged in physically to check this out. and found that my messages log file was spammed with errors of the /dev/null file missing. Interestingly enough, I couldn’t run any programs (w, ls etc.) because they all complained about the null device. I never realised how much depends on it…

The cause of this was that when I was compiling the Percona database source, it removed my /dev/null file. Incidentally the Percona compilation failed, although it is a problem with the InnoDB source / Makefile that is known. Anyway, a quick reboot of the server fixed it as it causes the device filesystem to be repopulated. If you every get this happening on a production server, I suppose you could just mknod the null device. I don’t know what the correct major / minor numbers on FBSD7.0 are though. There wasn’t really any need to learn given that I knew a reboot would fix it anyway - it did. :)