RSS

Category Archives: web

perlbrew and mojolicious

I’m not a fan of the guys over at mojo but it’s probably the better of the Perl micro-webframeworks out there. So I was curious if mojolicious was going to work with perlbrew.

The first thing I did was install perlbrew. There are several ways to do it. I decided upon the first option:

curl -Lk http://xrl.us/perlbrewinstall | bash

What I do not like about the above command is that the code is assumed to be good and safe. It would have been a little more helpful of the code were downloaded from CPAN.

Once the module was installed. I was directed to add a line to my .bash_profile and then restart my terminal session. Easy enough.

NOTE: I did not recall what the base version was so I edited the .bash_profile file again and commented out the line that I was instructed to include. Then I opened a new terminal session and executed the command:

perl -v

My default/host perl version was 5.12.3. And I wanted to install perl 5.16.0 the latest and current version of perl:

perlbrew install 5.16.0

Easy enough! At this point there was a message on the console that suggested a tail command that I could use to monitor the build. That was easy too. In the end it took about an hour or so and I had a working Perl 5.16.0. (feel the perlbrew doc for the interesting commands)

As a last step I wanted to see what was going to happen when I installed mojolicious, could it be installed in userspace, and which version was it doing to use. So I installed mojo:

curl -L cpanmin.us | perl - Mojolicious

I omitted the ‘sudo’ that the mojo guys recommended and it installed fine. But now the proof needed to be in the pudding. I created a hello.pl file:

use Mojolicious::Lite;
get '/' => {text => 'Hello World! ' . $] };
app->start;

Notice that I added the $] to the message. This is going to append the Perl version number to the end of the hello world string. The good news is that when I ran the application:

morbo hello.pl

and launched my browser, I received a message that told me I was using Perl version 5.16.0. Perlbrew was a success and so was Mojo.

 
10 Comments

Posted by on 2012/05/26 in Tools, web

 

Tags: , ,

Killer new feature

I’m trying to locate an eBook called “Effective Perl Programming (2nd ed)”. It’s a fairly popular book with pretty good recommendations. But what has totally pissed me off is that the one site that I thought was legit, redirected me to one of two commercial sites that either wanted my personal information or wanted me to download their downloader. Can you say malware or privacy?

Boy it would be really nice of the search engines could filter these sites out of my results… and since Chrome is my browser if nefarious links could be removed or highlighted.

And while I’m at it I want some way to reject SMS messages from people who are not in my address book.

 
Leave a comment

Posted by on 2012/05/25 in Tools, web

 

Tags:

Google drive support page useless

Google drive is close to dropbox but adds support for syncing google docs.

Google’s support for the application is severely limited. There is little or no indication of any type of errors. I still have 100 files missing on my target system.

Dropbox is much more reliable.

 
Leave a comment

Posted by on 2012/04/28 in Tools, web

 

Tags: ,

Google Drive – just not syncing everything

[Update 2012-04-28] It was looking like over 100 files failed to sync. And I discovered a couple of things. (a) Google Drive’s desktop app for OSX does not replicate the .DS_Store file. (Yippee). (b) is also appears that if you “touch” or change the file’s timestamp, that is not enough to trigger a “re-copy”. (c) does not copy or process symlinks.

Google Drive is mostly working… but it is simply not syncing all of my files reliably. This would be a critical flaw and a single reason to go back to DropBox.

Yesterday a couple of files were in the Google Drive menu as “failed to upload for unknown reason”. Strangely enough the files were already uploaded and they had been downloaded by one of the other machines. They were Google App files (gdoc and gsheet), however, the sync indicator was on the files and the parent folder icon. What was that all about?

Now I have files with the sync icon all over my filesystem instead of the checkmark. This is a fundamental function/behavior that should not happen.

Sorry I do not have any recommendations… I really like the unified filesystem. It’s so much better than what DropBox does. What that means is that many of the files are just stubs that cause the Google Apps to launch and open the file or do some other action. I’m hoping that this “sparse” file system is extended to regular files.

 
17 Comments

Posted by on 2012/04/26 in web

 

Tags:

Google Drive – ToS cannot stand the test

Some writers have criticized the Terms of Service for Google Drive.It’s nice that someone has time, energy and a law degree in order to take them to task. But while it’s nice to throw rocks at Goliath I’m not certain that they are going to get any real remedy as the ToS is critically flawed in my opinion… sort of a poison pill.

First and formost the ToS requires that I relinquish some rights to the material I’m uploading or allowing to be processed by Google’s services. (a) this is very similar to the verbiage to the other cloud file servers. This is because they are going to compress and uncompress the files in order to be efficient on their side and it’s sort of a request to hold them harmless in a sense because they make mistakes and shit happens sort of a thing… sometimes on purpose and sometimes not. (b) since I/we have been are likely to uploading documents that have various types of licenses assigned to me/you/us that are non-transferable … just because I said it was ok is not going to make it so.

