Ubuntu Desktop feature: screen zoom

Here’s how to set up a graphics-accelerated zoom feature on your desktop. The intent is a magnifier for the visually impaired, but I find it handy to highlight a small part of the desktop for focus or demonstration.

First, install prerequisites.

sudo apt -y install compizconfig-settings-manager compiz-plugins-default

Next, run ccsm (as your normal, non-root user) from the command line or the Dash.

Under “Accessibility” find “Enhanced Zoom Desktop”. Enable it. In the settings for the plugin, set Super+Button4 as the “Zoom In Button” and Super+Button5 as the “Zoom Out Button”. Done!

To zoom, hold down the “Super” key (Windows key on a PC keyboard, Command key on a Mac keyboard) and scroll in either direction.

screenshot of the compiz config settings manager

UDP 1, 2, 3: netcat vs. socat

TCP is handy for simple, reliable communications like this tiny toy logger. I run the server and clients in separate consoles on the same machine:
# TCP log server
nc -kl 8000 > server-log.txt
 
# TCP logging from netcat client
date | nc 127.0.0.1 8000
 
# TCP logging from socat client
date | socat STDIN TCP:localhost:8000
 
# TCP logging from Bash client
date > /dev/tcp/127.0.0.1/8000
The only bummer about TCP is that–in my example–other clients have to wait in line. We are logging so I want fast, one-way communication from any number of clients to the server, and reliability of every log message is probably not critical. Let’s try UDP! I could just add -u to the netcat server args to use UDP datagrams, but a netcat UDP server gets a little wonky. The easy workaround is to use socat as the server instead. socat happily accepts any datagram from multiple clients, simultaneously.
# UDP log server
socat UDP-RECV:8000 STDOUT > server-log.txt
 
# UDP logging from netcat client
date | nc -q1 -4 -u 127.0.0.1 8000
 
# UDP logging from socat client
date | socat STDIN UDP-DATAGRAM:localhost:8000
 
# UDP logging from Bash client
date > /dev/udp/127.0.0.1/8000
Use at your own risk. The TCP version is surely simplest, safest (ahem, still no auth – this is just a toy) and reliable. I don’t know much about what’s going on under the hood here. Insight welcome! Messages from different clients might get mangled together, too. Tested on Ubuntu 14.04.

Group chat me crazy

Group chat (IRC, Rocket.Chat, Let’s ChatMattermost, Zulip, Slack, etc) rocks! Definitely use it. But, fair warning:

My thoughts on group chat:

  1. Be available sometimes, especially when your coworkers are. Aim for healthy overlap.
  2. Be unavailable sometimes. Focus on your work and get stuff done.
  3. Managers: support your team doing both #1 and #2 above.
  4. Discuss and curate tribal knowledge in group chat, but distill often into other permanent, public, shared resources for your “knowledge base”, such as mailing lists, wikis, and (gasp) formal documentation.

Survey for my SeaGL 2015 command-line talk

I want to give my best talk ever, and I need your help. Knowing my audience will help me produce the most relevant, fun, and insightful content. Please spare a minute and take this survey. Submission does not guarantee admission. All questions are optional. Here’s more info on my talk (including date, time, and location).

Alternative to the Google Form above: all survey questions are repeated below. Email your response to [email protected]

  1. Will you attend my talk?
    • Yes/No/Maybe
  2. How experienced are you on the command line?
    • 1=Beginner,2,3,4,5,6,7,8,9,10=Expert
  3. What’s something you love or hate about the command line?
  4. What shell(s) do you use?
    • bash, zsh, ksh, fish, tcsh, other
  5. What operating system(s) do you use?
    • FreeBSD, GNU/Linux, Mac OS X, Windows, other
  6. Is there something in particular you want to learn or improve related to the command line?
    • Examples: basic stuff, piping multiple commands, find/grep/xargs/ssh/cut/paste/col/parallel/at/sed/awk/vim/git, job control (running multiple programs at once), fun/silly stuff, customizing my shell, programmable completion, shell programming, advanced/experimental stuff (like what?)
  7. Anything else you’d like to tell me?

Free Software Claus is Coming to Town

I help organize a conference for Free Software enthusiasts called SeaGL. This year I’m proud to report that Shauna Gordon McKeon and Richard Stallman (aka “RMS”) are keynote speakers.

I first invited RMS to Seattle 13 years ago, and finally in 2015 it all came together. In his words:

My talks are not technical. The topics of free software, copyright vs community, and digital inclusion deal with ethical/political issues that concern all users of computers.

So please do come on down to Seattle Central College on October 23rd and 24th, 2015 for SeaGL!

Sandstorm – personal cloud, self-organzing cluster

I’ve heard a lot of Meteor news lately, but somehow I missed Sandstorm. Your own personal cloud. Install services easier than installing apps on your phone. Add machines and they self-organize into a cluster. This sounds just way too awesome. Looks like they use Meteor heavily. Jade Wang (formerly of the Meteor Development Group) is a co-founder.

Apps must be packaged for Sandstorm (made into “grains”). The list of ported apps is pretty inspiring. Included are: draw.io, LibreBoard, HackerSlides, Let’s Chat, Paperwork… All were new to me, several are written in Meteor, and I was able to check out all of these in seconds. I’m hooked.

how to upgrade MongoDB 2.6 to 3.x on Ubuntu

sudo mv /etc/apt/sources.list.d/mongodb* /tmp/
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update && sudo apt-get install -y mongodb-org

And I also had to do fix my replica set in the MongoDB shell (necessary for Meteor oplog tailing):

var a = {"_id" : "rs0", "version" : 1,"members" : [{"_id" : 1, "host" : "localhost:27017"}]};
rs.reconfig(a, {force:true});

UPDATE 2015-10-01: Alas, one of my coworkers found even all the above wasn’t enough–he had to blow away his old MongoDB install.

sudo mv /var/lib/mongodb /tmp
sudo apt-get purge mongodb-org-server
sudo apt-get install -y mongodb-org-server

We also use one-member replica sets in dev (Meteor uses the oplog), so edit /etc/mongodb.conf and include something like replSet=rs0, then restart mongo (sudo service mongodb restart). Finally, initialize the replica set:

var a = {"_id" : "rs0", "version" : 1,"members" : [{"_id" : 1, "host" : "localhost:27017"}]};
rs.initiate(a);

It appears that collections can be restored by simply copying files like blah.0, blah.1, blah.2 and blah.ns from /tmp/mongodb to /var/lib/mongodb while the MongoDB server is stopped.