Author Archive | Ted Roche

Notes from Python Special Interest Group, 20-Nov-2009

Eight people attended the Python Special Interest Group, held a week early to avoid the Thanksgiving holiday. Anticipate a reschedule December meeting as well.

Last night’s meeting was a vigorous and far-reaching discussion of MySQL, Oracle, the future of MySQL, Maria DB, OpenOffice.org automation using Python, OpenOffice.org automation using Visual FoxPro, Twisted, IE6, Zope, Plone, Django, MS SQL Server, pyodbc, SQLAlchemy, Cascading Style Sheets, IE6, FireFox and FireBug, User Agents, IE6, how not to insulate a bungalow roof, the (Python!) cssparse module (http://cthedot.de/cssutils/), Fortune’s selection of Steve Jobs as “CEO  of the Decade”, Lenovo netbooks and Ubuntu, the Millennium, why calendar years are one-based and not zero-based, distributed version control systems, master-slave and master-master replication using MySQL and Postgres, svn and git, and more! Whew! You should have been there!

Thanks to Bill for organizing the meeting, to all for attending and participating, and to the Amoskeag Business Incubator for providing the great facilities!

Stay tuned for an announcement of the December meeting, and hope everyone has a good Thanksgiving!

Notes from NH Ruby/Rails group, 17-Nov-2009, rvm and EC2

Brian Turnbull and Nick Plante each had excellent presentations for the New Hampshire Ruby Rails Group’s first meeting on the third Monday of the month, our new “regular meeting day.” (We won’t be having a December meeting, however; have a happy Kwanzaa, Hanukkah, Christmas, Saturnalia, Winter Solstice or non-denominational generic shopping holiday of your choice.)

Brian was up first, and talked about rvm, the Ruby Version Manager (slides here: http://www.slideshare.net/bturnbull/rvm-nhruby-nov-2009). RVM doesn’t just allow you to have multiple versions of ruby on your machine; you’ve always been able to do that with side-by-side installs or linking or aliases or other kludges. RVM can be found at https://rvm.io/ and can be installed as a Gem, from the Git repository or as a tarball. It’s not Ruby code, actually, but shell scripts, and it allows not just switching of the current active version of ruby, but much more interestingly, the entire set of gems associated with a version! Multiple gemsets can be assigned an alias that lets you group your gems by function or project or client. RVM also provides a facility to dump the list of gems from one version or gemset and load it into another, allowing you to test out the migration of an existing system to a new version with much less hassle. Finally, rvm also lets you invoke multiple versions serially, passing them a command like “rvm 1.86, 1.8.7, 1.9.1 rake spec” where rvm will run all your tests on multiple versions and report results, even in JSON if specified. This could be the core of a really simple Continuous Integration (CI) server in a single line of code!

Brian cautioned that rvm is early in its development cycle (current as of last night was 0.0.79) and changes are coming fast and furious, but it’s worth taking some time to keep track of this very interesting development!

Brian also mentioned that rvm has some extensions to work with Bundler. Nick mentioned that Bundler, a project from Yehuda Katz (core contributor to both Ruby and jQuery) , is slated to become the default means of managing gems in Rails 3.0. Here’s a good link to learn more: http://yehudakatz.com/2009/11/03/using-the-new-gem-bundler-today/

Nick Plante was up next, with his presentation on EC2 for Rails Development (http://zapnap.github.com/presentations/ec2-rubber/#0). Nick talked about the evolution of deployment of Rails (or Rack) solutions, moving from very painful to much easier with the introduction of Capistrano (http://www.capistranorb.com/). He reviewed how simple it was to deploy an application with Capistrano, and then talked about the power of the Amazon Web Services (AWS) http://aws.amazon.com/ and Cloud Computing in general. Capistrano is focused on general deployment to a server, but the new add-on, Rubber (http://github.com/wr0ngway/rubber),  extends that to work with elastic computing resources like AWS’ Elastic Compute Cloud (EC2). We walked through the basics of the install-configure-deploy scenario and then “Insert Demo Here.” – he did it. Defying the Demo Gods (who had already tortured Brian a bit), Nick grabbed a copy of RedMine (http://www.redmine.org/) from GitHub, did the couple of minor configuration items needed to make it work locally (creating the session key, copying the sample database config to the live one, setting it to use SQLite3 locally and running db:migrate) and then set it up for deployment: first invoking Capistrano (doing some configuring) and then Vulcanizing (how else would you make rubber) the installation, then deploying it to a brand-new AWS instance. The steps flew by lightening-fast: the Amazon instance was up and running a minute after being invoked, then took a couple of minutes to install and configure Apache, Passenger, MySQL, the Redmine application, and sftp the development directory files to the instance. Within a few minutes, Nick could browse the machine and see the running application as well as ssh into the box and make any changes. There are innumerable options, of course, but they are all accessible by reviewing the configuration files and the source to tune it to your particular needs.

While we waited for the installation to complete, I brought up some of the customer’s concerns and practitioner’s insights from last Thursday’s MonadLUG meeting on Cloud Computing and we talked about how those applied. I expressed concerns about how persistent data storage worked, since the cloud images were considered ephemeral. Nick pointed out that the instance, while running could have a local database and it could be in a master-slave replication arrangement with either another instance (within the AWS, there aren’t bandwidth charges) or a hosted or local machine. Also mentioned was the Amazon Relation Database Service (RDS), which can provide a MySQL database instance with backups. So, there are lots of options.

Thanks to Brian and Nick for excellent presentations as well as organizing the meeting and bringing the pizza, to Tim and the folks at RMC Research for providing the excellent facilites and to all eleven who attended and participated in the meeting.

Remember, no Ruby meeting meeting in December. Stay tuned for a January announcement.

New Hampshire Ruby / Rails Group, MONDAY, 16 November 2009

Reposting Nick’s announcement from http://nhruby.org/2009/11/8/november-meetup-ec2-and-rvm:

NHRuby is meeting for the last time this year on Monday the 16th at 7pm at RMC Research, 1000 Market Street, Building 2, Portsmouth, NH. Monday?! You say? Yes — due to scheduling conflicts, the regular meeting day for NHRuby is now to the third Monday of the month. Also, since next month’s meeting fell so close to the Christmas holiday, we decided to skip the December meetup and resume in January. So join us for the last meeting of 2009 for two presentations by NHRuby regulars, Nick Plante and Brian Turnbull.

Nick will present EC2, Amazon’s Elastic Compute Cloud. EC2 is a web service which allows customers to rent virtual server instances by the hour. The real power of EC2 is that it allows you to auto-scale your web applications on demand. Expecting heavy load today? Fire up another web app server or two, with no wait time for procurement, while taking advantage of Amazon’s robust infrastructure.

Making EC2 even more attractive are tools like Matt Conway’s Rubber, a set of extensions to Capistrano that allows you to script procurement and provisioning of server instances as well as deployment of your application itself. Need to set up a staging server? Use Rubber to deploy a disk image, install the necessary stack and utilities, and deploy the appropriate version of your application — in moments — all automatically. In this talk, Nick will quickly discuss the basics you need to know and then dive right into a realtime demo.

Brian will introduce RVM, the Ruby Version Manager. RVM is a command line tool which allows us to easily install, manage, and work with multiple Ruby environments and sets of gems. Topics to be covered include:

  • Installation of RVM on Linux or OS X.
  • Day to day use of RVM to switch between Ruby interpreters
  • Managing sets of gems using Named Gem Sets

If you’ve ever been burned by differences between development and production, you should check out RVM — see how easy it is to take control of your Ruby environment.

So join us on Monday, 16 November at RMC Research for the last meeting of the year. Hope to see you there!

Windows 7 Motto?

I noted on the Lenovo site a note on the page that said, “Windows®. Life without Walls™.” It’s pretty hard to believe that even Microsoft marketing, well known for tone-deafness, thought this was a great motto. I mean, without walls, who needs windows?

The note goes on to say, “Lenovo recommends Windows.” Do they really, or does Microsoft pay them to say that? Or require them to say that in order to get a discount on their OEM licensing, which amounts to the same thing? Where’s their FTC disclaimer? (I posted my disclaimers about 3 years ago here.)

Frankencameras

I think I saw this written up in one of ACM‘s magazines, but those don’t get a lot of traffic, and they hide much of their best content behind subscriber-only firewalls. NPR did a story over the weekend on a group at Stanford doing “computational photography” – camera hardware with a Linux backend. I’ve been a fan of photography for decades, since Dad and I set up a dark room in the cellar. The Stanford prototypes are ungainly, of course, but the potential is very interesting. Here’s the story and the linked video. While you wouldn’t like to lug the prototype around all day on a neck strap, the idea of a “smart” camera where you could develop (or download) new effects, hacks, etc. and upgrade the capabilities of your camera is very attractive. Like the consumer cellular telephones started out as fixed devices and added uploadable ringtones, then backgrounds, then camera effects, then wide-open platforms like Google’s Android phone, an open hardware platform for photography could create an entire new category of devices.

NHRuby, 17 September: Games in Ruby

The New Hampshire Ruby / Rails Group announces the topic of their September meeting: Games. It sounds like the games are just an excuse for us to have problems to solve by actually writing code in Ruby. Not a bad idea — trick us into coding by having fun? Radical.

This Thursday: Patrick Galbraith at MonadLUG

  • Who: Patrick Galbraith
  • What: Memcached and moxi
  • Date: Thursday, September 10, 2009
  • Time: 7:00PM
  • Where: SAU 1 Offices, 106 Hancock Rd., Peterborough

About the presentation:

Patrick will do a talk on memcached (http://memcached.org/), the moxi memcached proxy (https://code.google.com/p/moxi/) and about Northscale’s memcached AMIs for Amazon EC2 as well as using these with the memcached functions for MySQL (user-defined database functions) that he wrote. How you can use these for caching data to reduce the load on database servers.

About Patrick:

Patrick has been working with Linux since 1993. Some of his previous experiences have included working on Slashdot, Linux.com, Newsforge.com, launching Slashcode.com and Sourceforge Foundries, developing and maintaining DBD::mysql, mysqlslap development and more than I could possibly list here.

He is the author of “Developing Web Applications with Apache, MySQL, memcached, and Perl” published by Wylie and Sons.

DLSLUG: Forecast is Clouds, and Nifties! Notes from 3-Sept-2009 meeting

Fifteen people ranging in age from 4 years old to, well, quite a bit older than that, attended the September meeting of the Dartmouth – Lake Sunapee Linux User Group. DLSLUG meets on the first Thursday of most months somewhere on the Dartmouth campus. Join the announcement list to keep up with the latest news. The meeting consisted of the usual round of announcements, two short presentations, informal quick presentations by the assembled crowd — Nifties! — and discussion that went on until the janitors kicked us out.

Bill Stearns demonstrated the drop-dead simplicity of configuring and launching a virtual machine on the Rackspace Cloud (http://www.rackspacecloud.com/) Computing site. Nearly as quickly as he could describe it, Bill set up a new machine, choose the memory and disk size, the version of operating system, and got the machine up and running (he had previously registered, so he had an account and payment information on file). The costs for machines are based purely on how much you use, the hours the machine is running and the bandwidth consumed. A minimal machine can be deployed at 1.5 cents per hour, and a busy machine can cost less than $60 a month. This is well worth looking into if you’d like to deploy a backup DNS server or your entire online facilities.

Rich Brown of Dartware showed what his company has been up to in extending the reach of the InterMapper (http://www.intermapper.com/) network monitoring software to work on, and with, the Amazon Web Services (AWS), EC2 and S3. AWS is the more mature service and seems to be targeted more at enterprise customers. Amazon offers a cloud monitoring service and APIs that let you launch additional instances of your saved imaged machines as needed. InterMapper is adding some interesting facilities to the service, and have free 5-user licenses available for the asking.

Alan Johnson showed a nifty on the command line pv tool (Progress Viewer) which is a classic small-tools-loosely-joined *nix tool: a  pipe that can display the progress of data through that pipe. Alan showed a simple example of cat’ing /dev/zero to /dev/null and sticking pv in the middle to show the progress. Cognoscenti in the audience pointed out that cat wasn’t necessary, and using pv with directly piped input and output displayed throughput of an order of magnitude increase. Debate ensued as to the many causes likely to contribute to this effect. Nerds are so cute.

P.S. Those interested in testing pv on their own machines should find it part of many Linux distributions. The caution at the end of the discussion section of the man page (http://linux.die.net/man/1/pv) should be taken seriously.

Nifty!

James Murza showed us some code he’d been working on. It looks up words you specify on wiktionary (http://www.wiktionary.org/), finds all of the translations wiktionary offers and calculates a numeric value based on some semantic qualities of the word for each language. Then, James offers a PHP page where you can list the relative differences between any two languages, based on the words you’ve selected. So, for example, French and Spanish words tended to score close together, while Tagalog and Frisian had little in common.

Nifty!

Bill McGonigle demonstrated his Wok-Key login, a very clever Javascript routine for allowing you to log into your SquirrelMail front end from a machine you might not trust to share your password with. Instead of typing your actual password, the Wok-Key code generates a table on the fly (different each time) of two-letter pairs matched to all the keyboard characters, and displays a table to the screen of the letter-pairs laid out like a QWERTY keyboard, upper- and lower-case. Rather than typing your password, you type the equivalent two-letter pairs, and the Javascript on the page converts your choice to the password to be sent to the backend. This means a keystroke logger will never see your password, and it is unlikely to be saved in a cache on the browser.

Nifty!

Lloyd Kvam announced there were two new additions to the library, one book on Erlang (http://www.pragprog.com/titles/jaerlang/programming-erlang) and a DVD on Perl (http://www.informit.com/store/product.aspx?isbn=0137001274). Any GNHLUG member (that’s you!) can check out a book by contacting Lloyd. The list of books in our library can be found at: http://dlslug.org/library.html

Bill McGonigle said that he’s trying to line up the correct facilities for the next meeting, and if we’re able to get a room that will support all our laptops, we’ll go for a session on encryption and a key-signing party. Stay tuned for a confirming announcement.

Thanks to Bill McG for organizing the meeting, to Dartmouth College for the great facilities, to Bill Stearns and Rich Brown and all the Nifties! presenters for the participation.

Adding Fail2Ban to the web site

I swapped out web servers two weekends ago, when the old machine started showing some unacceptable behavior. Part of that swap involved switching from a CentOS-based Linux distribution to an Ubuntu-based distribution. There were some great learning moments involved in that. I also wanted to swap out a few programs that hadn’t worked as well as I had hoped.

One of the new packages I’m trying out is Fail2Ban, an Python-based application to review the logs and temporarily bans IP addresses based on the patterns of abuse. Similar applications like DenyHosts are well-rated, but DenyHosts specializes in ssh, which hadn’t been too much of a problem for me, and didn’t have a straight-forward configuration for ftp, which unfortunately I must offer. I had used a similar Perl-based application before, but it hadn’t supported a couple of a my applications, and appeared to introduce some instability in the system. Fail2Ban came with configurations for Apache 2 and vsftpd. In their wiki, there was a HOWTO for banning PHP-based file upload attacks, something which had begun to fill the logs with nonsense.

So, 48 hours in and things seem to be running well. The log files clearly show some applications being blocked, other applications seems to be running well, and performance and responsiveness of the site seems to be okay.

Notes from Python Special Interest Group, 27-August-2009

Twelve folks attended the August meeting of the Python Special Interest Group, one of the most active chapters of the Greater New Hampshire Linux User Group. The meeting was held on the regular night, the fourth Thursday of the month at the Amoskeag Business Incubator in Manchester, gathering at 6:30 with the formal meeting starting at 7 PM.

I gave the usual pitch about the GNHLUG, checking the calendars for upcoming meetings, joining the announcement mailing lists for low-traffic meeting announcments, or the GNHLUG and PySIG discussion list for slightly-higher traffic but high-quality technical discussions, and mentioned some of the upcoming meetings. I also reminded members that user group discounts are available from many of the book publishers, and that if they are interested in reviewing a recently released book, I can request one through the user group program.

Software Freedom Day is coming up September 19th, and Arc will be running an event in Manchester. Keep an eye on the mailing list for further details.

Mark talked about his monthly Tech Talk presentations in at the Lawrence Library in Pepperell, MA (next meeting, September 30th), and his Tech Talk newsletter. Mark is doing a great job getting the word out there and spreading the message about Free/Open Source to non-technical folks. He’s also tried to get a hearing about Open Source in his local schools, but without much luck. Mark also pointed out the new Full Circle magazine Issue 27, which starts a tutorial series on Python.

Arc Riley gave a quick demo of Crunchy, a python-based local web server for serving Python tutorials. Looks neat.

Arc talked about the Python Software Foundation and the Google Summer of Code and also here. The project Arc mentored helped to develop the 3to2 program for rolling back code written for Python 3 to run in Python 2.x. While the code is still in an alpha state, it successfully performs a lot of the conversion needed, and will continue as a framework for the final product. Arc managed the GSOC for the PSF. The Python Software Foundation had the second largest number of sponsored GSOC projects (Apache was #1) and most were completed successfully. Thanks to Arc for a lot of hard work this summer!

Kent S. Johnson talked about itertools. Itertools provides a simple way to represent and manipulate large sequences of numbers without the necessity to consume large memory and CPU resources with creating the entire sequence before iterating over the sequences. Starting with some simple examples of arrays and lists, sequences and generators, Kent built up examples (with some contributions from Bill Freeman) into a more complex problem that illustrated why itertools is so handy. Well done!

Bruce Labitt is almost single-handedly responsible for keeping the pysig mailing list going this summer. Bruce talked about the work he’s doing with intensive calculations and huge arrays. Bruce is building some complex simulations of radio waveforms and calculating various aspects of the radio waves for regulatory compliance. He’s using Python and NumPy and other libraries to generate test data and simulations, and interfacing common PCs with some supercomputing facilities for the heavy number-crunching. Very interesting talk.

Thanks to Bill Sconce for organizing the meeting, to Mark, Arc and Bruce for presenting, to Janet for the awesome cookies, to the Amoskeag  Business Incubator for the great facilities, and to all for attending and participating.

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.