Techmania

July 7, 2009

Radeon 3400 on Lenovo T400 and Ubuntu Jaunty Jackalope

Filed under: Uncategorized — mifan @ 10:02 am

Recently ran into problems with my new Lenovo Thinkpad T400 and the Video Card.

Problem: The internal Intel card worked fine. The T400 contains switcheable-graphics which can switch between the Intel Card (low-performance for power saving) and the ATI radeon mobility 3400 series card (high performance). In some OS, automatic switching occurs based on the power status. Unfortunately, Ubuntu, and the latest version I’m using – Jaunty Jackalope a.k.a 9.04, doesn’t support this. What’s more is that since the Intel card is set as the primary card, that is what Ubuntu detects.

Solution: To install the ATI Mobility driver, do the following:

  1. Reboot the T400, and go into the BIOS setup
  2. Under Config, select Display
  3. Change from Switcheable-Graphics (both cards) to Discreet Graphics (ATI). Integrated Graphics is the Intel card.
  4. Disable OS Auto-detection of Video Cards
  5. Save and Exit (F10)
  6. Boot into Ubuntu, go into menu: System->Administration->Hardware Drivers
  7. Install the ATI driver given there – Ubuntu will automatically do this for you

Everything’s up and running after this (a reboot maybe required), and ATI’s proprietary fglrx driver should be installed. The ATI Catalyst Center should be under Applications->Accessories->ATI Catalyst Control Center.

However, I did experience a lot of flickering – especially when Google Earth was running – I also couldn’t watch movies in the full screen mode.

This fix worked:

  1. Install the latest version of the ATI Catalyst Center. I installed version 9.6
  2. URL: http://support.amd.com/us/gpudownload/Pages/index.aspx
  3. Select the correct version for your architecture.
  4. Assign permissions to your downloaded file:    sudo chmod +w <filename.run>
  5. Run the installation:   sudo ./<filename.run>
  6. Once finished, reboot into Linux. Everything worked fine for me hereonwards.

January 21, 2009

Adding Google Calendars to Evolution

Filed under: Uncategorized — mifan @ 10:21 am

Evolution Calendar offers a great way to manage tasks – reminders and all. And the popup tasklist in the taskbar is even greater. Google calendar on the other hand also offers a wide variety of benefits for an online calendar client. Here is a way to see all your Google calendar items from within Evolution – and thus letting you go offline with your GCal stuff in Evolution.

Ok – there seems to be some bugs overall which restricts 2 way sync between Google Calendar and Evolution (2.22.31) – however for simple calendars, here goes:

1. Create your calendar in Google Calendar
2. In the Evolution (2.22) mail client, select New->Calendar
3. Set the type of the calendar to Google
4. Give a name for your Calendar such as “Conquest of the Shire Timeline”
4. Enter your google account username in the Username section
5. Click OK, and enter your Google account password in the resulting box
6. Sit back and view your Google calendar in Evolution

There seems to be some bugs in accessing multiple calendars from the same account too. Anyways, as a workaround, you can add calendars as ICAL:

1. In your Google calendar account, within the specific calendar settings, copy
the ICAL URL.
2. In Evolution, create a new calendar of the type “On the Web”
3. Enter the ICAL URL in the URL section: replace the ‘http://’ section with ‘webcal://’
4. The other steps are similar to the Google setup given above

Enjoy…

November 18, 2008

Maps for Advocacy: An Introduction to Geographical Mapping Techniques

Filed under: Uncategorized — mifan @ 9:51 am

TacticalTech recently released Maps for Advocacy: An Introduction to Geographical Mapping Techniques. This book is very informative and nicely edited, and gives an overview of mapping techiques to a new user. I had the priviledge of contributing to this wonderful piece of work, and I received my complimentary copies today. A must read for everyone. Good work, TTC.

September 2, 2008

Cows Point North

Filed under: Uncategorized — mifan @ 8:32 am

Interesting article in the Telegraph about how Cows automatically point to the north.

Dr Sabine Begall and colleagues from the University of Duisburg-Essen looked at thousands of images of cattle on Google Earth in Britain, Ireland, India and the USA. They also studied 3,000 deer in the Czech Republic. The deer tended to face north when resting or grazing.

Wow. And to know that the cow in my backyard can be used as a very handy compass :) . This comment on Slashdot summarizes it all:

Having an edible compass would come in handy if you get lost.

July 9, 2008

Facebook chat on Pidgin

Filed under: Uncategorized — mifan @ 11:33 am

