archive_

Email To Hoist

Email To Hoist

I mentioned in jest to the Hoist Product Manager that there should be a way that you can email data to Hoist, but my mind would not let it rest.

So I bring to you a not so finished method of sending an email to get data into Hoist.

https://bitbucket.org/andrewcox/email2hoist

There was nearly some code reuse from mailthrottler so I am very pleased with myself.

Now if I can just find a use case!

Creating a simple voting site with Hoist

Creating a simple voting site with Hoist

I needed to create a simple site (2 page) that would let people vote on when my baby would be born. Not wanting the trouble of hosting the database or creating the api to store the data, I turned to Hoist

With the easy to use javascript library found at https://github.com/hoist/hoist-js I was quickly able to create the voting app I needed.

Here how:

To Vote:

New Website Content

New Website Content

Just pushed a new version of www.civet-labs.com live, just more content than the last parked version.

Some interesting things for us all to remember:

One:

Always have someone test your work! (Thanks James) As you are bound to forget something.

Two:

Always have a deploy script! It makes life so much easier.

Here is the exceptionally simple one to release www.civet-labs.com to s3. Using boto (again)

import boto.s3.connection
import boto.s3.key
import os, sys

bucket_names = {"peek":"peek.civet-labs.com",
           "live":"www.civet-labs.com"}

default_name = "peek"
name = ""
if len(sys.argv)>1:
    name = sys.argv[1]

if name not in bucket_names:
    name = default_name

def s3Callback(bytes_transmitted, bytes_total):
    print "\t",bytes_transmitted, bytes_total

conn = boto.s3.connection.S3Connection()
bucket = conn.get_bucket(bucket_names[name])
print "Deploying to: ", bucket

filenames = map(lambda x:os.path.join("..",x), os.listdir(".."))
for filename in filenames:
    if os.path.isfile(filename):
        print filename
        key = boto.s3.key.Key(bucket, os.path.split(filename)[1])
        key.set_contents_from_filename(filename,
                                       cb=s3Callback,
                                       policy='public-read'
                                       )

Three:

Twisted Server on AWS EC2

Twisted Server on AWS EC2

This is a post on how I built a script to provision a AWS EC2 instance for a twisted server, for those that just want the finished script it is in my bit bucket repo here with instructions on how to use it - https://bitbucket.org/andrewcox/provisiontwistedserver

Wanting a public facing version of MailThrottler I started to look to see if there was an easy way to deploy it, like a web site on Heroku or AWS elastic beanstalk.

Heroku Scheduler and the UnicodeEncodeError

Heroku Scheduler and the UnicodeEncodeError

Ruminate runs a scheduled task on Heroku every hour to grab the new entries from the configured news feeds.

I was noticing that some feeds were not updating, checking the logs I saw that I was getting a:

‘ascii’ codec can’t encode character u’\u2022’ in position 49: ordinal not in range(128)

This was odd because if I ran it from the command line on my machine it worked, and even stranger when I ran it with the heroku run it also worked.

Announcing Ruminate

Announcing Ruminate

A week ago I challenged myself to write a simple Google reader clone.

The reason being that I wanted to write a non-trivial piece of python code, and document the creation process.

It is now in version 0.1. I have released it onto heroku and it works for my reading needs.

You can see the Trello board at https://trello.com/b/ZqZWaSlr

and the code here https://bitbucket.org/andrewcox/ruminate

Currently Ruminate really only works for me, but in the coming weeks I hope to add more functionality (as seen on the trello board) if you want access find me at @vipox or follow the instructions on how to set it up on heroku yourself.

Installing .Net 1.1 on a AWS Windows 2008 machine

Installing .Net 1.1 on a AWS Windows 2008 machine

I am trying to get the .Net 1.1 applications that I work with installed on a AWS Windows 2008 instance so that it can act as a development server.

After installing .Net 1.1 our windows services install and run OK.

The problem comes when you try to run an ASP.Net application. Searching I found this blog post, which has great instructions on how to get .Net 1.1 installed.

Installing Nikola on Windows 7

Installing Nikola on Windows 7

The new version of Nikola was released and wanted to know if I could use it for www.civet-labs.com.

I started by trying to pip install nikola into a virtualenv, but it didn’t work out of the box. The reason it was not installing out of the box was due to the fact windows doesn’t have a build chain installed, and pip doesn’t use eggs or exes. Here are the steps I took to install nikola on my windows 7 laptop into a virtualenv

Would your device lie to you?

Would your device lie to you?

The purpose of this post is the pose the question “Why would your device lie to you?”

One of the assumptions of the “Internet of things” is that the device is objective. That the device will report the truth within the limits of its sensors.

That is a useful assumption, but what if the devices weren’t. They were telling less than you the truth.