Author: jonathanb

  • File Editing, Chromebooks, and Development

    Continuing on a tilt from my previous post on developing from a Chromebook, there are still lots of rough edges, even for developing toy projects, primarily stemming from file-system access. A simple rule has kept me out the weeds: for Node.js projects develop only from Android apps using Android app-private storage.

    The File System

    The Termux documentation partitions storage into three categories: private-app, shared-internal, and external. You won’t see the shared-internal storage from Termux until you run termux-setup-storage.

    It appears that under Chrome OS, all Android apps have the same file permissions, which will allow you to edit source files using vim to be read by Node.js, for example. There are, however, lots of operations from Android that fail with shared-internal storage. Creating symbolic links (ln) and updating permissions fail (chmod). Running npm from the shared-internal storage results in lots of errors of the form “Error: EPERM: operation not permitted…”

    The default Chrome OS document root used for file selection runs on top of the Storage Access Framework, but the default root only provides access to video, music, and SD-card, not to the private Android emulator storage. Here lies the obstacle between using Chrome apps to build executables for Termux or Crouton.

    Editors

    Given the rift between Android app-private and shared storage, I find it’s easiest to edit files using Android apps. There are several editors available within a few keystrokes of Termux, e.g. vim, though I wish I knew how to have multiple Termux windows open at once.

    A work around to multiple windows is to use another Android app as an editor. Turbo Editor can access Termux private data once you enable the storage-access-framework option under settings. It provides syntax highlighting for HTML and JavaScript files. Under my installation, it periodically pauses, sometimes forgetting to remove the dialog box announcing the pause.

    Other Directions

    I’ve been scurrying about today looking for alternative methods of editing source code and general file-system access from Chromebooks:

    • Use window.webkitRequestFileSystem() Chrome has supported HTML5 file-system operations for several years now. File access is partitioned by the requesting website and stored locally in Chrome private storage.
    • Chrome app file storage. Google has discontinued support for Chrome apps outside of Chrome OS. Will they do the same within Chrome OS? chrome.fileSystem is not available to Chrome extensions.
    • Chrome storage. Chrome provides a key-value service similar to window.localStorage, except that the data are synced with the user across machines.
    • Expose file-operations to a web client. noide is an Node.js application that provides a web interface to edit source files. It has gyp dependencies that are broken from Chrome OS. There are a couple of projects that provide web-client editor widgets, one could leverage to present a front-end for a file server build with Express.
    • Use Eclipse Che or Cloud 9, but that’s not really developing on a Chromebook….
    • Switch to developer mode and replace Termux with Crouton, which reportedly yields a more faithful Linux experience, including running Electron.
    • Drop any notion of keeping local files.
  • Developing and Serving React Apps from Chromebooks

    Yesterday I started to collect some notes on setting up React, Typescript, Babel, Webpack, Karma…. Holy cow! How many tools do you need just to get hello-react running? Fortunately, a web search short circuited most of that when the Interweb powers showed me Facebook’s create-react-app script “bundled” with recent versions of npm.

    pkg install git    # you have to save your work
    pkg install nodejs
    npx create-react-app lookout-unicorns
    cd lookout-unicorns
    npm start
    

    A couple of command-line entries later, node was scanning a directory, transpiling Typescript, running tslint and unit tests, and serving up the results. It was so easy, you must be able to do this on a Chromebook….

    There aren’t many steps here. First install Termux, nominally an Android terminal emulator, but green-circle gateway to Linux from Chrome OS. We’ll briefly use its package manager to bootstrap into the npm world.

    Now point your browser to http://localhost:3000. Chrome, surprisingly doesn’t recognize the URL, but Firefox for Android running on Chrome OS does.If you want to use Chrome to view your fruits…. Chrome OS assigns the Android emulator a private IP address which you can get from ifconfig in Termux or Crouton. This won’t be the same IP address assigned to your Chromebook by the network, but oddly Chrome OS will expose port 3000 to the world on your Chromebook’s IP address to the rest of the network, just not to its own Chrome browser….

  • Vacation Pictures from Italy

    Well we’re back from Italy, and if you want to see where S and I took her parents, head on over to this Facebook album, or to this other one to complete the in-law travel extravaganza, depending upon which branch of the family you want to see.

    Being B&L’s first trip to Italy, we focused on the sites perhaps considered boring by seasoned travelers, but expected by anyone claiming to have visited Italy: Rome, Venice, and Florence. We braved the throngs of tourists we’ve always tried to avoid, but as a result a lot of it was new, even to S.

    We started with 3 days in Rome, staying near Piazza Navona at Hotel Raphael. The location is a great launch pad for walking trips, and there’s a lovely rooftop bar to return to. In April, the rooms didn’t suffer from the usual Italian urban din. We loved the breakfasts, served with a myriad of buffet-style options including lox, omelettes cooked to order, mechanically fresh-squeezed juice (blood orange one day), breads, standard English fair…..

    The crowds were incredible, but we lucked out in getting guided tours of the Colosseum, Forum, and Palatine Hill one day and the Vatican Museum, Saint Peter’s Basilica, and the Sistine Chapel, both from City Wonders. Jack-ass tip? Though there are still crowds in April, the tours don’t fill up. Your tour guide will give you a discount code to book future tours. Book one ahead of time, and wait until the evening after to book subsequent tours. Really, the tours weren’t that expensive and the benefit of skipping the line and providing interpretation are invaluable. Sites usually have text interpretation, but the plaques are usually obscured by several dozen oblivious tourists listening to their own guide.

    Away from the tours, we saw the Trevi Fountain, the Spanish Steps, and the Pantheon. The crowds were horrendous, even in April, so have a back-up plan to drop by during the evening or early morning. One nice surprise taking a detour to avoid a crowd was Fontanella Borghese Market where we bought prints of Roman sites. Make sure to avoid your hotel restaurant and ask for restaurant suggestions, avoid the shills, and kill your jet lag at the bar (with espresso! :)….

    The Forum.

    The sight that surprised me the most was Galleria Borghese. I love baroque music, but never paid much mind to sculpture. Who knew naked marble bodies could be so beautiful. In my backwoods opinion, there are several Borghese items that put Michelangelo to shame… I guess that’s what a couple hundred years of study will do. The cherry on top has to be the ceiling frescos above the sculptures. Jack-ass tip?: You have to book your visit for a 2-hour block ahead of time. There’ll will be a big crowd rushing to go in. Avoid the crowd, spend 45 minutes upstairs to look at the paintings, and then return downstairs to the now relatively empty sculpture galleries.

    A fiercer David than Florence’s.

    We took the train next to Venice. The rap on Italian trains is not well-deserved. Our train was fast, modern, smoke-free, and more-or-less on-time. It did help to have S have her attack-dog Italian schpiel ready to assert our seat reservations, though.

    Canal-side in Murano.

    I had only been to Venice for a day trip and it was like another world to be able to explore away from the cruise-ship crowds, get lost at night, and take longer trips on the vaporetto to other clusters like Murano, San Michele, and Guidecca, where there are burnt-out glass furnaces, Igor Stravinsky’s grave, and wonderful pizza, respectively. Honestly, there’s amazing pizza all over Italy, even in the Venice train station, but Guidecca after dark was deserted and the pizzeria staff were delighted to share their knowledge of American pop music….

    We stayed at the Locanda Ca San Marcuola, which was simple, centrally-located close to San Marco and the train station, and spitting distance from a vaporetto stop. Detracting from the beauty was the ceaseless canal noise.

    My favorite sights were the Museo della Musica, where there were Calace mandolins; seeing Lame de Barba perform in the campo; and the Rick-Steves-endorsed bar tour with Alessandro. Swallow your ego with your wine and enjoy the personal stand-up routine/roast; you’ll learn what sfuso is.

    We had to back track to get to Florence, where we stayed around the corner from the Duomo at Rodo Fashion Hotel, which is great if you really cannot walk far to the Duomo or want to spend your time watching the crowd ooze by from their terrace, but the constant noise and uncomfortable beds drove me weary.

    Speaking of crowds, we never made it into the Duomo or to the Accademia to see the real David…. so take my opinion lightly on the younger David above. Jack-ass tip?: Book your trip to the Uffizzi on-line and early in the day. The line will be 20-minutes instead of hours. S told me that she cried when she first saw the Birth of Venice, and from the crowd around it, I believe her — that painting commands respect. It’s the only high-profile work of art I’ve seen where tourists almost-universally keep a several-pace distance from it. I say “almost” because a group of high-school students crouched underneath it for a jubilant photo op. It might be the most beautiful painting in all of Italy, and it’s still underrated.

    Beyond the periphery of the crowd, I enjoyed most our trip through Santa Croce just before closing, and the Opera del Duomo where you get to get up close to designs of the Duomo, art that just didn’t fit into it, and copies of sculpture too high to otherwise observe closely. Cathedrals aren’t my motivating reason for travel, but perusing the monuments and grave markers in Santa Croche was a pleasant stroll through renaissance history. The Opera del Duomo provided a relatively intimate look at the tourist-inflicted church around the corner.

    Big men at the Opera del Duomo in Florence.

    Following our guided-tour theme, we took walking night tour (not highly recommended) and a day trip to a winery near Castellina in Chianti, San Gimignano, and Siena. The Siena Duomo interior was certainly the highlight for me. Again, I’m not a cathedral person, but the paintings, high striped columns, and tiled floors could give me days of ogling.

    We staged our departure from the Hilton Rome Airport, relatively reasonably priced and it spared us from the long morning commute from Rome to Fiumicino. Jack-ass tip?: print a copy of your air-travel itinerary, otherwise the airport ushers won’t let you get to the ticket counter….