RPM Spec Files for nodejs 0.9.5 and v8 on CentOS 5

The latest version of nodejs that I could find as an RPM for CentOS was 0.6.16, from http://patches.fedorapeople.org/oldnode/stable/. That’s the one that puppetlabs currently uses in their puppetlabs-nodejs module. There is, however, a nodejs 0.9.5 RPM in the Fedora Rawhide (19) repository. Below are some patches to that specfile, and the specfile for its v8 dependency, to get them to build on CentOS 6. You can also find the full specfiles on my github specfile repository. I had originally wanted to get them built on CentOS 5 as well, but after following the dependency tree from nodejs to http-parser to gyp, and then finding issues in the gyp source that are incompatible with CentOS 5′s python 2.4, I gave up on that target.

nodejs.spec, diff from Fedora Rawhide nodejs-0.9.5-9.fc18.src.rpm, buildID=377755 (full specfile)

diff --git a/nodejs.spec b/nodejs.spec
index 050ed86..86c0f4b 100644
--- a/nodejs.spec
+++ b/nodejs.spec
@@ -1,6 +1,6 @@
 Name: nodejs
 Version: 0.9.5
-Release: 9%{?dist}
+Release: 10%{?dist}
 Summary: JavaScript runtime
 License: MIT and ASL 2.0 and ISC and BSD
 Group: Development/Languages
@@ -25,7 +25,7 @@ Source6: nodejs-fixdep
 BuildRequires: v8-devel >= %{v8_ge}
 BuildRequires: http-parser-devel >= 2.0
 BuildRequires: libuv-devel
-BuildRequires: c-ares-devel
+BuildRequires: c-ares-devel >= 1.9.0
 BuildRequires: zlib-devel
 # Node.js requires some features from openssl 1.0.1 for SPDY support
 BuildRequires: openssl-devel >= 1:1.0.1
@@ -165,9 +165,13 @@ cp -p common.gypi %{buildroot}%{_datadir}/node
 
 %files docs
 %{_defaultdocdir}/%{name}-docs-%{version}
-%doc LICENSE
 
 %changelog
+* Thu Jan 31 2013 Jason Antman <Jason.Antman@cmgdigital.com> - 0.9.5-10
+- specify build requirement of c-ares-devel >= 1.9.0
+- specify build requirement of libuv-devel 0.9.4
+- remove duplicate %doc LICENSE that was causing cpio 'Bad magic' error on CentOS6
+
 * Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9
 - fix brown paper bag bug in requires generation script

v8.spec, diff from Fedora Rawhide 3.13.7.5-2 (full specfile)

--- v8.spec.orig       2013-01-26 16:03:18.000000000 -0500
+++ v8.spec     2013-01-31 09:04:51.068029459 -0500
@@ -21,9 +21,11 @@
 
 # %%global svnver 20110721svn8716
 
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "import distutils.sysconfig as d; print d.get_python_lib()")}
+
 Name:          v8
 Version:       %{somajor}.%{sominor}.%{sobuild}.%{sotiny}
-Release:       2%{?dist}
+Release:       5%{?dist}
 Epoch:         1
 Summary:       JavaScript Engine
 Group:         System Environment/Libraries
@@ -32,7 +34,7 @@
 Source0:       http://commondatastorage.googleapis.com/chromium-browser-official/v8-%{version}.tar.bz2
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 ExclusiveArch: %{ix86} x86_64 %{arm}
-BuildRequires: scons, readline-devel, libicu-devel
+BuildRequires: scons, readline-devel, libicu-devel, ncurses-devel
 
 %description
 V8 is Google's open source JavaScript engine. V8 is written in C++ and is used 
@@ -51,8 +53,13 @@
 %setup -q -n %{name}-%{version}
 
 # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
-PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-error=unused-local-typedefs -Wno-unused-but-set-variable\'| sed "s/ /',/g" | sed "s/',/', '/g"`
+%if 0%{?el5}
+PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -lncurses\'| sed "s/ /',/g" | sed "s/',/', '/g"`
+sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct
+%else
+PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable\'| sed "s/ /',/g" | sed "s/',/', '/g"`
 sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct
