My pretty face [ László Monda's Blog ]
Exploring the cyberspace, one quadrant at a time!
 
Main Page | Blog | Projects

Archive for August, 2009

Minimizing household energy consumption

Monday, August 24th, 2009

I try to become more and more energy conscious nowadays.  I think it's important to minimize our resource consumption to save the environment.

A couple months ago I bought a power consumption meter and I've done a number of measurements.  I was only interested in quantitive amounts, that's why the some descriptions are inexact.  Here they are:

Videoton Precision 2000 - 56 cm diameter CRT TV

  • idle: 4W
  • powered on, dark screen: 65W
  • powered on, bright screen: 85W

noisy (a PC of mine)

  • idle, wake on LAN ready: 6W
  • powered on, idle CPU: 104W
  • powered on, busy CPU: 120W

LG Flatron F700P - 17'' CRT monitor

  • idle: 0.4W
  • dark screen: 77W
  • bright screen: 95W

Videoton Waltham TS 3343 - 53 cm diameter CRT TV

  • idle: 1.5W
  • blank screen: 50W
  • bright screen: 60W

Sony DVP-NS32 - DVD player (you shouldn't buy this piece of sh*t)

  • enabled: 7W
  • audio cd playing: 9W
  • divx playing: 10W

Technics SA-GX130 - stereo synthesizer receiver + 2x big loudspeakers (don't ask how big)

  • idle: 1W
  • not so loud: 19W
  • pretty loud: 40W

Toaster:  725W

Grundig P45-342CTI - 42 cm diameter CRT TV

  • idle: 12W
  • blank screen: 60W
  • bright screen: 80W

My mother's halogen lamp: 26W

Pirelli DISCUS DRG A225G - all-in-one broadband DSL router

  • powered on: 7W
  • DSL link up: +1W
  • active phone call: +1W

ASUS WL-500GPV2 - DSL router

  • idle CPU: 2.2W
  • busy CPU: ???W

Samsung 204B - TFT monitor

  • idle: 0.7W
  • powered on: 22W

Water pump that circulates the water for the house heating system: 44W

Goldstar ER-3520D - microwave owen: 830W

ENERGY SAVING TIPS

  • Try to avoid to generate heat using electricity because it draws a vast amount of power.
  • PCs are power hungry due to their inefficient power supply, so it's better to use laptops.
  • Use compact fluorescent lamps instead of incandescent light bulbs.  They are being replaced in the EU anyways.
  • You can keep your CRT TVs because in spite LCD TVs are power efficient per-inch wise, they're also larger than CRTs, so they're usually more power hungry in overall.  Plasma TVs are very power hungry on the other hand. LED TVs are the most power efficient, but it'll take some time for their prices to drop.  It's probably worth waiting for them.
  • You should absolutely replace your CRT monitors with an LCD.

How to make your mice last forever

Wednesday, August 19th, 2009

I have two Logitech MouseMan Dual mice which I bought almost 10 years ago. This model was far more expensive and provided a vastly superior usability than its competitors and I still love it, but time went by and its mechanics failed.

What do I mean by "mechanics"?  Well, considering that every recent mice use purely light (either optical or laser) for motion tracking, the only mechanics left in mice are microswitches.  These switches are usually provided by OMRON and most of their switches can endure about 10 million operations which may sound much but I guarantee you that it won't last more than several years of intensive usage.  What I want to conclude is that the current design of mice is potentially incredibly durable, except the microswitches.

Given the kind of green person I am and considering how much I hate planned obsolescence, I was thinking on how is it possible to maximize the lifetime of a mouse with minimal resources.  The operations below require a soldering station and a modest amount of soldering skills (or a friend who has the equipment and is willing to do the work for a beer).

1) Switch swap

Switches do not completely die from one moment to another in my experience.  Usually you notice that drag and drop operations are hard to make because the switch cannot operate correctly during sustained action.  Once you think about drag and drop and you realize that only the left mouse button is used for it and others are not used for sustained operations you immediately ask the question: why not swap them?

The middle and right buttons are very rarely used compared to the left button so they can last about 10x (right button) to 100x (middle button) longer.  First, you can swap the left and middle buttons and several years later you can swap the (then) left and right buttons.  This should give you alone a 3x durability for no money!

2) Buying a new switch

Once it gets inevitable you have to buy a new microswitch eventually.  The challenge is that the exact switch model you need is probably not in the market by that time because the manufacturer have obsoleted it.  However, it's probably possible to find another switch with almost identical dimensional and mechanical characteristics, so keep looking!  I'd really love to see a site listing all the microswitches that are on the market for various mouse models.

3) Designing a mice for durability

