Posts tagged 'python'

Back

published on May 21, 2009.
Heads-up! You're reading an old post and the information in it is quite probably outdated.

It’s been a while since I last wrote something; didn’t have anything smart or interesting to say. Not that I do have this time. It’s 4AM and I can’t sleep. Can’t really find the inspiration for work and writing (if you can consider these scribblings as writing). Lots of ssss… stuff happened which had a great impact on my mood and my ability to do something useful. And I just didn’t felt like doing something about it. Until recently…

I was having a couple of beers with a friend of mine, with whom I go to college. After the 3rd beer or so, we came to an idea of submitting a paper to this year’s SISY conference. All I will say for now, that it will include Python, Assembly, microcontrollers, electric motors and lots of other geeky stuff. This project, even while the idea is still only in my head, got my mind running again and might be the way out of this state of indifference. Why? Well, to be able to start this project, I first need to finish my current project, my graduate work. To finish my grad work, I needed to start working on it again (which I did, honest!). I’ll even spend my whole Saturday this week in the college to write/test/debug my app there. If all goes well, the app will be finished this week and I can go onto writing the documentation for the grad work. Everything will go fine, right?

I installed Ubuntu 9.04 on my laptop a few days ago. Loving it! Had only 2 minor issues with the hardware upon the installation. First, the graphic card was messing around, it didn’t want to enable all those funky visual effects. That got sorted out, thanks to @firusvg who suggested to install compiz and @ivan86 who pointed me to this article. Second, when plugged in the headphones, the sound was still coming out on the speakers. @Asgrim sent me this link which helped me to sort this out. Apart from this, everything else works out-of-box. Even the wifi!

OK, enough for now. Here’s to hoping that the bad times are over and the good times are coming. Cheers!

pywst - setting up web projects quickly

published on February 22, 2009.
Heads-up! You're reading an old post and the information in it is quite probably outdated.

I wrote a Python script for automating the steps required to setup a web project environment on my local dev machine that runs on Ubuntu. Called it pywst: Python, Web, Svn, Trac. That’s the best I could do, sorry :P

The main steps for setting up a new project are:

  • Create a virtual host
  • Add it to /etc/hosts
  • Enable the virtual host
  • Import the new project to the SVN repository
  • Checkout the project to /var/www
  • Create a TRAC environment for the project
  • Restart Apache

After these steps I have http://projectName.lh/ which points to /var/www/projectName/public/, SVN repo under http://localhost/repos/projectName/ and the TRAC environment under http://localhost/trac/projectName/.

As I have this ability to forget things, I always forget a step or 2 of this process. Thus, I wrote pywst (note, this is a txt file, to use it, save it to your HDD and rename it to pywst.py). It’s not the best and nicest Python script ever wrote, but gets the job done. All that is need to be done to setup a project with pywst is:

sudo ./pywst.py projectName

2 things are required: to run it with sudo powers and to provide a name for the project.

Future improvements

The first, and the most important is to finish the rollback() method. Now, it only exits pywst when an error occurs, but it should undo all the steps made prior to the error.

Second, to make it work on other distros, not only on Ubuntu. That would require for me getting those other distros, set them up, look where they store Apache and stuff, where’s the default document root, etc. Hmm… This will take a while :)

Third, support PHP frameworks - Zend Framework, CodeIgniter and CakePHP — ZF is a must :P Under support I mean to create the basic file structure for them automagically.

Cheers!

Robert Basic

Robert Basic

Software engineer, consultant, open source contributor.

Let's work together!

If you require outsourcing or consulting help on your projects, I'm available!

Robert Basic © 2008 — 2019
Get the feed