Browsed by
Category: How-To

Tethering a G1/dream on cyanogen-mod 6 in windows XP

Tethering a G1/dream on cyanogen-mod 6 in windows XP

икона за подарък

I recently found myself in a situation where tethering my phone to my laptop was needed. The hotel i stayed in charged $14/day for wireless access, and plugging into the hotel wired network is a guarantee of a 0-day exploit showing up on my laptop.

Luckily, I started using Cyanogen-mod 6 on my rooted Tmobile G1, which offers USB tethering without the drama of having to sign up through a service provider. The only hitch in the plan is that the laptop with which I needed to tether was a Windows XP laptop, that had no damn idea what an NDIS driver was, much less how to enable the phone to tether.

Luckily, I had some time to kill, so I figured out how to make it all happen. This should work for any tmobile G1, or htc dream, running Cyanogen-mod 6, tethered to an antiquated windows XP operating system.

  1. Obtain the NDIS windows XP driver for the android phone here: Remote_NDIS_based_Internet_Sharing_Device
    • You may have to browse to the file above with your phone, download it to your phone, then connect it in USB harddrive mode, and transfer it to your system..
  2. unzip the folder on your desktop or wherever you saved it.
  3. plug in your G1/Dream via USB
  4. Go to settings, then wireless settings, then tethering in the menu
  5. click the checkbox next to USB tethering
  6. when the windows XP dialog comes up asking for drivers, specify the folder you unzipped in step 2 as the source for the drivers.
  7. Windows should then install the correct drivers for your phone to start working as a tether.

As always, be sure to light up the comments if it works or doesn’t work for you, and good luck!

How to remove U3 from Sandisk jump/flash drives on GNU/Linux

How to remove U3 from Sandisk jump/flash drives on GNU/Linux

For a long time, the U3 technology on sandisk cruzer devices has been annoying Windows and Linux users alike. The issue is that there is some hardware built into the device that maps part of the drive as a hardware CD-rom drive and performs some “big-brother” style property storage. The idea, in theory, is that using a sandisk cruzer would allow the device to store properties of applications you use commonly, all without your intervention. It also allows the drive to more easily be used as a boot device, as it pretends to be a USB CD-rom drive. And by the way, it also takes up extra storage on the device, so your 16gb flash drive is only usable at the ~14gb level with U3 installed. The icing on the cake is that until recently, there was no way, using open source software, to remove this “feature”. The only thing you could do is download the binary blob and find a windows pc and run the application on the device that flashes the firmware to remove the logic that sets up the CD-rom portion.

Not any more.

Doing “sudo apt-get install u3-tool” on debian based distros, or the like on most other distros, will give you a tool that allows you to manipulate the hardware controlling u3, all from the comfort of the linux command line.

To remove u3, first make a backup of your files on the device, if any. This is mainly a precaution, as some of the operations using u3-tool do retain data. For the sake of this article, it is wise to assume all your data will be irrecoverably destroyed. Just make a backup…

Then, execute the following steps:

  1. Do “sudo apt-get install u3-tool”, or the equivalent in your distribution.
  2. Plug in the flash drive.
  3. Observe that it mounts 2 different points by using the “df -h” command:

    /dev/sr1 6828 6828 0 100% /media/U3 System
    /dev/sdc1 15640000 108416 15531584 1% /media/A3CC-70F0

    apparently sr1 seems to be common to most cruzers, but sdc1 will likely be slightly different for you, as it depends on how many drives you have installed. In this case, /dev/sdc1 is the drive with U3 on it.

  4. We want to hit the main device mount with the remove command, so I target sdc1 in this case. Your target may be slightly different, but you should be able to identify it by choosing the drive that is closest to the size of the flash drive. If you have more than one of the same size, just unplug the flash drive and see which one sticks around. then plug it back in.
  5. Execute “sudo u3-tool -p 0 /dev/sdc1”, where /dev/sdc1 is your actual device you found in step 3 and 4
  6. cd back to the device root mounted at something like /media/A3CC-70F0 and “rm -rf /media/A3CC-70F0/System” and “rm LaunchU3.exe”
  7. you now should have a clean device

A Couple Spring Freemarker Binding Tags are Broken..

A Couple Spring Freemarker Binding Tags are Broken..

Java Spring binding tags for checkboxes and multiselect lists are broken in the Spring freemarker template.

I found this out after spending a large amount of time trying to determine why my simple validation to check for completion of required fields kept breaking on page reload after an error was found. I discovered there is an issue with the spring freemarker template macro named formMultiSelect and also in the formCheckboxes macro.

The issue is in the line determining if there is a previous selection made on the checkbox or multi-select. The check doesn’t properly dereference the variable containing the pre-selected values, and so attempts to deal with it as a string rather than an array, which causes an error similar to “freemarker.runtime – Expected collection or sequence. list evaluated instead to freemarker.template.SimpleScalar on line 368, column 12 in spring.ftl.”

The error can be corrected by copying their binding macro and modifying it to properly dereference the object in the routine to check existing values. In my case, the following line:

<#assign isSelected = contains(status.value?default([""]), value)>

became:

<#assign isSelected = contains(status.actualValue?default([""]), value)>

This change needs to be done in both the checkboxes macro as well as the formMultiSelect macro. This change allows the reload of the page to work properly after an error occurs, or if preliminary choices are made in the multi-select or checkboxes.