My friend Gunith mentioned that there was a plugin to integrate Facebook chat into the Pidgin instance messenger – and obviously, I tried it the very next day, and am glad to mention that it rocks :)
Pidgin is an all-in-one instance messenger client, formally known as GAIM. Facebook-chat is one of the latest additions to its ever-growing list of supported protocols. To install the Facebook plugin for Pidgin (assuming you have Pidgin in the first place), select the appropriate package from Google Code and install it. If you use Debian/Ubuntu, then grab the .deb package, and install it via
sudo dpkg -i [name of package]
Next, go into Accounts->Manage in Pidgin, and add a new IM account. You should see Facebook-chat as an option in the protocol section. Select it, enter your account details, and accept it, and hey presto, your Pidgin should be Facebook-chat enabled.

qGIS on Ubuntu Hardy

Filed under: Uncategorized — mifan @ 8:19 am

I’m a big fan of qGIS, my favorite GIS desktop client. I recently upgraded to Ubuntu Linux 8.04 LTS, a.k.a Hardy Heron, and was amazed to find that qGIS was no longer part of the standard Ubuntu repositories, which is absolutely dissapointing – anyways, here is a workaround to getting qGIS installed on Ubuntu. Of course, compiling from source is always an option, but I’m going with the ‘Ubuntu way’ here.
The latest version of QGIS for Ubuntu is available at http://ppa.launchpad.net/qgis/ubuntu/. Add this entry:
deb http://ppa.launchpad.net/qgis/ubuntu/ hardy main
to your Sources list, usually available at
/etc/apt/sources.list
And Update your Ubuntu sources:
sudo apt-get update
Now install qgis:
sudo apt-get install qgis

However, when I tried starting qGIS from the command line, I got the following 2 errors/warnings:

Couldn’t load SIP module. Python support will be disabled

And

Couldn’t load PyQt bindings. Python support will be disabled.

The above 2 can be corrected by installing the following packages in Ubuntu:
sudo apt-get install python-sip4
sudo apt-get install python-qt4
And with the above steps completed, I now can run QGIS again. Viva GIS :)

July 2, 2008

Debugging PHP in Eclipse using XDebug

Filed under: Development, FOSS, Linux — mifan @ 12:44 pm

My previous post touched upon the basics of getting Eclipse PDT (PHP Development Tools) up and running for PHP development. In this post, we’ll be looking at getting PHP debugging capabilities into our PHP dev environment. Again, I’ll be focusing on Ubuntu Linux – 8.04 LTS to be specific: however, with minor changes, this can be used on any platform.

Of course, there are simpler methods of debugging PHP scripts: a var_dump is quite handy in terms of simple debugging – however, having the right tools at hand for development means that we can spend more time in actual development than writing debug statements every once in a while – anyways, that’s my take.

XDebug is a remote debugger. Here we’ll take a look at getting XDebug working with Eclipse PDT providing a full debugging client. The first step would of course be to get Eclipse PDT up and running (refer previous post if needed). Once done, the next step would be to get Xdebug for our PHP environment set up – in my case, PHP5. On Ubuntu, this can be achieved by:
apt-get install php5-xdebug
This should install Xdebug for PHP5. Next, we’d configure Xdebug by editing the PHP configuration file. Most systems require the configuration items be added to the main php.ini, or the appropriate conf file. In Ubuntu 8.04 LTS, a separate configuration file,xdebug.ini, is created for Xdebug. Open this file using your favorite text editor (vim in my case):
sudo vim /etc/php5/conf.d/xdebug.ini
Add the following lines after the zend_extension= or zend_extension_ts= conf value.

xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"

And restart your web-server. In my case, Apache:
/etc/init.d/apache2 restart
To try out the debugger, open a PHP project in Eclipse (if you are importing an existing project via CVS, remember to add it as a PHP project using the New Project Wizard). In Window->Preferences->General->Web Browser, select external web browser, and set it to point to your default web browser. Next go into the debug section, by Window->Preferences->PHP->Debug, and set the PHP Debugger option to XDebug (by default this is set to the Zend Debugger). Note the chekbox “Break at first line” in this page as well – you can change this later on, as required. After you’ve applied your changes, go into the Debug menu, by Run->Open Debug Dialog… Here, make sure the Server Debugger is set to XDebug, and that the PHP server points to http://localhost or an appropriate server location. The file section should point to the file to be debugged, relative to your workspace (Note: if your project is missing from the list, check whether you’re project is configured as a PHP project – I’ve noticed that non-PHP projects fail to appear on this list). Thus if your file is index.php, the relative path maybe something/www/index.php etc.
Next, check the URL section to see whether it points to the correct location – if not, make sure you uncheck the “Auto-Generate” check box, and enter in the correct location. Apply the changes and close the dialog box.
A view of the Debug dialog is here:
EclipsePDT Debug Dialog
You should now be ready to debug your application. Click on Run->Debug or F11 to enable debugging – Eclipse should switch to the Debug View, and the page should start loading in your external browser. If “Break at First Line” checkbox was checked previously, then the program would have “stopped” at the first line – you can step into or step over subsequent lines using the controls on your top left corner. Alternatively, you can place breakpoints at various locations and stop code execution there as well. The variables tab should give you the variables and their values at various times. I good guide from which I borrowed from is here. Get creative – start debugging.
A view of the debugger in operation is here:
EclipsePDT XDebug for PHP

