Archive for the 'tech' Category

xorg.conf for Ubuntu Gutsy tribe 5 on IBM Thinkpad t43 2668-75U

This is the xorg.conf file as generated from the Live CD.

# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
Identifier "ATI Technologies Inc M22 [Mobility Radeon X300]"
Driver "ati"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
EndSection

Section "Screen"
Identifier "Default Screen"
Device "ATI Technologies Inc M22 [Mobility Radeon X300]"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1400x1050"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
InputDevice "Synaptics Touchpad"
EndSection

Top 30 Django Tutorials and Articles

As a response to the Top 30 Ruby on Rails Tutorials, I’ve compiled a list of the top 30 Django tutorials and articles. These links are in addition to the great documentation on the Django project site.

For those who don’t know, Django is a Python web development framework that makes development super fast.

The list in no particular order…

  1. Are you generic?
  2. Sending E-Mails via Templates
  3. Django admin for your PHP app?
  4. Hacking FreeComment
  5. the difference between ‘blank’ and ‘null’
  6. Using Django’s TemplateTags
  7. A Django website that took (a lot) more than 20 minutes
  8. Forms With Multiple Inline Objects
  9. Extending Generic Views
  10. Template context processors
  11. Custom SQL In Django
  12. How Django processes a request
  13. Write better template tags
  14. Extending the User model
  15. Django’s Undocumented contenttype app
  16. Django, gzip and WSGI
  17. Django for non-programmers
  18. Django Templates: The Power of Inheritance
  19. Django Templates: An Introduction
  20. Setting up Django on Dreamhost
  21. Django on Windows HOWTO
  22. Django Admin Hack - Fields varying with user permissions
  23. Some django gotchas
  24. Django Templates are not limited
  25. Develop for the Web with Django and Python
  26. An AJAX ComboBox Widget for Django
  27. Using Django’s Free Comments
  28. MochiKit and Django
  29. RSS made stupidly simple
  30. Installing Django on OSX

Note: keep an eye out at Django’s community page for new tutorials and articles.

Related Links

If you have an additional tutorial, put it in the comments.

digg story

Setting Up Tomcat 5 on Ubuntu 6.06

I had mentioned that I’d post a quick how-to on setting up Tomcat 5 on Ubuntu Dapper. So here it is and lucky for me it’s VERY easy.

Translations: castellano

First a quick overview of what we are going to do:

1. install software
2. change 1 line in a configuration file.
3. start the Tomcat5 service
4. go to http://localhost:8180

And now for the good stuff.

First we want to install the right packages. basically we want to install apache2, a java jdk and tomcat (duh). I’ve chosen to use Sun’s java implementation. To install this you need to enable the multiverse repository. See this section of the Unofficial Ubuntu Starter Guide for help with enabling additional repositories. To install Tomcat itself you will also need to have the universe repository enabled.

Note: For Tomcat you MUST have a jdk not just a jre.

So, for the basic install use the following command.

sudo apt-get install apache2 tomcat5 sun-java5-jdk

If you want a shiny Tomcat welcome page when we finally get that far then install the example apps by adding tomcat5-webapps to the end of the last command. For the Tomcat admin web interface add tomcat5-admin, too.

My final command looks like this.

sudo apt-get install apache2 tomcat5 sun-java5-jdk tomcat5-webapps tomcat5-admin

By default Ubuntu uses a free Java implementation. We now need to tell Ubuntu that we want to use Sun Java as the default. Run the following command.

sudo update-alternatives --config java

Then enter the number of the version of Java you want from the list when prompted. The one I wanted was /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.

Now we need to tell Tomcat where the jdk is. Open /etc/default/tomcat5 and change the variable JAVA_HOME to read…

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/

Make sure it’s NOT got a “#” at the start of the line. You can should now be able to start Tomcat5 with…

sudo /etc/init.d/tomcat5 start

Tomcat is listening on port 8180. So open up firefox and enter http://localhost:8180 in the address bar. Once the page loads you should see either a tomcat welcome page or, if you chose not to install the examples and admin packages, a fairly empty page with “Apache Tomcat/5.0″ at the bottom left. Congrats, you just installed a working Tomcat service. If you don’t see one of these pages, either you or I screwed up. ;)

If you installed them, the example apps can be found in “/usr/share/tomcat5/webapps/“. Also take a look at the configuration files in “/etc/tomcat5/“.

