Michael's musings


This is a blog of
mcr at sandelman.ca

Sun, 07 Feb 2010

Thing I saw at Active Surplus

I was in Toronto at the AGM for http://www.EspressoCode.com/. I had to stop at Active Surplus for switches and what-not for my model railroad. I certainly the a "what-not"

Check it out:

[[http://www.sandelman.ca/mcr/humour/2010-02-04-10-46-whatnot.jpg][Some kind of Pumpy Thing]]



posted at: 20:40 | path: /modelrailroading | permanent link to this entry

Tue, 02 Feb 2010

Sharp microwaves

My Samsung microwave died last March. It makes sparks from the magnetron. I tried a bit to see if I could get a new one, but it's annoyingly difficult, since the magnetron is half the cost of the unit.

I'd really like to buy a microwave not-made-in-China. Sharp is reported to make them in Japan, assemble them in the USA.

But, I can not find a store that sells them. I'd really like to touch one before I buy it.



posted at: 00:44 | path: /appliances | permanent link to this entry

Wed, 06 Jan 2010

no-op instructions for ARM

At http://www.credil.org/ we had to deal with some code that was not yet GPL compliant, fixing bugs (removing features!) from a .so file that we had. We had some of the source code, but not enough to recompile it.

We needed to disable certain calls, so we disassembled the object file with objdump -d. We then reviewed the code, looked for the calls we wanted to remove, which are "bl" instructions.

../../prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin/arm-eabi-objdump -d libmyso.so >libmyso.S

All branch instructions are conditional, but one valid condition is "branch always" (and link, which means it's a subroutine). See: http://www.peter-cockerell.net/aalp and http://www.peter-cockerell.net/aalp/html/frames.html, section C which is at: http://www.peter-cockerell.net/aalp/html/app-c.html

Just look, if we change 'e' to 'f', it becomes Branch Never! We tried that.

Oops, this doesn't work. Peter Cockerell's book (from 1987) documents ARMv3, and we are up to ARMv9. It seems that his bit pattern now means to branch, and change to THUMB mode... The clue that this is what happens is that when we disassembled the result we saw "blx", but the real clue was that the offset was no longer "place", instead was "place+2". Thumb instructions are 16-bit big.

See http://www.keil.com/support/man/docs/armasm/armasm_cihfddaf.htm for details of BLX.

So, how to create a NOP? We didn't see an official one. Some googling revealed that "MOV R0 R0" is a good choice.

http://www.keil.com/support/man/docs/armasm/armasm_cjafcggi.htm

To assemble this:

First nibble is 0b1110 (15, 0xE) for "Always".

Second nibble is 0b0001 (1, 0x1), for 00, Immediate bit = 0, first bit of opcode is 1. (The Opcode is 0b1101 (14, 0xD) for MOV)

Third nibble is 0b1010 (10, 0xA), three bits of opcode, S bit set to 0.

Fourth nibble is 0x0000 (R0), and Fifth nibble is 0x0000 (R0).

The last 12 bits are 0.

The result is: 0b1110 0001 1010 0000 0000 0000 0000 0000. Or 0xE1A00000.

We didn't realize that the Android phones are in big-endian mode, so when we searched for the right instructions to change, we did not find them.

When you objdump a .so file, it's mapped directly, so the offsets that objdump products are actual file offsets.



posted at: 03:11 | path: /android | permanent link to this entry

Mon, 04 Jan 2010

An open Letter to Shaw Direct

Dear Jim,

You write, "Over the last 8 years, we have seen huge advances in the technology of our receivers without an impact on the MRF. Effective Feb. 1, 2010, the monthly rate for MRF (multiple receiver fee) will increase by $1/month to $5.99/month"

Over the past 8 years this is simply not true.

When I signed up in the summer of 2001, there was no multiple receiver fee. So, the MRF fee has in fact gone up by $5 over the last 8-9 years.

Meanwhile, my receiver is still the same VERY SLOW piece of crap motorola receiver you made me buy in 2001. I've seen no improvement in technology at all, and I'm locked into buying crappy, closed source, proprietary receivers if I want to receive your signal. You make me pay for the equipment, and then prevent me from using it the way I want.

When I first signed up, you gave me this "credit" on programming, but you made me spend it on your premium package, rather than on the basics package that I wanted, which meant that the receiver really cost me 2x as much as I was lead to believe.

The packages are such that I get hundreds of channels I do not want, and I can not get the two or three channels that I want without huge expense.

Meanwhile, the number of Pay-per-vue channels continues to decrease (and most of them are porn), I guess because you never bothered to offer your loyal customers an upgrade to the oval dish, and I can only see one of the two satellites.

If hulu.com opens in Canada, you can kiss my business goodbye.

If any local TV stations disappear from my dial, you can kiss my business goodbye. If you pass on any local TV tax to me, then I can assure that I will simply cut my bill by that same amount, or give up, and just watch DVDs.



posted at: 20:35 | path: /netneutrality | permanent link to this entry

Sun, 27 Dec 2009

IPv6 with mcast UserModeLinux backends

I am doing some work with IPv6. (see http://bluerose.sandelman.ca/projects/show/unstrung )

I have a test network shown at: http://bluerose.sandelman.ca/repositories/changes/unstrung/doc/network-1.png

In automated testing I would normally use the daemon mode, with uml_netjig. In casual use, I was using the mcast backend, because it has fewer moving parts.... but my network interfaces kept remaining in state "tentative" and I could not send packets.

What was the problem, I debugging for awhile through the IPv6 code, and finally thought that it had something to do with the UserModeLinux network interface never providing low-level LINK "UP" signal, and so it never did Duplicate Address Discovery, and remove the tentative mark.

5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 fe80::1000:ff:fedc:bcff/64 scope link tentative
       valid_lft forever preferred_lft forever
6: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 fe80::1000:ff:fe64:6423/64 scope link tentative
       valid_lft forever preferred_lft forever

Note that it says "tentative".

NO! DAD was occuring just fine, but it FAILS. Why? Because it thinks it has a duplicate... finally I noticed

eth0: duplicate address detected!
eth1: duplicate address detected!

Why is this? It's because the mcast interface gets a copy of the packets that are output. I.e. it hears itself. DAD should work even when that happens, I think.

I need to look at whether the mcast interface should be fixed (remember it's own packets and ignore them? Drop packets that originate from it's own MAC address?), or should DAD be fixed?



posted at: 03:08 | path: /virualization | permanent link to this entry

Wed, 02 Dec 2009

Profit on Farmville

I'm level 14 on Facebook's Farmville. Why do I play? Because my 4yr old likes it. Of course, I want to maximize my profit.

I only run it about once a day, so crops that wither before I can harvest them are out, but what next? It costs 15 coins to plow the field each time.

It turns out that longer growing crops aren't worth much more. I did a spreadsheet to work things out.

<pre>

cost sell harvest profit profit/day wheat 35 115 3.0 65 21.7 eggplant 25 88 2.0 48 24.0 artichokes 70 204 4.0 119 29.8 daffodils 60 135 2.0 60 30.0 squash 40 121 2.0 66 33.0 soybeans 15 63 1.0 33 33.0 cotton 75 207 3.0 117 39.0 bell-peppers 75 198 2.0 108 54.0 aloe vera 56 85 0.2 14 56.0 strawberries 10 35 0.2 10 60.0 cranberries 55 98 0.4 28 67.2 pumpkin 30 68 0.3 23 69.0 rice 45 96 0.5 36 72.0 peppers 70 162 1.0 77 77.0 raspberries 20 46 0.1 11 132.0 </pre>

Raspberries take 2 hours. Sometimes worth it, but the profit margin is very low unless you do it all day long.

Ruling out the things that take less than a day, leaves me with peppers, bell-peppers, and cotton as the highest grossing.

Too bad that the market price didn't depend upon other factors, like how many other people were growing it... or if you grew some things properly, you could keep the seed.

Or maybe you have to rotate your crops. Or grow eggplants next to pumpkin will keep away the racoons, or the blight.



posted at: 05:49 | path: /personalmba | permanent link to this entry

Wed, 25 Nov 2009

Port forwarding from something not your firewall

I have a number of web servers which want to express their port 443 to the world. These machines also have IPv6, and that's what I hope many clients will use. Since HTTPS servers can not do virtual hosting, and port 443 on CREDIL's firewall is already taken, what can I do?

We have other public IPs, with other (virtual) machines that have internal and external connections. I could use their port 443s.

I previously did this for port-119 (NNTP). I had set things up like:

iptables -A PREROUTING -d ${myexternalip}/32 -p tcp -m tcp --dport 119 -j DNAT --to-destination ${serverinternalip}:119
iptables -A POSTROUTING -d ${serverinternalip}/32 -p tcp -m tcp --dport 119 -j MASQUERADE

The first statement is relatively ordinary. Change the destination address. The second statement is annoying. It is critical on machines when the default route does not point at it. Basically, it changes the source IP that connects to the ${myinternalip} to be the internal address of the firewall.

This actually necessary even on the default route: without this, internal connections to port 119 do not work — this is because the internal machine sees a connection originating from the internal client IP, to the internal IP. The problem is that the internal client actually has a connection from it's IP, to the external IP of the firewall.

The above method works fine, except.... the internal machine sees the connection as being from the internal IP of the firewall. That really sucks from a point of view of logging!

How to solve it? The problem is that packets with an origin of port 443 needs to go to the other machine... this is what I did:

On the gateway machine:

iptables -A PREROUTING -d ${myexternalip}/32 -p tcp -m tcp --dport 443 -j DNAT --to-destination ${serverinternalip}:443

On the target machine:

iptables -A OUTPUT -t mangle '!' -d ${myinternalnetwork}/24 -j MARK --set-mark 443
ip rule add fwmark 443 table 443
ip route add 0.0.0.0/0 via ${myinternaliP} table 443

It's very important that you set the mark using the mangle chain. It will not work on the NAT or the regular OUTPUT chain!

The result is now that packets with origin port 443, go via this alternate firewall, and the web server itself will see the correct originating IP.



posted at: 18:21 | path: /howto | permanent link to this entry

Mon, 23 Nov 2009

Xmas lights with white cords

Apparently, at Canadian Tire, and online, if I want multicolour Xmas lights (ideally LEDs), that I have to have a green cord. Only white cords are with white LEDs.

I considered buying one of each and moving the "bulbs", but many of the systems are not socketed.

I want Xmas lights I can put up on the house, staple in, and LEAVE there.



posted at: 18:16 | path: /howto | permanent link to this entry

Wed, 18 Nov 2009

My personal MBA

I blame Mike Charlton. I'm pretty sure it was some email of his that suggested that I read The Goal. This was back in Winter 2008, I think. Wait, can Amazon tell me... Yup. Ordered the book in February 1, 2008.

The Goal is a novel, in it we learn about the fate of a branch manager, who learns that his branch, in his original home town, is going to be shutdown, unless he can figure something out in just three months. Our hero learns the Theory of Constraints http://en.wikipedia.org/wiki/Theory_of_Constraints and saves the day... except that now Peter's principle gets applied to him, and in the next book he has to save the division. A great read, and I learnt lots that I didn't think I'd ever use. When I got the second book It's Not Luck, Amazon suggested I get Critical Chain, and I did.

It turns out Critical Chain is about project management of all sorts, including software. It's written ten years later (mid-1990s), and some of it's a bit naive about things, but the essential theory is great, and furthermore, it's very much compatible with Agile Methods.

I wanted more. I wondered how to get more. In early 2009, I started to wonder if I business school might teach me more. I had not quite understood part of the underlying story in Critical Chain was probably autobiological, and that the frustrations of the business professor in the novel expressed Goldratt's experience that it was very hard to get TOC accepted into business schools.

I also began to understand that a difficulty I've had in many companies is that I'm a techie, and I explain things from that point of view often. Unlike other techies, I tend to be pretty good, given some face to face time with a non-technical executive to explain things in terms that he can use, but I am missing many of the shortcuts that would come form having more language in common. It's not enough to talk about ROI, sometimes I think it might have helped to be able to start from the CFO's terminology and relate it back to mine. (i.e. to lead them from where they are, to where I am, instead of having to entice them to start where I am, and discover the path back to where they are)

I investigated executive MBAs. Ottawa U failed to impress me at all. A meeting with the director was offered, but the whole thing just didn't feel right. I went to a Queens executive MBA session, and they got me the information that I wanted... yes it is expensive, yes, the content is mostly there, but doing it in Ottawa is probably a mistake. I won't meet the people that I really want to understand.

The Theory of Constraints does not figure prominently in either program. At least Queens mentioned it. I started from the other end, who teaches this? Google told me that it's popular at one university in Mumbai, at the Goldratt Institute, and that the Harvard MBA also teaches it now. I talked to my mother's cousin about all of this, and he pointed me at Henry Minceberg. http://www.henrymintzberg.com/

I highly recommend reading: http://www.henrymintzberg.com/pdf/productivity2008.pdf

He hasn't got nice things to say about the MBA. I certainly agree. MBAs should only be done as executive MBAs, you need ten years out there before any it can make any sense. Harvard only offers the residential 2 year MBA.

Many of my colleagues and mentors quietly discouraged me from an MBA. One of them pointed me at http://www.personalmba.com/ --- essentially a reading list. In August, I decided, this would do, and the price was right.

So far I've read:

10 days to faster reading

Crucial Conversations: Tools for Talking When Stakes Are High

Indispensable: How To Become The Company That Your Customers Can't Live Without

Necessary But Not Sufficient: A Theory of Constraints Business Novel

I'm in the middle of reading:

Results Without Authority: Controlling a Project When the Team Doesn't Report to You, A Project Manager's Guide

The Unwritten Laws of Business

Throughput Accounting

Managing

Necessary But Not Sufficient is another novel. Set in 1998/1999, and apparently written just after the dot-bust, it explains the dot-bust very well, but also talks a lot about software companies, and manufacturing companies, and ERP systems. It's supportive of Agile Methods (even though I don't think Goldratt knows that term, it certainly wasn't coined until after the book was in print).

More important, it basically concludes that software is best sold as a service, not a product, and that actually there no value in the software itself, only in how it reduces or eliminates limitations, permitting a person or company to do more.

I take this to suggest that open source licensing of a lot of software is the right way to go, particularly for anything which is targetted at business.



posted at: 07:12 | path: /personalmba | permanent link to this entry

Fri, 06 Nov 2009

Fido Dollars suck

Dear Fido:

Please cease telling me about my fido dollars. (I've received two emails in the last 24 hours)

Your fido dollars have no value. Not only are they not going to keep me as a customer --- I prefer to have an unlocked phone, and I'll pay for it.

In fact, your recent change to prevent me from spending my credits on whatever I want means that I will look for alternate GSM providers as soon as they appear.

I'd gladly trade my 284 fido dollars for a bluetooth headset, (now required in Ontario), and I tried to do so a year ago. You changed your rules without any real notice last March.

But, it's hard to pick the right headset when you can not see it. And I can not redeem through your stores. and your web site was totally useless.

No, I do not think Fido Cares about me. I think Fido is busy humping Ted Roger's leg.



posted at: 20:34 | path: /netneutrality | permanent link to this entry

dumping list of active services

From the shell of your rooted android phone run:

# dumpsys activity.services
Currently running services:
  activity.services
-------------------------------------------------------------------------------
DUMP OF SERVICE activity.services:
Services in Current Activity Manager State:
  Active services:
  * ServiceRecord{43a3dca0 com.android.inputmethod.latin/.LatinIME}
    intent={act=android.view.InputMethod cmp=com.android.inputmethod.latin/.LatinIME}
    packageName=com.android.inputmethod.latin
    processName=com.android.inputmethod.latin
    permission=android.permission.BIND_INPUT_METHOD
    baseDir=/system/app/LatinIME.apk/system/app/LatinIME.apk dataDir=/data/data/com.android.inputmethod.latin
    app=ProcessRecord{43a3e670 660:com.android.inputmethod.latin/10002}
    isForeground=false lastActivity=-296633
    startRequested=false startId=0 executeNesting=0 executingStart=-296565 crashCount=0
    totalRestartCount=0 restartCount=0 restartDelay=0 restartTime=-296633 nextRestartTime=-329523
    * IntentBindRecord{43a3e110}:
      intent={act=android.view.InputMethod cmp=com.android.inputmethod.latin/.LatinIME}
      binder=android.os.BinderProxy@4392a698
      requested=true received=true hasBound=true doRebind=false
      * Client AppBindRecord{43a3e288 ProcessRecord{439c0190 572:system/1000}}
        Per-process Connections:
          ConnectionRecord{43a3e400 com.android.inputmethod.latin/.LatinIME:@43a3da60}
    All Connections:
      ConnectionRecord{43a3e400 com.android.inputmethod.latin/.LatinIME:@43a3da60}

  Connection bindings to services:
  * ConnectionRecord{43a3e400 com.android.inputmethod.latin/.LatinIME:@43a3da60}
    binding=AppBindRecord{43a3e288 com.android.inputmethod.latin/.LatinIME:system}
    conn=android.app.ActivityThread$PackageInfo$ServiceDispatcher$InnerConnection@43a3da60 flags=0x1

If you run it without any arguments, you get a big huge dump of all sorts of interesting things. I do not yet know how to get it to give me a list of just the services that have registered themselves, or are actively running.



posted at: 13:46 | path: /android | permanent link to this entry

Sun, 25 Oct 2009

The pitchfork is skeptical about plan

Over at: http://thepitchfork.blogspot.com/2009/10/time-for-trusteeship-were-you-shocked.html Citizen Ellie wonders if we are shocked by the $2.1B price tag for the tunnel.

My answer is no. It's really important to understand that the consultants that do the actual work for the city, are not interested in light rail. That's not their product: their product is busways. McCormick Rankin sells busways worldwide, and Ottawa is their reference city.

McCormick Rankin rewarded former City of Ottawa planning staff Helen Gault and Peter Steacey with plum positions. It's a good reward after decades of throwing consulting work their way, even hiring them to creat a evaluation system system called "TRANS", that only they have experience with, guaranteeing that future contracts could be answered only by them.

It would be very embarassing for McCormick Rankin to loose their reference city. That's why there is the mantra amount staff and some councillors that we "have to complete the transitway". That's why the 2006 NSLRT plan did not have any transfer stations, and why it terminated at Ottawa U (a dead end), rather than continue to Hurdman (which would have turned it into a downtown system).

But, light rail is in the air, and sometimes you can not fight it, even if former regional chair, and continuing bus-freak Andy Haydon (anyone ever seen HIM on the bus?) keep talking about bus tunnels.

Since you can not fight some kind of light rail, and Ottawa already has a massively successful 5 station system (the O-Train), with 5 stations, and 10,000 riders/day, what can you do? Well, busways are designed (we have been told many times), to be turned into LRT if you need to grow. So, do not fight light rail, but it's gotta be more expensive than bus rapid transit.

If LRTs cheaper than BRT (to build), then why build BRT first? In Houston, they found that it was cheaper to just build the LRT first. This is very much accute if you actually do a full system cost (i.e. include operating costs, such as labour and diesel), and not just capital costs.

That's why we have to have a tunnel. It's not because it's better, it's because it costs more. That's why we have to have the "cross-country" option, rather than the cheaper cut&cover option. That's why we have to convert the Hurdman/Blair part of the transitway, because that part was among the most expensive part of the system, and the cost of it was never properly justified.

What would a sane system look like? We (Friends of the O-Train) presented the base of a system in 2006. It would have 3-car trains from Hurdman to Tunney's Pasture. It would have major developments at Lebreton/Bayview and Hurdman, where transfers would occur to transitway bus, and also to NSLRT (O-train), connecting people to South Keys and across the Prince of Wales bridge to Terasse de la Chaudiere, and the Casino. (And it could continue all the way out old Gatineau if STO was interested)

It would cost $400M for the expensive downtown electric system, and an additional $39M would extend O-train-style LRT to Kanata, Barrhaven ("Barrhaven Bullet"), and to a new Earl-Armstrong Park'n'Ride in the South.

All of this would take about 2 construction seasons. It could have been ready NOW if we had started in December 2006, when council wisely shelved the broken plan. The work could have been done by Siemens/PCL, using the same vehicles we had already contracted to buy. No lawsuit, no $37 penalty.

The first expansion would have been to (South) Orleans along the cooridoor reserved for it. An extension from Hurdman through the General Hospital complex, behind the Pearly Hospital, and out Innes Rd. It would be quiet, electric, light rail. It would occupy less than 10m width of space, and people could walk dogs or ride bikes next to it without getting $55 fines from transit-cops.

We can still do this. All that we need to do is tell our councillors to stop the insanity.

The plans we have proposed have are well researched, and have been examined by multiple professional engineers (unlike the city's plans, which have never been signed off by a professional engineer).



posted at: 15:11 | path: /otrain | permanent link to this entry


XML


March
Sun Mon Tue Wed Thu Fri Sat
 
10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
2010
Months
Mar
Apr May Jun
Jul Aug Sep
Oct Nov Dec