+%endif
 
 # clear spurious executable bits
 find . \( -name \*.cc -o -name \*.h -o -name \*.py \) -a -executable \
@@ -198,6 +205,17 @@
 %{python_sitelib}/j*.py*
 
 %changelog
+* Thu Jan 31 2013 Jason Antman <Jason.Antman@cmgdigital.com> - 1:3.13.7.5-5
+- remove -Werror=unused-local-typedefs on cent6
+
+* Wed Jan 30 2013 Jason Antman <Jason.Antman@cmgdigital.com> - 1:3.13.7.5-4
+- define python_sitelib if it isn't already (CentOS 5)
+
+* Wed Jan 30 2013 Jason Antman <Jason.Antman@cmgdigital.com> - 1:3.13.7.5-3
+- pull 3.13.7.5-2 SRPM from Fedora 19 Koji most recent build
+- add ncurses-devel BuildRequires
+- modify PARSED_OPT_FLAGS to work with g++ 4.1.2 on CentOS 5
+ 
 * Sat Jan 26 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:3.13.7.5-2
 - rebuild for icu-50
 - ignore new GCC 4.8 warning

Project – Storing and Analyzing Apache httpd Logs from Many Hosts

I’ve recently started casual work on a side-project to collect, store, and analyze apache logs from a bunch of servers – for the initial implementation, I’m looking to handle about 15M access_log lines per day (that works out to 173 lines/second assuming an even distribution, which there certainly isn’t). Here is a selection of links that I’ve been using for ideas and inspiration, both for the technical side (data collection, transport, storage and analysis) and visualization:

  • RRDtool – RRDtool Gallery – I’m starting a graphing/log analysis project, and looked here for some inspiration for my proof-of-concept code
  • Creating pretty graphs with RRDTOOL from Girish Venkatachalam.
  • There’s some good information on RRDtool’s “Abberant Behavior Detection” (Holt-Winters prediction, deviation and failure detection) on the rrdtool, rrdgraph_examples and rrdcreate documentation pages, but unfortunately no anchors to link directly to.
  • Cube – “Cube is a system for collecting timestamped events and deriving metrics. By collecting events rather than metrics, Cube lets you compute aggregate statistics post hoc. It also enables richer analysis, such as quantiles and histograms of arbitrary event sets. Cube is built on MongoDB and available under the Apache License on GitHub.”
  • Cubism.js – “Cubism.js is a D3 plugin for visualizing time series. Use Cubism to construct better realtime dashboards, pulling data from Graphite, Cube and other sources. Cubism is available under the Apache License on GitHub.” The demo on that page looks pretty cool.
  • Highcharts Demo Gallery – JS chart/graph library. It requires a paid license for commercial use (though it’s a bit unclear to me whether an internal ops dashboard would fall under this license provision) so I probably wouldn’t go with this one. They have some cool charts, including a dynamic line chart updating every second, a scatter plot and a nice zoomable time-series graph, though IMHO it’s not as nice as the Google Chart Tools (formerly Google Visualization) annotated timeline.
  • [ HOWTO ] Graphing Holt-Winters Predictive Analysis – Cacti forums
  • dygraphs – an impressive permissive-license JS chart library dedicated to visualizing dense time-series data. Developed by Google and now used by them (Google Correlate, Google Latitude) as well as NASA, 10gen and others. There are some very cool demos on that main page, and also on the tests page.
  • Graphite, JMXTrans, Ganglia, Logster, Collectd, say what ? « Planet DevOps
  • Visage
  • kgorman/mongo_graph – a tool to pull data from MongoDB and put it in RRD files
  • drraw – a perl-based graphing frontend (web UI) for RRDtool
  • etsy/logster · GitHub – Etsy’s Python tool to maintain a pointer on a log file, and parse at a regular rate feeding the data into a tool like Graphite or Ganglia.
  • cebailey59/charcoal – a Sinatra app that allows creation of dashboards from Graphite, collectd, or any other service that creates images from URL calls.
  • etsy/dashboard – some examples of how Etsy builds monitoring dashboards.
  • GDash – Graphite Dashboard | R.I.Pienaar – a Sinatra dashboard app for Graphite, using Twitter bootstrap for visualization.
  • paperlesspost/graphiti – a Ruby and JavaScript front-end for Graphite.
  • Graphite Screenshots – just two, but they get the idea across pretty well.
  • Graylog2 – a centralized log management application with a powerful web interface. Stores logs in ElasticSearch (which is built on Lucene, a Java-based index and search server) and statistics/graphs in MongoDB. It does analytics, alerting, monitoring/graphing and searching all through a web interface, and accepts log data via syslog, AMQP and GELF (its own log format). Java server and Ruby on Rails web UI.
  • Logstash – another centralized log project that stores and indexes logs, with search via a web UI. “Ship any event to anywhere over any protocol.” Takes many inputs including files, syslog, AMQP, Flume, STOMP, HTTP and even twitter, performs a number of filters including timestamp checks, parsing, dropping, joins, etc, and then sends logs back on an output including AMQP, Graylog2 GELF, STOMP, MongoDB, ElasticSearch, syslog, WebSockets and to Nagios. One particularly cool feature is its “file” input, which continuously tails a file and claims to be log rotation safe. Just cool.
  • jordansissel’s Logstash intro slides.
  • Kibana – an alternative interface for Logstash and ElasticSearch that allows searching, graphing and analysis of log data stored in Logstash.
  • Pivotal Labs: Talks – Metrics Metrics Everywhere (Coda Hale)
  • PaperlessPost – @quirkey’s talk on metrics – very good high level stuff, but slides only
  • paperlesspost/graphiti – graphiti, a JS/Ruby frontend for Graphite that does graphs, dashboards, and point-in-time snapshots of graphs. Lots of functionality.
  • Redis – a distributed key/value store that’s really popular with the cool kids. Another Redis Use Case: Centralized Logging • myNoSQL
  • Charcoal – a Sinatra (Ruby) dashboard app (ready for use on Heroku but usable anywhere). Graphite-oriented but will work with any tool that generates images from URLs.
  • etsy/logster – etsy’s Logster tool, which keeps a tail on log files, parses them, and ships metrics to Graphite or Ganglia.

