RSS Feed Subscribe to RSS Feed

 

Docker talk at SVCC’15

Some short notes from a talk from Ted Young on the Docker ecosystem. Slides available here.

BusyBox – a number of use linux tools packaged up in to a single file. “The Swiss Army knife of Embedded Linux”

CoreOS and Red Hat’s Atomic are particularly suited for running containers, work well with (and I think even come preinstalled with) Docker.

VM vs Container. VMs ofter have multiple apps running in them (e.g. a tomcat with multiple apps running it int). With containers it is typically 1 app per container. Containers typically run within a VM (although can run on “raw metal” too). Multiple containers per VM? – I’m not so clear on!

Cgroups may be used to limit and control resource usage.

12 Factor apps – Good practices for building “cloud native” or software-as-a-service apps.

 

Tags: , , , ,

Git talk at SVCC’15

Some short notes from a talk on “Everything you wanted to know about Git…” by Lenny Markus. Slides available here.

Tips:

Use autocomplete

Use the latest git tool, not the apple default

As part of the demo, he used watch to monitor a directory by running a command every few secs.

Covered git init, staging, reset and rebasing.

 

 

 

Tags: , ,

RESTful Microservices at Silicon Valley Code Camp ’15

Thanks to everyone who came to my RESTful Microservices talk at Silicon Valley Code Camp today. Great turnout and lots of good follow up questions.

You can find the complete slides on slideshare.

Tags: , , , , , , , , ,

Java vs .Net Accessor Modifiers

I’ve been looking at some .Net code recently, and I wanted to do some comparisons on Java access modifiers vs .Net to help me better understand the code.

(more…)

Tags: , , ,

Versioning APIs

I have blogged in the past about microservices, and the advantages that architectural style can bring. These small, focussed and, most importantly, autonomous services commonly expose their functionality via a REST interface.

Inevitably there will come a time when you need to change that interface. Yes, in an ideal world, you will come up with a perfect API first time round and it will never need to change, but requirements change or new users come on board, and we must adapt. Read on to find some approaches to dealing with changing interfaces without breaking clients.

(more…)

Tags: , , , , , , , , ,

Using Butler shortcuts to enter commonly used text

Is there a piece of text that you find yourself typing again and again? Want a keyboard shortcut to enter it? For example, pressing Alt-E to enter your email address anywhere.

The solution I use is Butler. It is an extremely versatile tool.

  • With Butler running, go to Configuration
  • Right click on Hidden Items
  • Smart Item -> Text
  • Under Triggers, specify your ‘Hot Key’ keyboard shortcut
  • Under Text, specify your frequently entered text e.g. email address

Done! The next time you press Alt-E anywhere, your email address will show up.

Notes:

  • You are probably wise to choose a more obscure shortcut the Alt-E to avoid clashes with other apps, but the principle remains.
  • I use LastPass to automate filling in entire forms (name, address, email), but the approach I describe here can be used anywhere (in a document, IM window, whatever).

 

Tags: , , ,

alternative to tail -f that allows scrolling: less +F

You can use less +F to start less in its “forward forever” mode. In this mode, less will behave like tail -f, ignoring the ends of files and providing a steady stream of text.

When you want to scroll, press Ctrl-c. To re-enter forward forever mode, press F.

From http://unix.stackexchange.com/questions/81628/is-there-an-alternative-to-tail-f-that-has-convenient-scrolling

Tags: , , ,

Rest and Microservices talk at the Las Vegas .Net Group

Thanks to Richard Rosenheim for inviting me to talk on REST and Microservice at the Las Vegas .Net Group today.

If you came along, thanks for attending!

You can find my slides here.

You can also check out my blog posts that the talk is based on:

Tags: , , , , , , , ,

sed

sed (stream editor) is an simple but incredibly versatile command line tool that parses and transforms text. It is line-oriented in that it reads the text line by line, transforms it, and outputs the result.

For example, this sed command would replace all occurrences of the text “white” with “black”:

sed s/white/black/g

sed reads text on a line by line basis and performs an operation on it, usually extracting or replacing text snippets. In this case, the s prefix means substitute, and the g suffix means global. Other example usages include:

(more…)

Tags: , , ,

find

“find” is a unix command-line tool for locating files (and directories). The results can be displayed, passed to another command (e.g. grep, ls etc, see more below), or the find command has its own limited set of actions that can be performed too, such as delete.

Find allows you to specify all manner of search criteria such as name, location, size, permissions, modify date etc. Using regex expressions with those criteria makes it more flexible still.

See the full find manual here.

(more…)

Tags: , , , ,

awk

I think of awk as a tool for searching, manipulating and reporting on text files, but it is in fact an entire programming language. Its basic function is to search files for lines that contain certain patterns, and perform specified actions on that line.

The name awk comes simply from the initials of its designers Aho, Weinberger and Kernighan.

The basic format of an awk command is:

awk pattern { action } file

Every line in ‘file’ matching the ‘pattern’ will have the ‘action’ performed.  Either the pattern or action are optional, but not both.
No pattern means every line is actioned.
No action defaults to print.

(more…)

Tags: , , , ,

grep

“grep” is a unix command line tool to search a file (or files) for lines containing a match to the given pattern (often a regular expression). Its name comes from the ed command g/re/p for globally search a regular expression and print (1). See the grep manual.

The basic syntax is:

grep [options] pattern [files]

Example:

grep -rl --include=*.java "MySearchString" .

(more…)

Tags: , , ,

An intro to Microservices and REST: SoCal Code Camp 2014

If you came along to my session at the SoCal Code Camp, thanks for attending! Any feedback always appreciated.

You can find the slides on slideshare.

You can also check out my blog posts that the talk is based on:

 

Shaun

 

Tags: , , , , , , , , , ,

An introduction to REST

REST, or Representational State Transfer is an architectural style, or more simply, a set of constraints.

We will look at the constraints REST imposes for web apps, but some highlights are:

  • Uniform interfaces: all resources are identified by URIs (think: links)
  • It relies on a stateless, client-server, cacheable communications protocol (think: HTTP).
  • Interaction with resources is via a set of standard methods (think: HTTP verbs)

 

REST can be viewed as a lightweight alternative to mechanisms like RPC (Remote Procedure Calls) and Web Services protocols (SOAP, WSDL, etc)., but it is much more than that too! It is not an exaggeration to say that REST has been used to guide the design and development of the architecture for the modern Web.

The term REST was defined in 2000 by Roy Fielding in his doctoral dissertation at UC Irvine.

(more…)

Tags: , , , , ,

Getting rid of IntelliJ warning: Value ‘yourVariable’ is always ‘null’

IntelliJ was giving me a warning message like this:

Value ‘yourVariable’ is always ‘null’

I often set values to be null for tests (e.g. checking a method can deal with a null parameter), so I wanted to disable this warning.

To do so, deselect the following:

Preferences -> Editor -> Inspections -> Probable bugs -> Constant conditions and exceptions -> Warn when reading a value guaranteed to be constant.

Or you can setup custom handling for tests (e.g. weak warnings) under Severity by Scope.

(Based on IntelliJ 14)

Tags: