Friday, November 10, 2006

Apparently, laptops may be legally seized and searched at U.S. borders, they may even be kept and not returned.

“My laptop was initially searched by one person, but he called for backup” when he saw the blueprints. “It seemed they were convinced I was sent to plant bombs in those nonexistent buildings.” He said he hasn’t seen the laptop since.


It probably happens very rarely, perhaps randomly (although there was the case of someone who had his laptop searched because there was a report of child pornography or similar on him).

One more reason to avoid going to the U.S., I guess. Not a decisive reason, my family and I aren't going to the U.S. until at least after George W Bush is out of office, and probably not even then, unless the TSA and the Department of Homeland Security have either been dismantled or become accountable for what they do. As it is, I'm not risking my laptop in checked luggage (although possibly that restriction is lifted now) and I'm not risking losing it and never getting it back just because it's impossible to get anything out of TSA or Homeland Security (since the judiciary and police will bend over backwards even if there is no case).

There's no important information on my laptop (all my mail is on gmail, and the CIA already has all of my mail, and even if they don't, the NSA does), but I'm not some rich american who can afford to buy a laptop every month. So I'm just not going where they can take my laptop and never return it (and because I've been so critical of George W Bush's incompetent administration, I'm not going to be a random sample, they'll do it on purpose).

security bank ATM bugs

I'm not very happy with Security Bank ATMs. I don't have much choice in the matter since my company has my salary go into a Security Bank ATM account. But I'm definitely not impressed with their ATM software or their commitment to quality, if any.

Long ago I saw a Security Bank ATM bug where, if I were to try to withdraw, say PHP 11,000, the ATM would say that it was out of 100 peso bills (I think, or 500 peso bills) and that it could not process the request. The actual error is that Security Bank has a cap of PHP 10,000 on individual withdrawals. The error message is wrong though.

At exactly the same time (during the same withdrawing session), I also saw a strange bug. I was at the Security Bank branch at Timog and Tomas Morato in Quezon City and the ATM said that it was in Baguio. I don't know what the deal was there. Maybe they moved the Baguio ATM and physically installed it at Timog and Morato. Or maybe they took the install disks or CDs from Baguio and installed them elsewhere. Whichever it was, the lack of quality control is disturbing in a bank.

Just yesterday (8 Nov 2006), I was at the Security Bank on Shaw Blvd (right by Jose Rizal University). The old gentleman ahead of me took a long time to process his transaction. He was confused though, he seemed to think that either he could withdraw PHP 1432.57 (or something like that), or he might have been trying to do a merchant payment. He was trying to do all this at Security Bank even though he was a Metrobank subscriber. So, OK, he was just confused. I pointed him in the direction of the Metrobank branch up Shaw Blvd a bit.

When it was my turn at the ATM, I was concerned because the screen was blank except for some ASCII at the top (which had an A:\, and some random characters, some of them greek). So I thought maybe the ATM was not working. When I pressed a button though (ENTER), a text menu came up asking me which telephone company I wanted to pay bills for. That's bug #2. Why was I being asked to choose a telephone company when I hadn't even inserted my ATM card yet.

I wasn't interested in paying any telco bills, so I pressed CANCEL and it went to the ASCII rubbish at the top bug. I wasn't too confident about this, but the bank staff were still in the bank (but the bank was closed). I figured if something went wrong, I'd just knock on the door and tell them the problem.

So I fed the ATM my card and was able to withdraw money. When the transaction ended, the screen went blank again, with the ASCII rubbish at the top.

I pointed this out to the guards, but they said there was nothing wrong and they had just reinstalled from CDs (or floppy, I couldn't quite understand that part). I guess the guards had been *told* (perhaps by the manager, or some IT guy, or whoever was in charge of the care and feeding of the ATM) that it was OK. In which case, whoever that person was had no clue.

The clearly visible bugs in the ATM detract from the confidence that depositors or account holders have in the COMPETENCE of the bank. If they can't fix the bugs in their ATMs, how confident should I be in their financial and accounting competence? The fact that they *KNOW* about these confidence sapping bugs in their software, and they don't care enough to at least hide them from view (by taking the damn ATM offline until the glitches are fixed) weakens my confidence in them some more.

With Banks (and with other companies too, but with Banks and hospitals and air traffic control systems in particular, where lives or money may be lost) there must be no tolerance of error. Even if the branch manager knows that the ATM will continue to function correctly, the customer doesn't know that.

Monday, October 30, 2006

Damn - I'm in trouble for googling svn

There's an article about how google is in bed with the CIA. I hope it's not true. As it happens, my own sense is that there's probably a lot of overreaching going on there (the interviewee also thinks that the U.S. government probably had a hand in creating 9/11,I mean, that's possible, and Cheney and his gang are evil, but probably not *that* evil).

