Archive

Archive for the ‘Linux’ Category

Android Proxy support

May 25th, 2011 No comments

So, last week I found myself immersed in Android again, figuring out for a client to what extend Android can support proxies. For future posterity, I’ve written this post to document what I found.

User-level proxy support

Proxy support under Android is somewhat of a mixed bag. What you will find is that is it possible to setup a proxy server for your 3G connection, but that it is not possible to setup a proxy connection for your WiFi or VPN connection. A system-wide proxy cannot be setup as well. Mind you, this is based on what is possible under the default Android settings. The Samsung Galaxy S, for example, does support the use of a system-wide proxy, but this is a Samsung-addition.

A 3G proxy can be set via the APN settings (Settings →Wireless Controls→Mobile Networks→Access Point Names, then select the active APN):

Edit APN settings

This does give you a proxy for the 3G connection you are currently using, but most probably you want to use a proxy for your WiFi. As  of this moment (September 2010), this is not possible without rooting your handset. I won’t go into the details of that operation, as there are many sites dealing with that issue. Instead, I’d like to point you to Xda Developers, whose many forums are bound to contain rooting instructions for your particular Android handset.

If you do have a rooted phone, you can use a tool called.
It is possible to have a UI popup that handles the configuration of a proxy for wifi but the settings that it stores are harshly discarded by Android when it configures a network connection.

One thing is for certain: Google needs to step up to the plate to make Android proxy friendly if it wants to break into the enterprise market.

Categories: Android, Linux Tags: ,

WiFi lesson…

September 23rd, 2010 No comments

For the past few days I wondered why my laptop refused to connect to my wireless access point in my study, instead insisting to connect to the wireless router in the basement. As my study is one floor up, with hard concrete walls and floors seperating them, the resulting signal was abysmal.

As both networks were configured to use the same SSID, theoretically they should both be visible to the laptop and the strongest signal should have been chosen. Indeed, an ‘iwconfig wlan0 scan’ command showed that both access points were visible. As I had configured them with the same WPA2 passkey, I could not figure out why it refused to connect to the nearest access point.

After a few days, it suddenly hit me: I had one access point configured to allow for WPA/WPA2 connections and the other access point for WPA2 only. This is enough of a difference to force Ubuntu into thinking that these are different access points. What is strange though, is that they do not should up in the wireless network browser as two different networks. I know that my Android phone has no problem connecting to the nearest network, regardless of WPA settings.

Anyway, fixed now… :)

Categories: Linux Tags:

Android on the HTC Diamond/Raphael/Topaz/Rhodium

May 25th, 2010 No comments

OK, so I promised some more details on the current port of Android to the HTC Diamond. As I referred to before, there is a porting effort underway to get Android running on the HTC Diamond (both the GSM and CDMA version). Most progress is chronicled on the (ever excellent) XDA-developers.com site, but there are several changes.

Running Android on your HTC Diamond means installing 3 different things to the internal storage of the Diamond (or an SD-card for the Topaz  and Rhodium):

  1. A Linux kernel (found here)
  2. A rootfs for booting the kernel and Android (found here)
  3. An Android distribution (found here).
  4. Oh, and a configuration file for configuring the Android build (you are probably best off getting the first version out of the full build linked below).

If you’re not familiar with booting Linux or Android, you may want to download everything in one package, which can be found in this thread on XDA. After downloading, unzip everything in the root of the Internal Storage (for HTC Diamond) or in the root of your SD-card for all the other models. Copy the startup config for your device

A few attention points:

  • Disable the PIN-code on your SIM-card! The current ported version does not handle SIM PIN-requests properly (it gives a pop-up but does not unlock the SIM properly) No longer applicable, with the current rootfs PIN requests are handled properly.
  • On the HTC Diamond, change the file in <tbd> (while running Windows Mobile) and look for the line with cc-cache=100 in it. Change this to cc-cache=20. This prevents Android from pre-loading a lot of applications upon startup, slowing down your phone
  • The clock will start drifting a bit, about half an hour a day. This is annoying, but the developers are aware of this.