Even though mouse manufacturers have no financial incentive to design a mouse for a lifetime, it's worthwile to think about the issue.  Putting the microswitches into sockets for easy replaceability and providing replacement switches for sale and/or bundling a dozen of them with the mouse itself would solve the issue.

Enjoy and make your mouse last forever!

Agni étterem – Ha finomat és egészségeset akarsz enni Szegeden

Monday, August 17th, 2009

Mióta itt élek Szegeden kipróbáltam vagy egy tucat éttermet.  Talán mondanom sem kell, hogy ezek közül a legtöbb gyorsétterem.  Ahogy az elmíút évek alatt igyekezem egyre tudatosabban táplálkozni, úgy azt vettem észre, hogy egyre kevesebb éttermet tartok megfelel?nek.  A "civilizált" világ általánosságban szemetet eszik ezért nem meglep?, hogy aki normálisan akar táplálkozni az nehéz helyzetbe kerül ilyen tekintetben.

Körülbelül egy hónappal ezel?tt betelt a pohár mert úgy éreztem, hogy egyetlen megfelel? éttermet sem találok és ekkor kerestem rá a "szeged vegetarianus etterem" kifejezesre, aminek kapcsán nagy meglepetésemre megtaláltam az Agni éttermet.

Ez az étterem üde szí­nfoltja a városnak mert nemcsak nagyon egészséges, finom és tápláló ételeket kaphatsz itt elérhet? áron, de a hely atmoszférája is nagyon kellemes.

Az egyetlen kellemetlenség, hogy ha a kerthelyiségbe mész akkor el?fordulhat, hogy perceket kell várnod, amí­g valamelyik felszolgáló kiszolgál téged ezért azt javaslom, hogy inkább a f?bejáraton menj be a pincehelyiségbe mert ott sokkal gyorsabban ki fognak szolgálni, f?leg ha menüt kérsz.

SMTP relaying with Postfix through GMail

Monday, August 17th, 2009

cat << END >> /etc/postfix/main.cf
smtp_sasl_auth_enable = yes
smtp_use_tls = yes
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
relayhost = smtp.gmail.com
END

echo "smtp.gmail.com youraccount@gmail.com:yourpassword" >> /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
/etc/init.d/postfix restart

Setting up HTTPS with Apache using a CAcert certificate

Monday, August 17th, 2009

openssl req -new -nodes -out yourdomain.com.csr -keyout yourdomain.com.pem
# Type your domain name to the Common Name field.

# Log in to CAcert, go to Server Certificates > New, select "Sign by class 3 root certificate", hand the CSR and get the CRT which you should place to your server as /etc/apache2/ssl/yourdomain.com.crt

cat << END > /etc/apache2/sites-available/yourdomain.com
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot /var/www
Options FollowSymLinks
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/obconsulting.hu.crt
SSLCertificateKeyFile /etc/apache2/ssl/obconsulting.hu.pem
</VirtualHost>
END

a2ensite yourdomain.com
a2enmod ssl
apache2ctl restart

How to wake on LAN by hostname on OpenWrt

Monday, August 17th, 2009

opkg update
opkg install etherwake
opkg remove wol
echo '#!/bin/sh'$'\n'"etherwake \`grep \" \$1\\$\" /etc/ethers | awk '{print \$1}'\`" > /usr/bin/wol
chmod 755 /usr/bin/wol
wol yourhostname

Installing OpenWrt Kamikaze on the ASUS WL500GPV2

Monday, August 17th, 2009

I'm a big fan of OpenWrt for more than a year when I got to know it.  I daydreamed about a powerful router that is fully controllable and runs Linux.  Little did I know in those times about specialized Linux distributions running on routers. I can remember when I started to chat with my good friend, Dömi about this topic and he immediately mentioned OpenWrt. Fast forward one month and an ASUS WL500GPV2 was sitting on my desk running OpenWrt Kamikaze.

I'd like to mention that although I'll talk about the V2, I wish I would have bought the V1 because that's much more hackable. You can upgrade its memory and/or replace its Mini PCI WiFi card, but you can't do that with the V2, unfortunately.

