Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

24 September 2023

Chromebook and Linux for Travel and Photography

I enjoy making the most of lower-end devices and appreciate economy, portability, and ruggedness. For a travel computer, I want something that I can throw into a bag without much worry about cushioning, that I wouldn’t have spent so much on that I’d feel far out of pocket if it were lost, and that I might even be able to unfold on an airplane seat. Long battery life is another desirable attribute. So, I bought a new 11” Chromebook, of the sort designed to be handled roughly by school kids, a Dell Chrome 3110 2-in-1. It has 64GB of storage and 8GB of RAM, with a Celeron N4500 processor. (Note: there’s also a 32GB/4GB version of the same model, which seems to have better availability. I didn’t want or select that one.) The keyboard has a good feel and a comfortable amount of travel. As a significant extra bonus for me, it includes native Linux support, which fits many of my preferences and application needs.

I attempted some photography and photo processing through it before traveling:

  1. Take RAW photos in rather dim weather.
  2. Extract memory card, plug into Chromebook via USB card reader.
  3. Select-all of RAW files on memory card, copy to folder on Google Drive. I was interested to see that it copies many files in parallel with individual completion indicators, maximizing use of available bandwidth. I subsequently found that it’s not necessary to do the manual select-all, and can instead just copy a folder. Nonetheless, it still takes a while to push many RAW files through the 12Mb upload speed of a cable Internet connection.
  4. Find that Google Photos doesn't support Canon CR3 RAW format.
  5. Enable the Chromebook’s Linux development environment, which I believe is included on at least most fairly recent Chromebooks, obtaining a shell in a Debian instance.
  6. In a spirit of "why not?", install Darktable as a Linux app on the Chromebook, via Flatpak to get a more current version than the older one in the Debian repository. Icons for Linux GUI apps appear alongside other Chrome apps in a folder named "Linux apps" so you can launch them alongside anything else you run in a Chromebook like the native apps or Android apps. Clever.
  7. Launch Darktable and import photos from Google Drive. This creates references only, not retaining the raw files themselves within limited Chromebook storage. From the ChromeOS environment, it’s necessary to use a menu option to grant folder access to Linux. Darktable’s sidecar files appear alongside in the Google Drive folder and can be accessed later to preserve edits made when mobile. Some patience is required as new photos are imported and thumbnails are generated.
  8. Raw-develop and edit with Darktable, as if on a more powerful computer though slower and obviously with a tiny screen; raw development takes a few seconds on a 32 MP RAW file, but works.
  9. Export generated jpg back into Google Drive.

I'm impressed that this is possible and, after a trip where I shot about 1400 photos, found that it offered a useful travel capability for archiving and for developing, editing, and posting a few shots while on the move like this Sandhill Crane:



I imported daily folders with a few hunderd RAW images into Google Drive and watched them synchronize through hotel WiFi into the cloud in under an hour, but the actual elapsed time depends critically on tha available upload data rate. (Warning about hotel WiFi, BTW: if a Chromebook is freshly started, it may have trouble launching a new Linux container instance until normal Internet access is available; a captive hotel login page may not suffice. This didn’t seem to be a concern if the Chromebook already had a live container and was just being resumed after suspension.) If the Chromebook went idle, the sync paused, but it resumed in place once the machine was awake again. It was notable how Google's integration between the Drive file system and the Linux container "just worked", and that the Darktable instance was able to find a folder there via its chooser.

A few things I’d like to improve for a next round:

  • Automate extraction of images from a camera memory card into folders organized by days, keeping accumulated images on the card but also copying each into Google Drive once and only once. It may also be useful to explore camera options for folder placement and photo numbering to better facilitate this.
  • Figure out how to keep Google Drive’s cloud sync uploading actively even when the Chromebook is otherwise idle. (There may be an obvious configuration option somewhere that does this, but I haven’t yet stumbled on it.)

13 September 2022

Update day! Whee!

