The popular clock module is uses the DS1307 real time clock chip, which is not very precise. For just a few dollars more, you can get a module with a much more precise DS3231 RTC chip. The one I got was SunFounder's module from Amazon for $9 (free shipping for Prime). It plugs right onto the Raspberry Pi's 40 pin header and doesn't even interfere with the plastic case I have. I have a Model B, but this module should also work on Model A and Model B+. The instructions refer to DS1307, but the chips use the same I2C commands, so it also works for DS3231. I changed some references that appear in 'standard' instruction from ds1307 to ds3231, but you could instead leave them as ds1307 just as well.

To install the module, run the following commands (from SunFounder's instructions). Turns out Amazon's product page also has good comments and perhaps more up-to-date than SunFounder's.

# Comment out the blacklist entry so the module can be loaded on boot 
sudo sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf
# Load the module now
sudo modprobe i2c-bcm2708
# Notify Linux of the Dallas RTC device (use -0 for Model A or -1 for Model B)
echo ds3231 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
# Test whether Linux can see our RTC module.
sudo hwclock

You should see a response with what the chip thinks is the date. I think mine said 1999 or some such. No problem.

If your system date is NOT correct (if you don't have an internet connection or something), set the date using ONE of the following commands, with the appropriate date and time, of course:

# Only do ONE of two the below:
sudo dpkg-reconfigure tzdata
sudo date -s "Sep 27 2014 12:46:00"
# Now that your system date is correct, simply use this command to transfer the system date to the chip:
sudo hwclock -w

 

Next, to read the time from the RTC chip and set the system time from it at every boot, open /etc/rc.local and add these two lines above the exit 0 line:

echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s

We can also disable the ntp daemon and fake-hwclock during boot. 

sudo update-rc.d ntp disable
sudo update-rc.d fake-hwclock disable

That's it. Pretty easy.

 

You can still sync the system time from the internet using...

sudo ntpd -gq
sudo hwclock -w

 

Detecting MouseEnter and MouseLeave in a control that has lots of children controls (.Net)

Seems like I have been through this before. What I want to do is hide and show something, depending on whether the mouse is inside of a certain area. For instance, I have a container of some sort with lots of controls on it. When the mouse is anywhere inside of the container, I want a link to be visible. I can't simply use the MouseEnter/MouseLeave events on the container, because MouseLeave is triggered when the mouse enters a child control and the MouseEventArgs don't say anything about what control is being entered.

Say Goodbye to Windows 8's Start Screen

 

All of the people I've talked to who don't like Windows 8, don't like it because of the new start screen. You know, the tiled "apps" screen. A.K.A. "Metro" screen.

Maybe that sort of thing makes sense on a touchscreen device. Not on a desktop computer or standard laptop.

This free software brings back your start menu, like in Windows 7: ClassicShell. If you set it to start in desktop mode, you can say goodbye to the start screen! Here's how.