Hope that was helpful.

Update: Manolo Canga added a section in his Spanish translation of this tutorial that I’ve translated into English below.

Setting up an admin user

If you try to use the admin interface you’ll find you can’t because no admin user has been set up. To resolve that go into /var/lib/tomcat5/conf and edit tomcat-users.xml. You’ll see that 3 users have been created by default. We’re going to change the password of the user “tomcat” (<user username="tomcat" ) to something better than the default of “tomcat”. Duh!? Now we are going to give the user “tomcat” admin access. Add “admin” to the user tag’s roles attribute. It should look smilar to this.

<user username="tomcat" password="your_password" roles="tomcat,admin"/>

Now restart tomcat…

sudo /etc/init.d/tomcat5 restart

…and you’re done!

Sleep Deprivation and Being a Loser

On Sunday I installed Ubuntu 6.06 (Dapper) at Sprachenatelier Berlin e.V. a small language school in Friedrichshain. It took all night and I’m still not finished. Someone had installed a Tomcat server that was serving a custom jsp app. Having never installed tomcat nor having ever developed Java Server Pages and only finding out about it when I arrived I didn’t have enough time to do all the other thngs plus learn about tomcat and install jsp apps. So I installed Ubuntu on the 4 “student” computers and left the 2 office computers for some time in the next couple days. On Monday in the comfort of my own home I learned about Tomcat and I had everything running in an hour or so. I also wasted a good amount of time ridding the single duel-boot Windows install of viruses and spyware.

I’ll do an Ubuntu 6.06/Tomcat install how-to soon. No, really… I promise. :)

On Tuesday Annika and I packed a picnic and went to the Fan Mile to watch the Germany vs. Italy match. Of course, Everyone knows the outcome of that. I was so looking forward to the penalty shoot-out. Oh well. May Italy suffer a humiliating defeat in the finals. They are such whiners; falling at the slightest touch. I’m hoping Portugal wins it all now.

Mysql, JDBC and relationships in Openoffice.org 2.0.x

By default when attempting to create a relationship by way of Tools > Relationships… in OpenOffice you’ll get an error that relationships are not supported. However this is not true if you are using the InnoDB tables. In order to enable relations you need to add overrideSupportsIntegrityEnhancementFacility=true to your connection string. So where do I do that you ask? Simply append the option to the end of your Name of the MySQL database field preceded by a “?”. Just right click on the database name and choose Propeties to get there. Mine looks like this now…

test?overrideSupportsIntegrityEnhancementFacility=true

…with test being the database name.

This will work with both the Mysql Connector/J 3.1 and 5.0

Father of the WWW on Net Neutrality

Tim Berners-Lee, the inventor of the World Wide Web, has a short journal entry and also a video of his take on Net Neutrality.

He is just one of many people who support Net Neutrality. In my last entry on the subject I quoted Scott Cleland of NetCompetition.org, an opponent of network neutrality. He listed in his NPR article a couple supporters of Net Neutrality. Here I would like to link to a fuller list of supporters on both sides.

Net Neutrality supporters ..and even more.

Net Neutrality opponents ..and more.

You decide who has the more genuine (read non-money) interest in internet freedom.

You can see the Net Neutrality proponents answers to the opponents arguments here.

Keyboard shortcut for changing search engine in Firefox

If you want to change the Firefox search engine from the keyboard here is what you do.

Ctrl + k --gets you to the search box
Ctrl + Up or Down --switches the search engine.

Now my life is complete.

God Save Net Neutrality

Slashdot has and interesting post about Net Neutrality. It deals with one pro and one con article published by NPR. The con article is written by Scott Cleland of NETCompetition.org, a telecom-funded org. Astroturfing comes to mine. The pro article is from Craig Newmark, creator of craigslist.org.

The first question I ask myself before reading the article is, “who do I trust more?” Craig wins here. He has more than proven his integrity. Scott, as a paid mouth-piece of the telecom industry doesn’t get my trust.
In Cleland’s article he says quite a few things that are misleading and obviously intended to instill fear. Some examples…

They want Congress to pass a new law to ban that practice by regulating the price of broadband service and the way it’s sold.

See the last paragraph of this post as a comment to that.

First, net neutrality is really a misnomer. It’s really just special interest legislation, dressed up to sound less self-serving. Did you know Microsoft, Google and Yahoo are lobbying for net neutrality?