Anyway, this argument and ones like it have already been bantered about with Box, DropBox, SugarSync, and CrashPlan among others. Frankly I do not think that Google is going to read the email you sent with the family recipe for Oatmeal Cookies and open a bakery. (take 5 minutes and do a little light reading on the internet email systems. Most of the email systems are in the clear. Like sending a letter to your grandmother and when it gets to the postoffice someone opens the letter and then sends the letter inside to the postoffice closest to her home. The the postmaster puts it in a new envelope and delivers it to her house. But this only describes some of the ways email is delivered.)

On the other hand a little paranoia is a good thing.

 
Leave a comment

Posted by on 2012/04/26 in architecture, Tools, web

 

Tags: , ,

Django project folder format

It seems that the Django has changed the project directory structure with version 1.4. This stackoverflow post does a good job describing the new layout. I’m in the process of refactoring an asterisk dashboard so that it’s multi-tenant and runs from a single server instead of one per tenant. This is just the first stop.

 
Leave a comment

Posted by on 2012/04/24 in architecture, web

 

Tags:

Where are all the clouds?

I’m about to start comparing cloud server brands. Please help identify the brands and criteria.

BRANDS: rackspace, peer1, amazon. Linode, gogrid, beanstalk, heoku, google appengine.

CRITERIA: phone app, CPU, ram, disk, network, geographic diversity, cost, backup, storage, OS variety, disk persistence, overall system latency, reliability, customer service, PCI.

I would like to compare these services to a home grown solution but my intuition suggests that a performant server org all the required hardware to match these brands will be out of reach for just one or two virtual server instances. I’m taking about 50K USD. Multiple cores, lots of speedy ram, San disk cluster plus spare parts. There is now way to build this on the cheap.

 
Leave a comment

Posted by on 2012/04/13 in architecture, web

 

Tags:

Your Next Web Application Framework?

Suppose you are the person who has to make the decision as to what language and framework your startup is going to use to deploy it’s application.  What would you choose? There are so many interesting and qualified frameworks that are already powering a good portion of the internet.

(You don’t have to know the language and framework but enough to argue what makes it idea.)

What would it be?

For example: I read an article several years ago that strongly recommended Erlang. At the time it was a great idea. The author suggested that using Erlang would attract smart people and keep the actual number of respondents to something manageable. Since then I implemented several applications that in hindsight: (a) impossible to attract new talent. (b) the more time that passes the more fragile the app gets because my detail recollection is fading (c) and it lacks common tools that would make allow generalized apps to give access to “operators” instead of programmers.

Other examples include: perl, ruby, python… mojolicious, rails and sinatra, flask, tornadoweb, and django.

I have my ideas… what are yours?

 
Leave a comment

Posted by on 2012/04/12 in architecture, future, web

 

Tags: , , , , , , , , , , ,

What is so interesting about the Flask microframework?

I get that Flask has a lot of the same design patterns that Ruby’s Sinatra has. I suppose if one used a metadata approach to application construction/deployment that you might be able to basically interchange between them.

I did a search hoping to find out the differences between Flask and Tornado. I was rewarded with a page from the the Flask development doc. The contributor was suggesting that one might link or cascade Flask with either Tornado, Gevent, Gunicorn or some other proxy setup.

While mentioning Tornado the contributor says…

Tornado is an open source version of the scalable, non-blocking web server and tools that power FriendFeed. Because it is non-blocking and uses epoll, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. Integrating this service with Flask is a trivial task:

In the deployment section of the doc Flask makes is clear that the built-in webserver is strictly for development. The reasons are probably very similar to Rails’ webrick but in the case of Flask there are no explanations. Nor is there a recommendation just a list of servers.

I recently deployed a Tornado-ZeroMQ bridge in order to increase the transaction throughput. Sitting in front of the Tornado instance is a traditional webserver like apache, lighttpd, nginx. These webservers are serving static content because that is what they do best and the dynamic requests are passed thru. But why would I deploy lighttpd->tornadoweb->flask? There is plenty of room for improvement here but someone transitioning from sinatra to/from flask could be rewarded.

hello world from their respective websites:
(Flask)

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
  return "Hello World!"

if __name__ == "__main__":
 app.run()

(Sinatra)

require 'sinatra' 
get '/hi' do 
  "Hello World!" 
end
 
Leave a comment

Posted by on 2012/03/22 in Tools, web

 

Tags: , , , , , , , , , ,

iPhone battery life with iCloud

I do not have any proof, however, over the last two days I have had a serious drop in battery life and the only thing I have done is turn on iCloud. Granted I expected that when I first initiated PhotoStream because all of the images that needed to be passed around.

However last night I left the house with 80% battery and while I was sitting in the waiting room of a local hospital (with free wifi that requires a T&C agreement) The battery dropped to 40% within the first hour. The battery was at 20% by the second hour and the iPhone turned itself in the 3rd hour.

Seems to me that iCloud+wifi is just draining the battery but I have no proof.  I’ve turned off iCloud and now let’s see what happens.

 
1 Comment

Posted by on 2012/02/24 in architecture, web

 

Tags: , ,

 
One Page Docs

Creating a library one page at a time.

One Page Bugs

Reducing the friction of writing and fixing bugs or features.

Follow

Get every new post delivered to your Inbox.

Join 223 other followers