March 26th, 2006 by greg
Sadly many people use tools like Microsoft Word or OpenOffice.org to maintain large structured documents. If you’ve ever used a tool like this to maintain a large document you’ve probably already grown to hate it. Things like latex and DocBook make handling structured documents much more bearable. I’ve come up with some simple code that allows me to integrate DocBook documents into my website.
Read the rest of this entry »
Category: Geek, Site |
4 Comments »
March 21st, 2006 by greg
Tonight I tried to figure out how I might be able to write some nice Docbook documentation for this site. The goal is to have a way that I can integrate the docbook content into my wordpress site. I spent some time looking for something that already does this and my search turned up empty. My next step was to look into available stylesheets for Docbook. A quick search using apt revealed some stylesheets. I installed them and attempted to use them using the docbook2* scripts that I’m used to. This proved to be a failure. I then found xmlto via apt (you just have to love apt-cache search). This was the tool I was looking for. This allowed me to use the stylesheets that I installed.
// This produced output using the system default stylesheet
$ xmlto -o html xhtml mydocbook.xml
// And this used the stylesheet that I had installed
$ xmlto -o html -x /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl html mydocbook.xml
I guess the next thing for me to do is to learn to write my own stylesheet so that the output integrates into wordpress.
Category: Geek, Site, Tips |
No Comments »
March 19th, 2006 by greg
All too often I see code that is commented like this:
/*
Function: foo
foo does baz to bar
*/
int foo(int bar);
This is stupid. It is obvious that the documentation block is describing the foo function. This type of commenting is extremely common and I don’t understand why programmers feel compelled to waste their time like this. I’ve seen this practice required in coding standards! The only time this practice could be considered acceptable is if you are using a documentation extraction tool that can not parse your language. If you are using a tool like that you ought to use something better (or write your own, it’s not that hard). Java has javadoc, for C and C++ there’s Doxygen.
Category: Code |
1 Comment »
March 18th, 2006 by greg
Not too long ago I purchased a computer system from New Egg. When I got to the checkout screen I was given the option to get a free subscription to PC magazine; a $10.00 value. I knew from experience that PC magazine really is not a good magazine for me. It’s packed with ads and questionable reviews. Most importantly I’m just not their target audience because I’m beyond that level of geekdom.
I was surprised to see that you could get the $10.00 refunded to you provided you filled out a form and mailing it with your New Egg receipt. I did this and was careful to include all of the required items listed on the form. Today I got a letter from PC Magazine telling me that they could not honor my refund request. They didn’t state what they claimed I had forgotten to do but claimed that I had forgotten something.
It is possible that I forgot something but I think it’s very unlikely. I find it far more likely that they are simply not honoring the refund. It’s not worth fighting for $10.00 and they know that. In fact I didn’t keep any record of the refund offer because I knew when I sent it in that it wasn’t worth a fight. If I got the refund I would be pleased.
No refund from PC magazine but at least I don’t have to take the time to discard their terrible publication each month either.
Category: Geek |
No Comments »
March 14th, 2006 by greg
I’ve decided against using ipsec on my router. This is mostly because the openswan packages in the white russian release of OpenWRT are broken. I found alternate ones which I can get to work but those packages break many other parts of the system (wan interface won’t start at boot, dnsmasq doesn’t work right, etc). I looked into openvpn, and that might be somethign I’ll try – if – I can successfully get a machine behind the router to do the decryption of the traffic. The processor in the wrt54g isn’t really beefy enough for what I want to do with it. As for now I”m happy. I can block NFS traffic from the wireless interface. I settled on using WEP plus mac address filtering on the wireless interface. Since I broke the default bridge I have the wireless in a different subnet. That makes it easy to prevent access to NFS from the wireless network. Once I get MythTV working like I want I will probably come back to openVPN so that I could watch shows on a laptop on the deck… I’ve installed snmpd and setup MRTG so I get pretty graphs of network traffic over each interface. I also use SNMP from the inside network to find the IP address of the WAN interface on the router. An internal machine uses the DDNS feature of bind to update my DNS for my home network
Update: I’m using cacti now for my interface graphing needs.
Category: Geek |
No Comments »
March 14th, 2006 by greg
Once I disabled the annoying bridging I ran across a problem. My wireless devices couldn’t get internet access. I have very little experience with iptables but I was able to get enough out of reading the default firewall rules that I could enable NAT for the wireless interface. I added the following to /etc/firewall.user:
WIFI=$(nvram get wifi_ifname)
iptables -A FORWARD -i $WIFI -o $WAN -j ACCEPT
And now I have everything I wanted. My NFS stuff is protected from the wireless devices. My next project will be to setup ipsec stuff so that authenticated wireless devices will have nfs access.
Category: Geek |
No Comments »
March 14th, 2006 by greg
It annoyed me to death that the wireless interface was bridged to the wired interface. I would much prefer to keep my NFS mounts local to my wired ethernet. Luckily openwrt lets you break the bridge and do just that so things are “normal.” This is covered in the openWRT FAQ.
Unless you are sure you probably don”t want to change the wan_* settings. Specifically setting the wan_proto to static is probably not wise as then you will not acquire an IP address from your provider.
Category: Geek |
No Comments »
March 14th, 2006 by greg
I’m a stickler about having the right time on all my machines. I usually use ntp but rdate is included with openwrt so that’s what I use on my router. The first thing I needed to set was the time zone. This is done via the environment variable TZ. I put the following in /etc/profile:
I like to have my time updated each day so I added the following to my crontab:
0 0 * * * /usr/sbin/rdate 128.138.140.44
Finally, I had to enable crond so I created /etc/init.d/S51crond which contains:
#!/bin/sh
# start crond
/usr/sbin/crond -c /etc/spool/cron/crontabs
Having the spool directory under etc preserves changes over reboots.
Category: Geek |
No Comments »
March 14th, 2006 by greg
- If you have a message stuck in your queue and you want to see why it is there run exim -Mvl. I’m assuming “vl” is short for “view log”.
- In alias files or in the main config file you can use :fail: as an address to force a failure. Under certain convoluted circumstances this can be quite helpful.
- When running as root the -d option is a life saver. Running -d 9 with the -bv option can really help you understand how mail is delivered on your system.
- The -C option is important for testing changes with out interrupting the live config. This with -bv is really nice.
- The -brw command line option lets you see exactly how an address will be rewritten.
Category: Geek, Tips |
No Comments »
March 14th, 2006 by greg
For quite some time I was using some code I wrote (based on another author) to toggle between header and implementation files for c and c++ when in emacs. Today I learned that feature already is in emacs and so my code isn’t needed. The wonderful function is ff-find-other-file. This thing is sort of a mind reader. If you call it in a header file it will open the corresponding implementation file. If you call it in an implementation file it will open the corresponding header file. It gets better! If you call it while on a #include line it will open that include file by searching the directories in cc-search-directories.
Category: Geek, Tips |
1 Comment »