Josh Benham The teachings of a student

14Mar/120

Setting up a Pyramid project from scratch on Ubuntu 11.10

Recently i have been getting into more Python and have been using the Pyramid framework. Pyramid framework is a micro framework for Python kind of like Sinatra for Ruby.

So here is a quick guide showing you how to set up Pyramid on an Ubuntu 11.10 base install in only 6 steps.

1. First thing to do is make sure that python setup tools are installed

sudo apt-get install python-pip python-dev build-essential

2. Next we want to install virtualenv as we will keep all our packages in their own virtual environment.

sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv

3. Create your home directory and cd into it

mkdir PROJECT_NAME
cd PROJECT_NAME

4. Create a virtual environment and activate it

virtualenv env
source env/bin/activate

5. Install pyramid framework and start an empty pyramid project

env/bin/pip install pyramid
env/bin/pcreate -s starter PROJECT_NAME

6. Go into the project. Run the set up script and run the website using Pyramids own little server

cd PROJECT_NAME
../env/bin/python setup.py develop
../env/bin/pserve development.ini

Once you have done that it will return the IP and Port that it is running the webserver on and you use that in the browser. THAT IS IT!

22Sep/110

Sublime Text 2 and the Vala programming language on elementary OS

Today i am going to show you how to install the new beta Sublime Text 2 editor with the addition of also adding a Sublime Package to add Vala support seeing as most elementary applications are starting to be built in the Vala programming language as it is the preferred language to use for elementary OS.

First thing you will need to do is to go to http://www.sublimetext.com/2 to get version 2 and click on the download link for the version that you need. In my case i will be downloading the Linux 64 bit version of the current build which is at 20111 (which probably doesnt mean a whole lot at this time).

Once you have downloaded Sublime Text 2 extract it to where ever. In my case i have an Applications folder in Home which i will install it to. Then inside that folder you will see an executable file called sublime_text. Click on this as it will create a whole lot of files that you will need later on. Then close Sublime so we can install the Vala Package.

The good thing about Sublime Text 2 is that a lot of the TextMate packages are also compatible with Sublime Text 2 so go to https://github.com/technosophos/Vala-TMBundle. So you can go to this page to install the Vala package or you can continue and we will install it through Github.

If you do not have Git installed go to your terminal and type:

sudo apt-get install git-core

Installing Git

Once you have installed git go to the Sublime Packages folder and install the Vala Package.

cd .config/sublime-text-2/Packages/
git clone git://github.com/technosophos/Vala-TMBundle.git Vala

Installing Vala Package

Now there we have it. Now just open up Sublime Text 2 and folders to your project and start programming in Vala with nice syntax highlight.

Squish Vala Program

15Sep/115

Installing elementary OS Luna Development Build

Today i am going to take you though the easiest way to install the development version of elementary OS Luna. Keeping in mind that Luna is still very alpha and I wouldn't suggest you install it on your main computer because to put it lightly ..... shit might break!

The easiest way as of TODAY (that i am aware of) to install elementary OS is by installing Ubuntu Oneiric Alpha 3 and going from there. At the moment I am assuming you know how to install Ubuntu so I will skip that part.

One you have installed Ubuntu we are going to update the system to have all the latest packages. Open up the terminal and type this:

sudo apt-get update && sudo apt-get upgrade

Upgrading Oneiric

Add in both PPA's into software sources:

# Elementary Development PPA
deb http://ppa.launchpad.net/elementaryart/elementary-dev/ubuntu oneiric main
deb-src http://ppa.launchpad.net/elementaryart/elementary-dev/ubuntu oneiric main 

# Elementary Unstable Upstream
deb http://ppa.launchpad.net/elementaryart/unstable-upstream/ubuntu oneiric main
deb-src http://ppa.launchpad.net/elementaryart/unstable-upstream/ubuntu oneiric main

Software Sources

Once you have done this it is now time to update the PPA's and install elementary!

sudo apt-get update
sudo apt-get install elementary-desktop

Installing Elementary Desktop

Once this has finished restart your machine and now at the login screen we click on the dropdown and choose Pantheon instead of Ubuntu.

Pantheon Desktop

Once this has done you have finished and you can start playing around with the unstable packages of elementary Luna like so:

Elementary System

Remember that whenever you want to keep your system up-to-date with the 'unstable' packages in the PPA's we added we need to run:

sudo apt-get update && sudo apt-get upgrade

I tend to run this once a day and i am getting a lot of updates because Ubuntu and elementary are so heavily under development at the moment!

If you have any questions feel free to leave them as a comment. I am not a developer or a designer of elementary just a fan of it and would still love feedback!