Friday, May 6, 2011

Opening up the Box for our Youth and Future

I think it's important that people have the freedom to open up any 'box' they purchase and understand how it works, modify it, and do something new and creative with it. When you lose the ability to change the way something works, you put yourself at an extreme disadvantage.

For example, a Pak 'n-Sav in Hamilton opened on Good Friday... with no employees present. Someone forgot to program the building not to turn on the lights or open the doors as it does normally each day.

Apple II


When I was is school, it was actually mandatory that we learn to program computers. We had a computer lab with a bunch of Apple II machines with green screens. We'd write some simple BASIC programs that had a number in front of each line to control the order of the commands and which one to GOTO next.

GO TO '10'


In college, one of my professors designed a programming language he named after Bacchi which was laid out visually using a mouse. It generated computer code suitable compilation into programs. Fairly novel back in 1994, but it appears we have evolved.

Nowadays, a waterbear isn't just an small animal popular with scientists in labs, it's also a new visual programming language. It just runs in any HTML5 compliant web browser (basically anything pretty recent). You can try it out at waterbearlang.com



So great, now we have a visual language that we can write scripts to run on the web, but what about getting underneath the hood and understanding how to write something more complex. How about giving cheap computers away that can fit on your keychain?

The lead guy over at the software company Frontier Games has designed a new small computer that will cost around $15-25 and can be given away to students to help them learn how computers work. It will probably run Ubuntu and it sounds like we are about 12 weeks away from seeing them on the market.

HDMI/TV out on the left, keyboard on the right. Computer in the middle.


But for the short term, we have some free training next week from some folks that know a bit about programming. Google has a programming event  in San Francisco that you can attend via the net for free next week. They often reveal new technology that may affect the future as we know it.

It's our future. What will we make of it?

I say we start with open minds and boxes.


ps. I'm looking for work in the Tauranga area. If you are a technology company please send me an email or call/txt me at 022-077-5899.

Thursday, March 10, 2011

ChiliProject up in minutes on Heroku w/ Gmail and S3

Requirements

  • Heroku account
  • Gmail account ( or sendgrid account ) if you want to send email
  • Amazon S3 account if you want to store documents and files
The S3 account requires a credit card to setup, but has a free tier
with 5 GB of Amazon S3 storage, 20,000 Get Requests, 15GB of bandwidth
each month.



Walk-through

ChiliProject via git

mkdir groupprojects
cd groupprojects
git init
 
git remote add chiliproject https://github.com/chiliproject/chiliproject.git
git fetch chiliproject
git merge chiliproject/master
 
git add .
git commit -m 'clean version of base code' 

Heroku, Giternal and Rails via Bundler

# create the Gemfile
cat << EOF | tee Gemfile
source :rubygems 
gem 'rails', '2.3.5' 
gem 'i18n', '0.4.2' 
gem 'giternal' 
gem 'heroku' 
EOF
git add Gemfile
git commit -m 'Added Gemfile for rails, i18n, heroku, and giternal' 
 
# install bunlder then use it to install the gems in the Gemfile
gem install bundler
bundle install

Heroku App

Let's configure a place to push the code to! Choose your name well as
it sets up up my-project-name.heroku.com, so choose a good unused name.

heroku create my-project-name
All the configuration should happen with heroku config environment
variables. We'll put the at the beginning of each section, then
install components and configure them to use the ENV variables.

  • Note that this just configures environment variables on the heroku instance. We would need to export these to the local environment to do any local development.

Session Store and Secret

heroku config:add SESSION_SECRET=`ruby -e 'require "rubygems" ; require "active_support" ; \
   puts ActiveSupport::SecureRandom.hex(40)'` 
cat << EOF | tee config/initializers/session_store.rb
ActionController::Base.session = { 
  :session_key => '_redmine_session', 
  :secret => ENV['SESSION_SECRET'] 
} 
EOF
git add -f config/initializers/session_store.rb
git commit -m 'Added session key and secret to be populated via env variables' 

Gmail

heroku config:add GMAIL_SMTP_USER=username@gmail.com GMAIL_SMTP_PASSWORD=your-password
cat << EOF | tee config/giternal.yml
action_mailer_optional_tls: 
  path: vendor/plugins
  repo: http://github.com/collectiveidea/action_mailer_optional_tls.git
EOF
git add config/giternal.yml
 
giternal update
sed -i '' "\:vendor/plugins/action_mailer_optional_tls:d" .gitignore
 
git add vendor/plugins/action_mailer_optional_tls/
 