Perl script to convert F5 BigIp VIP address to list of internal pool member addresses

I often find myself logging in to the web UI of F5 BigIp load balancers and tracing down a VIP address to the servers that actually back it. This is an arduous, repetitive task of tracing from the VIP list to the VIP details page to find the default pool, then matching up that in the pool list and checking the pool members page. Luckily, the F5 boxes have a web service API that can be used for tasks like this. They have GPL sample code in Perl that uses only SOAP::Lite (as well as Getopt::Long and Pod::Usage) to interact with an F5 BigIp. I wrote a simple script to trace a VIP to the appropriate internal pool member addresses, assuming you have a simple configuration of VIP -> Single default pool -> pool members.

Usage is quite simple:

> ./VipToInternalHosts.pl --host=prod-lb1.example.com --user=myname --pass=mypassword --vip=128.6.30.130:80
VIP 128.6.30.130:80 (f5_vip_name) -> Pool 'pool_name'
Members of Pool 'pool_name':
	10.145.15.10:80
	10.145.15.11:80

The code can be found at http://svn.jasonantman.com/misc-scripts/VipToInternalHosts.pl via either HTTP or SVN. I hope it’s of use to someone else as well.

Verizon Wireless uses Mantis for ticketing

Many times, I’ve wished that I paid the $20 to get software for my Treo 700p to record phone calls. About a month or two ago, I had some issues with my phone and had to call Verizon Wireless. The poor woman was trying to open a ticket for me, but said that she was having some problems, as they were moving from one ticketing system to another, she was having some issues with the new one, and the old one was down at her location.

As she waited for a rep from another location to come on the line and enter the ticket, I happened to remark that I work in IT and had been doing some work with them (Eventum) lately. She mentioned that the old one was a proprietary system, but asked if I’d ever heard of Mantis. Of course, I said that I had. And was then asked if I knew much about it, and whether I might know what the problem she was having was caused by. Unfortunately, I had to say no, as I’d never used it for more than a few minutes. But I did get to confirm that a company as large and closed (they won’t support Linux, their phones run closed OS’s, and they block my port 80) as Verizon is happily transitioning from closed-source proprietary software to a GPL’d alternative. I also got another item to add to my list of telephone tech support people who have asked me (the customer) for support.

