Tuesday, November 30, 2010

What is Thimbl?

>From: Stephen Fortune
>I would also like some clarity on how Thimbl works.

Yes - that can be a little confusing!

> I read in the manifesto that
>"It is up your own webhost, Internet service-provider or system administrator to
>provide accounts". This is where I require information: can someone use Thimbl
>without having a domain or webhosting service of their own, or is it restricted
>to those running a web presence of some form of preexisting server.

I'm not entirely sure of the plans of Thmibl.Net itself. I, for instance, put
together some tools that does not require a web server.


When people say "web server", they usually mean a piece of software that
presents pages like you would see if you typed into your web browser
www.google.com . I think that Thimbl.Net aims to provide that kind of interface.
My tools, OTOH, do not require it.


There are two sides to Thimbl: a client side, and a server side. "Client side"
refers to what you have to do to read some else's blogs. "Server side" refers to
what you have to do to let some else read your blogs. The client side is easier
than the server side.

The bare minimum you need for client-side work is a program called "finger".
This program is present on Windows, Linux, and a lot of other Operating Systems
that matter. You can access it from a DOS prompt on Windows,

I have set up a testing account for user ossa at my site nummo.strangled.net. If
I go to the DOS prompt, I can type
  finger ossa@nummo.strangled.net
If you do it, it currently returns the response:
[75.101.142.245]

You fingered the user 'ossa'
Plan:
{"name": "Ossa", "address": "ossa@nummo.strangled.net", "messages": [{"text":
"First post", "time": "20101117130604"}, {"text": "I am the King of Siam",
"time": "20101120105506"}, {"text": "Ossa 1", "time": "20101120110631"},
{"text": "Ossa 2", "time": "20101120130159"}, {"text": "Ossa 3", "time":
"20101120142248"}, {"text": "Thimbl-CLI gets an embryonic GUI:
http://alt-mcarter.blogspot.com/2010/11/embryonic-gui-for-thimbl-cli.html",
"time": "20101127151646"}], "replies": {}, "following": [{"nick": "dk",
"address": "dk@telekommunisten.net"}], "properties": {"website":
"http://mummo.strangled.ner", "mobile": "N/A", "email":
"ossa@nummo.strangled.net"}}

You can try it yourself, if you like. What you are seeing is an "encoded" form
of my blog. It is convenient for a computer to understand, but inconvenient for
a human to read. I think that Thimbl.Net's aim is to present the "decoded" blog
onto a web page. It's not necessary to show them on a web page, though. I have
put together some tools, called Thimbl-CLI, that just prints them out. If you
Thimbl-CLI installed, for example, you could type
  thimbl print
and you will get the output

2010-11-17 13:06:04  ossa@nummo.strangled.net
First post


2010-11-20 10:19:39  me@localhost
Test user says hi


2010-11-20 10:55:06  ossa@nummo.strangled.net
I am the King of Siam


2010-11-20 11:03:50  me@localhost
A stitch in time saves nine


2010-11-20 11:06:31  ossa@nummo.strangled.net
Ossa 1


2010-11-20 11:09:50  me@localhost
lappie 1


2010-11-20 13:01:59  ossa@nummo.strangled.net
Ossa 2


2010-11-20 14:22:48  ossa@nummo.strangled.net
Ossa 3


2010-11-27 15:13:45  me@localhost
Thimbl-CLI gets an embryonic GUI:
http://alt-mcarter.blogspot.com/2010/11/embryonic-gui-for-thimbl-cli.html


2010-11-27 15:16:46  ossa@nummo.strangled.net
Thimbl-CLI gets an embryonic GUI:
http://alt-mcarter.blogspot.com/2010/11/embryonic-gui-for-thimbl-cli.html


As you can see, it's in a much more readable form. For those that don't like
using the command line, I have started to create a GUI. You can see a pic of it
on a recent blog post at http://alt-mcarter.blogspot.com/search/label/thimbl .
This allows less knowledgeable users to get up-and-running quickly. Currently,
there is not convenient executable available for it, though. You have to be a
bit of a techie that knows about "git" and "python" in order to get it working.
An executable will be available eventually.

When things become a little more developed, it should therefore be possible for
anyone to be a "client" with little effort.


"Client-side " is less than half the fun, of course. You want to be able to make
your thoughts heard. This is what the server-side is about.The server side tends
to be tricker to set up. You need to set up a "finger daemon". A "finger daemon"
is to finger what a web server is to a program like Firefox. That generally
means you need "system privileges" in order to activate a daemon. It also
requires some fairly savvy system administration skills. If you have an account
within an existing institution (by which I typically mean corporation or
educational establishment), then it will be very difficult to convince the
system administrators to activate the finger daemon. If you run your own server,
then of course, all you have to do is convince yourself! Configuring these
things takes a little time, and is work generally undertaken by quite a computer
geek working on Linux.

All is not lost, though, because part of my Thimbl-CLI package includes a
tailor-made finger daemon which should work on any Operating System. It's not a
full executable yet, but that's my plan for it. Eventually, anyone could
therefore publish on the internet, provided that their ISP or firewall isn't
blocking incoming connections. If you turn off your machine, then, naturally,
people will not be able to access your current content.