Ubuntu's 22.04.1 LTS release came out fairly recently, and I had it on my to-do list to get around to updating some components of my personal digital empire once it did. I'd already been using 22.04 on my desktop for several months, to general satisfaction and particular appreciation of its having included a new enough version of Darktable to handle the CR3 raw format that one of my cameras produces.

So, to the updating. I have a DigitalOcean droplet that runs the Nextcloud snap. I like having a small bit of cloud that I can manage myself, primarily to share files among devices and sometimes with others. I use memory cards with higher storage capacity than the minimal droplet's 25GB, but it serves its purpose. sudo do-release-upgrade worked fine. One system checked off.

I also have a home server, which also hosts a Nextcloud alongside other services, for larger-capacity sharing within my LAN. Here, the Nextcloud instance hadn't auto-updated like the droplet's snap, and I (bad me!) hadn't been attentive to updating its versions while the service continued to "just work". After the OS upgrade, I found that the Nextcloud-in-place required a PHP version earlier than the 8.1 included with Ubuntu 22.04, so couldn't generate display pages. There's a third-party repository that has older PHP releases, but I wasn't quickly able to line up the right set of configuration for the old Nextcloud to make use of it, and it was Update Day anyway! After three successive updates to Nextcloud to successive versions, I got it current and able to find and use PHP 8.1. My screen sync icon winked with approval. 

Lesson: be aware of dependencies, and do upgrades when you have time to deal with surprises.  

01 September 2019

Increasing cloudiness

I've been a long-time Dropbox user, mostly for making files conveniently movable and accessible to myself and family members across Linux, MacOS, iOS, and (less frequently) Windows platforms. I wanted something based outside my local LAN, so that I could synchronize when away from home. Dropbox's free service seems to be becoming more restrictive, notably in terms of Linux file system support and with regard to numbers of synchronized devices per account. The lowest paid tier provides 2TB of storage, which is far more than the few GB I need for my usage model, where I don't use the cloud storage as a long-term repository for massive amounts of data. Apple's iCloud offers a reasonably-priced package with 200GB, but lacks a native Linux client. So, I looked into other alternatives, and quickly gravitated to a quasi-DIY approach.

I've had good recent experience with DigitalOcean, as I discussed a few months back. It was easy to create another small droplet hosting a snap of Nextcloud and, "viola", I've instantiated my own cloud storage facility, with available clients for all of my platforms and enough storage within a minimal 25GB droplet to satisfy my current usage requirements. Even with a new domain name registration to address it, the additional $5/month droplet cost is fine to satisfy my purposes, and I like having my own control over it.

21 April 2019

I see you knocking but don't want you in

A few days back, I set up a "droplet" at DigitalOcean to host a Django application that I'd been building, and so I now have a small net-facing Ubuntu VM there. As a security person, I've been, er, interested to see just how interesting my site has quickly become to, er, unexpected visitors. Looking at its first-ever auth.log, it went active at:

Apr 16 15:33:23  systemd-logind[1385]: 
Watching system buttons on /dev/input/event0 (Power Button)

The sshd logged its first preauth disconnect at 15:38:27 (just over 5 minutes later), from an IP address that whois resolved to country code IR. Since I didn't have an associated domain registered at this time, I assume that this was a random address scan.

I started an Apache server about an hour later, at 16:47. Following some of my own testing (and a domain name registration), its first unexpected visit came at 17:40 in the form of a POST from an IP address in St. Petersburg, RU.

I can see that my droplet's sshd and apache have been busy rejecting varied streams of "knocks" since, and am applying best practices of firewalling unneeded ports and disabling passworded access to ssh. Still, I've been surprised at just how quickly and broadly my site was discovered. If more of my prior experience had fallen on the operational response vs. architectural development side of security, maybe I'd be less surprised. Anyway, a valuable learning experience and reminder. Stay safe!

30 January 2019

