Tim Habersack

Where I put my things..

A walk.

Oct 17th 2012
Quiet stroll, calm mind;
in familiar neighborhood.
My past and present.

#poetry

Gasworks, redux.

Oct 14th 2012

The majority of what I spent my time on this weekend was finishing up some outstanding contract work that desperately needed to be completed. The project in particular is called 'Gasworks', for Energy Operations Management (EOM). They are a privately-owned natural gas transmission line company. What this means is, let's say you have some property that has natural gas deposits. You've drilled, and there is actually natural gas there. That's great, but what do you do now? That is where EOM comes in. They build and manage pipelines from natural gas wells to the market, either by connecting to a utilities transmission line, or directly to a customer (Normally a power plant or refinery).

EOM has a SCADA system that monitors their real-time natural gas flow rates and pressures throughout all the pipelines they manage. Gasworks is a web application that ties into EOM's SCADA system, and offers up that real-time data to EOM's customers. I designed the original Gasworks back in 2005, and have been updating and revising it ever since. Most recently, they were due for a complete overhaul. They needed a better design, better mobile/tablet support, and a robust administration section, where their staff could add Locations and Data points to the system, as well as manage customer logins and permissions.

I utilized the CodeIgniter MVC Framework for the site, using their default css for the administration side, and using jQuery Mobile for the customer side. I made a significant change this time around. All the data a customer sees when they log in is pulled from XML (generated via CodeIgniter). The main page is generated with jQuery, based on the XML. It's pretty fast, and lets customers refresh their page without a total page reload. It also added the capability to have customers pull their XML, and integrate it into their own SCADA systems.

On to the screenshots! I can't really show the administration half, since the data is confidential.

[caption id="attachment_200" align="aligncenter" width="645"] The XML data that is generated via CodeIgniter[/caption]

[caption id="attachment_201" align="aligncenter" width="300"] The main view the customer sees when they log in. Systems and locations are all dependent on user permissions. [/caption]

[caption id="attachment_202" align="aligncenter" width="300"] Systems expand to show locations within. Notice how it relates to the generated XML[/caption]

[caption id="attachment_203" align="aligncenter" width="300"] When user clicks on specific location, they see realtime charts. Layout different depending on device used. Mobile users will have charts vertical for spacing issues.[/caption]

And for those who are interested, here is an example of some of the js I wrote. This is the js function I use to parse the XML and print out the main view of Gasworks.

