Wednesday, 21 November 2007

motorbike switch

Motorbike hasn't ever liked starting when weather is cold. It's a bit oldish but also needs a service now I think but it won't get that for a few weeks. Last year I got some practice push-starting it before I got new battery. But have seen that even with everything off there is a small current being drawn to somewhere deep inside (not by lights or anything I could disconnect easily. Now hill-start in morning is no problem, push-start is okay, but tires one out very fast.

Charging battery while still connected in motorbike didn't seem to charge it very well. It's a trickle charger and maybe if bettery is in bike the little current being drawn from battery uses up much of the trickle current. Also sometimes ground connection wasn't great, lots of metal bits on bike actually don't conduct well or don't connect to ground I found. And there's no good grip for a crocodile clip to get hold of.

I push-started bike after donating blood one evening ... :-P urgh. And another evening there was almost zero power in battery, push-starting was hard.

I added a switcheroo to my motorbike between battery and everything else. It allows battery to be isolated completely from bike circuit so if bike is not being used for a weekend battery won't discharge. It also gives me a reliable place to connect battery charger clips to.

Switch was lovely for 3 weeks. (my battery lasting > 1 week is SO SO SO nice). Anyway now switch is stuck on (in off position) now since yesterday. oops. Presumably burnt out? Thankfully burnt out so that can still drive bike! >;) Not sure how long it will last! Have tools with me in case. Must open up and have a look. Presumably the fuse right there on bike is 15 amps for a reason!

I decided a 2 amp switch was worth a go as I've nothing else handy. The first thing connected to +ve terminal is THICK cable, 15A fuse and funny potty thing. I've an old kettle switch and toggle switch of unknown ampage and a spare but too large 20amp trip-switch at home. Don't have enough electrical junk :( don't seem to have switches on their website. OHHH ho ho! Maplin have 20A ILLUMINATED toggle switches >;) Hmmm, red, green, blue or amber, ... what do you think? :) Anything more than 10A often have leds in them. maybe. Switches

Update: (Dec 2) My 15Amp switch is COMING slowly I hope. In the meantime the switch on bike is actually still working out quite well. The switch mechanism goes through phases of not working and back to working. Weird but theory is that plastic is going soft inside.

Tuesday, 20 November 2007