Let me see if I can answer some of your questions in more detail.

> can someone use Thimbl without having a domain

Technically, yes. You would need to know your IP address at the very least. So,
instead of typing

    finger ossa@nummo.strangled.net
you could type
  finger ossa@75.101.142.245
and get the same result. An IP address is like a phone number. I believe that
most people have static IP addresses, meaning that their address remains
constant over time. This is contrasted with dynamic IP addresses, where
effectively your ISP allocates you a different one every time you switch your
machine on. A dynamic IP would be like your telephone company giving you a
different telephone number every day - it makes it nearly impossible for people
to know how to contact you, although you could still contact them.

> webhosting service of their own

Well, technically speaking, a web service serves web pages, and need not serve
anything else. So you couldn't use cheap hosting providers, or free ones, to
achieve what you wanted to.


> or is it restricted to those running a web presence

It's more a question of being able to run a server, rather than have a web
presence. "Web presence" is rather an imprecise term,  in any case. It might
mean someone who uses a web host to serve web pages, or it might mean someone
who has a blog (which is effectively the same thing), or it might mean someone
who has a Facebook account. Maybe it could mean other things, too. So, is it
restricted to those running a web presence? Theoreticall"no", in practise you'd
probably need to be a geek to set it up. Over the longer term, that should shift
towards a less technical orientation.

> of some form of preexisting server.

In practical terms, at the moment, I would say "yes". Eventually it should be
possible to the layman to set something up. The concept of a server is also
hazier than you might perhaps realise. It's a bit like this: everyone likes to
listen to singing, but very few people sing. Everyone can sing if they so
choose. That makes them de facto singers. By the same token, if a computer is
set up to serve web pages or finger information, then it is a server. In
reality, it's basically the same computer it always was, but now it just happens
to perform some serving functions.

>I'd personally like to be more concrete on exactly how people can maintain their
>
>own data,

I'm not sure how the folks at Thimbl.Net intend to do it, but using the
Thimbl-CLI tools, you could aimply type:
  thimbl post "I am creating a post right now!"
What happens when you do that is that thimbl encodes that post in with the
existing data file. Thimbl.Net probably does the same thing, only it uses a web
interface to do it.

Technically, you don't need any of these things to manipulate the data, you
could do it by hand. You would need to know "json", and the location of the
files. Tools like thimbl-CLI and Thimbl.Net exist to save yourself that bother
... which is their whole point. I dare say that Thimbl.Net's solution will be
more user-friendly.

If you want actual technical information as to how the data is stored, then take
a look at
https://github.com/blippy/Thimbl-CLI/blob/master/doc/plan.rst
It would be easier for a user to use a tool provided. These are  currently being
developed.


> i.e. what is setting it aside from other microblogging sites

I'm only familiar with Twitter, so I'll compare thimbl with that:
* Twitter is "centralised", thimbl is "decentralised". IOW, Twitter hosts your
account information, and gives you ready access to other accounts. Thimbl
doesn't do that.
* Twitter is about "capitalism", Thimbl is about "freedom". Witness the current
criticisms about Facebook and privacy. FB is about "monetising eyeballs", and
selling data to advertisers. FB can set user policies, and dictate what
constitutes acceptable use. It wants to "own", "sell" and "control" your data,
because that's the only way it can make money. With Thimbl, data isn't owned by
anybody, and it's not possible to exercise control over content. People can
publish whatever they want to publish. Whether or not other people choose to
listen is another matter, of course.
* Twitter is a "walled garden", Thimbl is a field of wild oats. Twitter is to
Thimbl what Windows is to Linux. IOW, Twitter gives you a convenient "canned"
solution. Thmbl is rougher around the edges, but ultimately you might be able to
do a lot more.
* Twitter follows a client/server model, Thimbl follows a peer-to-peer model.


>diaspora,

I've never used Diaspora, so I couldn't anser authoritively. AFAIK, Diaspora
tries to be the free equivalent of Facebook. Thimbl tries to be the free
equivalent of Twitter. From what I can understand, Diaspora is quite an
ambitious heavy-weight project. It seems like it will need a lot of resources to
pull it off. I suspect it is complex architecturally. Thimbl, OTOH, adapts what
already exists, and has a very simple structure. Thimbl is a Buddha that is
small and serious. Diaspora is a Buddha that is hairy and laughs (I'm
paraphrasing the comparison between the Scheme and Lisp programming languages,
BTW).



> but I have to keep my pitch light on computer science terms for
>accessibility reasons.

Using Twitter is like eating at a restaurant. The menu is preset, hopefully
quite tasty, and they wash the dishes for you afterwards. Using Thimbl is like
home cooking. You have to assemble the ingredients yourself, and wash your own
dishes. You get a more choice in what you eat, and the standard of hygiene are
the ones you set yourself, for better or worse.

On thimbl.net, Dymitri said "The most significant challenge the open web will
need to overcome is not technical, it is political." Thimbl is about taking back
ownership of our data for ourselves. It's a question as to whether we think our
best interests are served by thinking for ourselves, as opposed to letting some
government think for us. It's "not technical", because Thimbl is really about
putting a thin wrapper around solutions that already exist. It's like clothes:
sure, you can go to the shops with nothing on, but then you'd have nowhere
hygenic to put your money, and you'll attract some odd stares.