Unfortunately, I don’t see Verizon listed on the list of known Mantis users, so I have no way to fully confirm this.

Firefox 3 Finally Out!

It’s a wonderful day. And if you haven’t taken a swing by the Firefox Download Site yet today, shame on you! Mozilla is attempting to get the Guinness World Record for most software downloads in 24 hours – and that 24 hours ends at 2:16 PM EDT today! So run over and get it… now! (and please download from Mozilla’s site so they have an accurate count).

Anyway, I’m going to do my part by downloading the Linux tarball on every machine I have that has a graphical display – though I don’t know if my NAT will end up being counted as one download. For the Linux users out there, I was able to find an RPM on the openSuSE site though I’m not yet sure whether it’s the release or the beta version. Windows and Mac users have it easier – Mozilla packages software for you, we have to do it ourselves or wait for someone else to.

Anyway, Firefox 3 is supposed to have much better memory usage, be a bit faster, and also have some great feature enhancements.

Update

I’ve been incredibly busy lately. But I have 2 quick updates-

1) tuxOstat, my thermostat project, isn’t totally finished, but is up and running. There’s still some work to do, but the code is largely complete, and in CVS. There’s also a web interface with temperature graphs, system status, and a (horrible) webcam view of the LCD control panel. I’ll probably be finishing up a first version this week, finishing the documentation next week, and releasing what I have soon.

I got an e-mail today about one of my older projects, PHP EMS Tools, a PHP/MySQL based application for fire/EMS agencies to handle scheduling, membership rosters, equipment checks, etc. The potential user was asking about running the software on Windows – which, of course, I have no experience with. I’m pretty sure there aren’t many, if any, Unix-specific calls hidden in the code, and advised him to try XAMPP (Apache/MySQL on Windows). But I did take a moment to comment on why I chose Linux. My pilot installation of PHP EMS Tools, at the Midland Park Volunteer Ambulance Corps, where I’ve been a member since 2005, has been handling our scheduling, roster, and equipment checks since June 2006. It’s running on a generation 1 Compaq Proliant DL380, running dual Pentium III 733MHz processors and 1GB memory – and even with a number of other programs on it, including ieilogd which is reading from the serial port 24×7 – the load average has never passed 1.2 and the memory usage is well under 50%. More importantly, the system has been up for 442 days without a hiccup!

Sun Blog

Well, I’ve created my official Sun Microsystems blog as Campus Ambassador for Rutgers University. Not that I honestly think anyone reads the non-technical blog entries here, but if you do, you may want to check out the Sun blog as well.

Most of the Sun blog entries will probably have to do with Sun technologies in education or at Rutgers, but when there is something of interest to a more general audience, I’ll be sure to post here as well.

In other news, I’m really really busy lately, between Sun training, my job (now doing hardware/lab support and some wireless work) for Rutgers, and school. I have a really long list of things to do personally, including buying some new systems to move my home/development network over to the Solaris 10 operating system, getting a new template for this blog, and wikifying all of my web sites (mostly those at jasonantman.com). To top it all off, my truck was broken into this afternoon (broad daylight on a busy street) while I was at class. The front passenger window was smashed in and my Mio c310x GPS was stolen, so between the window and the GPS, I’m a bit behind where I’d like to be in terms of budget.

Bug / Issue Tracking Software

I recently posted the following to the DevShed forum in hope of an answer:

I’ve spent the last 48 hours reading up on bug tracking software. At the moment, I’m using the SourceForge tracker for my public projects and a custom (lightweight kludge) system for internal and customer-specific stuff.

First off, I’m looking for something that’s F/OSS and no-cost. Beyond that, it should have a web-based interface, preferably coded in PHP as that’s what I’m most comfortable writing code for.

I’ve looked into many possibilities. At the moment, they’re pretty much narrowed down to RT, FlySpray, Codetrack, Trac, and a few other america’s promise rorabaugh3possibilities. I’ve immediately disregarded anything without an online demo, so some may have slipped by me.