The reason I put this guide together is that I wanted a detailed configuration guide on the topic because it's quite demanding to rebuild my mental model of how things work after some months. Be aware that that this HOWTO is not for the faint of heart. I assume you know what you're doing.

1) Download the firmware

wget http://downloads.openwrt.org/snapshots/trunk/brcm-2.4/openwrt-brcm-2.4-squashfs.trx

2) Set up localhost to hang on the 192.168.1.x subnet

sudo ifconfig br0 down  # in case you use VirtualBox host networking
sudo brctl delbr br0  # also for VirtualBox
sudo ifconfig eth1 192.168.1.2

3) Flash the router firmware

# Boot the router into diagnostic mode by pressing the reset button right after restart. Wait until the power LED starts blinking.
atftp --trace --option "timeout 1" --option "mode octet" --put --local-file openwrt-brcm-2.4-squashfs.trx 192.168.1.1
# Wait at least half a minute otherwise the router won't get flashed properly and boots into diagnostic mode.

4) Set up SSH public key authentification

# Disable and enable router and wait for the boot that takes about half minutes.
telnet 192.168.1.1
passwd
# At this point telnetd gets stopped and the dropbear sshd gets started.
exit
scp ~/.ssh/id_rsa.pub root@192.168.1.1:/etc/dropbear/authorized_keys
ssh root@192.168.1.1

5) Set up WAN connection

# Use this for cable modem connections:
uci set network.wan.proto=dhcp

# Use this for ADSL connections:
uci set network.wan.proto=pppoe
uci set network.wan.username=yourusername
uci set network.wan.password=yourpassword

# Let's commit the changes finally:
uci commit network
ifup wan
reboot  # If the WAN connection is still down at this point.

6) Set up WiFi connection

uci set wireless.wl0.disabled=0
uci set wireless.@wifi-iface[0].ssid=yourssid
uci set wireless.@wifi-iface[0].encryption=psk2
uci set wireless.@wifi-iface[0].key=yourpassword
uci commit wireless
wifi

7) Install packages

opkg update
opkg install mc ndyndns etherwake ntpclient openvpn kmod-fs-ext2 fdisk e2fsprogs kmod-usb2 kmod-usb-storage nmap
# Here you can remove every luci related packages if you don't need the web interface.

8) Restore configuration

# It's pretty easy to restore configuration from a backup once you made a backup like this:
ssh your-router 'tar czf - /etc /root' > kamikaze-backup-`date +%Y-%m-%d_%H-%M-%S`.tar.gz

9) Supercharge storage space

# Plug in the pendrive.
mkfs.ext2 /dev/scsi/host0/bus0/target0/lun0/part1
mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt
cp -a /bin /etc /home /lib /root /sbin /usr /www /mnt
mkdir /mnt/dev /mnt/jffs /mnt/mnt /mnt/proc /mnt/rom /mnt/sys /mnt/tmp /mnt/var
umount /mnt

cat <<END >/etc/config/bootfromexternalmedia
config bootfromexternalmedia
    option target   '/mnt'
    option device   '/dev/scsi/host0/bus0/target0/lun0/part1'
    option modules  'usbcore ehci-hcd scsi_mod sd_mod usb-storage jbd ext2'
    option enabled  '1'
END
cat <<END >/sbin/init.new
#!/bin/sh
. /etc/functions.sh
config_load "bootfromexternalmedia"
local section=\$CONFIG_SECTION
config_get      "target"   "\$section" "target"
config_get      "device"   "\$section" "device"
config_get      "gpiomask" "\$section" "gpiomask"
config_get      "modules"  "\$section" "modules"
config_get_bool "enabled"  "\$section" "enabled" '1'
[ "\$enabled" -gt 0 ] && {
    [ -n "\$gpiomask" ] && {
        echo "\$gpiomask" > /proc/diag/gpiomask
    }
    for module in \$modules; do {
        insmod \$module
    }; done
    sleep 5s
    mount -o rw "\$device" \$target
    [ -x \$target/sbin/init ] && {
        . /bin/firstboot
        pivot \$target \$target
    }
}
exec /bin/busybox init
END

chmod a+x /sbin/init.new
ln -f -s /sbin/init.new /sbin/init
reboot