>  If you can shed some light on my question that would aid
>immensely

I hope I've been able to answer some of your questions. If you still need some
guidance, then email me back, and I'll try to help further.

I find it hard to describe Thimbl. In a way, "it's anything and nothing". It
establishes a convention (or "protocol", or "customs and language") for
exchanging information about microblogs. That leaves a wide open gate for people
to exploit that in freeform ways. Thimbl.Net, for example, aims to put a web
interface on top of it. In my own project, I take the "old-school" approach that
real men type commands, so it doesn't use web interfaces. I suspect Dymitri
would like to see many experiments conducted as to how the idea of microblogging
could be exploited.

Ultimately, I think people will choose Twitter over Thimbl. It has the advantage
of the network effect (it's popular because it's popular), and it will always
likely be easier to set up (there are generally always issues with firewalls,
installing software, etc.). Thimbl is a lot more fun, though.

Saturday, November 27, 2010

Finger protocol notes

finger protocol using netcat:

nc example.com 79
[return] - prints info about everyone
[username] - returns plan and stuff for username

RFCs:
RFC 742 - NAME/FINGER Protocol
RFC 1288 - The Finger User Information Protocol

A finger client written in Python:

import socket

def finger(node):
    
    # Separate out username and domain
    elements = node.split('@')
    if len(elements) == 1:
        user, host = '', elements[0]
    elif len(elements) == 2:
        user, host = elements
    else:
        return '' # Input was not in a useful format
    
    # Contact host
    
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.settimeout(5) # we get bored after N seconds
    print 'host by name'
    socket.gethostbyname(host)
    print "address info"
    socket.getaddrinfo(host, 79)
    print 'start connect:', host
    s.connect((host, 79))
    print 'connect finished'

    #print socket.getaddrinfo(host, 79)
    #s.create_connection((host, 79), timeout = 10.0)
    #s = socket.create_connection((host, 79), timeout = 5)
    
    s.send(user + "\r\n")
    result = ''
    while True:
        data = s.recv(1024)
        if len(data) == 0: break
        result += data
        
    s.close()
    # print result
    return result



print finger('ossa@nummo.strangled.net')
print finger('nummo.strngled.net')
print 'Finished'


It has a basic problem: it connects via the standard socket connect() command. Unfortunately, on both Linux and Windows, there is no way to set a timeout. This makes it inconvenient to use if you have the host wrong. connect() will eventually time out, but the delay is quite long, and you have no control over it. This makes the python code tedious to use.

Embryonic GUI for Thimbl-CLI

In addition to command-line scripting of Thimbl, I have added a little GUI tool around the CLI. Here's a little screenshot showing the latest messages, and the people I'm following:





You can see it in action for yourself by checking out the latest commits from https://github.com/blippy/Thimbl-CLI . Start the GUI by typing: python gthimbl.py . It's pretty much as easy as that. Requires wxPython, though.

Wednesday, November 24, 2010

Share selection criteria

My current favoured share selection criteria are:
  • MFI (Magic Formula Investing)
  • GR (Graham Ratio)
  • GG (Graham Gearing)
  • PIO (Piostroski score)
 I think that most of the formula above are "doable", esp. MFI , with the expection of GR, which needs to be significantly relaxed in order to work. I think that very much weakens its approach. PIO I think is also a little tricky, as you have to start stepping outside the ideal range of PTBV.

I think that an MFI-based selection criteria is quite good, as it yields a sensible universe of stocks to choose from. I'm still not 100% sure MFI is a sound investment idea.

My MFI approach is better what I would call a "take" on Greenblatt's approach. I don't really like the way he does the ranking, and I think that his Return On Capital and Earnings Yield seem unnecessarily complicated. I'm also a little worried about the theoretical underpinnings of his ROC. With that out of the way, here's my selection criteria:
MKT > £75m (market cap)
ROE > 15% (Return on Equity)
PER > 0 (P/E ratio)
PER < 15
EGP1 > 0 (Earnings Growth Projected yr 1 out)
EGP2 > 0 (Earnings Growh Projected yr 2 out)
Z >= 3 (z-score)
ROA > 7.5% (Return on Assets)

Sharelock Holmes doesn't publish ROA figures, but you can find them on Google. The ROA figure was taken from "The Little Book That Builds Wealth"., by Pat Dorsey. It is an indicator that a company has a franchise business. Together with demanding a z-core of at least 3, it acts as an additional security that the ROE hasn't been obtained by taking on massive debt. I added EGP1>0 and EGP2>0 to ensure we aren't buying dogs that we think are going to collapse.

You do get a sensible selection of shares out of the process. To help whittle them down, I suggest going down in order of descending dividend yield because hey, everyone loves a dividend. As a final check, ROA can be examined on Google to ensure it passes the requisite hurdle.

What you end up with should be quite a sensible list. You aren't buying shares that are too highly priced. You demand to see rising expected growth figures, which adds safety that you aren't buying on some current earnings anomoly, and that the market expects it to be a growing company. Also, by demaning that both EPS1 and EPS2 are positive, you tend to eliminate any timing anomolies that might be going on at year-end. I think the dividend yield helps you in two ways, too: dividends are great to receive in their own right, and they also help prevent wacky EPS anomolies.