bash redirection (what "duplication" of file descriptor really means and how to use it.

This has annoyed me for YEARS! Much reading of `man bash` and the internet didn't come up with a solution until yesterday.


# save stderr and stdout to seperate files AND show to user
bash$ ((ls gah source/ 2>&1 1>&3 | tee stderr.log) 3>&1 1>&2 | tee stdout.log) 2>&1

Anyway 2>&1 syntax is "duplicating" stderr to stdout. But this sense of "duplicate" has not made sense to be before because in doing 2>&1 then stderr is ONLY going to stdout and not to stderr anymore. BUT using the ()s => AHHH! that's where stderr and stdout are duplicated.


( (ls gah source/ 2>&1 1>&3 | tee stderr.log) 3>&1 1>&2 | tee stdout.log ) 2>&1
(dup stderr(2) to stdout(1) and stdout(1) to fd3 |tee stores what's on stdout (now stderr))
now outside inner ()s
stderr is on fd1, stdout is on fd3, nothing is on fd2
try this: (ls gah . 2>&1 1>&3 |tee stderr.log) 3>fd3 2>fd2 1>fd1
( dup fd3(original stdout) back to stdout(1), dup fd1(original stderr) back to stderr(2)
|tee stores what's on stdout (now original stdout))
now outside all ()s
stdout is on fd1, stderr is on fd2 as originally

All is clear as semi-translucent puddle-water ?

And I'd to look up how to acheive parameter expansion in bash parameter name AGAIN. Using ! is not intuitive.


bash redirect stderr stdout

Friday, 16 November 2007 has very nice DIY electronics.

->o Moo Moo Moo Moo

Nothing to do with cows.
M is a magnet.
o is a metal marble.
-------- is a ruler with a groove.
The whole is a gauss gun.

Make a REALLY BASIC motor:

Sunday, 11 November 2007

Snap Circuits by Elenco

I found Snap Circuits by Elenco while searching for a 15Amp switch for motorbike on maplin.
Looks lovely. Reviews on Amazon look good.
Only problem is maplin don't make credit card payments easy :(
To authorize credit card got email from maplin, phoned up credit card team.
Told to wait for access code sent via snail-mail.
It's two weeks now (Dec 3) have been so busy work/home haven't had a chance to phone them and find out what's up.

Wednesday, 7 November 2007

The problem with God-faith-religion[tm]

Executive summary:

The main problem as I see it is that God-faith-religious[tm] people can (and all the time do) abdicate responsibility (for all kinds of everything) to a "higher power". The instructions they receive are not from a "higher power" but from a group of humans.

I have been very respectful to any religion before. But I have also been growing more concerned about the danger of having huge groups of "faithful" people who believe they have a God-given right to push their particular rules anywhere. Stupid ideas might actually perhaps be deserving of some disrespect.

I found book "The God delusion" and started reading it last weekend.
wikipedia: Richard Dawkins

He's preaching to the converted (HA HA!) and I didn't think I'd be interested reading if I agreed. Two of Dawkins points I'm finding interesting follow, they're very complimentary but distinct enough that I'll seperate them.

1. That atheists should be more actively atheist and more vocal. Atheists are not organised as a group and the G-f-religions[tm] have the powerful political lobbys that run the countries we live in. So it is important for atheists not to be closet atheists. And it's important to evangalise atheism (Ho ho!). I've been concerned/thinking about problems the God-faith-religious[tm] mentality has mostly latent inside it but not sure what could be done about it. Even with our kids we're starting to see how they are now at a disadvantage (a small but pervasive disadvantage) when it comes to choice of schools.

2. All of society gives a huge respect to all G-f-religions[tm] (except for maybe the poor Pastafarians!). And the G-f-religions[tm] expect it. AND they're offended if this respect isn't enthusiastically and fully granted to every aspect of the funny G-f-religious[tm] rules that have been imagined and evolved over the years.

You know, he is DEAD right with point #2 there. I (and I think atheists in general) would be very respectful of other peoples beliefs and cultures and want to be very open-minded. G-f-religions[tm] themselves are probably the groups that are least respectful to each other. There are some (some? more than some maybe) bad things I can think of about any G-f-religion[tm]. I think I have been deluding myselfmy earlier religious indoctrination that a belief in God is good and right has deluded me into thinking it is harmless to allow some of these bad things to persist (and hence possibly to grow) because _most_ of the G-f-religion[tm] is pretty reasonable and good (and after all of course most of the people in the G-f-religion[tm] don't _REALLY_ believe every nuance of weird detail, ... do they?).

Essentially I'm thinking now that it is dangerous for society to be giving these G-f-religions[tm] too much respect. It's like looking the other way when first you see minor bad behaviour. Soon you're looking directly at abuse and torture and you can't do anything about it.

Heh Heh. This person does disrespect nicely :)
youtube: Pat Condell

What's this God-faith-religious[tm] stuff? Gah. Traitor (English) language! :)

English (and maybe every language?) doesn't have a good vocabulary for describing enthusiasticcomitted atheism. You can say you are religious about your food, about your operating system, about your favourite author/newspaper/politics, even about your philosophies and science. And people understand there is no God involved (more-or-less). But can you say you're a religious atheist? HAH. It doesn't quite work. You can see the argument G-f-religious people use often attacking atheism because the atheist is as "religious" about their atheism as they are about their delusion.

Dawkins also talks about the use of the word religion (or spirituality). I see these words as being so inherent in the language because of a few thousands of years of belief in Gods and religions that you can't express some ideas which have no God. There I go respecting God too much again and giving it a capital letter! :) e.g. atheists would describe themselves as having a spirituality consisting of a philosophy of beliefs in the human race - this sounds very religious but it is NOT it is a Godless spirituality.

For me (and others I think) the word "religious" is naturally a word devoid of God because of course there is no God. To me religion simply means the whole structure of a group of people that believe in this kind of God or Gods and follow these particular rules. It's completely natural for me to know there is no God. I'm very very certain of this (of course allowing for a minute (NEGLIGABLE! (hmfph, emphasis of negligable? is that an oxymoron?))) probability which must be allowed by scientific open-mindedness.

This meaning of religion is so obviously not so for God-faith-religious people. A bit scary if you think how different their mindset must be.

I wouldn't have been a closet atheist exactly, a very VERY quiet atheist though! :) It seems just to very rarely come up.

Maybe I'll start by getting a Pastafarian t-shirt! :)