Enjoying the Android platform

It’s about 13:37 here and about half way through the work day. Normally I use a mixture of my workstation, Alice, and my phone; lately I have been using Alice quite heavily. I guess there is enough crap going through the wires that sometimes it is better to offload some of the heavy network traffic, plus it is rather handy that if I need to get up and walk around to do something, I can bring my /entire/ session along with me. So my workstation isn’t Mission Critical to doing my job. In fact, it is pretty much a heavy weight client doing what a humble X terminal could do really.

The important things to getting work done around here, in regards to all that, is a terminal, SSH client, and a web browser. Last night I setup the free Android Terminal Emulator app that I have on my phone, only to find that it seems to be crash happy on Andrea :'(. Likewise I setup ConnectBot for SSH access, only to find that it doesn’t support real modifier keys. So I can’t use it with my docks actual Control, Tab, Alt, etc. ConnectBot does work great on  my touch screen phone though. How did I solve these problems? After spending for the tablet and dock, I can’t bitch about paying another $4 for Better Terminal Emulator Pro (BTEP). Not only is it stable, it includes ash (probably dash but I haven’t checked), bash and busybox in its toolset. Dropbear is even slipped in for SSH, which while not something I like, will do fine for at work needs.

I can SSH into the development server at work, use tmux & vim, and go about doing stuff. Heck on a good signal day, I could stand next to the Microwave with the tablet portion and keep coding! I can do that with my phone too but practical issues like screen size/virtual keyboard, mean going from vim to ed. Emacs should even work but I don’t use it. All that is missing is a native X Server, and I could fix that with some rooting and VNC stuff, or maybe try to write one, idk. My workstation can deal with that slice of stuff easily.

To top it off, 94.9 has always been a bug to keep playing since they moved to a Flash based web player. The iHeartRadio app on my phone works but ahem, sound quality blows. The app doesn’t support Honeycomb tablets but I was able to download and install it manually, then setup the radio station to play using portrait orientation: the app doesn’t do landscape. So now I can finally work and listen to music without having to periodically stop to kick the radio stream into working 🙂 🙂 :-).

I is satisified so far!

Hello Andrea :-)

Today, I went out and bought an ASUS Eee Pad Transformer from the local Microcenter. It is very much like the ASUS EeePC, or at least the 1015PE I have been using since retiring Dixie. In point of fact, I am typing this up on my new Transformer! It took quite a while to charge up enough to get to the updating but it was a very simple, quick, and easy process to update from Android 3.0 to 3.2; one of the things to attract me to this device, has been that ASUS seems to be supporting it much better than most companies have been supporting their mobile phones.

Being so much like Alice, which is also an ASUS product, I have named this Android “Andrea”. The Transformer has interested me since I learned of it’s existence, but I didn’t quite think I would be purchasing one so soon lol. I will admit, that the differences between an Atom N450 and a Tegra 2 interest me. As does the notion of pushing Android harder to its limits. What really makes it worth while how ever, is between the dock and the tablet, the battery life should be insane.

Compared to the EeePC 1015PE, it is very similar: most external differences are more cosmetic or a reflection of the change in internals; like the ports involved. Andrea has basically the same keyboard as Alice. Except the left Windows and Alt keyshave ben replaced by “Home” and “Search keys”. Android doesn’t understand function keys, so rather tha being Fn+F* combos, various operations are instead directly accessible via the top most row of keys. There is also no numpad to enable via Fn+F* key, not that I have ever used this on a mobile. Oddly, delete has been replaced with lock where as appropriately, escape was replaced with “Back”. While docked the keyboard operates as you would expect, there are only a few noticable irregularities when coming from a PC. Mostly things like Control+Arrow-key or Control+Backspace are not working, although Control+A, Control+C, Control+X, Control+V combos working. Fair enough on a touch screen oriented OS I guess. Alt+Tab even works, more or less like long-pressing the home button on an Android 2.x phone. Using the cursor/tab keys to move around does not generally work as good as a PC user is used to, although such PC users are probably a dying breed. The touch pad however is very nice and useful. Very enjoyably you use left click/tap as on a phone and right click as an alias for the back button. Context menu is usually a soft button on the bottom or top side of the screen.