PHP development with Eclipse PDT

Filed under: Development, Linux — mifan @ 9:48 am

In this post, I’ll be outlining the steps to get a fully functional PHP IDE setup. I’ll be using the Ubuntu Linux way of installing stuff, but you can replace it with any repository or online location as needed. First things first, the ingredients: Sun Java 6, Eclipse Europa 3.3, Eclipse PDT. I’m using the latest version of Ubuntu at the time of writing: Ubuntu 8.04 LTS Hardy Heron.

Get the JDK: in Ubuntu, the latest version can be obtained by
apt-get install sun-java6-jdk
which installs the Sun version from the Sun Java website. If you already have GCJ (the GNU JDK), better replace it with this. Installing Java from the Ubuntu repository instead of downloading it manually from Sun means that you don’t have to muck about creating symlinks to Java and the likes – everything’s done for you. Next, install Eclipse. Eclipse is available as a Ubuntu package, but since Hardy Heron contains version 3.2 (not 3.3, which is required for the latest version of PDT) of Eclipse, lets resort to a manual install. What’s more, Eclipse Europa 3.3 bundled with the PHP Development Tools (PDT) can be obtained from the PDT site, so this is what we’ll do. Visit the Eclipse PDT download page. Select the download version you need (1.0.3 in my case), which will take you to the next page. Select the PDT All-in-One package for your platform: Linux, Windows or Mac OS. Download the relevant package and unzip/untar it somewhere. In Linux, I’d do:
tar -xvzf pdt-all-in-one-R20080603-linux-gtk.tar.gz
Which would create the Eclipse directory in the specified location. Go into the Eclipse folder and assign the correct permissions to the executable eclipse file under the Eclipse folder:
chmod 777 eclipse
And then run Eclipse by:
./eclipse
Alternatively, you can add a launcher/shortcut to the panel pointing to this so that Eclipse can be executed with a click of the mouse. Eclipse should be up and running now, with full PDT support. PDT provides error-detection, project builds, and debugging support amongst others.

Eclipse PDT contains many features useful for PHP development, including the much needed PHP debugging support. I’ll touch upon this in my next post. Enjoy Eclipse :)

June 26, 2008

Enabling Apache User Directories

Filed under: Development, Linux — mifan @ 10:25 am

In Apache, you have the choice of allowing users to have their own web URIs from within their home folders. Say for instance that my username is nazgul, on a domain http://somewhereonmiddleearth.com, then I can have a web-enabled folder within my home directory, which is accessible by http://somewhereonmiddleearth/~nazgul. To do this on Linux, do the following:
Create a folder named public_html
mkdir public_html
Go to your Apache folder (/etc/apache2/ on my system), and copy over the userdir modules from the mods-available folder to the mods-enabled folder:
cd /etc/apache2/
sudo cp -r mods-available/userdir.* mods-enabled/

Restart Apache2
sudo /etc/init.d/apache2 restart
And hey presto, your files under public_html would be accessible via a browser: thus if you are on your local machine, then you can access them via http://localhost/~nazgul . This is quite useful if you create web applications using Eclipse – where having your workspace inside public_html means they areautomatically web-accessible.

June 9, 2008

Creating ER diagrams from SQL

Filed under: Uncategorized — mifan @ 10:34 am

SQLt/SQL::Translator/SQLFairy is a great tool to create ER diagrams from SQL:

SQL::Translator is a group of Perl modules that manipulate structured data definitions (mostly database schemas) in interesting ways, such as converting among different dialects of CREATE syntax (e.g., MySQL-to-Oracle), visualizations of schemas (pseudo-ER diagrams: GraphViz or GD), automatic code generation (using Class::DBI), converting non-RDBMS files to SQL schemas (xSV text files, Excel spreadsheets), serializing parsed schemas (via Storable, YAML and XML), creating documentation (HTML and POD), and more.

In Ubuntu Linux and Debian Linux, this can be obtained by installing SQLFairy:
apt-get install sqlfairy
This is quite useful if you follow a bottom-up approach: create the SQL first, and then create ER diagrams – although this might not be a common development method, it does have its uses, and some of us like it :)
So for instance, say you have a MySQL schema named sample.sql. To create a ER diagram with color, named sample_schema.png, run the following in the command line:
sqlt-diagram -d=MySQL -o=sample_schema.png sample.sql --color
where -d=MySQL specified the MySQL driver. Other available drivers can be obtained by:
sqlt -l
Additionally, sqlt can also be used to convert between various database schemas as well.

SQLFairy ER Diagram

Next Page »

Blog at WordPress.com.