Category Archives: Tools

Do you use Docker Swarm? If so, how?

Docker swarm page

UPDATE – 20 Nov 2018 – I wrote this back in 2016 as I was just experimenting with Docker. Since that time, not only did Swarm emerge as Docker’s tool for container management/orchestration/clustering, but we also saw the emergence and then domination of Kubernetes as a tool for container orchestration.  I’m leaving this post online, but at this point the examples are quite prominent for how Swarm and other tools can be used.

—-

Do you use Docker Swarm? If so, how?  I have been incredibly intrigued ever since reading about the release of Docker 1.12 earlier this week.

As Benjamin Wooten writes, now with only two commands:

  • We get a deployment platform which gives us resilience, robustness, failover and fault tolerance for our containers.
  • We get load balancing and a routing mesh which makes service discovery simple.
  • We can use our server resources more efficiently with various allocation strategies.
  • We can scale containers up and down with one command.
  • Communications within the cluster are secured with dynamically rotating certificates.

Ever since, I have been reading more, such as this piece about setting up a swarm with Raspberry Pi systems.

Now I am curious… how are any of you reading this using Docker Swarm? What are doing with it?  I am intrigued and curious to do more…

Contrasting Mercurial vs Git: Two Opposing Blog Posts

GitvsmercurialWhich should you use for a distributed version control system (DVCS) – git or mercurial? That was the question taken up recently by two opposing blog posts on Atlassian’s blog:

Admittedly this is a bit of a “religious” issue with adherents on either side being extremely passionate about the topic. In my own case, my writing here (as well as my Github account) definitely show that I fall down on the side of git… but I’m also always interested to learning more about the various tools.

The two blog posts are written by passionate advocates for each tool and so naturally have that flavor. Regardless, they make for interesting reading. I don’t see myself switching to Mercurial any time soon… but it’s interesting to see the pros and cons of each. We still don’t have the “perfect” tool… but will we ever?

Given that I started working with version control systems back when RCS was the only option I had… and then CVS was a huge step forward… and then SVN was viewed as excellent… all I can say is that we’ve come a loooonnngg way and it’s greatto see both git and mercurial out there.

P.S. I should note that both of these articles are part of Atlassian’s “DVCS Guide” that has some other useful pieces about why distributed version control systems are worth investigating and using.

Vim is 20 Years Old Today!

Amazing to read via Ars Technica that Vim is 20 years old today! In the proverbial “vi vs emacs” religious war, I’ve always come down firmly on the side of vi/vim…. but mainly because I started using vi 25+ years ago back in the mid-1980s when vi represented a quantum leap forward from “ed” and “ex”! 🙂

I climbed the steep learning curve for vi/vim many years ago, wrote my .vimrc macros and continue to use it extensively even today. Of course, today on my Mac and Linux systems I’m using vim vs. actual “vi”.

The Ars Technica article has a great history of Vim and is well worth a read for those who use vim as their editor-of-choice. (And even for those who don’t…)

Vim

A Quick Python App to Send SMS via SMSified’s REST API

Smsified 1Today Voxeo[1] launched SMSified a new service that lets you use a really simple RESTful API to send text messages within the US for only 1 cent per message. I and other colleagues have been writing about SMSified on the SMSified blog and after writing a tutorial about using SMSified with curl, I figured I’d play around with python a bit and code up an example of sending a SMS via python.

So here it is… stored up in my Github account, but also here:

#!/usr/bin/env python

# Really simple python app for playing with sending SMS messages
# via SMSified - http://www.smsified.com/
# Created by Dan York - May 2011

import json
import urllib

senderid = "dandemo"   #SMSified account
password = "notmyrealpassword" #SMSified password
sendernum = "5853260800"       #SMSified phone number

apiurl = "https://"+senderid+":"+password+"@api.smsified.com/v1/
smsmessaging/outbound/"+sendernum+"/requests"

address = "14079678424"        # Phone num to which you want to send
message = "Hello there"        # Whatever msg you want to send

data = urllib.urlencode((('address',address),('message',message)))

f = urllib.urlopen(apiurl,data)

print json.loads(f.read())['resourceReference']['resourceURL']

As you can see in the code, there are really only three lines of importance: the one building “apiurl”; the one urlencoding the data; and the one opening the URL. The rest are really just for the convenience of using variables.

The final line simply prints out the info included in the result JSON. I was going to (and still may) make that print out prettier or say something more… and if you are reading this sometime in the future, the version on Github may have already morphed and evolved into something different. The point is that now that you get JSON back, you can parse it and start to take action on it.

Anyway, this was just a quick sample app to experiment with SMSified. If you have checked out the new service, it’s free to set up a developer account and currently is free entirely during the beta period.

[1] In full disclosure, Voxeo is my employer.

Video: How To Create a Simple DocBook document using oXygen XML editor

Recently I’ve needed to get back into creating some DocBook documents and needed to refresh my knowledge of the latest tools. Back about 10 years ago, I did a great amount with DocBook and spoke about single-source publishing at conferences and created a few tools and vimrc macros. However, since that time I’ve not done much with DocBook – and obviously the tools and toolchain have evolved a bit.

In looking around, I’m quite impressed by what the oXygen XML editor can do with DocBook. oXygen looks quite powerful! It’s also got a bit of a price tag… on the other hand, I know that putting together the pieces to create your own toolchain can take a bit of work. The ever-present tradeoff between your time and your money…

I think I’ll certainly try out the 30-day trial to see what the writing experience is like.

This video shows how to create a simple DocBook document using oXygen and certainly makes a compelling argument for how easy the editor can be:

 

Do any of you use oXygen? Have you found it worth the price?