So, I think my criteria mutually boost each other. You get a great company at a reasonable price, with positive prospects and financial health. This should help weed out a lot of the crud.

Also, take a look at a previous post I made in July 2009 of the various selectio criteria I have used in the past.

Monday, November 22, 2010

Creating servers in OS X

How to create a simple echo server in OS X. Assuming that you already have MacPorts installed (and if not, why not!), install xinetd as follows:
port install xinetd
Create the file
/Library/LaunchDaemons/org.macports.xinetd.plist
with the following contents:


 Label
 org.macports.xinetd
 OnDemand
 
 Program
 /opt/local/sbin/xinetd
 RunAtLoad
 


Edit /etc/services to include the line:
myecho  7745/tcp # mcarter's weird nonsense
Edit /etc/xinetd.conf to include:
service myecho
{
        disable         = no
        socket_type     = stream
        wait            = no
        user            = root
        protocol        = tcp
        groups          = yes
        server          = /Users/mcarter/docs/echoserv/echoserv
        port    = 7745
}
Adjust the value of server to wherever you create echoserv. Create the file echoserv:
#!/bin/bash
read
echo $REPLY
exit 0
Test it out:
telnet localhost 7745
hello world
It should print out hello world, and exit. Open port 7745 on your router, and you should be able to connect remotely.

How much do CDs cost?

Price comparisons

In May 2009, unless otherwise stated, I did a survey of prices for CDs. Here's the results:
eBuyer: Datasafe 52xCD-R 100 pack spindle: £10.53
Everest Technology: TDK 52xCD-R 50 pack spindle £7.83
GOA Office wanted to charge £11.88 for 50 CDs. I can't remember if that's net/gross and with/without discount
Insight: TDK 50xCD-R 50 pack spindle £10.34
Insight: Imation 52xCD-R 100 pack spindle £14.94
PC World: Verbatim 100 pack CDs £19.99 (June 2008)
All prices include VAT.

Sunday, November 21, 2010

PBV and PTBV by quintiles

Using Sharelock Holmes, I decided to calculate the PBV (Price to Book Value) and PTBV (Price to Tangible Book Value) for stocks listed on the LSE having a market cap of over £100M. Here are the results in quintiles:


     PBV   PTBV
P20  1.13  1.64
P40  1.80  3.89
P60  2.76  8.81
P80  4.93  NEG

SH (Sharelock Holmes) returned 589 results. Negative values were given a value of 10000. There was only one null/blank in the stats - it's incosequential for me to determine its proper treatment. The resulting scores were ranked numerically, and the quintiles stated using the normal nomenclature (e.g. P20 stands for the 20th percentile).

In the sample, 3% of the companies had negative PBV, and fully 25% of the companies had negative PTBV (hence P80 shown as "NEG").

Saturday, November 20, 2010

thingerd - a simple finger daemon for Thimbl

I have rewritten the finger daemon with an eye to improved ease-of-use,a dn being able to function on Windows. I wrote a little man page for it

thingerd

thimbl finger daemon

Author: mcturra2000@yahoo.co.uk
Date: 2010-11-20
Copyright: Public Domain
Version: 0.0
Manual section: 8
Manual group: thimbl

SYNOPSIS

thingerd.py

DESCRIPTION

thingerd (actually thingerd.py, but hereafter referred to as thingerd) is a replacement finger daemon, written in Python, that is tailored specifically for Thimbl. It is designed to take the hassle out of installing and configuring a finger daemon. It exposes very little information about the operating environment, and may this be considered beneficial from a security standpoint. It was also designed to be used, eventually, from Windows. It therefore tries not to rely too much on UNIX infrastructre.
thingerd was not written by an expert in protocol writing, SO YOU SHOULD EXERCISE CAUTION IN ITS USE. I welcome feedback from security experts as to how the program can be made more secure.

OPTIONS

thingerd accepts no options. It binds to port 79, which is the standard fingerd port.

INSTALLATION ON LINUX

This section describes one way to set up thingerd as a daemon. On UNIX there is, of course, more than one way to do it, so this section is merely a suggestion, not an absolute rule.
The recommended way is to launch thingerd as a regular user, and use authbind to gain access to port 79, which is a privileged port. You will need to install authbind. The method of installation will depend on your Linux distribution. Some typical ways: * Debian/Ubuntu: sudo apt-get install authbind
You now need to give a user (in this example, I assume the user name is ossa) permission to execute on this port:
touch /etc/authbind/byport/79
chown ossa:ossa /etc/authbind/byport/79
chmod 755 /etc/authbind/byport/79
As user ossa (or whatever), type crontab -e, and edit the crontab file to include the line:
@reboot authbind --deep /path/to/thingerd.py
This will ensure that the daemon will be started on each server reboot.
You will probably want to start the daemon immediately, too. If so, then type:
authbind --deep /path/to/thingerd.py
You should now be set up and ready to go.

INSTALLATION ON WINDOWS

This is currently untested. It should be possible to run thimbld.py from a command line. Provided that the firewall unblocks port 79 for its use, it should Just Work (TM). Setting up a service for it is a TODO item.