cat << EOF | tee config/initializers/gmail_tls.rb
if ENV['GMAIL_SMTP_USER'] and ENV['GMAIL_SMTP_PASSWORD'] 
  ActionMailer::Base.perform_deliveries = true 
  ActionMailer::Base.smtp_settings = { 
    :address => "smtp.gmail.com", 
    :port => 587, 
    :authentication => :plain, 
    :domain => ENV['GMAIL_SMTP_USER'], 
    :user_name => ENV['GMAIL_SMTP_USER'], 
    :password => ENV['GMAIL_SMTP_PASSWORD'], 
    :tls => true 
  } 
end 
EOF
git add config/initializers/gmail_tls.rb
git commit -m 'Added support for GMAIL that comes from ENV' 

Amazon S3

heroku config:add S3_ACCESS_KEY=your-access-key S3_SECRET_KEY=your-secret-key S3_BUCKET_NAME=your-bucket
 
cat << EOF | tee -a config/giternal.yml
redmine_s3: 
  path: vendor/plugins
  repo: https://github.com/edavis10/redmine_s3.git
EOF
git add config/giternal.yml
 
giternal update
 
sed -i '' "\:vendor/plugins/redmine_s3:d" .gitignore
git add vendor/plugins/redmine_s3/
 
cat << EOF | tee config/s3.yml
production: 
  access_key_id: <%= ENV['S3_ACCESS_KEY'] %>
  secret_access_key: <%= ENV['S3_SECRET_KEY'] %>
  bucket: <%= ENV['S3_BUCKET_NAME'] %> 
  cname_bucket: false 
 
development: 
  access_key_id: <%= ENV['S3_ACCESS_KEY'] %>
  secret_access_key: <%= ENV['S3_SECRET_KEY'] %>
  bucket: <%= ENV['S3_BUCKET_NAME'] %> 
  cname_bucket: false 
EOF
git add config/s3.yml
 
git commit -m 'Added s3 configuration that pulls keys and bucket from env variables' 

plugin assets

This dir needs to exist on heroku side, and is populated when the
plugins are installed. However git doesn't track directories, only
files.

mkdir public/plugin_assets
echo this must exist >  public/plugin_assets/README
git add -f public/plugin_assets/README
git commit -m 'Added plugin_asset dir for Heroku' 

pushing our code out to the configured heroku instance

First we push our local changes out, this may take a bit as we are uploading all our code.

git push heroku master
Now that our code is up, we want to setup the database and load
the default data set.

heroku rake db:migrate
heroku rake redmine:load_default_data REDMINE_LANG=en
You could login at this point, but it might be interesting to go ahead and disable the default admin account and create our own.

# lock default admin user account
heroku console "x=User.find(1) ; x.lock ; x.save" 
 
heroku console "user = User.new { |u| u.login='hacker'; \
       u.firstname='Hippie'; u.lastname='Hacker'; \
       u.mail='hhh@hippiehacker.org'; \
       u.admin=true; u.language='en'; \
       u.password='XXXXX' } ; \
       user.preference=UserPreference.create!(:time_zone=>'Auckland') ; \
       user.save! " 
There are a few settings you'll probably always want to set right off. Here's how to do it programattically.

# get your hostname and settins your URL value within the app settings
heroku console "setting = Setting.find_or_create_by_name('host_name') ; \
       setting.value=ENV['URL'] ; setting.save! " 
 
heroku console "title = Setting.find_or_create_by_name('app_title') ; \
      title.value='Our Little Cows' ; title.save! " 
 
heroku console "setting = Setting.find_or_create_by_name('welcome_text') ; \
       setting.value='Yet Another Cool Website' ; setting.save! " 
Format the heroku config for use as local variables:

heroku config --long | sed s/\>// | sed s/\^/export\ / | sed s/\ \*\=\ \*/=\"/ | sed s/\$/\"/
Finally launch the site in the browser.

heroku open

Monday, August 30, 2010

Home Brew solar powered cell phone towers now a reality

I knew it would be a big thing back when I saw software radios being introduced back in the late 90's that could run open software, but not setting up inexpensive cell phone networks has become a reality and I know I want to be involved. For around $4500 you can setup a cell phone tower that is solar powered, self contained and can be used to bring voice calling and texting to an area that has absolutely no service. Connect that to the internet, and you have international calling at extremely reasonable rates. Ability to set this up in a relief zone where there is no infrastructure? Priceless.

Tuesday, August 24, 2010

SHSH Blobs and Installing Older Versions of iOS

We have several iOS devices, and all of them are jailbroken. Apple put restrictions on what versions of their software you can run on the hardware you purchased from them. They literally say today you can install version X, but tomorrow you can only install version Y. When you try to install the operating system on your iPhone/iPod/iPad, they make you ask them (over the internet) if it's ok! I think that the walled garden they are trying to create started feeling like a prison long ago.

