欧美头像

欧美头像

Sunday, December 26, 2010

Disabling internal wireless card in linux

I bought this Zotac zbox a while back to play with a small computer attached to a touch screen monitor: wanted to experiment with android-x86. The one big problem with this box is that it has a worthless internal wireless card and it frequently keeps disconnecting even when it is 6 feet away from my wireless router.

However, disabling this is not simple. There is nothing in the BIOS to disable the card and in Ubuntu 10 there is no straightforward way of disabling a wireless interface. Several searches and a lot of dead ends later, I came across an article that said that NetworkManager will not manage interfaces that are marked as manual in /etc/networking/interfaces. The basic idea is to mark the unwanted interface as manual and never manual activate it.

So this is what I added to my /etc/network/interfaces and all works. The applet shows the built in card as device not managed and it stays that way after a reboot.


# disable the builtin wireless card
auto wlan0 wlan1
iface wlan0 inet manual
    down ifconfig $IFACE down


The other thing I had to do was to stop Ubuntu from bugging me for the WPA password (for which it needs the keyring password) was to follow the steps from ubuntu-tutorials.com. I'm also listing the steps below in case the URL is unavailable later on
  • sudo aptitude install libpam-keyring (was not needed on Ubuntu 10)
  • echo "@include common-pamkeyring" | sudo tee -a /etc/pam.d/gdm
  • requires that your login password and the keyring password be the same

So now, I can mount my router attached USB share on my zotax box, and all is setup to launch a picasa slideshow making for a nice 21inch touchscreen Picture Frame (Will be best after I get android-x86 onto it but for now it is dog slow and this solution works for me). Will keep checking on the progress of the android-x86 folks though as having android run on a large touch screen will be fantastic.

Wednesday, November 17, 2010

Ahh sweet debugging monkey..

I am building this C++ to C# bridge prototype to in order to investigate what it takes to allow IronPython or .NET assemblies as plugins for a big C++ code base.

All was well in the prototype but when I started integrating it into our code I started running into all kinda of crap. A series of mysterious EEMessageException etc. My VS2008 would indicate that an exception was thrown, from some hex address and the stacktrace would point to some random location for the source. This was pretty frustrating as that EEMessageException was not listed in the SDK.

.NET errors are also logged in the Event manager. However, theinformation there was useless (it just said Fatal Error). No dice there as well.

After doing all kinds of things (basically re-reading the Pratschner book) and starting with implementing my custom AppDomainManager , I started seeing some changes: different exceptions. Since I defined my own AppDomainManager which had to be loaded from a .NET dll, the exception changed to EEFileNotFileException. Again, no details whatsoever, but atleast now I can figure out that the problem is definitely that the assembly containing my custom AppDomainManager was not being loaded. Some more inspired googling later, I found this gem: Apparently I need to set my debugging type to Mixed (It was being set to auto and it obviously was not auto enough).

Now, the debug information was fantastic. I had specified blah.dll as the containing assembly and the debug dialog indicated that the missing files were blah.dll.DLL and blah.dll.exe. The methods simply expect the name of the assembly without any suffixes (makes sense when you think in terms of mono where it should ideally search for .so files).

Anyhow, once I figured this out, the debugger pointed out all the boneheaded things I had done (keeping assembly names in sync across C++, C# and python) it was easy to get it all working again and I can sleep well today :-).

Saturday, November 6, 2010

Issues with the Pro-Blend.

I loved these when I got them initially, however, the shine has worn off since and I see some issues when the gallon just I am pouring from is nearly full. The following images illustrate the usage.


 First you squeeze the jug so it can fill up the pro-blend. Here I am measuring out the Chemical Guys Microfiber wash. A very small amount as you can see.


Then you pour it out. The problem starts with this: notice how the tube (there is a tube inside connecting the bottom of the dispenser and ending at the bottom of the jug) is still immersed in the liquid. Since this pro-blend has no controllable valve, as long as the tube can pick up liquid it keeps on pouring it out. Speak about unbounded measurement error! Epic failure of duty!

As you can see, I have tried to minimize this by pouring it out in an awkward angle (instead of holding the handle above the level of the dispenser), however, the tube in my case is still not empty of fluid till I tilt the jug level: by which time most of the liquid in the tube has already flown out, once again messing up my calculations. Atleast now, the error is minimized to the volume container in the tube. Still, Incompetent design! to say the least.

Proper disposing of gas filled struts

I don't imagine this to be a problem occupying may minds :-). However, I recently replaced two aging gas struts which were failing to keep the weight of my engine hatch up. My plan, prior to the replacement was to dispose of the old ones at the S.M.A.R.T station where I go once in a while to dispose off scrap metal, used batteries, CFL bulbs etc (BestBuy also takes used bateries and CFL bulbs for disposal).




The warnings on the struts gave me pause though: It said Contents under pressure. Do not puncture, take apart, or apply heat. Since I assumed that the scrap metal handling will involve some sort of compacting and subsequent melting, I started seeing visions of exploding jagged scrap metal pieces! suitably scary thought.

Started researching about how one goes about properly disposing these things. finally found a good article (pdf) with nice pictures :-). Please note that the drilling is on the body of the shock and the other part with the dashed rod in the middle doesn't always look like that; sometimes the rod is exposed without any cover. The document indicates that my struts are of the high-pressure kind, so I know which instructions to follow. It does seem to require two things that once again, not many people I know have lying around:
  1. A vice (which by definition has to be mounted on a string stable surface)
  2. A drill with a 1/8inch or 2/3mm drill bit capable of drilling steel