function parseXml(xml)
{
    var html='\n';
    html+='\t
\n'; $(xml).find("system").each(function() { html+='\t
\n'; html+='\t\t

'+$(this).attr('name')+'

\n\n'; html+='\t\t
    \n'; $(this).children('location').each(function() { var location_html=''; var latest_poll=new Date('January 1, 2000');); var a_or_b=true; $(this).children('tag').each(function() { if($(this).attr('date')) { date_string = $(this).attr('date'); var this_date = new Date(date_string.replace(/-/g,'/')); if(latest_poll"+$(this).attr('name')+''+the_time+'\n'; html+=location_html; }); html+='\t\t
\n'; html+='\t
\n'; }); html+='\t
\n'; $('#loading').hide(); $('#accordion_content').text(''); $('#accordion_content').append(html).trigger('create'); $('#accordion_content').show(); }

I'm proud of how this came out. It helped me become very familiar with the jQuerymobile framework, and definitely leveled up my XML manipulation skills.

Start of the personal mini-vacation

Oct 13th 2012

In preparation for the newest addition to our family being born mid-February (yay!), Tara and I determined we needed a short vacation to recoup before our little girl is born. And by short vacation, we're talking totally away from everything. I am currently on my mini vacation right now! (Taras is next week.)

I used Airbnb and found this place to stay. I came here right after work Friday night, and I won't be headed home until Sunday evening. I miss my family like crazy. It's the first time I've ever been away from them. Like for real. Last time Tara and I didn't sleep in the same place was the couple days before our wedding. That also means I've never been away from little A either. It's hard, but I think it's a good thing for everyones sanity overall.

Funny thing, so I have all this time now, right? I totally can't think of what to work on! I am at Fertile Grounds in Berkeley right now.

What are the things I could work on?

  • Nickelpinch actual code
  • Nickelpinch video
  • Spacefruit (codename for space game)
  • Other game (?)
  • Contract work

UPDATE: I'm glad I typed this out. Thinking about it, definitely going to tackle contract work. There is a job I'd really like to finish, for the customer and so it is off my mental stack. And billing money that covers my stay will feel awesome.

Why stories are powerful.

Aug 29th 2012
Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed.

-G. K. Chesterton

And something similar he said later...

Fairy tales, then, are not responsible for producing in children fear, or any of the shapes of fear; fairy tales do not give the child the idea of the evil or the ugly; that is in the child already, because it is in the world already. Fairy tales do not give the child his first idea of bogey. What fairy tales give the child is his first clear idea of the possible defeat of bogey. The baby has known the dragon intimately ever since he had an imagination. What the fairy tale provides for him is a St. George to kill the dragon. Exactly what the fairy tale does is this: it accustoms him for a series of clear pictures to the idea that these limitless terrors had a limit, that these shapeless enemies have enemies in the knights of God, that there is something in the universe more mystical than darkness, and stronger than strong fear.

-G. K. Chesterton

I came across this today. I swear it's like a message from my younger self. I don't understand how I lost this feeling, but I will try to never lose it again.

CloudPrinter

Aug 8th 2012

TL;DR print doc->driver uploads to your owncloud->QR code displayed, links to it

Quick brain dump

ownCloud needs this. It would help it ascend to low-oxygen heights.

  1. Using my desktop, I'm on a page, or email that I need to take to a meeting, review later, whatevs.
  2. I go to print, choose 'CloudPrinter', and print.
  3. Print driver turns content I was viewing to either png or pdf, and uploads to my ownCloud
  4. Moments after it 'printed', a big QR code shows up
  5. Take pic with tablet/smartphone and BAM that file is on my device

Heavens, think of the paper savings in offices..

Rsync problem; connection refused

Jul 11th 2012

I was trying to rsync over some content between two linux servers (RHE5) at the office, and I kept getting:

servername: Connection refused rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(165)

It was driving me batty. Rsync was set up on both servers, I could rsync from my workstation to either of them just fine. What was the problem rsync'ing between them??

I found excellent info in this ServerFault answer:

Try verbose mode in rsync by adding -vvv to see where it is failing. Are you using a very old version of rsync that doesn't default to using ssh (older than 2.6.0)? If so, try adding -e ssh to force ssh mode. -Phil Hollenback

I used the '-vvv' option to get very verbose output when I tried the command. And, ah ha! It was trying to use rsh for the connection.

Getting it to work was just a matter of adding the option '-e ssh' after my other options, and it worked!

(I'm going to start writing posts documenting problems I ran into, and how I fixed them. It helps me remember, and maybe could help others.)

Support the FOSS you use!

Jul 10th 2012

In the last couple of months I've gotten fairly active on Kickstarter. Check out my backed projects if you're curious.

I've also started donating to the FOSS projects I use, and it feels good. However! I need to do more. There is a list of projects I want to donate to, and I keep forgetting. Then it gets to the tight part of the month, and I can't afford to. So I made a page of projects I donate to, and some I want to in the future. I'm forgetting many on that page, but I'll fill it in as I remember. I'm doing this to be held accountable, and to encourage others to support the FOSS tools they use.

A miniature place for meditation.

Apr 25th 2012

It's a quiet place, where a little being can go to meditate and calm themselves.

meditative moss

Revenue from online courses?

Apr 22nd 2012

I've been thinking more about online courses (Since I enrolled in CS253), and different possible models for revenue.

Free seems interesting and obviously useful, but maybe not right away? Here is what I was thinking:

  • Course begins; $5 per class (Mostly for bandwith/server costs)
  • All the lectures, reading etc is passive, and doesn't cost the teachers anything
  • For every question you ask the teacher/TA, a $0.50 charge goes to your account, which you pay off monthly
  • Obviously, help obtained from community support (class forums, chat) is free

This seems like it could be sustainable, especially as some of these courses get larger.

What could be done is, at the end of the course, the content is freely-accessible. Still, questions can be asked anytime for that $0.50 charge.

Enrolled in CS253 on Udacity

Apr 20th 2012

I enrolled in CS253 on Udacity.com. I can't get to the course content yet, because apparently their site it slammed?

Anyway, I'm interested in what the course offers:

Description: Web applications have the power to provide useful services to millions of people worldwide. In this class, you will learn how to build your own blog application starting from the basics of how the web works and how to set up a web application and process user input, to how to use databases, manage user accounts, interact with other web services, and make your application scale to support large numbers of users.
WEEK 1: How the Web Works
Introduction to HTTP and Web Applications
WEEK 2: How to Have Users
Getting and processing user input
WEEK 3: How to Manage State
Databases and persistent data
WEEK 4: Whom to Trust
User authentication and access control
WEEK 5: How to Connect
Web applications as services, using APIs
WEEK 6: How to Serve Millions
Scaling, caching, optimizations
WEEK 7: Changing the World
Building a successful web application, project

A lot of this I know, though I'm mostly self-taught. I try to find standards compliant places to learn from, but I always fear there is a better way out there to do certain things; this should help with that.

Week 6 looks the most interesting, as I don't have experience with scaling. I have lots of things I implement to handle scaling, but haven't gotten the traffic to really put them to the test.

I'll keep posting about my experience.

< Older Newer >