Posted
by
timothy
on Sunday July 22, 2012 @10:55PM
from the also-must-have-infinite-battery-life-and-candy dept.

An anonymous reader writes "I am choosing a smartphone for work, moving up from a long history of just-a-phone phones. This coincides with moving into an environment where I will have a desktop machine in my office, rather using my laptop — so I'll VPN in from home, and am looking forward to not trucking my laptop around everywhere. BUT ... this means I now won't have my laptop all the time. I have gotten used to scripting various little things that make my life easier, and would like to carry that over to the phone. For example, periodically check that a certain machine is online and backing things up the way it is supposed to; if the lab monitoring system sends me an email that the -80 freezer is up to -50, play a sound and run the vibrate system in a specific, arbitrarily chosen pattern; when I press this button, record an MP3, when I release it prep an email with it attached, that sort of thing. Does such a beast exist? Has anyone used one and if so what do you think? Bonus points if you know if I can use it with Rogers (Canadian wireless provider used by my workplace)." I've heard good things about (but never used) the payware Android app called Tasker; what other recommendations do you have for running the world from a smartphone?

So that you can properly automate functions on the phone itself - many scripting apps can access root-restricted parts of Android, and are therefore quite a bit more flexible when the device is rooted. As a simple example, just take a look at GScript.

I believe that up until at least 2.0 or 2.1, your phone had to be rooted if you wanted to use Connectbot to connect to a remote host and forward local port traffic to the remote host (ie, run an Android SQL client and connect to an instance of MySQL running on the remote host that only accepted incoming connections from localhost). For all I know, it's still required (my phones have been continuously rooted since late 2009, so I'm often not really sure what non-rooted users can even do or not do anymore), b