I can do some coding to add a few features as needed, but here’s what I’m looking for:

1) Web-based interface
2) Ability to handle multiple projects
3) Ability to handle modules/branches of a project – specifically to be used for projects which also have custom, user-specific modifications on a branch.
4) *multiple* bug submission forms – ideally, one for team members/technical users, one (simplified) for non-technical end users, and one for non-technical users which also collects browser/OS information, as many of my projects are web-based.
5) If possible, integration with CVS or SVN so that I can track commits related to a specific bug.
6) Fine-grained access control. There should be a way to submit an anonymous (unregistered user) bug. Anonymous submissions and registered user submissions should be authorized on a project-by-project (or branch-by-branch) basis. There should also be access control on viewing *any* information at all for certain projects/modules (so the same system can be used for internal-only projects).

I’m sure that I have a lot of other requirements, but these are the ones that stuck out in my mind. Also, though I don’t have a system up and running yet, there’s a possibility I may be moving to LDAP for all auth, so something where I could drop in a custom auth module would be a plus.

Any suggestions?

I know I probably won’t find *all* of this in one place, but I’d like to minimize the amount of programming I have to do. After all, starting a new programming project to track bugs in an existing one isn’t especially efficient.”

We’ll see what happens out of it.

I recently received a few emails from someone attempting to get PHP EMS Tools up and running for his EMS agency. I did a lot of correspondence via email, and ended up in a bit of a predicament. First off, since CVS is down, I had to make a copy of the latest development sources from their live location on my web server, and revert to using RCS for the development work. Secondly, he wasn’t familiar with the SourceForge trackers and didn’t have an account with them, so I had to manually enter the bug reports. This was not good. I need something better.

I know that a lot of ticketing systems use e-mail interfaces, but I have no interest in that – I want to be able to require certain information for certain people. Moreover, I have a few main issues with most of the ticketing software I’ve seen:

  1. It’s either designed for development team members or non-technical end users. I want a system that can present an end-user with a simple, non-jargon-filled issue submission form, yet put that right in with issues entered by developers, which would have a greater depth of technical content. Developers should be able to follow-up on users’ tickets and add technical details as needed. Most importantly, since most of my projects are web-based, I want to add JS to the form which will include the users’ browser and OS information in the ticket.
  2. I don’t have a server farm. I don’t expect to be getting hundreds of bugs a year, let alone week. As such, it makes no sense for me to run a separate system for every project. I want a system that can handle multiple projects.
  3. Furthermore, I want it to handle internal projects as well – server upgrades, hardware issue tracking, etc. As such, it should support fine-grained access control, both for viewing and submitting bugs. Some projects should allow anyone to view bugs, and allow a non-registered (provided the email address is valid) user to submit. Some projects shouldn’t let anyone but me see *anything*.
  4. I need support for branches within projects. While PHP EMS Tools only has the trunk publicly available, I now have two branches, one customized for my organization and one for this gentleman’s organization. I want a system that can understand that these are branches of the main project, and that bugs may pertain to only one of these branches, but that all of the bugs from the trunk will pertain to them.
  5. I would love a system that can somehow integrate with CVS or SVN, so that I can associate a specific commit with a specific bug(s).

So far, I’m considering FlySpray, RT, and Trac. I’m also looking at Eventum, Codetrac, and BugZero. I’m interested in OTRS as I’ve heard good things about it, but I can’t seem to find a web-based demo. Most likely, I’ll probably give two or three of them a whirl, and then add in the custom code to do what I need. Of course, none of this will happen until I either get CVS back up or migrate to SVN.

Well, I did it…

I’ve been resisting it for quite a while, but in an effort to cut down on extraneous content on my web sites (JasonAntman.com, php-ems-tools.com, and KC2OZU.com) I decided to give in and setup a blog.

The content will probably be a smattering of IT, Linux, GNU/Free Software, EMS (Emergency Medical Services), Ham/Amateur Radio, and other content. It might not be updated very often, but I plan on putting on somewhat interesting, informative content.

-Jason