As a tablet, I personally would prefer a smaller screen like my mother’s 7″ Dell Streak. It just feels more managable in my hands. As Andrea is meant to be docked, I am quite happy to have a full 10.1″ screen. The resolution is also one up from what Alice supports, which makes for an interesting experience! It is so much easier to use Android on a 10.1″ at this resolution then my phones lowly ~3.2″ HVGA display. Changes to apps like GMail and the like, generally seem to be improvements for having a tablet sized screen in Honeycomb; I am somewhat interested to see what happens in Ice Cream Sandwich and Jelly Bean.

I have the TF101-B1 version, so 32GB is a lot. Most stuff on my phone is on the MicroSD card, and I only maintain 35-50MB of space. Andrea came loaded with something like 200MB of space in use out of 28GB accessible, a pretty good deal. Especially since unlike my phone, it isn’t loaded down with applications, even if the updates to 3.2 added more. Alice is only 11-13GB with a bunch of software installed on GNU/Linux, less than 4GB of which amounts to my home directory. So I am pretty sure that I don’t need to wory much here! I can also use memory cards and USB devices for more stuff. ASUS preloads it with a bit of My* apps, including a form of ASUS Web Storage. I have tried it under Froyo and Windows XP, Dropbox is better, and has the advantage (unlike ASUS Web Sotrage) of being able to access stuff in app when you are disconnected. Android client is OK other than requiring Network access (or side stepping out of app) but the Window PC version just sucks, period. FWIW though the integration into MyCloud and the procing is very nice—but I will stick with Dropbox.

Honeycombs UI is very enjoyable for me, and I am kind of impressed by the bundled office app: Polaris Office. Haven’t used it very much (just for documents) but it is nice. Something that really aces it for me, the Browser app is much more like Google Chrome than the Froyo version. Running off a 1Ghz dual core instead of a little 600Mhz single cored ARM, it is also fast enough that I don’t need to reach for Opera Mobile.

So far, I’m lovin’ it. Really the main lossage is a native X server. I would have to root Andrea and set things up using X/VNC. Except for a few things I do at work, I don’t need X, as a decent shell environment or a SSH client to one, does most of what I need. Hehe. My only real complaint is that while Alice has a _long_ charging cord/adaptor, Andrea has a short one :-/.

This is a deplate of my Viki notes file on XRandR

1.1 Querying information

This was taken  with my ASUS 1015PE Netbook (Alice) hooked up to my LG
wide screen at home on 2011-07-23.

$ xrandr -q

Screen 0: minimum 320 x 200, current 2944 x 1080, maximum 4096 x 4096

LVDS1 connected 1024x600+1920+0 (normal left inverted right x axis y axis) 220mm x 129mm

   1024x600       60.0*+

   800x600        60.3     56.2 

   640x480        59.9 

VGA1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm

   1920x1080      60.0*+

   1680x1050      60.0 

   1280x1024      75.0     60.0 

   1152x864       75.0 

   1024x768       75.1     60.0 

   800x600        75.0     60.3 

   640x480        75.0     60.0 

   720x400        70.1 

$

LVDS1 is Alice’s display. VGA1 is the monitor hooked up to the VGA
port on the side.

1.2 Positioning monitors

       

  • xrandr –output M1 –left-of M2 :: M1 is left of M2
  •    

  • xrandr –output M1 –right-of M2 :: M1 is right of M2
  • xrandr –output M1 –above M2 :: M1 is above M2
  • xrandr –output M1 –below M2 :: M1 is below M2
  • xrandr –output M1 –same-as M2 :: M1 and M2 mirror each other.

Where M1 and M2 are the short names given from xrandr -q. I assume that

    $ xrandr --output M1 --left-of M2 --output M2 --right-of M1

Is permitted, +/- using two xrandr commands for it, as well as being
redundant.