SEE ALSO

  • thimbl - main page for the description of thimbl

Interested?  Then visit https://github.com/blippy/Thimbl-CLI

Wednesday, November 17, 2010

Samba - old web page

Samba

How to set up samba on Linux.

Installation

On Xubuntu Dapper Drake, Samba can be installed by typing
apt-get install samba
The software is stored on the CD.


/etc/samba/smb.conf

Supposing you wanted to set up a shared folder called projects . Your smb.conf entry might contain the following fragment

workgroup = CAPCIS # or whatever workgroup you decide on
[projects]
       comment = Projects
       path = /home/shared/projects
       writeable = yes
       valid users = @users
       create mask = 2660
       directory mask = 2770

This will give users access to this directory, and they'll be able to read and write to it.

User accounts

You will probably need to create a samba account for a user:
smbpasswd -a username
You will be prompted for a password

Start/stop/restarting samba

On Xubuntu Dapper Drake, to restart samba you would type, as root:
/etc/init.d/samba restart
Starting and stopping is achieved by replacing the word restart with either start or stop .

Mounting directories

If you want to mount directories on your Linux drive that belong on remoter machines, (to use smbclientsmbmount etc.), you will also need to install package smbfs . A typcial way of doing it might be:

mkdir /mnt/projects
chmod a+w /mnt/projects
smbmount  //192.168.30.3/projects /mnt/projects -o username=NNN,password=NNN,workgroup=NNN,uid=NNN,guid=NNN

You can umount by typing
umount /mnt/aber1

Author:  Mark Carter
Created: 06-Feb-2006
Updated: 06-Sep-2006

Squid - an old web page of mine

Squid(guard)

My notes on getting started with squid and squidguard. Seeings as squid is well-documented and fairly easy to set up, the rest of this page will concentrate on squidguard - a filter for squid.

To set up on Ubuntu, you need to enable universe, the apt-get install squidguard.

Interesting files:
/usr/bin/update-squidguard

Tuesday, November 16, 2010

Stop the congestion tax

A webpage I made in 2009, but no longer think it needs to exist on my site ...


Arguments against CT (congestion tax):
  1. LACK OF GOOD ALTERNATIVES. The alternative to private transport is public transport - and we all know how good that is! Londoners, for example, must face the never-ending threat of the tube workers going on strike. Country dwellers who must drive to cities are faced with a train service which is either non-existent, or patchy at best. Let's face it: public transport is just plain rubbish, and it costs more.
  2. ROAD USAGE IS MOSTLY NON-DISCRETIONARY. Given the lack of viable alternatives, most people use their cars because they have to, not because they want to. Until people develop the art of magic yogic flying, they're just going to have to use their cars. To tax them is most unfair.
  3. IT WILL MAKE CONGESTION WORSE, NOT BETTER. Restricting access to some roads is just going to push the traffic to other roads. This will make matters worse, as the same number of cars are now trying to use fewer roads.
  4. IT'S A STEALTH TAX. It seems that the UK government's answer to everything is to put a tax on it. This is quick and easy for the government, and of course beneficial for them, but it does absolutely nothing to solve the problem. Drivers already pay a car tax - it's about time this tax was used to its full extent to improve roads.
At the end of the day, though, the simplest argument against the congestion tax is that it's totally misguided. The whole point of a system of transport is that it gets the most amount of people to where they want to go as conveniently as possible. Congestion charging is aimed at stopping people from travelling. It's not a transport policy - it's a non-transport policy. I don't see anything particularly clever or visionary about making it more burdensome for people to get from A to B - any fool can achieve that.

Monday, November 15, 2010

thimbl-cli gets a thimbl daemon

I have had had no end of trouble trying to get a finger daemon set up on my Ubuntu EC2 account. There was always something wrong. efingerd crashed on me, and there were various configuration and other problems with the other finger daemons that were available.

In the end, I decided that the simplest solution was to write my own. Thimbl-CLI now has the directory "daemon", containing all the demonic fingering that is necessary to get a daemon going. It aint pretty, but it works. Here's the README file that I wrote in the daemon directory:

How to set up a crude finger server
I have trying ubuntu, and I have been most unstatisfied with the
finger daemons on offer. Instead of going an ultra-complicated route,
I have tried to opt for about the simplest thing that will work. It is
based on the assumption that there is only one real user on the
system, and that it is only him who has a .plan file that needs to be
published.
Here's what to do:
* REDIRECT PORT 79
Normal users can't bind below port 1000, so you need to redirect it to
some other port. In this case, use port 4214. As root, type:
   iptables -t nat -A PREROUTING -p tcp --dport 79 -j REDIRECT --to-port 4214
Don't change it from 4214 without good reason, because thimbld.c is
compiled under the assumption that you will be using 4214.
Other solutions, including 'authbind', are mentioned here:
http://serverfault.com/questions/112795/how-can-i-run-a-server-on-linux-on-port-80-as-a-normal-user
Security and other problems and limitations are also discussed there.
* COMPILE THE DAEMON
You will need gcc and the include files to compile the binary. On
Slackware, this wont be a problem. On other systems, you may need to
install them. To compile, issue the command:
   gcc -o thimbld thimbld.c
