DrySQL
cornet — Thu, 2006-11-09 19:35
Currently investigating this Ruby on Rails thing that everyone is raving about and so far I'm liking it.
DrySQL is one of the many examples as to why Rails rocks :)
DrySQL is a Ruby plug-in that extends ActiveRecord and applies the DRY principle to Object-Relational Mapping.
The idea behind DrySQL is that you define columns, keys, constraints, and relationships on your database, and you shouldn't need to re-define any of these things in your application code.
Shame about this thou...
has_and_belongs_to_many association generation is not implemented at this point
... hopefully it'll be supported soon.
Bogofilter
cornet — Sat, 2006-11-04 02:47
I, and other people on my server, are having SPAM issues again. Spamassassin is great but it eats RAM for breakfast about the same rate it eats SPAM.
After some hunting I think I have found a solution:
Bogofilter is a mail filter that classifies mail as spam or ham (non-spam) by a statistical analysis of the message's header and content (body). The program is able to learn from the user's classifications and corrections.
Bogofilter Home Page
Happy SPAM munching.
Hard disk monitoring
cornet — Thu, 2006-05-18 00:25
IDE drives are basically crap. However they are cheap so most people use them.
I’ve recently discovered smartmontools which monitors most hard disks using S.M.A.R.T which allows the disk to do self testing.
Setting up on gentoo is fairly easy and should hopefully give me some advanced warning of disk failure. Together with mdadm , which monitors raid arrays, then you can minimise the risk of loosing data.
**Big fat hairy warning**
This is NOT any reason not to back up your data.
On with the install and config.
emerge -v smartmontools
Now create /etc/smartd.conf and have it contain something like the
following:
/dev/hda -a -m nathan@domain -s (S/../.././02|L/../../4/05) /dev/hdb -a -m nathan@domain -s (S/../.././03|L/../../5/05) /dev/hdc -a -m nathan@domain -s (S/../.././04|L/../../6/05)
The usual start on bootup.
rc-update add smartd default /etc/init.d/smartd start
This config checks all supported attributes of the disks performs a short self test once a day at 2am, 3am and 4am for hda,b and c respectivly. It also does a long self test once a week at 5am on Thurs, Fri and Sat, again respectivly.
If a test produces an error then it emails nathan@domain telling me so.
Also check the man page for smartctl for more options and details.
Next up - mdadm
This is fairly trivial to set up and get working. Again it emails you when there is a problem.
Install
emerge -v mdadm
Create the mdadm.conf with details of our RAID array
mdadm --detail --scan > /etc/mdadm.conf
Set your email address
echo "MAILADDR nathan@domain" >> /etc/mdadm.conf
Make the monitor start on boot, and start it now.
echo "mdadm --monitor --scan --daemonise --config=/etc/mdadm.conf" >> /etc/conf.d/local.start /etc/init.d/local restart
Dell 2005fpw
cornet — Wed, 2006-04-05 23:07
My Dell 2005fpw 20" widescreen TFT arrived today.
Hunting arround there appears to be a few different modelines that people use for it.
After some more digging the most popular seemed to be the following:
ModeLine "1680x1050" 146.2 1680 1960 2136 2240
1050 1080 1086 1089 -hsync +vsync
So the relevent part of /etc/X11/xorg.conf looks like:
Section "Modes"
Identifier "16:10"
ModeLine "1680x1050" 146.2 1680 1960 2136 2240
1050 1080 1086 1089 -hsync +vsync
EndSection
Section "Monitor"
Identifier "dell"
UseModes "16:10"
HorizSync 30-83
VertRefresh 56-75
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "dell"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1680x1050" "1280x1024"
"1024x768" "800x600"
Viewport 0 0
EndSubSection
EndSection