MD5: nice to see you here, old friend!

I recently assembled a new desktop computer system. In the course of moving my data to it from its predecessor, I managed to corrupt the database that my photo organizer (Shotwell) uses to manage my photo collection. I rebuilt a new database from the photos themselves, but this lost metadata like comments and edits that I'd applied. I hoped, though, that I'd be able to recover that information later from the older versions of the database tables. I managed to do this, thanks in part to one, er, key element in the database structure.

In Shotwell's database, each photo has a row in the PhotoTable, with many columns containing information about it. There's a unique ID for each photo, but the IDs generated as photos were imported into the earlier database couldn't be assumed to be the same as when I reimported them into the new database. It would clearly be a Bad Thing to apply the tags for photo #457 in the old database to photo #457 in the new database. What to do?

Looking at the PhotoTable columns, I noticed that each photo had an entry for an MD5 hash of the image. Hash functions are great and useful things. It's unlikely (and, I mean, highly, probabilistically, unlikely) that I'm going to encounter two different images in my collection that yield the same MD5 value. (Even though MD5 isn't recommended today for security-relevant applications, it's still doing its job here in distinguishing among image files that came out of my cameras, which haven't generally acted as hostile attackers.) I expect that Shotwell's code uses the stored MD5 as a quick and effective means to determine whether or not a photo has already been imported into its database. When I saw the MD5 column in the table, I realized that it also provided me with a means to find the correspondence between photo entries and their IDs in the old table with their entries in the new table. Thusly armed, SQL of this form followed:

REPLACE INTO PhotoTable ( named-columns )
SELECT named-columns
FROM old-PhotoTable src
INNER JOIN PhotoTable dest ON src.md5 == dest.md5

which took less than a second to replace corresponding metadata into a table representing about 23,000 photos. I restarted Shotwell with the resulting table, and found my edits accurately restored. I was pleased to have been able to accomplish this. I was glad to have been using an open source organizer with an accessible and documented database representation, and emerged with refreshed respect for the power and value of hash functions.

03 February 2013

On computers and cameras as containers

In a traditional cold-season home activity, I've spent a while recently setting up a "new" server system on my home network. I'm quoting "new" because it's a repurposed desktop PC that's about a decade old, retrofitted with Linux and more disk capacity than its designers probably ever envisioned as being connected to its SATA ports.  It's working well for now, though. It's entirely possible that its aging power supply may die or that its motherboard may fail. Power supplies aren't hard to replace, but finding appropriately sized and cabled motherboards might be harder.  The important thing, though, is my data; if the surrounding hardware fails, I can remove the new disks, read them elsewhere, or build them into a new system.  The computer isn't a destination in itself; rather, its purpose in my IT life is to act as a means to get data on and off of disks.  The "peripheral" disk device is the central component, and the "central" CPU is present and running in order to support it.  Similarly, the purpose of a digital camera is to translate views into bits that can be stored on a memory card and processed, and that become independent of the camera that collected them. A closed camera whose images couldn't be exported or viewed except through its own screen wouldn't be nearly as interesting or useful. The cheap and ever-more-capacious storage modules can be read and written elsewhere; their information is what matters, not the surrounding systems that load the information into them.

11 October 2010

Evocative typography

I appreciate effective technology and design aesthetics, but often find one appearing without the other, as their experts often seem to live in parallel universes.  As such, I was pleased to note The Ubuntu Font, and interested to note that the simple fact of using a different combination of pixels to represent menu characters could confer a noticeably different user experience. At least to me, it seems evocatively British, providing a welcome transatlantic contrast to many user interfaces.

05 October 2010

Yes, Virginia, an encrypted object can compress (in a special case)

Not new news, but a nice delighter to discover by experiment - when the rsync command (with -z compression and -c checksum options) transfers a TrueCrypt volume to replace a prior copy, following changes to selected files within the volume, it manages to do so without resending all of the encrypted volume's data.