NATS Tutorial at Digital Ocean Community

My How To Install and Configure NATS on Ubuntu 16.04 tutorial was published at Digital Ocean Community. You can check it out here.

Digital Ocean
NATS
Tutorial

A Simple Systemd Service for NATS

Here's a simple NATS gnatsd service for Systemd, which starts gnatsd on boot and restarts it in case it crashes (which is highly unlikely). I assume you've already downloaded the gnatsd executable and placed it in /opt/bin/gnatsd.

Save the configuraton below as /etc/systemd/system/gnatsd ...

NATS
systemd

ReportLab on OSX

It's easy to compile ReportLab on OSX (in my case, 10.8). The only problem is, you'll get the following warning:

# installing without freetype no ttf, sorry!
# You need to install a static library version of the freetype2 software

Don't try to brew it yet. OSX already ...

python
reportlab
freetype2
osx
tip

Prometheus - The Movie

Scenario: a grocery store

A WOMAN approaches you as you carefully appreciate the sodium content of a can of beans.

WOMAN: That can of beans is going to kill Earth!

YOU: My God!

(you proceed to bludgeon your forehead with the can of beans until you knock yourself unconscious.)

— This ...

prometheus
failure
movie
parody

Compiling Python Extension Modules on Mac OSX 10.6

If you get the following error when you are compiling a Python C extension module in Mac OSX 10.6:

/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture ...

python
mac
osx 10.6
tricks

Installing Flash on Open Solaris snv_132

  1. Install SUNWmlib package.
  2. Save flash_player_10_solaris.x86.tar.gz from http://get.adobe.com/flashplayer/ to ~/Downloads.
  3. Open a terminal and execute the following:

    cd ~/Downloads
    tar xjvf flash_player_10_solaris_x86.tar.bz2
    pfexec cp ~/Downloads/flash_player_10_solaris_r42_34_x86/libflashplayer.so /usr/lib/firefox/plugins
    
  4. Restart Firefox

open solaris
flash
firefox

Go Sample: Link Checker

You should have heard about Go, Google's new language. To be honest, it is one of the ugliest languages I've ever used (I mean among the ones not designed to be ugly); but it's interesting enough, and I decided to teach myself some.

Here's the result ...

go
link checker

Getting the Current Module in Python

Say, you want to insert a function, class or any other object into the current module dynamically. How can you do that? Of course, you start with getting the module name:

myName = globals()['__name__']

Then, get the module itself:

import sys
me = sys.modules[myName]

OK, you got the module ...

python
tips