In any case, if this stuff is true, I'm in sooo much trouble. I keep forgetting (actually, I keep not remembering to write it down or look in my overflowing bookmarks) the URL to subversion. So I keep googling for it (there's another problem, I keep saying "googling" with no (tm) or whatever it is that will appease the lawyers, mainly because I don't know what the protocol is there. I bet I'm going to receive a cease and desist email any day now, from a company that's in cahoots with the CIA, i'm *sooo* going to be waterboarded).

Ho-hum. I do wonder how much of that is true. Maybe a lot. But I don't worry too much about it. I don't intend to come anywhere near U.S. territory until this insanity ends (probably going to be a long wait). I'm certainly not guilty of anything (well, except for saying that Bush is an incompetent nincompoop and his vice president and advisers are evil, that might be a crime now, not really eager to test it), I can explain what subversion version control is, in so much detail it would be torture on the torturers, I'm so enthusiastic about it, but there's just insanity and paranoia there. Best to leave them alone until they decompress and are more likely to leave the innocent alone.

Saturday, October 28, 2006

Upgrading ubuntu without reinstall

I see that There's a step by step guide (with pictures even) to upgrading ubuntu dapper drake to eft

I'm going to try that one of these days. But first I think i'll watch someone else do it at work :-). I've been burned quite a few times upgrading distros (mostly mandrake and mandriva) upward. It's possible to do, but a lot of things can break in the middle (with mandrake and mandriva, urpmi being so dependent on perl, there are lots of things in perl upgrading that could break urpmi which would break the whole thing.

Yeah, I think I'll watch someone do it first. I wouldn't be surprised if it goes smoothly. A lot of things go smoothly with ubuntu (although I still need to get sound working on my wife's laptop, I got that working when I had a similar laptop more than a year ago, but I've forgotten the magic incantations necessary).

A* pathfinding fun

On one of the games programming feed aggregators I monitor (or rather, that I have Bloglines monitor), there was a recent post pointing to an A* pathfinding discussion for beginners.

I haven't finished it yet, but it's sufficiently fun that I'm blogging it already :-). I doubt if I'll actually implement it. But I like knowing about random things not directly related to work. It might come up in an interview. If it doesn't, I *might* bring it up in an interview :-). And, anyway, a problem in the future might come up that looks like a pathfinding problem. It's useful to know things that are close to but not exactly in ones normal problem domain.

At work, my company happens to have How To Solve It: Modern Heuristics and I read that slowly, mostly on breaks. Not because I necessarily understand everything I read, but it's interesting, expands the mind, and even if I don't understand, it's useful to know that this or that technique exists so that, if something comes up in the future whose shape looks like it's solvable by the familiar technique, I know which book to look to. Or at least, which wikipedia article to follow :-).

Tuesday, October 17, 2006

wifi insecurity

By today I should have set up the wifi router to use WEP (I don't see where I can set up WPA on the netgear, which is a bit strange since it *is* 802.11g capable, so it's *new*).

I've decided against doing that for now though. I'll just make sure all computers in the house are firewalled off, and I'll keep the wifi router open. There's not that much bandwidth to share, but I'm interested in:

