> trial and stderr

Syncing Google Drive on Linux (using ODrive free)

 •  Filed under linux

GNOME's Google Drive integration never quite seems to work for me. So I started using google-drive-ocamlfuse, which is great, if you're happy with using Google Drive as a remote mount. The internet where I am isn't reliable enough for me to trust that kind of connection, so I'm looking for a Google Backup and Sync type option for Linux.

I've found one I'm happy with.

It's ODrive. Yes, there's no desktop client for Linux (yet?). Just the miserably poorly documented ODrive CLI. But it's not actually hard to get it working.

Scott Lowe wrote a great post that covers just about everything. Go read that. Then, if you're using GNOME, do the following.

Add a "Sync" option to the Nautilus right-click context menu (gist here):

# Put this file at ~/.local/share/nautilus/scripts/Sync
# Remember to `chmod +x` it

    if [[ $file == *.cloud ]] || [[ $file == *.cloudf ]]
        odrive sync "$file"

Installing Ubuntu on a USB Drive

 •  Filed under tutorials, linux

After many, many failed attempts, I finally got this working, and nonetheless in a very convenient fashion. I also got the flash drive Ubuntu running within VirtualBox, so I can administer it from the comfort of my host machine's OS. Awesome. If you're not interested in knowing what attempts failed, read on...

Ubuntu Training Exercise


Here's a fun Ubuntu exercise:

  1. In a running terminal, restart GNOME using gnome-shell --replace.
  2. Realize that it's going to be running your GUI shell out of the foreground of a terminal, decide not to worry about it.
  3. Forget about that terminal for a while, then come back to it.
  4. Wonder what's producing all this weird output about GTK, whatever, it's probably not important
  5. Ctrl-C

So from here, your goal is to get the gnome-shell going again without losing the windows you had open.

Okay, ya got me, this is actually just a screw-up I made that was somewhat interesting to fix.

The key steps, in Ubuntu Desktop 18.04, are...

  • Use ctrl + alt + F<#> to switch TTY. This produced some bizarre visual glitches, but after switching back and forth a few times, they resolved into a nice command-line login prompt.
  • Enter your username and password
  • Execute gnome-shell --replace
  • GNOME is probably running again, somewhere. Go find it (with ctrl + alt + F<#>). Log in.
  • Now that you've recovered the windows you were working on, save and close everything and restart your computer. Your nice new GNOME shell might get screwed up by something like the system suspending (mine did).

New Job


I got a new job as an OpenMRS implementer / general tech guy for CompaƱeros en Salud, aka Partners in Health Mexico. You're gonna start seeing posts about OpenMRS and Java development. Be warned.

I've also finally ditched Satan and come back to Linux/Ubuntu. It's not Arch or anything, but there's certainly some hilarity to be shared here.

Managing Global Styles with styled-jsx


There's a bug, it might exist in styled-jsx but it certainly exists in styled-jsx as used by nextjs, where you can't have multiple <style jsx global> tags -- only the first one gets used. A nice, not very hacky solution, (assuming you're using inline-loader or raw-loader for CSS):

// global-styles.js
import foo from 'foo/style.css'
import bar from 'bar/style.css'
export default foo + bar
import GlobalStyles from './global-styles'
// in component
<style global jsx>{ GlobalStyles }</style>