Google 2-factor authentication
About a month ago, Google made available to all users their new 2-factor authentication, which they call 2-step authentication. In addition to the customary username and password, this optional new feature requires that you enter a 6-digit number that changes every 30 seconds, generated by the Google Authenticator app on your Android, BlackBerry, or iPhone. The app looks like this:
This was straightforward to set up and has worked well for me in the past month. It would thwart bad guys who intercept your password in most cases. It would also lock you out of your Google account if you lose your phone and your emergency scratch codes. :)
I was happy to see this is all based on some open standards under development, and Google has made this even more useful by releasing an open source PAM module called google-authenticator. With that PAM module, a Linux system administrator can require a Google Authenticator code in addition to password authentication for login.
I tried this out on a CentOS x86_64 system and found it fairly straightforward to set up. I ran into two minor gotchas which were reported by others as well:
-
The Makefile calls sudo directly, which it shouldn’t—I was …
hosting linux mobile open-source redhat security sysadmin
Presenting at PgEast
I’m excited to be going to the upcoming PostgreSQL East Conference. This will be both my first PostgreSQL conference to attend, as well as my first time presenting. I will be giving a talk on Bucardo entitled Bucardo: More than Just Multi-Master. I’ll be in NYC for the conference, so I’ll get to work for a couple days at our company’s main office as well.
I look forward to learning more about PostgreSQL, putting some names and faces with some IRC nicks, and socializing with others in the PostgreSQL community; after all, Postgres’ community is one of its strongest assets.
Hope to see you there!
conference postgres bucardo replication
Liquid Galaxy in The New York Times
We got a charge at End Point seeing an article on the front page of The New York Times website this last Sunday about the @america cultural center exhibit the US State Department opened in Indonesia this last December. The article features the Liquid Galaxy that End Point installed on Google’s behalf there. There was no mention of End Point, but heck, we’re only a few clicks away from the Liquid Galaxy link in the article!
The article also appeared on page A6 of the publication’s New York print edition, leading off the International Section of the paper with a big 9" by 6" color photo with the Liquid Galaxy in the background—the same photo that appears on the website and at the top of this blog posting.
Kiel Christofferson made the trip from New York to Jakarta to do the installation. After he installed the Liquid Galaxy in the exhibition space he moved it with local help to a ball room nearby where there was a State Department gala for the opening of @america. Kiel got dressed up in black (not so unusual for him) and staffed the booth to make sure there were no glitches for the event, then he oversaw the move back to home base.
This Liquid Galaxy was a bit different …
clients visionport
jQuery and Long-Running Web App Processes: A Case Study
I was recently approached by a client’s system administrator with a small but interesting training/development project. The sys-admin, named Rod, had built a simple intranet web application that used a few PHP pages, running on an Amazon EC2 instance, to accept some user input and kick off multiple long-running server side QA deployment processes. He wanted to use Ajax to start the process as well as incrementally display its output, line-by-line, on the same web page. However, waiting for the entire process to finish to display its output was a poor user experience, and he wasn’t able to get an Ajax call to return any output incrementally over the lifetime of the request.
Rod asked me to help him get his web app working and train him on what I did to get it working. He admitted that this project was a good excuse for him to learn a bit of jQuery (a good example of keeping your tools sharp) even if it wasn’t necessarily the best solution in this case. I have always enjoy training others, so we fired up Skype, got into an IRC channel, and dove right in.
First, I started with the javascript development basics:
-
Install the Firebug add-on for Firefox
-
Use Firebug’s Console tab to …
javascript jquery php sysadmin
A Ruby on Rails Tag Cloud Tutorial with Spree
A tag cloud from a recent End Point blog post.
Tag clouds have become a fairly popular way to present data on the web. One of our Spree clients recently asked End Point to develop a tag cloud reporting user-submitted search terms in his Spree application. The steps described in this article can be applied to a generic Rails application with a few adjustments.
Step 1: Determine Organization
If you are running this as an extension on Spree pre-Rails 3.0 versions, you’ll create an extension to house the custom code. If you are running this as part of a Rails 3.0 application or Spree Rails 3.0 versions, you’ll want to consider creating a custom gem to house the custom code. In my case, I’m writing a Spree extension for an application running on Spree 0.11, so I create an extension with the command script/generate extension SearchTag.
Step 2: Data Model & Migration
First, the desired data model for the tag cloud data should be defined. Here’s what mine will look like in this tutorial:
Next, a model and migration must be created to introduce the class, table and it’s fields. In Spree, I run script/generate extension_model SearchTag SearchRecord and update the migration file to …
ecommerce rails spree
Ecommerce on Sinatra: A Shopping Cart Story
In a couple recent articles, I wrote about the first steps for developing an ecommerce site in Ruby on Sinatra. Or, here’s a visual summary of the articles:
|
|
| In the first article, a single table data model existed with a couple of Sinatra methods defined. | In the second article, users and products were introduced to the data model. The Sinatra app still has minimal customer-facing routes (get "/", post "/") defined, but also introduces backend admin management to view orders and manage products. |
|
|
In this article, I introduce a shopping cart. With this change, I modify the data model to tie in orderlines, where orderlines has a belongs_to relationship with orders and products. I’ll make the assumption that for now, a cart is a set of items and their corresponding quantities.
The new data model with tables orderlines, products, orders, and users.
An Important Tangent
First, let’s discuss cart storage options, which is an important topic for an ecommerce system. Several cart storage methods are described below:
-
Conventional SQL database models: Conventional SQL (MySQL, PostgreSQL, etc.) tables can be set up to store shopping cart items, …
ecommerce ruby sinatra
API gaps: an Android MediaPlayer example
Many programming library APIs come with several levels of functionality, including the low-level but flexible way, and the high-level and simpler but limited way. I recently came across a textbook case of this in Android’s Java audio API, in the MediaPlayer class.
We needed to play one of several custom Ogg Vorbis audio files in the Locate Express Android app to alert the user to various situations.
Getting this going initially was fairly straightforward:
In this simplified version of our PlaySound class we pass in the app resource ID of the sound file, and using the MediaPlayer.create() method is about as simple as can be.
We keep a map of playing sound files so that external events can stop all playing sounds at once in a single call.
We set an OnCompletionListener to clean up after ourselves if the sound plays to its end without interruption.
Everything worked fine. Except for a pesky volume problem in real-world use. MediaPlayer uses Android’s default audio stream, which seemed to be STREAM_MUSIC. That plays the audio files fine, but has an interesting consequence during the actual playing: You can’t turn the volume down or up because the volume control outside of any specific …
android java mobile api audio
SSH: piping data in reverse
I found myself ssh’d several hops away and needing to copy output from a script back to localhost. Essentially what I wanted was a way to get the data in question piped backwards from my SSH connection so I could capture it locally. Since I utilize .ssh/config extensively, I could connect to the server in question from localhost with a single ssh command, however bringing the data back the other way would make it a multi-step process of saving a temporary file, copying it to a commonly accessible location which had the permissions/authentication setup or intermediately sshing to each node along the path—in short it exceeded my laziness threshold. So instead, I did the following:
[me@localhost]$ ssh user@remote nc -l 11235 > output.file # long, complicated connection hidden behind .ssh/config + ProxyCommand
[me@remotehost]$ perl -ne 'print if /startpat/ .. /endpat/' file/to/be/extracted | nc localhost 11235I ended up choosing an arbitrary port and ran a remote listen process via ssh to pass on any output directed to the specific remote port and capturing as STDOUT on my local machine. There are a couple reasons I think this setup is nicer when compared to just …
sysadmin tips