A. *Whether* someone will piggyback on the wifi at all (we're
in a lower middle class neighborhood and it'll be interesting
to see if anyone even notices that there's some free wifi
available.

B. If anyone *does* notice the free wifi and decides to piggyback,
I'll just sniff the network and snoop a bit :-). I don't care
about any of their data, I won't crack their windows box or
anything (although I may portscan, you come in the door without
knocking, I'm going to frisk your donkey), I'll just see what kind
of traffic they generate.

C. If they start doing peer-to-peer downloading, well, I'll block
them just to see if they know enough to change their Mac address
to get back in :-).

Monday, October 16, 2006

PLDT mydsl, wifi, woohoo!

I was mistaken in my http://monotremetech.blogspot.com/2006/10/pldt-mydsl.html previous post on pldt mydsl not working with linux. It *does* work. The problem I encountered was that when requesting an IP address over DHCP, there is a delay between when the first computer (which got an IP) stops using the internet and when the second computer (which could not get an IP) finally gets an IP over DHCP. I haven't done much more experimentation than that. I got the same problem with the computers reversed. When I was able to get an IP via DHCP on my Linux laptop, when I switched to the Windows computer and tried to get an IP, it wouldn't get one until many minutes later.

My guess is that this is related to the DHCP lease time. PLDT probably just won't provide another IP to a computer behind the DSL modem until the most recent DHCP lease provided to another computer behind that same modem has expired and has not been renewed.

In any case, I've got a new NetGear WGR614 v2 wifi router courtesy of Jijo Sevilla and after a painless (because I didn't try to set any security, I'll do that tomorrow or the day after) setup, my laptop (Ubuntu linux), my brother-in-law's laptop (Windows XP) and my brother-in-law's desktop computer (Windows XP) are now all able to go online, although the desktop computer is wired.

I'm typing this from the bedroom, but I'm going to have to turn this computer off soon. It's just nuts to be surfing continuously for the whole weekend. There hasn't been enough quality time with my family and I haven't even done work-related stuff that I was going to do over the VPN over the weekend ;-).

Tuesday, October 10, 2006

pldt mydsl

Sol and I moved recently. We loved our apartment, but with the baby coming, it makes sense to move in with her family, for help at birthing, with the baby, and to consolidate costs.

I miss Destiny Internet I had hoped that I'd be able to bring it with me to Sta Mesa, but they don't have cable internet available there. So we decided to go with PLDT MyDSL, the PHP 999 low end version. Installation was pretty quick and the bandwidth is as expected (actually, it's a bit faster than advertised, which is all to the good).

There are some problems though. They don't use PPPOE, instead it looks like all that's necessary is to get an IP via DHCP and you're golden. This works with my brother-in-law's windows XP desktop and laptop. It doesn't work with my linux laptop though (dhclient eth0 just doesn't succeed). I'm wondering what I need to do to get this done (apart from buying hardware, although we might get a linksys wifi router so the two laptops in the house can use the link too).

In the process of trying to decide what router to use, my brother-in-law called myDSL support and asked them what routers work with myDSL. He got a singularly stupid reply from the tech support person there. It seems that (since we just got the connection yesterday) we're not in their database yet as being connected. Paperwork on the way from their DSL installation contractors I guess. But because we're not in their database, they won't help us.

Idiots.

If I were connected to ZPDee or Destiny or Globelines or some other internet provider, they won't help me switch to PLDT because they won't tell me whether the router I've already got will work with their system? I'd be a loss already. But maybe it's policy, they don't want to help anyone share the internet connection. It's still a loss though. People are going to share their connections anyway. I certainly am. Putting a speed bump in the way just pisses off paying customers. That's a stupidity worth a firing.

Sunday, October 01, 2006

milenyo overhang

We just had what must have been the typhoon of the decade pass through manila. Electricity went down within an hour or two of Milenyo making contact with metro manila. We stayed home (people told me of their cars shaking in the wind, cars being hit by flying billboards and people blown off their motorcycles by the wind).

Electricity didn't come back until Saturday night and by Friday night we were fed up with the heat and the uncertainty of getting electricity back (plus not being able to charge celphones, see the news on TV, etc. There's only so much AM radio one can stand).