1.3 Setting monitor resolutions

    $ xrandr --output NAME --mode SIZExSIZE

Sets the monitor NAME to the given mode.

1.4 Turning monitors on and off

1.4.1 On

    $ xrandr --output WHICH --mode 1024x768

1.4.2 Off

    $ xrandr --output WHICH --off

Rapid fire shell coding :-)

Well, since Friday night, I have been pretty steadily working on my ~/.sh infrastructure. I started by hooking up alice to sal1600’s monitor (22″), keyboard, and rat. Since I rather distaste how the GNOME/Ubuntu has been acting late: I also took the libtery of adding my xmonad.hs file to git, then ditching GNOME for a pure XMonad session. As I use programs that need a system tray to really be useful enough to me (e.g. pidgin), I’m using fbpanel: good old staple.

For a little while I experimented with making the inactive windows transparent, this works pretty great, but rather interfers with my custom xterm wrapper script that sets my terminals ocupacy: the propteries set by transset-df get lost :-(. Looked at some other terminal emulators supporting transparency, besides gnome-terminal and rxvt-unicode. Sakura seems to be the best bet, and evilvte almost excellence (better to compile from source then using the .deb). In the end, I just switched off the fancy effects, since most of the time I am using a terminal or reading text anyway.

Next up was figuring out how to use XRandR to manually configure my displays. Better still, I wanted to extend my ~/.sh and X session infrastructure to auto-magically configure itself to Do What I Want when I launch a session when hooked up to an external monitor. For architecture and convience, it can also be run as a shell script, thus supporting a sort of hot plugging. So right now, if I hook up to say my 22″ widescreen and let alice do it’s magic configuration: after I login, I will be working off the big screen, so I can ignore the 10.1″ little one :-). This isn’t without a few warts though, namely if I go hotpluggy with it, fbpanel needs to be restarted in order to render on the new primary display (I just switch off the netbooks display), and pidgin becomes confused on where to render notifications (oi) with how it’s setup in the default Ubuntux way. Oh, and hardware issue being that the touch pad makes the cursor jiggly should I close the lid lol. The performance is also noticably slower on 1980×1080 but works very snappy. I really am inpressed with this sweet little ASUS.

I then pretty much went about refactoring bits and pieces of my `sh services environment`, going so far as to create a GNUmakefile that I can use to help set things up whenever rigging a clone on a new install. Being lazy, I also finally moved ~/sw/sh from Dropbox to git. Generally I use bin for local binaries, sh for portable scripts, and sh.local for things specific to the system. Usually odds and ends that reflect a very specific setup.

Over a dozen commits later, I like the result pretty well. The only problem is, the difference between the 20″ screen at work and this 22″ screen, I now have so much screen realestate that I don’t know what to do with it LOL. In Windows, most of it just goes to waste for want of XMonad.

VNC over SSH, the idiots guide.

Since I rather like to have options, I’ve decided to augment my usual SSH /w option of X forwarding to the option of VNC as well.

Objective: connect to my netbooks X session using VNC, tunnelled over SSH.

Implementation:

Since my netbook runs a GNOME centric distribution, I’m using the “Remote Desktop” preferences program on “System -> Preferences”. If you’re like me and to damn lazy to hunt and peck, this just runs the program ‘vino-preferences’. On here it’s possible to setup VNC access to your desktop. In essence, it just runs vino when you login. There are loads of good and bad write ups on VNC server setup and 3 or 4 click setup is good enough for me.

My iptables rules pretty much block such things as incoming VNC requests, which is good because I don’t want the session exposed across the network interface. Pretty much all there is for accessing my netbook is the SSH port.

Now on another system, it’s possible to connect using SSH forwarding. This gains us both encryption for the VNC session and less port exposure; that is good for security.

PuTTY client setup:

  1. Load/create your session in PuTTY
  2. Go to SSH -> Tunnels
  3. Add a port forwards
    1. source port: 5900
    2. destination: localhost:5900
  4. Login to the system using PuTTY.