For me, this is the end of the line, as I have sold my HTC and instead opted to go the Android route entirely, buying myself a SonyEricsson Xperia X10

    Categories: Android Tags: ,

    Android or iPhone? Wrong Question « abovethecrowd.com

    March 4th, 2010 No comments

    Found a great read on why Android or iPhone is the wrong question.

    While Apple may have opened the proverbial Walled Garden, it is Google, with its aggressive Android offering, that aims to obliterate it. Make no mistake about it; Apple was the pioneer with the amazing revolutionary product. Also, with no iPhone, there is no Android. This is not to say that Android copied iPhone, but rather the impetus to adopt and trust Google’s Android offering was driven by a market dynamic that resulted directly from the iPhone’s success.

    via Android or iPhone? Wrong Question « abovethecrowd.com.

    Indeed, the iPhone represents only a very small portion of the global phone market. But it is the other portion of that same phone market that is the target for Google/Android. Google does not necessarily want to compete with the iPhone head-to-head (although they can!), but is more looking towards converting people that use a heavy feature-phone these days but may make the switch to a smartphone if a compelling enough offer comes along.

    Categories: Android Tags: ,

    HD Crash…

    February 17th, 2010 No comments

    So…. Here we go again: that all too familiar feeling of ‘uhoh’…. I was working on my PC the other night, doing a routine upgrade of KDE to the newly release version 4.4, when all of a sudden aptitude started spewing loads and loads of errors about not being able to save files and giving read-only errors all over the place. A quick check with mount and dmesg confirms my suspicion: a hard drive is giving problems and the file system has been remounted read-only. Dmesg confirmed that it was the drive timing out on commands, giving mentions that it was unable to remap a sector.

    Now, this puts me into a bit of a bind. This is an olderly PC that I scrapped together from a Dell Dimension 8400 and an additional HD and SATA card. As it doubles as the media-server for my XBox, it has to have some additional storage, hence the extra harddisk. The extra harddisk was a 300Gb one, the system harddisk it came with (which started failing) was a 160Gb one. I’ve routinely run LVM2 on my system exactly for this case, being able to add additional diskspace easily without fiddling with mounting additional drives, running out of space on one partition while swimming in space on another one. This time, that may have gotten the better of me though. I don’t run LVM in a RAID setup, so if one drive fails, I’m up sh*t creek. My only luck may have been that I only very recently added that disk, and I hadn’t really started using it.

    So, now I need to recover this data somehow. My plan of attack is as follows:

    • Put in another drive
    • Move the entire contents of the failing drive to the new drive
    • Try to reconstruct the LVM data from there.
    • Profit! :)

    Step 1: find a new drive

    We need a donor drive to transfer the data too. Preferably, use a drive that is bigger than the original drive. Nothing would be worse when you try to rescue your precious data and finding out that you are a few sectors short on the new drive. Even if both drives are advertised as being 160Gb drive, that doesn’t mean they will have the exact same sector count! When we have the drive, hook it up to the system

    In my case, I bought a 250Gb Samsung drive, only to find out after I built it into my machine that it was a) refurbished (it had a complete Vista install on it) and b) dying! I immediately got a warning from Ubuntu that the SMART data indicated that the drive was failing… Not good. I removed the drive and replaced it with a slightly larger 160Gb drive I had lying around. I will replace that drive when I get a replacement for the refurbed drive, but by then, I can hopefully use the ‘pvmove’ commands.

    When connecting the drives, make sure that you hook up the donor drive to the cable that was originally connected to the failing drive and connect the failing drive with an extra cable. This way, the device enumeration under Linux would be identical and the partitions we salvage will appear on the device files that LVM expects.

    Step 2: re-create the partitions you had on the drive

    This step, in retrospect, may not have been necessary. I booted the mediaserver into a bootable Ubuntu 9.10 CD-image and re-created the partitions using Gparted, ensuring that each partition was slightly larger than the corresponding partition on the failing disk. Note: gparted will complain that it is not capable of working with LVM2, but you can ignore that.

    Step 3: get a copy of dd_rescue

    For the copying of the data to succeed, we need a copy of dd_rescue. Dd_rescue is a clone of dd, that copies data from a file or device and does not abort when it encounters a read error. Instead, it will fall back to a ‘sector-at-the-time’ reading mode, log the error and continue. Additionally, it has the option of reverse-copying, starting at the end of a device and working its way backwards, so that you can approach a problem area from both sides, maximizing the amount of a file or device that can be read.

    Ubuntu 9.10 does not come with this by default, but the sources are tiny and luckily our live-CD includes a working gcc compiler. Compiling it is a breeze, just consisting of a ‘make’ call. We run it is follows:

    $ sudo ./dd_rescue /dev/sdc1 /dev/sdb1

    Of course, you will need to change /dev/sdc1 and /dev/sdb1 into their appropriate device files. Also, be very careful about the order  of these arguments. The first is the input file, the second argument is the output file. Mess these up and you are overwriting the data you want to recover with whatever was on the donor drive!

    I had two partitions, so I executed this command twice. In retrospect I could have just specified the device files for the entire harddisk (i.e. /dev/sdc and /dev/sdb) and dd_rescue would have duplicated everything (including the partition table).

    I got around 40 read-errors on the first partition, and about 520 on the second partition. Now we have the drives duplicated, but don’t throw the faulty drive away just yet! If we manage to cock up the LVM restore, we can re-attempt the saving.

    Step 4: start salvaging using LVM

    Now we have a copy of our physical volumes. We will try to activate the volumegroups they belong to by executing vgscan:

    $ sudo vgscan -v
    Wiping cache of LVM-capable devices
    Wiping internal VG cache
    Reading all physical volumes.  This may take a while...
    Finding all volume groups
    Finding volume group "htpc-server"
    Found volume group "htpc-server" using metadata type lvm2

    After this is done and our volumegroups have been found, we execute a vgchange:

    $ sudo vgchange -a y
    2 logical volume(s) in volume group “htpc-server” now active

    vgdisplay will give us the names of all volumes and volumegroups:

    $ sudo vgdisplay
    — Volume group —
    VG Name               htpc-server
    System ID
    Format                lvm2
    Metadata Areas        3
    Metadata Sequence No  5
    VG Access             read/write
    VG Status             resizable
    MAX LV                0
    Cur LV                2
    Open LV               0
    Max PV                0
    Cur PV                3
    Act PV                3
    VG Size               428.24 GB
    PE Size               4.00 MB
    Total PE              109629
    Alloc PE / Size       109629 / 428.24 GB
    Free  PE / Size       0 / 0
    VG UUID               2arhGV-xkVa-MUXt-38PD-XOmE-TaYN-tpPJBT

    Finally, we can execute a full fsck on the volumegroups involved and if no unfixable errors are found, we can mount the filesystems and start assessing the real data-loss.

    Categories: Linux Tags: ,

    Git through proxy….

    June 4th, 2009 No comments

    To access the Android code from my laptop at work I need to go through a proxy. I had a hard time finding info on how to use git with a proxy, but then I found this link detailing a script that uses socat to get through a proxy. The sample script they provided did half of the work of connecting to the proxy. However, it didn’t handle the authentication part. Fortunately, socat has a few more tricks up its sleeve and adding a proxyauth option handles this case as well.  Full script can be found below:

    #!/bin/sh
    # Use socat to proxy git through an HTTP CONNECT firewall.
    # Useful if you are trying to clone git:// from inside a company.
    # Requires that the proxy allows CONNECT to port 9418.
    #
    # Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
    # chmod +x gitproxy
    # git config --global core.gitproxy gitproxy
    
    # Configuration. Common proxy ports are 3128, 8123, 8000.
    PROXY=yourproxy
    PROXYPORT=8080
    PROXY_AUTH=username:password
    
    exec socat STDIO PROXY:$PROXY:$1:$2,proxyport=$PROXYPORT,proxyauth=$PROXY_AUTH

    Be aware that your proxy must allow outbound connections to port 9418! If not, this script will not work

    Categories: Linux Tags:

    Mucking around with an embedded Linux board (again)

    April 7th, 2009 No comments

    Well, got a nice perk this week at work: assisting in getting an embedded linux board up and running. To be honest: it is a nice little piece of work, called a FriendlyArm. It is an ARM9-based development board, costing less than $150 with an 3.5″ TFT with touchscreen (optional 7″ touchscreen). It is fitted with 64Mb RAM and 64Mb Flash, and 2Mb NOR.

    I’ll be trying to get this to work, so expect updates on the blog. Eventually, I’d like to get Android running on this board as well (but memory may be a problem).

    Full specs after the break

    Read more…

    Categories: Linux Tags: ,

    Browser market share of Android rising above 5%

    March 26th, 2009 No comments
    Marketshare Android US

    Marketshare Android US

    Well, it does seem that Android is doing quite nicely on its own… Its market-share seems to have risen from nought to 5% in less than 5 months time. And that is with only 1 device out, on only 1 carrier (as opposed to Apple, who have 3 devices in the hands of 70 operators). The future is looking bright…

    (via droideo.com)

    Categories: Linux, Telecom Tags:

    How-to install Android on your HTC Touch Diamond

    March 25th, 2009 1 comment

    We have seen Android running on the T-Mobile G1 and very soon we will see Android on the HTC Magic (by Vodafone). But… did you know that you do not necessarily need a new mobile to run the Android OS? Due to its open source nature, the Android stack is available for everyone to tinker with, and tinkering they did. At the moment ports exist for the following phones (note: these are the ports that I’m aware of)

    But also for our beloved mobile, the HTC Touch Diamond a port exists. It is not yet fully functional, as a few important areas are still missing, including power-management, sound and WIFI/Cellular data. But call management, SMS and the rest of the functionality of the Diamond works just as it should.

    Detailed instructions for installation can be found on Connect-UTB, an enthusiast-run site, but it is as simple as downloading a zip-file and extracting it to a directory /tmp on the Internal Storage. Before running it, you should disable your PIN-code of your SIM, as the current port is not able to handle entry of the PIN-code after starting. Then it is just a matter of running haret.exe and having some patience. The first boot can take up to 2 hours.

    Progress on this port can be followed here, or at the following pages:

    let me know if it works for you!

    Categories: Java, Linux Tags:

    Firmware upgrade using Wine…

    February 2nd, 2009 No comments

    Interesting… The Wine (Wine is not an Emulator) project has been allowing me to run Windows applications on my Linux machine at home for quite some time. Recently, I needed to burn an image to a dual-layer DVD and was having problems getting it to read in my in-dash navigation system. Several posts on the internet pointed out that I was best off using Verbatim media, but I also feared that the ancient firmware on my burner (an NEC ND-3500AG) might be to blame.
    Newer firmware was available, but as is almost always the case only available on Windows. As I do not have a running Windows image on this machine (let alone the possibility to run DOS) I figured I might as well attempt the flash using Wine. Should it fail, I could always take the drive out and attempt a re-flash on a Windows-based machine. What spells my surprise to find that the flash worked flawlessly! I’m not advocating this route for each and every flash, but I’ve seen more success-stories of firmware flashes using Wine.
    And yes, the subsequent burn worked flawlessly…

    Categories: Linux Tags: ,
    Easy AdSense by Unreal