So we decided to go to Roxas Boulevard and stay in a hotel. That worked out really well. The Aloha hotel (which doesn't have a lot of stars but is reasonably comfortable and reasonably priced) had airconditioning, hot and cold water and a great szechuan restaurant on the ground floor.

One night later, the power is back in Sta Mesa and we're home.

I haven't been online (on this laptop) since Thursday and am at Robinson's galleria waiting for Sol and her sister to come out of their Victory Christian Fellowship sunday service. It's always a pain finding good places to sit down with a laptop. There's Starbucks, where they let you charge your battery (extra points for that), but I don't like coffee enough to pay $2 for it.

Fortunately, nearby is Cafe Mediterranean. I'm having a Greek Salad, olives and ice cold San Miguel Beer. I'm also posting this blog article. This, I think, is where I'll wait in the future. I spend more than I would at Starbucks, but I like the food and they just don't serve beer at Starbucks. now if only those two women over there would finish their meal so I can take over their table and plug in to the wall socket right by them.

Saturday, September 16, 2006

Matt Cutts SEO tips

I don't know if these SEO tips by Matt Cutts are good since I haven't read them yet. Posting them here though so I can find them again.

Google Browser Sync is very convenient, but it's led to a bookmarks list that is so long I'm just never going to go back to any of those links, probably :-).

Friday, September 08, 2006

catching up

I've spent some time working on requirements for immigration to New Zealand, and I got sick in the process (1.5 days off from work this week, recovering from fever, head cold and coughing, the last being a bit of a lifesaver, strangely enough). And work has been pretty intense too, when I was able to go.

Now I need to catch up. For one thing, my RSS feed reader tells me that I've missed *5* days of The Daily WTF. I'm not going to read everything since it's sol's birthday tomorrow. But I've certainly got to catch up with the WTF's of the week :-).

Saturday, September 02, 2006

A Gamer's Manifesto

I'm not really a gamer, but I had to point at A Gamer's manifesto (partly, so I'm reminded), because it's so funny. In the same vein, there are Weird Laws of the United States, which is funny but in whose veracity I don't have any data or confidence in. And there's also Schadenfreuidian slips which is just plain fun :-).

Thursday, August 31, 2006

Erlang concurrency discussion

Joe Armstrong has a good and interesting discussion of concurrency in Erlang. One point being, if the multiple/concurrent processes don't share memory but instead only send messages to each other, concurrency is easy and robust. Certainly, it's race conditions and incorrect locking of shared resources that makes concurrency difficult in languages which share memory.

Recently too, Joel had a discussion of MapReduce which, apparently, is something google uses to parallelize massively. Which is related to the Armstrong's article since the concurrent processes don't share memory either, they just work independently allowing massive concurrency scaling pretty much linearly as the resources.

I saw a blog post that said that Google doesn't work that way (and that discussed how map/reduce actually works in terms of the, I think, C++ API). I've lost that link though. I don't know if I ever bookmarked it, and if I did, well, I work on around 5 computers. So it's somewhere, but I don't know where it is. I could use Google Browser sync I guess. But I'm not convinced. I'm a bit paranoid about it (mainly about keeping passwords in there). I'm told that that's optional (a feature I'd expect from such an excellent company as google, certainly. But I'm still thinking about it. Oh, I'm sure I'll capitulate, eventually. But there's going to be at least one tulog before I do so.

Alright. and that's quite enough randomness already.

Monday, August 28, 2006

Libraries, books, Wow

I don't quite care for the title, but yeah, those *are* Lovely pictures of books and libraries and stacks. I would love to visit each of those at least once. For a year each :-).

Sunday, August 27, 2006

per-site color preferences in mozilla would be nice

I was surfing over to phpPatterns and I couldn't read it. It was in some sort of white over green font that was hard for me to read. At least it wasn't white (or light yellow) on black. But it's still not pleasant to read.

On the other hand, I *really* want to be visiting there regularly. I didn't want to have a separate firefox profile just to view that one site (or those sites which are hard to read due to their color schemes). I might still do that, but I'd rather avoid it if possible. So I thought I'd just go into Preferences|Content|Colors and force all pages to display in black on white.

That works OK. It messes with the tabbed style on, for instance, blogger, so that the line between the editor form and the Edit Html and Compose tabs is not there. I'm sure it messes with lots of other stylish pages too. I think I'm liking this though. I'll stick with it. If I start missing the styles on other pages I may go back, and then I guess I'll read phpPatterns on My RSS reader instead. I don't think that works right though, since I'd need to follow links, and those links wouldn't be in bloglines but would be straight to phpPatterns, and the problem re-emerges.