It's as you said: Nokia N900, hands down.You get:1. Fully unlocked phone, unlocked bootloader and real Linux.2. Loads of "hacker" tools and apps.3. Busybox ash(stock) or full Bash if you want.4. The phone part is fully scriptable with dbus commands. There's even a dbus monitor daemon to run a script when a certain dbus signal is sent.5. Hardware keyboard, decent specs(CPU's a bit weak, but greatly overclockable), and good screen.6. Debian Chroot gives full LXDE system right on your phone if you need it.7. Real web-browser functionality: tablet-friendly stock microB(FF based, renders like FF 3), Firefox Mobile, Chromium(desktop version basically), Opera

Really, it seems to be the only option.The N9 might also be doable, but there you have to enable developer mode, and have no hardware keyboard, screen's poorer(AMOLED vs LCD), and it's just more hassle.

It looks like an interesting device, but the low resolution kills it. 320x400's just too low, sadly. Heck, even 800x480's low - My optimum device would be 1024/1280x600 in a 4" screen, and a slightly larger form factor than the N900(plus dual/quad core, 1GB of ram). But I still don't see anything like that...

Don't know who the dumb fuck was going through modding all these posts down, but (s)he needs to have their head smacked.

This is what I was going to suggest. Using sl4a [google.com] allows the use of Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell. That pretty much covers all the good scripting languages except Rexx, and I haven't heard much about Rexx in years.

Of course, if you stop and think about it, Android's entire API is a scripting language, so...

For added fun, Tasker has SL4A integration, so you can have Tasker run arbitrary scripts when various events occur. SL4A also lets you (in addition to its own APIs) lets you install, e.g., additional python modules, and the Java-interpreted scripting languages (BeanShell, Rhino, and probably JRuby) let you directly invoke the Android APIs. The latest Tasker release also has JavaScript support and exposes more device functionality to it than SL4A's APIs do.

*shrugs* there's always been malicious modding going on. Piss off the wrong person, and they'll stalk you next time they have modpoints and downmod everything in your history. How else can you explain month-old +5 posts suddenly getting a -1 troll mod literally the day after you call somebody out on their bullshit?

I don't know who has been modding down the sl4a posts, but whoever it is, he knows what he is doing.I have been working with sl4a lately because my son has an Android phone, and I can tell you that it is half baked. There is much functionality that is missing regardless of the language that you choose. Much of it just does not work. I made a python script to send an SMS message every 4 minutes. In the script I have a time.sleep(240). Ten minutes later... still no SMS message.

While sl4a can do some things you can't do otherwise, don't forget it is an alpha quality software -- that is, it is quite unreliable. It crashes often, it uses archaic APIs, runs slowly and uses megatons of memory.

This is also true of Tasker -- while versatile, it is a resource and battery hog. There is a trial version on the website, so you should get it and give it a try. Maybe it isn't useful enough for you.

There is also a cheaper Takser - AutomateIt (nagware) and Automateit Pro. This overlaps somewha

"This is also true of Tasker -- while versatile, it is a resource and battery hog."

I see why you're posting this as Anonymous Coward. Because you clearly don't know what you're talking about.

Tasker is not a battery hog. However, it doesn't prevent you from doing things that hog the battery. Want to keep your screen on and not let the phone sleep while unplugged? Knock yourself out. Want to get a GPS fix every minute? Have at it. Turn on and leave on the LED camera flash while your phone is in your pocket? W

AC is quite right (I came to point out the exact same phone actually).Another great point is the hardware keyboard; it's really a paint to attempt to script or code or use ssh on a touchscreen-keyboard.

The OS is not just a Linux kernel with new stuff strapped on; it's a descendant of Debian GNU/Linux inside, so unless you're a windows user, you won't have any issues hacking from this phone.

I have used sl4a on my HTC EVO 4G Wimax. But I found that it is one of the models that will not work with a bluetooth silicone keyboard. This really burns me up and I have tried a couple in stores.For one model, the market app would not install.Another model, it would pair but not connect.If anyone knows a keyboard (silicone or not) that would work with it..Anyway you should note there are issues such as battery and what happens when connectivity is lost.For example in a gps tracking app, you would want to

n900. it's open source and has a full slide out keyboard for when you have to write a script on it an emergency. normally i prefer to write such things on my desktop then use ssh to get them over to the phone, but it can be done on the phone itself too.

Really any large screen high resolution smart phone will do the trick. Basically you want a phone (most of the time) and a terminal some of the time.
On screen keyboards suck. high resolution makes them easier to pack into a small foot print but doesn't address the big issue of lack of real estate. For this, I recommend (as small as you can get it) a blue tooth keyboard. Personally I use an old iGo Stowaway Ultra-Slim Bluetooth Keyboard. Small enough to carry around in the car with me, or in my pocket, if

Not really, not *any* high-res phone. He'll definitely need an open OS (open meaning that he can hack it and do whatever he wants, not open-source), and he'll most likely need an ssh client among other things. It's better to look for a phone which has those thing out-of-the-box, rather than trying to force some other model work as something it isn't.

How exactly do you set up the keyboard when you want to work (physically)? I used to have one too, but it was too flimsy to use on my lap with the phone on it (there was a flip-out cradle of sorts built in - seemed to be made for much smaller, lighter phones though), making a laptop the better choice for when I was out and about... I always saw the appeal of having a full-sized keyboard in your pocket, but finding a place that would actually allow me to use it (and prop up the phone so that I could actually

The web server is a very nice idea, but regrettably doesn't cover things like notification/events in cases that require immediate attention. On the other hand it might be rather easy to send out sms from the server (ideally from at least two different phone numbers - normal/emergency) and set custom ringtones for those. You could even include a (deep) link to the server.
In that case almost any smartphone (or even wap capable one) would do. It would be elegant and easy to update and replace.

The N9 is a wonderful phone, can certainly be scripted (I ssh into mine all the time to do things), but lacks a physical keyboard. The onscreen one is great, but because it takes half the screen it makes the shell-window smaller. (really, you might want an N950, but those "don't exist" and getting one is difficult, plus the antenna issues make it less useful as a real phone).

The N900, now hard to locate, has a great screen, a great keyboard and is the predecessor to the N9. But they have a known issue with the USB port breaking over time, so if you do actually succeed in finding one to buy don't expect it to last forever and ever. But this is 2000+ where things aren't expected to last longer than a few years.

Seconded. I have both phones now and have moved to having the N9 as my phone and the N900 just be my pocket/travel *nix box. I've not (touch wood) seen any problems with the USB port but it's something which is a known issue. The N900, while not perfect, is a damn good little machine.

Indeed; the N900 actually descends from the "pocket computer" idea, and they finally added phone functionalities; not the other way round, so it's a pretty complete computer. Hardware keyboard is the real big difference between the two, and will, most likely, be the feature that tips the scales (according to preference).

You should try Finger Term in the N9, transparent keyboard, so you can type over the screen, the main problem is that your fingers aren't transparent. The N900/N950 hardware keyboards are better anyway, but the overall experiencie of N9 could worth the difference.

You can use FingerTerm [ovi.com] on Nokia N9, like I do. It isn't as good as a HW full keyboard, but it's the next best thing. Even more, it is also opensource [unlink.org].

Aegis security system is a bit more limiting than I would like it to be, but you can easily bypass the limitations with inception [endno.de] (for the moment the site seems to be down, so just use your favorite search engine to get some info). With inception you don't even need a computer, everything is done on the phone afaik. Haven't yet tried it myself, because so far

The N900, now hard to locate, has a great screen, a great keyboard and is the predecessor to the N9. But they have a known issue with the USB port breaking over time, so if you do actually succeed in finding one to buy don't expect it to last forever and ever. But this is 2000+ where things aren't expected to last longer than a few years.

It is just some manufacturing batches that have issues with the USB, and even if you were to be an unlucky person it can always be fixed; the N900 is rather easy to open so you can just re-solder the USB-port more securely if it comes loose. One can also solder an extra USB-port by connecting it to the pads underneath the battery, though a USB-port and wires hanging out from there isn't terribly practical if you're still planning to use the phone a lot on the go.

My suggestion is Tasker, but unless there's a mail parser plugin I haven't come across (or unless you write one), it won't take actions based on the content of e-mail messages. It will, however, react to SMS message content. So one way to handle your custom notifications is to write a script that runs on another always-on, always-connected machine. Have it receive and parse the e-mails and when one of them meets your criteria, have it send you a text message with relevant content, then have Tasker do whatever is appropriate when that message arrives.

To make sure your script-running server is up, use something like Ping HostMonitor. You can also use that to monitor the status of any Internet-accessible hosts.

The biggest downside of this approach is that it relies on SMS to reliably notify you. You might also want to have Tasker send an e-mail acknowledgement when you get the SMS, and have your script keep re-sending the texts periodically until it receives the ACK.

Yes, everything OP wants can be done with Tasker, except that it can't parse email... unless you use K9mail. Tasker has support for that app, letting you parse the emails like you do with SMS. I've been debating whether to get K9mail myself, just for that reason.

I've done similar things, where I want my phone to tell me if some external activity has happened or has changed beyond certain parameters.

I do the analysis elsewhere, such as on that desktop PC, and the alert consists of sending a text message to the phone (or multiple phone numbers). Google for the how, it's a common practice and easy (and free) to do. Depends on the carrier, altho some sites claim to figure that out for you, but I just figure each one out and avoid them. this does mean that if a phone number changes carrier, I have to change the script, but since so far I have only sent texts to my own phone, it's no biggie. Just have one central script to send the actual alert.

your phone is a thin client. have it receive emails or some alert, but all heavy lifting should be on a server.

Why?

Even older smartphones have much more power than many desktop computers did 15 years ago. The I/O may not be up to much, especially over a network connection, but they definitely can do a lot of other work.

If you're comfortable with scripting, you may want to write your own android app to do just what you need. Just make sure you buy an android phone that can install non-market applications. To test this in the store, ask to see a running phone of the model you're considering, and follow this procedure:

1. From the main screen, tap the menu button.
2. Tap Settings.
3. Tap Applications.
4. Look for a checkbox that says "Unknown sources - Allow installation of non-Market applications", and make sure you can en

Just make sure you buy an android phone that can install non-market applications.

You only need to be able to turn on USB debugging (under "developer options" in 4.0.3) - then you can install any app you develop via a USB connection. It's easiest if you use Eclipse etc. Google "android development eclipse", or something similar, for help in setting it up. It's pretty easy!

Android Scripting Environment is a layer that allows various scripting languages interact with the Android API. It supports a bunch of languages and allows for a decent level of control over the Android device.
http://code.google.com/p/android-scripting/ [google.com]

I'd recommend a two-pronged approach, if you're looking for something user friendly and not requiring building an intermediate server.

First, check out the unbridled awesomeness that is If This Then That: http://ifttt.com/ [ifttt.com] It allows you to create simple (or complex) triggers based on all manner of inputs with all manner of outputs. Email, SMS, Social Networking, etc. I use it with a "private"(read: used only for this, and nothing actually private is tweeted) twitter account to pass data about. I originally used SMS, but I moved to twitter later as it's remarkably convenient and can be adapted easily to a number of different devices, whereas SMS is limited to phones (for the most part).

Then, on your sexy Android phone - I'm using a Note, personally, it's the closest I can get to a tablet but still be able to comfortably put it in a pocket - use Tasker to intercept and act.

Really, though, the first thing I'd do in your shoes is seriously investigate IFTTT. It's very easy to use and flat out awesome.

Why would you want to run the script on your phone?Of course there are apps for that.... but then why? Here is what I do. I use VPN (Cisco VPN is the one supported in most corporate environments, and is available on linux), and then just ssh to any machine I want.There is talk of even remote desktop kind of client coming to android.Alternatively, you could just ssh to the machine you want to access, and then do as you please.I use a Galaxy note, and since the screen is 5", its very usable. However, on smaller phones(like my older optimus one from LG), such stuff was a pain.

So all your scripts will run on the server, in your lab, and email will be sent to you. Its far more easy to set up these scripts on the computer in your lab. Heck, you could write the scripts locally, and then ssh to your server and put them there.

But if you still want to do stuff like access email, parse through it, and then do something(ssh to server blah blah), you may as well write your own app. On the market, most such apps will do only a part of what you want.

Somebody has suggest N900(linux), and if you want everything on your phone, a linux phone is what you are looking for.

A "remote desktop", as you put it, is available for plenty of others mobile OSs already, generally using VNC, though there are some other, less popular, protocols floating around.I've no idea where other OSs stand related to the Cisco-VPN support though, since I tend to stay clear of all proprietary protocols while I can:)

but not background scripting which is what he wants. on windows phone you would have to tie it to ms's push notification system and have a server handle most of the work, at which point you could be just as well sending sms messages. you really can't script different types of responses to different types of emails fetched on windows phone reliably currently, while touchdevelop seems to be oriented at simple ui scripts which fetch data from server and display it.

Since you're on rogers: http://www.rogers.com/web/content/iphone4s [rogers.com]
I suggest:
Prowl: For push notifications. It's free and you will find the perl script handy. There are some powershell ones floating around somewhere too. http://www.prowlapp.com/ [prowlapp.com]
Prompt: CLI. If you jailbreak (highly recommended) you can ssh to localhost, it's better than any Terminal app in cydia. http://itun.es/i624Jj [itun.es]
There are others but I never use them. My coworker and i opted for a home brewed app that handled a lot of our needs by phone in the event we had to be called about something off-hours.

^ LinuxOnAndroid [blogspot.in] is pretty good if you want a chrooted linux running on your phone simultaneously with your Android. You run a vnc server to connect to the chrooted linux if you want the full gui desktop. Otherwise, you can just use the shell.

I have been using it on a Nexus S 4G since last 6 months. Nothing much to install. Just download the image (3-4GB) and use the app to run a script which sets up devices and does chroot. Or you can do that yourself on the android shell. And the developer Zac is quite re

I have no clue why everyone is rushing to have you put scripts on a smartphone, which can be lost, stolen, run out of battery...

You do your scripting on a PC at work, and only receive reports on, or do *emergency* remoting from, your phone. At most you tweak your phone so that if it receives an email/text with keyword "ALERT" from sender my.scripts.at.work, it does something noisy.

Any phone can do that, it's a matter of finding the right size/features balance. I'd go for a big screen, and maybe a hardware keyboard if you think you'll be doing a lot of remote editing, though the best phone keyboard is a lot worse than any laptop's, so don't plan on using it too much.

Rather than using the Phone to do the monitoring and polling, I'd consider using a service on the network at work and then make your phone a client of this service.An example would be to use Nagios to do the monitoring and then use one of the countless Nagios Clients available to read the monitoring state from the service. You'll get the added bonus of knowing what happens if your Network coverage goes away to fill in the blanks after the event and be able to escalate to someone else if you're not available

The monitoring portion should be on platforms near the servers, not on your own device (mobile or desktop). Plus something to monitor the monitor, located farther away, preferably at another site. There are no good monitoring packages IMO, but many reasonable and usable ones. All of them should be as scriptable as you need.

You need one device on your person to receive alerts; a cell phone with SMS is good. My current job requires two devices on different networks, but that may

I'd argue this is part of the geek/hacker mindset, and while it's a valuable asset, we have to remember that this places us outside of the mass market in some fairly significant ways. As a direct result of this, we're no longer the "target market" for consumer electronics.

I always figured that anyone who buys a phone that needs scripting to do what they want is the one who under thought their purchase. It's like being proud that you need to install your own shocks in your brand new car.

There are indeed some Ask Slashdots (for example those that go on building some kind of datacenter at home) that overthink the problem, but I don't think this is one. The guy is just asking for some niceties to get alerts from the server room and extras for e-mail. A little bit of automation like that might actually make things smoother for him.

With a bluetooth keyboard and external display you could use your phone for dev, but I'd have to ask why. On the other hand, as an admin tool its great. I have often sshed into my home network to take care of one thing or another. For a professional sysadmin on call, scripting from the phone could will make the difference between needing to drive into the office on the weekend or not.

I think you're a little confused as to what "on-call" actually means. It is not regular work. You don't handle tickets, respond to emails or any of that. On-call is for emergencies, and it is typcially uncompensated. Your job is to respond if called. Otherwise you can do what you want. You are not by any means expected to stay sitting in your room hanging onto a laptop. Or if you are and you're not getting paid straight time for it, it's time to freshen up your resume.

Now that you understand what on-call is, if all you need to do is reset somebody's password or similar "emergency" and you can do that from your phone, then just do it and get on with life. Of course if you prefer to drive into the office instead then feel free.

I think you're a little confused as to what "on-call" actually means... it is typcially uncompensated. Your job is to respond if called. Otherwise you can do what you want.

This must be some new meaning for "on call" with which I am unfamiliar. We pay our people to be on-call for specific off-hours periods, and that pay is by the on-call hour and in addition to their base salary. If they are actually called on, then they get yet another additional payment, depending on how long it took to address the issue. Those eligible for on-call duty are also free to decline any or all on-call duty, if they wish. We expect our people to remain sober and capable when on-call, even if they are attending social events such as parties. This has a price, as it should.

Which industry/country do you work in, where on-call time is free (and possibly compulsory and/or unlimited)?

I've never been offered extra money to take 'pager duty' (as it was historically called). I hated it, I won't willingly do it again but its still the norm to pay one annual salary and still expect lots of 'free time' from your slaves. I mean employees. I did mean employees, really I did.

In a perfect world.In an imperfect world the guy that gets in at 6AM and the guy that leaves at 11PM both bother you for minor stuff because they think you should be working as well, so you do it and then later contact their supervisors to give them a clue about what an emergency is if you can.I did choose my last three phones with a keyboard to save a few trips into the office, and it has worked to an extent. One odd thing is free wifi sometimes blocks ssh (indeed everything apar

If you're *really* going to go that route, though, why on earth wouldn't you use a tablet instead of a cell phone? Archos makes some 10" tablets in the $200-300 range which are extremely Linux-friendly. Ok, so the tablet itself is somewhat underpowered by current standards, but how many tablets have officially manufacturer-supported Linux images (debian-based in this case) you can install in place of the Android that ships from the factory without voiding your warranty?

I didn't miss it, I just think it's an idiotic suggestion when an ultraportable laptop or tablet fit in just about any bag you could possibly be carrying around, let alone trunk or glove box space in a car.

We're talking about being on call for work here... there's no reason he can't leave the device in the car and fetch it if he needs access to it. When you're talking about carrying an extra device that's virtually unnoticeable in your bag, why would you want to force yourself to use a device that's the wro

With a bluetooth keyboard and external display you could use your phone for dev, but I'd have to ask why.

I'll answer why: Because certain electronics makers have jumped on the "post-PC", phone- and tablet-centric bandwagon and stopped making the smaller size laptops. Dell, for instance, has already dropped its 10" laptop.

Some soft keyboards have transparency, so can take most of the screen while you keep seeing what is below. And some have hard keyboards, some of them pretty good, or can use a bluetooth keyboard. The N900 is more a pocket computer than a cellphone, but could do work for what is needed (and was script friendly too)

The N900 wouldn't work on Rogers, though... they use 850/1900 for their HSPA bands. It's quad-band GSM, so it'd work at GPRS/EDGE speeds on Rogers' network, though, which *should* be plenty fast enough for SSH type work.

It's that the keyboards almost universally are horrible for it, because they are designed for things like natural speaking. Their processing of symbols is subpar.

The same is true of most small bluetooth keyboards, or built in keyboards. Frankly, my Zaurus SL-5500 from 2003 has a better keyboard on a mobile than almost anything that's come since. (And in fact, the only things I can think of that rival it that I have encountered, are also Zaurus devices.)

I have found one that I don't think sucks so far, it's "hacker's keyboard" on android. (Most important things it has that seemingly every other keyboard lacks are tab and arrow keys... easily accessible. It has some limitations though, and you'll almost certainly want to enable portrait 5-line keyboard) Though I usually use it more with my table as opposed to with my phone, though it does work there just fine, I use the phone more for email/texting/etc, so having a keyboard (swype) which is better for those things as default means the other isn't used as much.

Microsoft has something called on{X} for Android that allows you to use Javascript for scripting. It's not clear how extensive it is, but it might allow you to do some of the things you're thinking of.

Second this. I'm not at all a Microsoft fanboi, but this is actually interesting and good...

I have only one complaint. Back in may I set up a task to wake me half an hour early on any workday morning when

Minimum daytime temperature was predicted to be over 10 Celsius

Maximum windspeed was predicted to be less than 10Km/h

Propability of rain was predicted to be less than 10%

so that I could get up early and cycle into work (40Km). This alarm has never worked...

In fact the GUI on a windows/linux PC at home/office, through Teamviewer or VNC client, to control your tools/scripts is much more practical.
If you are on a slow connection then just have some web front end to run all your possible scripts (try webmin to see how that works) and use the browser on any smartphone to run your scripts etc.