The technology they use to keep the door of the prison shut is based on digital signatures. You have to get an apple 'signature of permission' to install a particular version of the operating system that runs on the device. This signature is specific to both that exact device and software version combination. You can and should save these digital 'signatures of permission' so that you can install older software after apple decides to stop granting permission.

I recently had to do that myself using a combination of Firmware Umbrella and the fact that Saurik's Cydia retrieves and stores these signatures for you if you ask it to. If Saurik has your specific device + software version signature, then you can ask him for it when you try to install new software on your phone.

Basically you change your computer to go to Saurik's server at 74.208.10.249 when you ask to goto gs.apple.com. It pretends to be that apple server that hands out signatures (or that refuses to once they choose to force you to upgrade). I was stuck for a while until I realized that you need to put the device in DFU mode.



Even if you don't want to jailbreak for whatever reason, I would suggest saving your 'signatures of permission' (SHSH blobs) with Firmware Ubrella.

Homebrew Apple Club

Let's take a mental meandering back to the beginning of Apple in the mid '70s. The original Apple computers where hobby, for-fun machines. Heck the schematics for the Apple I were passed around at the early meetings of the Homebrew Computer Club and Wozniak himself (co-founder of Apple) would go to people's houses and help them build their own. Freely exchanging, modifying, and giving software and hardware designs back to the community was the norm.

Fast forward into the early 80's and you see a shift in that open culture. Most companies adopted copyright and restrictive licenses to limit or prohibit copying or redistribution. Richard Stallman had been modified the software for printers to work well at MIT before Xerox showed up with one of the first laser printers. He was quite frustrated when Xerox would not give him access to the source code so he could utilize the improvements he had used on the previous printers. For the first time we began to see centralized control of the functionality of the hardware we purchase.

Stallman went on to found the Free Software Foundation, and write the General Public License upon which Linux is based.

Free software is simply software that respects our freedom — our freedom to learn and understand the software we are using. Free software is designed to free the user from restrictions put in place by proprietary software, and so using free software lets you join a global community of people who are making the political and ethical assertion of our rights to learn and to share what we learn with others. - Working Together for Free Software

Not being able to share software shortly extended to not being able to share music, and then electronic books. Much of this being controlled by Digital Restrictions Management (DRM) software which limits how you can read, view, or listen to books, video, and music. Of course Apple is on the forefront of this.



Apple's iPod/iPhone/iPad software, now called iOS, is designed not only to control and restrict the books, music, and content you can listen too but also the applications. They would like to keep track of every piece of software you have and make sure you can only buy it from them. We've gone from sharing everything that can run on a computer with each other to requiring that you have a credit card and billing address tied to an iTunes account so that we can run even free applications!

The limitations that Apple puts on what we can run on the hardware we own are arbitrary and we are not bound by them. Essentially they would prefer us to sit inside a jail they control. It's a silly prison that it's very legal to just break out of. To break out of this jail, you just have to open the door. However they keep making the door harder and harder to open. The software they would prefer you run on your iPhone is one they completely control.

This is a big jump over the past 30 years from helping people build the hardware from scratch in their homes. Apple, I'm disappointed. You are becoming the dispensary of Information Purification Directives in your walled garden of iOS.
Why do I feel like I'm staring at a big iPad in the 1984 commercial?




Text of "1984"


Today, we celebrate the first glorious anniversary of the Information Purification Directives. We have created, for the first time in all history, a garden of pure ideology. Where each worker may bloom secure from the pests of contradictory and confusing truths. Our Unification of Thoughts is more powerful a weapon than any fleet or army on earth. We are one people, with one will, one resolve, one cause. Our enemies shall talk themselves to death and we will bury them with their own confusion. We shall prevail!

We shall prevail indeed...

Monday, August 23, 2010

Boulder Bohemian will code for karma - Boulder Daily Camera

The Daily Camera did an article on me about two years ago. I sure do miss my '79 VW Bus Wally, but the spirit moves on as a friend told me about the song "free" by the Zac Brown Band. It's a fairly repetitive song, but does reflect Shalom and my life pretty well up to this point:


So we live out in our old van
Travel all across this land
Me and you

And we'll end up hand in hand
somewhere down on the sand
just me and you

Chorus:
Just as free
Free as we'll ever be
And ever be

We drive until the city lights
dissolve into a country sky

lay underneath the harvest moon
Do all the things that lovers do
Just me and you

Chorus...

No we don't have a Lot of money
No we don't have a Lot of money
No we don't have a Lot of money (X 10)
All we need is love

Chorus..

So we live out in our old van
Travel all across this land
Me and you