thimbld.c just executes a shell script. I have chosen to wrap the
script in a C file in this way so that I have an easily idintifiable
process that I can kill.
* LAUNCH THE DAEMON
Easy enough:
   ./launch-thimbld
It's a very simple script.
* KILL THE DAEMON
When you get fed up running the daemon, issue the command
   ./kill-thimbld
That should do the trick


Except, it doesn't quite work. The kill-thimbld doesn't quite seem to kill everything. Think of thimbld as only a stop-gap solution, anyway. I just want my EC2 account to transmit my .plan file so that I can do some testing from other accounts.

In order to checkout Thimbl-CLI, visit its page at github:
https://github.com/blippy/Thimbl-CLI

Sunday, November 14, 2010

Graham Ratio: definition and statistics

I thought it was be fun to take a look at the "Graham Ratio". Here's how Sharelock Holmes defines it:
A Ratio used by Ben Graham the famous Value Investor. It is defined as the ratio of Net Current Assets minus non current liabilities to the Market Capitalisation. Graham was looking for companies with a ratio of less than two thirds. Very few shares meet his criteria these days.
Market Capitalisation /(Net Current Assets – Creditors Long – Provisions) 

I ran some numbers through their database. I pulled up all the companies in Sharelock's database with market caps >=£50M. There turned out to be 773 of them. This seemed to be suspiciously low. If you pull up all of the companies in their database, you get over 1000 of them. Quite a few of them are microscopically small: 0.5M in market cap, for example. I'm going to assume that the list of 773 is complete for the purpose of this exercise.

Of the 773 companies, 688 had non-null GRs (Graham Ratios). The null entries were banks and non-life insurance companies, plus a couple of strays. There quite a lot of banks and insurance companies on the stock market. I excluded non-nulls from further selection. The logic behind this is that if you want to apply a value-based approach to banks and insurers, then you should apply separate criteria.

439 of the 773 companies (just over half!) had negative GRs. I excluded them from further consideration - as the sheer quantity of them mean that they would dominate the percentile rankings.

So that leaves 249 companies out of 773 which have positive GRs. I ranked these companies in ascending GRs. Below I present a table of the percentile and GR:


%     GR
P05  1.0
P10  1.5
P20  2.9
P40  6.3
P60 11.2
P80 24.5

So P05 means the 5th percentile, P10 means the 10th percentile, and so on. I have concentrated on quintiles - but of course we are mostly interested in what's at the bottom of the barrel, or top, depending on how you look at it.


Here is a table of the top 20%:


EPIC Share_Name MarketCap Last_Price Sector Graham_Ratio
RCG RCG HOLDINGS 88.03 30.25 ELECTRONIC AND ELECTRICAL EQUIPMENT 0.43
BDEV BARRATT DEVELOPMENTS 765.55 79.3 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.49
GLE GLEESON (M J) 53.95 102.5 CONSTRUCTION AND MATERIALS 0.66
TW. TAYLOR WIMPEY 830.1 25.97 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.67
BVS BOVIS HOMES 452.37 339.7 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.7
BWY BELLWAY 650.71 538.5 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.82
ABBY ABBEY 91.16 370 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.82
PSN PERSIMMON 1084.57 360.2 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.87
MTVW MOUNTVIEW ESTATES 154.06 3950 REAL ESTATE INVESTMENT AND SERVICES 0.92
RDW REDROW 318.76 103.3 HOUSEHOLD GOODS AND HOME CONSTRUCTION 0.96
PMHL PROSPERITY MINERALS HOLDINGS 159.72 113 CONSTRUCTION AND MATERIALS 0.96
SGR SHORE CAPITAL 69.65 28.5 FINANCIAL SERVICES 1.01
GFRD GALLIFORD TRY 233.4 285.25 CONSTRUCTION AND MATERIALS 1.03
POL POLO RESOURCES 124.62 5.13 FINANCIAL SERVICES 1.11
BMY BLOOMSBURY PUBLISHING 85.11 115.25 MEDIA 1.18
FCCN FRENCH CONNECTION 51.04 53.25 GENERAL RETAILERS 1.19
TRE TRADING EMISSIONS 220.04 85.5 FINANCIAL SERVICES 1.19
NUM NUMIS CORPORATION 127.54 114 FINANCIAL SERVICES 1.23
RAB RAB CAPITAL 63.54 13.5 FINANCIAL SERVICES 1.3
CHNS CHINA SHOTO 59.76 256 ELECTRONIC AND ELECTRICAL EQUIPMENT 1.32
BKG BERKELEY GROUP HOLDINGS 1095.6 834.5 HOUSEHOLD GOODS AND HOME CONSTRUCTION 1.38
GFM GRIFFIN MINING 61.62 34 MINING 1.38
PLAZ PLAZA CENTERS NV 310.36 106 REAL ESTATE INVESTMENT AND SERVICES 1.47
PRX PROXIMAGEN NEUROSCIENCE 83.33 145.25 PHARMACEUTICALS AND BIOTECHNOLOGY 1.55
CWR CERES POWER 63.76 74 ELECTRONIC AND ELECTRICAL EQUIPMENT 1.76
CSR CSR 584.25 324.1 TECHNOLOGY HARDWARE AND EQUIPMENT 1.77
BLZ EMBLAZE 50.54 45.25 SOFTWARE AND COMPUTER SERVICES 1.79
CPS CPL RESOURCES 75.35 202.5 SUPPORT SERVICES 1.81
RNVO RENOVO GROUP 69.55 36.5 PHARMACEUTICALS AND BIOTECHNOLOGY 1.85
DQE DQ ENTERTAINMENT 51.79 144 MEDIA 1.94
TMW TIMEWEAVE 55.22 24.5 SOFTWARE AND COMPUTER SERVICES 1.95
EVG EVOLUTION GROUP 188.15 81 FINANCIAL SERVICES 2.07
SIG SIGNET JEWELERS 1915.64 2236 GENERAL RETAILERS 2.08
EAGA EAGA 148.97 59.25 SUPPORT SERVICES 2.1
PVCS PV CRYSTALOX SOLAR 220.81 53 ALTERNATIVE ENERGY 2.1
CLST COLLINS STEWART 197.07 79.5 FINANCIAL SERVICES 2.18
NEO NEOVIA FINANCIAL 71.36 59.5 FINANCIAL SERVICES 2.27
TFW THORPE (F W) 80.87 690 ELECTRONIC AND ELECTRICAL EQUIPMENT 2.28
ACL ACAL 65.6 230.75 SUPPORT SERVICES 2.29
BOR BORDERS AND SOUTHERN PETROLEUM 300.99 70.25 OIL AND GAS PRODUCERS 2.3
ORA ORA CAPITAL PARTNERS 70.25 106.25 FINANCIAL SERVICES 2.32
ERE EREDENE CAPITAL 50.44 18 REAL ESTATE INVESTMENT AND SERVICES 2.33
NORK NORKOM GROUP 84.87 94.5 SOFTWARE AND COMPUTER SERVICES 2.48
BVC BATM ADVANCED COMMUNICATIONS 90.24 22.5 TECHNOLOGY HARDWARE AND EQUIPMENT 2.55
PON PSION 132.14 94 TECHNOLOGY HARDWARE AND EQUIPMENT 2.61
HTG HUNTING 846.26 640 OIL EQUIPMENT - SERVICES AND DISTRIBUTION 2.66
CNKS CENKOS SECURITIES 68.93 101 FINANCIAL SERVICES 2.72
ITL INTEC TELECOM SYSTEMS 226 71.75 SOFTWARE AND COMPUTER SERVICES 2.86
KEA KEA PETROLEUM 53.41 10.5 OIL AND GAS PRODUCERS 2.92
SEY STERLING ENERGY 149.7 68.25 OIL AND GAS PRODUCERS 2.98
Interesting reading.