Um, and who finances your “cause” Mr. Cleland? The Net Neutrality proponents seem a little more eclectic than Clelend’s telecom-funded cause. The last sentence is easy to counter. I’ll try… Did you know AT&T, Verizon, Comcast, etc. are lobbying for net ‘competition’?

Now, net competition proponents, like me, believe that the best way to guard a free and open Internet is to maintain the free and open competition that exists today, not create a new government-monitored, socialized Internet.

So free and open are the terms for his cause and government-monitored and socialized are the terms for the the Net Neutrality folks. Has any one heard about AT&T allowing government-monitoring without even a court order? Oh, I think they are referring to another type of government-monitoring here.

Amazingly, the proponents of this radical change in policy don’t even have any real evidence of a problem, only unsubstantiated assertions about hypothetical problems.

Actually, such unsubstantiated assertions about hypothetical problems have led to much greater actions in the US. For example, a war. Of course, these unsubstantiated assertions about hypothetical problems have proven to be wrong so it’s admittedly a a bad example. But what do we have from the telecom side to assure that these unsubstantiated assertions about hypothetical problems don’t become true? Only your campaign to make/keep these possibliities around.

And it would also mean less privacy for all Americans, as net neutrality would require more government monitoring and surveillance of Internet traffic.

Have I already mentioned that AT&T and friends allowed government-monitoring without even a court order? So how exactly would this reduce my privacy any more than your funders already have?

If they’re successful, they’ll get a special, low-government-set price for the bandwidth they use, while everyone else — consumers, businesses and government — will have to pay a competitive price for bandwidth.

Actually they already pay for their bandwidth. I know I pay for my server’s bandwidth. The price is currently quite low. I have never heard google complaining that there bandwidth cost is too costly. In fact, they consider the cost to power their data center more of a worry than bandwidth costs. What the content companies and a huge majority of content consumers don’t want is a toll gate as Craig mentions. I want to be able to choose what I want to see at a speed and quality not regulated by a middle-man.

I as a consumer pay the telecoms for my usage and the content providers pay for the bandwidth coming from their servers. As more users and content creators get online the telecoms make more money. The traffic demand per entity will also grow and this will require more infrastructure. This is exactly what both sides are already paying for now. If it’s not enough it’s only because the telecom shareholder’s demand for higher margins is to blame.

If you ask me, government regulation is better than the corporate regulation that Mr. Cleland supports. Governments by definition are there to govern. Corporations are there to make money for shareholders. Yes Google, Microsoft and Co. are also corporation but as I said before they are only a small part of the Net Neutrality supporters where as the Net ‘competition’ supports are by and large telecoms.

Give me an internet without toll booths.

In search of the perfect vimrc

I’ve been using Vim for the last couple years on and off. Over the last few months (since the Vim 7 release) I’ve been forcing myself to use it exclusively. To make working with Vim more intuitive for me, I’ve been trying to get my vimrc just right. Of course, this will probably be a never ending quest.

Currently it looks like this…


" set appearance
syn on
colorscheme torte
set vb " visual beep instead of audible beep
set nu

" tab behavior
set ai
set tabstop=4
set sts=4
set et
set shiftwidth=4

" backspace behavior
set backspace=2
set backspace=indent,eol,start " redundent?

" backup behavior
set backup
set backupdir=~/.vim/backup/

" search behavior
set incsearch

I’ve been googling and adding, googling and adding. I’ve tried to avoid the complicated stuff so far. The vim documentation is great but a little overwhelming at first. Jonathan McPherson has a nice series of articles that gives a really friendly intro to Vim.

I’m mostly doing python programming so if you have any tips please leave a comment.

Tracking Ubuntu Adjectives

Ubuntu’s quite known for its {obscure adjective} {animal} release names. I though it might be interesting to see how the Ubuntu release cycle affected the {obscure adjective}s’ search volume. I turned to Google Trends and did a query for each of the {obscure adjective}s. The results were quite interesting.

Warty wasn’t even on the chart before the initial Ubuntu release and the Hoary release showed the first clear jump in queries. It looks like the Ubuntu’s popularity really took of with the release of the Breezy Badger release and the Dapper Drake (current) release will soon top Breezy. Edgy just crossed Hoary and I suspect it will increase dramaticaly once the Ubuntu Developer Summit in Paris is finished and the work for the next release (Edgy Eft) gets underway.