Being a magpie when it comes to tools, I do have those lying around (one in storage and the a brand new Makita cordless drill and impact driver at home). I am not sure about the metal drill bit, however, drilling and breaking stuff is always fun ;-) and I am willing to buy a special drill bit just for this little project. If home depot caries it and it breaks while doing what it promises to, I can always get it replaced by them, so no worries there. I am also going to replace a leaking, much larger shock/damper on my car so I do need the practice on the smaller fellas I think.

I think I'll wait till I swap my suspension out to combine labor/HomeDepot/StorageTrip cost :-).

Wednesday, November 3, 2010

Android workaround for stupid bugs with adding a second gmail account

I have been parking under a big rock it looks like: wasn't aware that you can actually push a second google mail account to the gmail app. I was all set for integrating with my work google apps mail and calendar. I am running Android 2.1 on a HTC Hero.

My first experience went thusly:
  • Menu > Settings > Accounts & Sync > Google > follow the wizard
  • Add username and password
  • phone says "Hang on, communicating with google servers. This may take up to 5 minutes"
  • ........
  • phone says "Can not establish a reliable data connection to the server...." and then quits.
I thought maybe a phone issue and tried to update my profile, PRL, firmware etc and tried again. No dice..Same stupid dance. Googled all over the place and then finally found comment #93 which worked.
  • Android 2.1 and god knows which other versions are somewhat broken as far as their multiple account mail capability is concerned.
  • Use the included Youtube app to log in (use your google apps or google credentials). Don't worry if authentication fails.
  • Now go to Menu > Settings > Accounts & Sync and you'll find that the account you attempted to use with the Youtube app has been added.
  • Simply enable syncing and you are good to go.
Of course, life cannot be this simple. Apparently calendar syncing is not allowed for secondary account. So you'll still have to share all secondary calendars to your primary account and hope for the best (my work calendar is somehow setup to only allow the sending of busy/free status and it is either this restriction or someother issue that prevents it from being shown on my phone). So much for enterprise usage of this. Gah! Well life goes on. My old WM6 phone was complete crap and Android 2.1, while it behaves like a beta, is still better.

Maybe it isall HTC's fault. However, it says "with Google" in big bold letters onmy Hero so Google definitely is proud of what they are putting out, warts and all. At the end, all software companies must likely choose to triage and decide to release with em bugs. Thank god (and intrepid experimenters) for workarounds.

Monday, October 18, 2010

Spidey

I recently noticed these three huge spiders making their home right in front of my apt. They build these massive webs and sit right in their middle. They have sorta become my friends I think :-), when I head out, if I find one missing, I wonder where it's gone to, prospecting some other site or some such (they probably have multiple residences). A couple of days back, I think some of the landscaping people must have walked through and cleared some of the webs out, in the evening, one of them was busy rebuilding it's web. Looks pretty cool.



I don't have any high magnifications lenses that can focus close, so this is pretty much the best I can currently do. The rest of the photos are here.

Pro-Blend


 I  had ordered a couple of these from US plastics, but the site says that it is back ordered. Further searching revealed that Grainger also carries them and the local Grainger store on Kern St in Sunnyvale had it in stock. If you decide to get one from there, have them search for "Chemical dispensing" and locate the item. Do note that it comes in 1 gal and 1 qt sizes, so get the correct one for your needs.

This thread describes how to use it. I have 1 gal jugs of "Optimum No Rinse" and Chemical Guy's Microfiber wash. Totally looking forward to using it. Simply pouring from the 1 gal jug is next to impossible to do cleanly when you have very thin liquids.

Another alternative when you don't have to measure (I need to as the ONR and the MF detergent specify dilution ratios), you can also use these simple spouts or these pumps. I have the spouts on order from CGs as well just to keep them around as they look useful.