There are only 4 companies that satisfy Ben Graham's value criterion. Of those 4 companies, 3 are housebuilders. The whole of the top of the list is choc full of housebuilders. This is not terribly surprising considering that housebuilding has taken a tumble due to economic times, and the fact that WIP on house construction is shown as part of the current assets. Housebuilders carry a lot of WIP/stock of houses!

So, using this criterion is likely to be rather unsatisfying, and I definitely that an investor should buy a whole bunch of housebuilders. In order to produce adequate diversification, an investor will have to start selecting companies lower on the list. A cut-off of 1.5 seems to low to ensure adequate diversification. A cut-off point at around 3 would seem sensible.

My own take on this is that the basic idea is good, but I think it is very difficult to practice under current circumstances - and dangerous to practice under his strict criterion. The market is not especially high at the moment, so one would think that there would be a fair selection to choose from. However, this does not appear to be the case. The Investors Chronicle has an annual selection using the Graham Ratio idea. Alas, I can't find a reference just now. They don't apply the strict criterion - it's too limiting - but they go up to about 1.5. I suspect that they are using a better database than me. My recollection is that the performance of their model portfolios has been resoundingly excellent. I seem to recall that Stingy Investor has been running a similar portfolio for many years, and has produced returns clearly superior to the market.

Saturday, November 13, 2010

Tacc - fstats


If you have a portfolio called Equities, you can obtain the
performance using the command:
tacc-0.1> fstats Equities
You can obtain the performance of several accounts together, e.g. Eq1
and Eq2, using
tacc-0.1> fstats { Eq1 Eq2 }

Typical output is something like:
CRR% 6 IRR% 10 PROFIT 1000.00
This tells you that the profit you made (realised+unrealised) is
1000.00, and the interal rate of return you are making is 10%. IRR is
"a true compound rate of return" - which I think is the most
meaningful way of measuring the performance of a portfolio. It does
suffer from some theoretical weaknesses; but to me, it is the most
sensible statistic available.

The CRR figure is a bit of a home-brew statistic, which measures the
"current rate of return". All it does is apportion the IRR according
to the current date. So, if, for instance, the Dow is up 2% for the
current calendar year, you can see that you are currently beating the
index by 4% (6-2).

My goal in TACC is to be able to massage the data produce by
ledger-cli (it sometimes has a little quirky behaviour), and be
extensible. I think of it as being like John's REPL for v3, but fully
programmable.

John Wiegley's ledger program

.ledgerrc

Here are some notes about the .ledgerrc file.