OpenSSH client setup:
  1. ssh -L 5900:localhost:5900 username@host
There are options for both if disabling the shell session and only running the forwarding is preferred (PuTTY: SSH->Don’t start a command at all; OpenSSH -> RTFM for -n, -N, and -f). 5900 is the default VNC port running off the server end (my netbook).
Now on the client machine, connecting any VNC client (e.g. TightVNC) to localhost should give the desktop session over at user@host; in this case, my X session on alice!
This is the shortest, sweetest, non-non-sense, you’re assumed to know how to RTFM if you want to know the facts, kind of write up that I’ve seen on doing this. Hmm, maybe it helps that I already know how to use SSH port forwarding with OpenSSH, hehehe.

One of the things that I’ve been working on over the weekend, is expanding my unix profile a bit. Pretty much, I have a universal ~/.sh directory that houses a profile for Bourne style shells, well, modern ones in the sense that functions are supported, which is like everything since 1980 or so.

An extension to this was pulling in my X session setup, since it is already in the same repository. This pretty much resulted in ~/init.sh becoming ~/.sh/rc.xinit. I pretty much use the same setup across machines, so it’s not a big problem; but startup programs based on where I am and what I’m doing, rather than normal session management.

So this poses a good question, short of resulting to some kind of “Session Chooser” on login, how to make it smart? Magic kind of smart! It’s not hard, so much as it is a bit sticky. The thing that varies the most is the network. Either:

  1. I have no network, and thus don’t need stuff like instant messaging.
  2. I’m at work, and have more use for stuff like monitoring
  3. I’m at home, and have more use for stuff like gmail and a broader selection of instant messaging services.
  4. I’m using my phone, and need to worry more about data usage than pre-loading applications.
So obviously, the idea is to react based on what network is in use. That is pretty easy by asking nmcli for the name of the network connection being used, once NetworkManager gets the ball running. Case statements ftw :-).
I have found one problem so far, which is that the instant messaging client that I use, has a command line interface to specify which accounts to sign in, but apparently, pidgins -l option doesn’t work as advertised by –help—or NAME != the name in accounts.xml. So perhaps I’ll just have to use separate clients for at work and not at work, or modify the XML file.

Every so often, life gives you a reason to be glad you learned something. Well, one for me was being stuck without working arrow keys on my server during early boot—and smiling because I knew vi well enough not to need any!

Today, I just got another lol. Setting up a bit of a server install here using some scavenged hardware. The keyboard I’m working with is both one of those annoying ones with the pipe (|) key missplaced in favour of a larger enter key—and having most of the keycaps in the wrong places! Well, unless they make a “<>PYF keyboard layout and the hardware see’s it as QWERTY :-D.

Where else but technology, could you have this much of a chuckle and life still be great? Haha!

Paste it!

A while back I was thinking of setting up a personal paste-bin, but obviously that means finding suitable software or writing it. In my case, I’d rather like one that is locked to me or restricted to logins I issue.

But it just occurred to me, that having sufficient access to the system, I can just use vim’s :TOhtml command to export a file as HTML, upload it to a designated area, and have the web server pick it up. Then use a cron-job on the server side to clean out files in that directory every now and then.

Yeah.

+1 for git in my book

Parsing this old blog post by Keith Packard, somehow makes me happy that I opted to follow the Git path rather than the Mercurial (hg) path when I left CVS behind. I also like the trailing comment xD.

That being said, git and hg are the only version control systems I really respect, above tar. Perforce and Darcs, I at least consider worth a closer look someday. Just haven’t had any excuse to leave Git on my own projects since the first date.

Yeah, I’m a lazy git alright.

Alice just proved her ROI lol. When I left work yesterday, I just unplugged her, closed the lid and slipped alice in my backpack. There it sat until getting to work just now—with 2:35 hours remaining on the battery!

This thing is energy efficient enough to take several times my laptops battery life, when under a normal load. Let it go into restrained sleep and it’s pretty darn long lived; I have Linux programmed to prefer using more power then is strictly necessary when on battery as well.