I would be nice if site color preferences in firefox were configurable per-page. So that when someone's pages goes unreadable, I can force the colors, but just for that page.

Thursday, August 24, 2006

Re-engineering: Assertions versus Unit Tests

I'm working on re-engineering a whole lot of badly designed code at work. The code has been mostly working for 4 to 5 years (some of it seems to have been working since 2000 even, if I can go by the author:date comment at the top). Part of the problem is that many things have changed in the business since (any particular/the) code was written. Another part is that the database design was optimized for uploading (easy to identify all the new records for the day to be uploaded), but it is incredibly anti-optimized for querying. There are around 24 basic transactional tables (it could be whittled down to around 12-15, probably, that's another issue, related things should be together in one table) and every day, an additional 24 are created with the date (in mmddyyyy format, not even yyyymmdd) tacked on.

So creating a multi-day report involves running the same query over multiple tables and processing the data on the client side, or it involves a union over many tables.

The first part of the re-engineering involves creating suitable abstractions over this mess (and no, it's not fixing the table structures to be more sane, that comes later, there's too much other code that depends on the insanity). The abstractions will allow us to provide a more reasonable view of the DATA (hiding the database details) to higher (reporting) levels. This is at some cost in CPU processing though. We use PHP, and it's just not very efficient when shoveling a lot of data around while transforming it.

I'm working on basic classes that will interact with the database (everything else interacts with these classes, no higher level code will touch the database directly). I'm finding a problem though. The code aggressively checks parameters and (for anything complex), invariants inside the methods. Checking is done through assertions. At the same time though, I developed a UnitTest class (a simpler replacement for PHPUnit and similar). And when I develop unit tests, I find myself wanting to write tests that make sure the assertions are working. But the assertions can't be tested if assert.bail=1, and the assertions would get much longer if I wanted them to return failure codes to the unit testing framework (because assertions should be simple, just make the program fail immediately).