In v2.6.1, there seems to be a bug in that Ledger does not expand tildes for prices-db. So do not write
--price-db ~/docs/ledger/prices.dat
Instead, write the full pathname, e.g.
--price-db /home/mcarter/docs/ledger/prices.dat

Commodities

"Commodities" is a term that Ledger uses that also encompasses equities and mutual funds/OEICs/unit trusts, etc.. Writing commodoties in Ledger can be a bit of a problem. Here's some tips to get you going.

N - suppresses commodity quotes

If your native currency is not $, then Ledger has a habit of trying to download it as a commodity. To prevent this, put the following line in your ledger data file:
N £
Substitute for £ whatever happens to be your currency.

@@ - total cost

Using @ specifies the unit price at which a commodity is purchased. @@ specifies the total cost of the purchase. E.g.

2008/11/08 * Buy some Apple shares

  Assets:Equity:Portfolio    1000 APPL @@ $2000.00
  Bank

 symbol quoting

If you are in the UK, then you may have to qualify the symbols you give. For example, Glaxo shares have the code GSK.L - you can't just use GSK. The dot confuses Ledger, so you should quote the symbol, thusly:

2008/11/08 * Buy some Glaxo shares

  Assets:Equity:Portfolio    1000 "GSK.L" @@ £2000.00
  Bank

OEICS often have digits in them, which also confuses Ledger unless you double-quote them. For example, Fidelity Managed International has the Yahoo code GB0003860789GBP, which you will need to quote:

2008/11/08 * Buy some Fid Man Intl shares
  Assets:Equity:Portfolio    1000 "GB0003860789GBP" @@ £2000.00
  Bank


See also

build - instructions for various platforms
tacc - my Tcl extensions to John Wiegley's program.

Links to external sites

clacct - command-line accountant. It doesn't look particularly powerful, and hasn't been updated since 2003.
CSV2Ledger - reads a CSV file and outputs it in Ledger format. It is useful for converting data from financial institutions into your Ledger. Forum - official place to discuss the program
eqonomize - personal accounting software for KDE. Include securities handling.
Ledger - main webpage to the Ledger program
Projects tagged 'accounting' - Ohloh's list of alternative accounting software you might like to try

InfoEnclosure 2.0

By Dmytri Kleiner & Brian Wyrick

http://www.metamute.org/en/InfoEnclosure-2.0

PeerCast, an innovative peer-to-peer live video streaming network that
has been in existence for several years longer than YouTube, is
virtually unknown.

From this perspective, it can be said that Web 2.0 is capitalism's
preemptive attack against P2P systems. Despite their many
disadvantages in comparison to these, Web 2.0 is more attractive to
investors, and thus has more money to fund and promote centralised
solutions. The end result of this is that capitalist investment flowed
into centralised solutions making them easy and cheap or free for
non-technical information producers to adopt. Thus, this ease of
access compared to the more technically challenging and expensive
undertaking of owning your own means of information production created
a 'landless' information proletariat ready to provide alienated
content-creating labour for the the new info-landlords of Web 2.0.

Wednesday, November 10, 2010

Words of wisdom from Whitney Tilson

I made a few notes about the talk that Whitney Tilson made at a Value  Investing conference.

He particularly recommended people reading Intelligent Investor chapter 8 (intrinsic value) and chapter 20 (margin of safety).

You can use a variety of techniques to value a stock. Pick the mid-point of the range, and buy for half that.

Another quote he made: If you think you've found a cheap stock, there's a 90% chance that you are wrong.

8-16 stocks should be an adequately sized protfolio.

Tilson's rule of thumb for what he's willing to pay in terms of PER:
  • single digits for a mediocre business
  • 10 - 11 for a fair business
  • 14 - 15 for a superior business

Monday, November 8, 2010

emacspeakFireBox: Put The Fox In The Box

emacspeak The Complete Audio Desktop: FireBox: Put The Fox In The Box


Friday, June 22, 2007

FireBox: Put The Fox In The Box

I've finally found the right development environment for myself for writing and debugging Web Applications that use JavaScript to implement client-side interaction. It turns out that it wasn't just me who found the thought of programming inside the Web browser a painful experience --- pleasant though the final end-user interaction that those results deliver might be for the final user. I discovered MozRepl --- a read-eval-print loop for Firefox. MozRepl is a Firefox extension that allows you to open a connection to a running Firefox session and gain access to a JavaScript interpreter context that can access all aspects of the Firefox runtime.

This is quite neat, I can now use the power of Emacs to write and debug end-user JavaScript applications. But wait, there is more. So in general, as someone who doesn't need to suffer from the hit on cycles and memory that running an X environment involves, I usually dont start GDM --- the graphical desktop --- on my Linux box. Believe me, running just at the console, especially with the LCD turned off makes my laptop run a lot longer. So challenge: How do you take the fox's head off Firefox? How do you run a headless Firefox?

Friday, November 5, 2010

A command line tool for thimbl

I have been playing with thimbl , a P2P (peer-to-peer) microblogging "platform" - although it isn't so much of a platform as a set of conventions.

It's finally time for me to set up some tools for people to play with. If you want to run thimbl from the command line, then visit my newly-created Thimbl-CLI project. It is only suitable for geeks at the moment, but hopefully it will evolve over time.