Spotlight
After the Circus

Random Sample
July 1st, 2005








contact me
jean at geemoo dot ca
Blog

Jul 1, 2014
Sudo normally prompts you for a password whenever you do stuff, but it's possible to set it up to not do so. This can be handy for commands that aren't much of a security risk, like shutdown or reboot. Just add a line to your sudoers file with visudo that looks like these.

jean ALL=(ALL) ALL
jean ALL=NOPASSWD: /sbin/reboot, /sbin/halt

The first line gives you normal password protected sudo access to all commands like you have probably already setup. The second line gives you passwordless access to the reboot and halt commands. Make sure they are in this order, as sudo rules are intepretted such that later rules override the newer ones (AKA, not like a firewall).
Jun 29, 2014
So, I've started playing around with the STM32 arch again, and got myself an STM32F3Discovery board. I didn't really want to depend on the CodeSourcery toolchain like most websites seem to recommend getting, so my first step was to build a toolchain.

I discovered crosstool-ng, which is totally awesome, and found a site (mirror), on how to configure crosstool.

You'll also need the stlink stuff at https://github.com/texane/stlink, for connecting gdb to the stlink jtag programmer found on the Discovery board.

The one gotcha I had was that zsh seemed to be somehow interfering with how the config file was read. If you get issues with not building the toolchain you configured, I suggest you chsh to bash, and try it again. I didn't figure out exactly what in zsh was causing it to break, but if you do, let me know and I'll add a note here.
Apr 19, 2012
I updated my system lately and rebooted to find that the udev rules I was using to make my jtag programmer work, no longer worked. I had been getting messages about the rules being old and being deprecated soon for some time now, but it seemed that "Real Soon Now" had suddenly became "Now".

The new rules look like this:
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0008", MODE="666"
Oct 1, 2011
So, we bought a Acer Aspire 5560 laptop for my wife and one day while I was at work, she reported that she broke her battery. The battery was stuck at 5% charge and even though it was plugged in, Windows was reporting "Battery 5%, Won't charge." After a number of reboots, and removing and inserting the battery, I promised I'd take a look at it that night.

After a number of searches, we found something that worked. Shutdown the laptop, removing the battery and unplug the power brick. Press and hold the power button for two minutes. I held it for 3 minutes, just to be sure. Replace the battery, and plug in the power brick, and with luck, you should get a charging light now.

The idea is that even though the battery and power brick are removed, there's still enough residual charge left in the internal capacitors for the laptop to remember the incorrect battery state. Holding the power button drains that charge and resets the state.
Jul 26, 2011
So, I just got back from a 4 day camping trip in Algonquin park, and it was all around a great time. I've been camping for a great many years, and something that is still in a state of evolution is camping coffee.

I love coffee. It tastes delicious, and I love just having that hot beverage in the morning while you're waking up and chatting with everyone else. In the past, I had used instant coffee, but being the coffee lover that I am, it just wasn't satisfying me. I've been trying out various methods, and have gotten to a state of coffee which I am fairly content with.

Camping Coffee

Ingredients
  • coffee
  • instant milk powder
  • sugar
First off, fill whatever drinking mug you have with your water, and dump that into a pot. Bring that to a boil, and add one heaping tablespoon of medium ground coffee for every cup of water. Let that boil for a couple minutes, about 5 minutes or so, until it frothes up a bit. Take your pot off the heat, and let it stand for another 5 minutes or so. Really, since this is camping, you aren't going to have a watch or clock, so just kind of guess how long.

Take a piece of paper towel, fold it over twice and open up one corner. This is your coffee filter. Put this into your mug, and pour your coffee into the filter, let it strain through, and then add your milk powder and sugar as you like your coffee.

Sit back and enjoy the sunrise!