I would also like to know *which* assertion failed (my parameter checking is pretty paranoid, so there are many checks upon method entry, even if there's only one paranoid, it might even be that there are checks for object validity even if there are no parameters).

ifdef-ing (well, if(defined(....)-ing), the assertions when unit testing doesn't seem to be the right thing to do either. But I haven't really thought that through yet. Maybe I'll try that and see what falls out.

I wonder how others have resolved assert versus unit test (actually, assert versus the goal of complete test coverage, or close to it). Hmmm, I'll google that over the weekend, maybe.

Saturday, August 19, 2006

Jerry Pournelle's Byte column -- moved

It's too bad that Jerry Pournelle's contract with byte was not renewed. I've always enjoyed his columns (well, back when I could read them in dead-tree byte, and for a while, on free online byte). It's good to see that he's keeping the format though, and maintaining the site for himself at Chaos Manor Reviews.

I'd like to be able to subscribe, but that's not possible (the subscription is not inconsequential in the third world, even at my pretty good IT salary). I don't have a credit card, and even if I did, I'm not sure the transaction would be honored. Philippine credit card transactions are tricky.

I do hope that he keeps enough subscribers to make maintaining the whole chaos manor system worth his while. There are always good discussions there. I don't go there as often as I used to (due to Digg and Reddit, but it's always educational to swing by every few weeks to see what's being discussed.

Sunday, August 13, 2006

ubuntu wifi

I'm at Bo's coffee club in the Robinson's Galleria mall. I would put links there but frankly, I can't find the official websites with some very half-hearted googling. I'm running ubuntu on a toshiba laptop with an Atheros AR5212 802.11abg wifi card and ubuntu detected the wifi card flawlessly.

I also installed ubuntu on a winbook laptop with an Intel wifi chipset (it was a 1.5Ghz centrino system) and that was directly detected too. I'm not sure how ubuntu did that (with the intel system), since the intel firmware is required for that. I wasn't paying very much attention, just installing stuff and downloading packages from the network. Maybe it auto-downloaded the firmware upon detection. Or maybe it came with EasyUbuntu.

That probably cements my transition to ubuntu from mandriva. The main factor in the transition is the rate of development. Ubuntu has working svk packages (I never could get svk working correctly with Mandriva, although the packages are there) long before Mandriva does. And I never could get wifi working with Mandriva (although, to be fair, that was me being lazy, if I were younger and had more time and patience, I'd have figured it out long ago).

I never have been a linux fanboy. I'm a pragmatist. Whatever works better, that's what I use. Windows doesn't work for me since it's impossible to keep secure and, frankly, I can't afford the MS-Office license (windows itself I could afford, barely). Now, I *do* get a valid and legal MS-Office license with the laptops I purchase from the U.S., but then they have that pesky "legal only in the U.S.A." clause, so even if they're legal there, I can't use them in the rest of the world. At one point RedHat was the distribution to use (and before that, slackware). But now RedHat is moving in the direction of enterprise systems and I don't want to be in Fedora (where I would need to be if I wanted svk, etc).

I moved to Mandrake/Mandriva because of the superior package management, but now the speed of development isn't quite right for me. Ubuntu feels right. Although I wouldn't be surprised if I were to move on to something a bit faster later on.

Ah, but this post was not supposed to be about reminiscence. Instead, I was going to celebrate finally getting wifi working. I'm sitting in Bo's coffee club and for the price of a Cafe Latte I'm able to connect to Robinson's free wifi. The DNS is very slow (one reason why I don't have links above, the other being mentioned above), but surfing to this or that site, once it's been resolved, is pretty good. The DHCP server provides two IPs (the first of which does not reply to ping). That's a bit incompetent. But removing it from the list doesn't speed up DNS queries much (or at all, as far as I can tell). Once DNS resolves though, things are pretty good.

Connection to my office VPN is pretty fast (faster than at home), so I guess they use either meridian or PLDT (my home connection via Destiny Cable Internet takes a roundtrip overseas, so the VPN connection is reasonable, but not this fast).

OK. nmap -v says that the first DNS server *is* up, just not replying to ping.

I'm very happy to get wifi up and running, finally. Previously I didn't care very much. I still don't, really, since fast internet is available at work and at home. But it's a great convenience to be able to connect to wifi networks.

Next thing to learn, I guess, is how to connect to closed networks. It's been 4 years since I last had anything to do with that and it was a pain then (even with windows). I'm sure it's much easier now. Haven't done it at all though, yet. So there's going to be some learning involved.

Friday, July 21, 2006

switching svn URLs with rsync

I've got an svn working copy of close to 300MB. I'm across the internet from the source and I didn't want to check the whole thing out again. I had originally checked it out with svn+ssh:// but I wanted to switch to svn://. I needed to switch because svn+ssh takes longer than just svn://. The ssh part needs to reconnect with every svn * command, and I didn't want to pay the 2-3 seconds of that ssh negotiation. There might be a way to use a persistent ssh session, but that would look dumb, providing no beneft.

I thought maybe svn switch might do the trick, but after some trial and error, and actually reading The free svn online book show that switch doesn't work the way I thought. While trying stuff out I also looked at --relocate. There's an example of svn switch --relocate here, but that doesn't do what I need either. I'm not moving anything to a branch or elsewhere in the repository, I actually want to change the protocol used to communicate with the repository.

Finally, I fell back on rsync. I use rsync a LOT. It solves a lot of problems that I run across at work (and in the occasional consulting job). For this task, I first did an svn co svn:// checkout *at* the same computer as the repository. This was just so I'd have a working copy with svn://, normally, I use file:/// there.

Once I'd got a checked out copy using svn://, I rsynced that with my remote copy (which used to be svn+ssh://). There was probably something slightly wrong with what I did. It correctly synced the subdirectory .svn directories to use the new protocol, but the root didn't get changed. So I rsynced that .svn directory separately.

Total bandwidth cost of the rsync was around 4MB received and 2MB sent. Since the whole checked out working copy is 327MB, that's quite a savings. It actually took less time to do the rsync than my previous attempt, which was to tar and compress the remotely checked out svn:// working copy. I was then going to scp or rsync the archive over. When the archive blew up to 60MB though (and still going), I gave up on that. I certainly didn't want to copy over 60MB if there was some other way.