Nov 30
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Ok, so this is a few weeks after it’s been released, but I’ve not had much of a chance to catch up on these things! Anyway, following my post on MySQL Workbench 5.1.3 Alpha, here’s an update on installing the latest version - 5.1.4 Alpha. 32 Bit users can install from the repositories, by first adding the following to /etc/apt/sources.list so, open up a Terminal, and run the following:

gksu gedit /etc/apt/sources.list

Once the Text editor is open, add the following lines to the end of the file:

deb ftp://ftp.mysql.com/pub/mysql/download/gui-tools/ubuntu/ binary/
deb-src ftp://ftp.mysql.com/pub/mysql/download/gui-tools/ubuntu/ source/

Save the file, and close the Editor. From the terminal, run:

sudo apt-get update
sudo apt-get install mysql-workbench

That’s it. 64 Bit users still have to compile and install from the source tarball - the latest version of which can be downloaded from ftp://ftp.mysql.com/pub/mysql/download/gui-tools/mysql-workbench-5.1.4alpha.tar.gz, but the instructions are the same as in my previous post “MySQL Workbench 5.1.3 Linux Alpha - Testing on 32 bit and 64 bit Ubuntu“.

This version has loads of bug fixes and some new features implemented, but it’s still not recommended to use on a Production DB!

written by Hodge \\ tags: , ,

Oct 31
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

YouBundle is finally live! I’m currently trying to do 6 dozen different things, including debugging a really annoying “feature” in the Bundle Widget… For some reason, it only occurs on WordPress blogs, and basically, the page’s style sheet/CSS seems to be overriding the Widget CSS, and adding bullet styles to list items, where I really don’t want them! Anyway, here’s a nice introduction to YouBundle, and the Widget feature - the Ubuntu Bundle I created a while back, during early development and testing:

written by Hodge \\ tags: ,

Aug 04
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5 out of 5)
Loading ... Loading ...

Eclipse 3.4 GanymedeI’ve been checking out the recently released Eclipse 3.4 (Ganymede), and so far so good. I’ve managed to get PDT (for PHP Development) and SQL Explorer installed and running successfully, so I’ll be doing some testing to see how it compares to Europa, which I have been using for some time. Thankfully, installing plugins is much easier with Ganymede - this is how I got it set up an configured.

IMPORTANT NOTE: This installation configuration currently relies on Integration builds of both PDT and DLTK, since the current Stable builds of each are not currently supported under Eclipse 3.4. I will update this tutorial as support becomes available, but if you are not comfortable installing Integration builds, please see my previous tutorial on setting up a PHP IDE in Eclipse Europa: “64 Bit Eclipse: Linux Installation, including PDT, WTP (WST), ATF, and MySQL (SQL Explorer Plugin)“.

Install Eclipse

Installing Eclipse is a pretty easy task - just head over to http://www.eclipse.org/downloads and download the latest version of “Eclipse Classic” (direct link to 64 bit version). I downloaded the file to my desktop, and once finished, opened up a Terminal window, extracted the archive, and installed Eclipse into the /opt directory:

cd ~/Desktop
tar -zxvf eclipse-SDK-3.4-linux-gtk-x86_64.tar.gz
sudo mv eclipse /opt/ganymede

I installed into /opt/ganymede since I already have Europa installed in /opt/eclipse.

That’s all there is to installing Eclipse. It can be run (for now) via the Terminal:

cd /opt/ganymede
./eclipse

Installing PDT

As mentioned above, the latest Stable build of PDT is not yet supported in Eclipse 3.4, and since only PDT 1.0.x is available via the Update Site, it’s necessary to download the 2.0.x Integration Build from the PDT Website (see this thread at pdt-dev for more information). The same goes for DLTK (Dynamic Languages Toolkit) upon which PDT depends - only the Integration Build may be installed with Ganymede.

Firstly I downloaded DLTK, from http://download.eclipse.org/technology/dltk/downloads - click on the Integration Build download link, and grab the Core Frameworks archive (direct link to current version - Integration Builds are likely to change frequently, so best to visit the main doanload page). Next, grab the PDT archive from http://download.eclipse.org/tools/pdt/downloads/ (click on the 2.0.0 Integration Build link, then grab the PDT Runtime archive - direct link). Don’t worry about the requirements and handy extras.

Once downloaded, again to my Desktop, I created a couple of temporary directories, and unziped both archives into their respective new homes:

mkdir pdt dltk
mv org.eclipse.php_feature-I20080722.zip pdt
cd pdt
unzip org.eclipse.php_feature-I20080722.zip pdt
cd ~/Desktop
mv dltk-core-I-I200807291021-200807291021-incubation.zip dltk
cd dltk
unzip dltk-core-I-I200807291021-200807291021-incubation.zip

Now the Eclipse Update manager can be pointed to these “local sites”. I fired up Eclipse once again, and navigated to the Update Manager: Help -> Software Updates. Once open, I clicked on the Available Software tab, and added the new sites - click on Add Site, click Local, and navigate to ~/Desktop/pdt/eclipse. Click OK, and repeat for ~/Desktop/dltk/eclipse. Now there should be two more sites (”/home/username/Desktop/pdt/eclipse” and “/home/username/Desktop/dltk/eclipse”) in addition to “Eclipse Project Update Site” and “Ganymede” (or “http://download.eclipse.org/releases/ganymede”). Expand each of the two new sites, and select the lowest leaf in each tree - “PDT Feature” and “Dynamic Languages Toolkit”.

Eclipse Ganymede Update Manager

PDT is also dependent upon the Graphical Editing Framework (GEF), so expand the Ganymede tree, then “Graphical Editors and Frameworks” and select the “Graphical Editing Framework GEF” option.

Don’t click “Install” quite yet - there are a few other additional things to select for a full Web Application Development IDE.

Web Application stuff

Expand the main Ganymede tree, and “Web and Java EE Dvelopment”. I personally selected:

  • Eclipse XML Editors and Tools
  • Javascript Developer Tools
  • Web Developer Tools
  • Web Page Editor

You may want more, or less. Almost there…

Database Integration

Expand Database Development, and select Data Tools Platform Enablement and Data Tools Platform SQL Development. These are required for setting up a connection to MySQL later.

OK, click Install! Go and make a brew, or coffee - this may take some time.

Once everything has been downloaded and installed, restart Eclipse.

SQL Explorer Plugin

I find SQL Explorer is a great little plugin to use as a DB GUI. To install it, I downloaded the latest version to my Desktop, and extracted the files.

cd ~/Desktop
mkdir sqlexplorer
mv sqlexplorer_plugin-3.5.0.RC5.zip sqlexplorer
cd sqlexplorer
unzip sqlexplorer_plugin-3.5.0.RC5.zip

As with the PDT and DLTK plugins, to install is just a simple case of adding a new Local site to the Eclipse Update Manager, and selecting the plugin to install. So, open up the Update Manager - Help -> Software Updates, and select the Available Software tab. Add new site, click Local, navigate to ~/Desktop/sqlexplorer, click OK, etc. Once the site is added, expand the new SQL Explorer, select the lowest level leaf, and click install.

Once installed, restart Eclipse. Some configuration is still required to get SQL Explorer linked up to a MySQL Database, which I have covered in a previous tutorial: Eclipse PDT and MySQL - SQL Explorer Plugin. It’s pretty simple, and just involves downloading the Java Connector for MySQL, and pointing Eclipse to it.

ATF (AJAX Toolkit)

Unfortunately, ATF is not yet supported in Ganymede - I’m keeping track of it, however, and will update this tutorial as soon as support is available. In the mean time, check out the current status at atf-dev.

Debugging PHP with Xdebug

The information in my previous tutorial, Debugging PHP Applications with Xdebug and Eclipse PDT, can still be applied to Ganymede.

Hope that helps.

References

  1. http://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_1
  2. http://www.mail-archive.com/pdt-dev@eclipse.org
  3. http://www.mail-archive.com/atf-dev@eclipse.org

written by Hodge \\ tags: , , , ,

Apr 13
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Xdebug LogoOK, so I have x64 Eclipse successfully installed and running with all the plugins I use for Web Application Development. But what about debugging? Sure, var_dump(), echo, print and so on are all valuable to me when debugging a script, but it’s always good to have more information.

Xdebug is a fantastic PHP extension, which is written by one of the PHP Core Developers, Derick Rethans. The current version is 2.0.3, and I set about installing it on my system, and integrating it into Eclipse PDT today.

Xdebug can be installed in a few different ways - by downloading the binaries from the site, compiling the source, or via PECL:

sudo pecl install xdebug

Some days, I just prefer to download compile the source, as it gives me more of an understanding of what is being installed and where, and this is one of those days:

cd ~/
mkdir xdebug
cd xdebug
wget http://www.xdebug.org/link.php?url=xdebug203
tar -zxvf xdebug-2.0.3.tgz
cd xdebug-2.0.3

The packages phpize and php-config are required to install Xdebug, and can be obtained by installing the relevant PHP development packages:

sudo apt-get install php4-dev

or

sudo apt-get install php5-dev

depending on the PHP version installed. After unzipping the Xdebug source, I ran

phpize

which output:

PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519

I then checked this against the table at http://www.xdebug.org/docs/install#phpize to see if my PHP version (5.2.3) was compatible with Xdebug - it matched up to the table’s 5.2.x PHP version row, so I went ahead and installed:

./configure --enable-xdebug --with-php-config=/usr/bin/php-config
make

which created a file xdebug.so in the modules subdirectory. This file needs to be copied (or moved) to the PHP Extension directory, which on my system is in /usr/lib/php5/20060613/. An easy way to find the PHP extension directory is to run:

locate mysql.so

ok, so I copied the xdebug.so to the extension directory:

sudo cp modules/xdebug.so /usr/lib/php5/20060613/

So far so good. Now PHP needs to be told about the extension, and to load it. This can be done by adding

zend_extension="/usr/lib/php5/20060613/xdebug.so"

to the php.ini file. However, on my Ubuntu system, the PHP extensions are activated by adding an .ini file to the /etc/php5/apache2/conf.d directory, for each extension installed. The .ini file is the extension_name.ini, so I created a file called xdebug.ini:

cd /etc/php5/apache2/conf.d
gksu gedit xdebug.ini

which for now, contains a single line:

zend_extension="/usr/lib/php5/20060613/xdebug.so"

After restarting the Apache server

sudo /etc/init.d/apache2 restart

I created a file called test.php in my Web Root directory, containing a call to the phpinfo() function:

<?php
phpinfo();
?>

and pointed my browser to http://localhost/test.php. Just before the “PHP Credits” section, is a small box containing information on Zend - and now, with a successful Xdebug installation, additional information on Xdebug:

Xdebug information output by phpinfo()

The same information can be found by opening a Terminal and running

php -m

to output the loaded modules, and towards the end of the output, you should see

[Zend Modules]
Xdebug

alternatively, run

php -i | grep Xdebug

and if Xdebug has been installed successfully, you should see

with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans

Now, Xdebug needs to be enabled before any scripts can be debugged! So, in the php.ini file (or in my case, the newly created /etc/php5/apache2/conf.d/xdebug.ini file) I added the lines:

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

and restarted Apache again:

sudo /etc/init.d/apache2 restart

running

php -i | grep xdebug

in the Terminal, or using the test.php file containing phpinfo() shows that the new settings are being used, and Xdebug is active and running.

Configuring Eclipse PDT:

Setting up Eclipse PDT to use the Xdebug extension is pretty simple. In Eclipse PDT, I opened Window -> Preferences, then clicked on PHP, expanded the tree, and selected Debug. I Chose Xdebug from the pull down menu for the PHP Debugger, the “Default PHP Server” (should already be set to localhost), and then created a new PHP Executable option by clicking on the PHP Executables link next to the PHP Executable pull down menu.

XDebug and Eclipse PDT

In the PHP Executables dialog, I Clicked Add, filled in the name (PHP with XDebug), and entered the path to the PHP executable - on my system this is /usr/bin/php but if you don’t know, then in a terminal, run

which php

to find out where the php command is run from. I also entered the location of php.ini - again, on my system, this is /etc/php5/apache2/php.ini - and selected XDebug as the PHP debugger:

Xdebug - set up PHP Executable in Eclipse PDT

Clicked OK, then went back to the PHP -> Debug preferences screen, and selected the PHP Executable just created in the PHP Executable pull down. Finally, in the Debug -> Workbench Options option in the left, I selected “Never” for the “allow multiple debug sessions” option, since Xdebug does not support them.

Finally, I needed to set the Default Web Browser in Eclipse, to that when I debug a script, the output is sent to Firefox. Again in Preferences, I navigated to General -> Web Browser, and clicked “New”. It’s pretty straight forward stuff - entering a name and location - Firefox, and /usr/bin/firefox. Again, if you don’t know the location of the firefox binary, in a terminal run:

which firefox

With this done, and the preferences saved, I can now debug my scripts using Xdebug!

Using Xdebug in PDT

References:

http://www.xdebug.org/docs/install
http://www.eclipse.org/pdt/documents/XDebugGuide.pdf
http://devzone.zend.com/article/2803-Introducing-xdebug

written by Hodge \\ tags: , ,

Apr 12
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

Eclipse SDKNOTE, 04/08/08: This tutorial covers Eclipse Europa. If you would like to install the latest version of Eclipse 3.4 Ganymede, with PDT and SQL Explorer, take a look at my latest Tutorial: “64 Bit Eclipse 3.4 (Ganymede) IDE with PDT and SQL Explorer - Full PHP/MySQL Web Application IDE“.

I had tried once before to install the x64 (64 Bit) version of Eclipse IDE, about 8 months ago, but found it to be somewhat buggy and unstable. In the interim, I’ve been using the 32 Bit version of Eclipse PDT for my development stuff. Earlier this year (21/02/08) a new version of Eclipse 64 Bit was released, so I gave it a go today. So far, so good!

Unfortunately, there’s no 64 Bit PDT all-in-one, but I managed to install a 64 Bit equivalent by cobbling together the relevant packages available by using the Eclipse Update Manager system, after initially installing the latest version of Eclipse Classic 3.3.2 64 Bit.

I wanted to keep everything (or as much as possible) 64 Bit, so I also download and installed the 64 Bit JRE, which can be downloaded here (or use the direct link to the bin file). The method for installing the 64 Bit JRE is the same as the 32 Bit version - after the file downloaded to my desktop, I opened up a new Terminal Window (Applications -> Accessories -> Terminal), traversed to the directory I wanted to install it into, moved the file, made it executable, and ran it to install:

cd /usr/java
sudo mkdir 64
cd 64
sudo mv ~/Desktop/jdk-6u5-linux-x64.bin /usr/java/64/
sudo chmod a+x jdk-6u5-linux-x64.bin
sudo ./jdk-6u5-linux-x64.bin

If the “java” directory doesn’t exist, it needs to be created first:

sudo mkdir /usr/java

listing the directory

ls

should return

jre1.6.0_05

which is the directory containing the necessary Java binaries.

As with my previous 32 Bit installation, I wanted Eclipse to be installed in the /opt directory:

cd /opt
sudo mv ~/Desktop/eclipse-SDK-3.3.2-linux-gtk-x86_64.tar.gz /opt
sudo tar -zxvf eclipse-SDK-3.3.2-linux-gtk-x86_64.tar.gz

then rename the eclipse directory:

sudo mv eclipse eclipse64

I also needed to get the newly installed Eclipse to run with the newly installed JRE - by default, the eclipse executable in the directory will try and detect Java and use whatever it finds, so I created a shell script:

cd eclipse64
sudo gksu gedit eclipse.sh

containing the following:

#!/bin/bash
PATH=/usr/java/64/jre1.6.0_05/bin:$PATH
/opt/eclipse64/eclipse

Now instead of running the eclipse executable, I run eclipse.sh (make sure it’s executable)

sudo chmod 755 eclipse.sh

before running

/opt/eclipse64/eclipse.sh

PDT and WTP Plugins

The first time I ran the new 64 Bit version, everything went well - it was fast, and seemed stable, so I went ahead and started installing all the additional plugins I needed (and still need…). Goto Help -> Software Updates -> Find and Install, and select “Search for new features to install”.Click on “New Remote Site” for each of the following:

  • Name: PDT, URL: http://download.eclipse.org/tools/pdt/updates/
  • Name: WTP, URL: http://download.eclipse.org/webtools/updates/
  • Name: GEF, URL: http://www.eclipse.org/gef/updates/
  • Name: EMF, IRL: http://www.eclipse.org/modeling/emf/updates/

Eclipse Update Manager Add Remote Site

Actually, there are only a couple of components required from the GEF (Graphical Editing Framework) and EMF (Eclipse Modeling Framework) packages to satisfy dependencies - WTP (Web Tools Platform) requires a package from GEF, and GEF from EMF…

After adding these, click on Finish - the Update Manager will then query any mirrors for the latest versions of the plugins. Once it has finished, a dialog appears, where it is possible to select the plugins to download and install. First, I selected PDT - the Update Manager then informed me that PDT requires files from WTP, so I tried clicking the “Select Requires” button, hoping that it would sort out the dependencies on my behalf. Unfortunately, nothing happened… So, I selected WTP manually, then expanded GEF -> Eclipse SDK R3.3.1 and Selected Graphical Editing Framework 3.3.1v20070814, then expanded EMF -> EMF SDK 2.3.2 and selected Eclipse Modeling Framework (EMF) - org.eclipse.emf.ecore 2.3.2v200802051830… I could then click “Select Required” to get the last few residual required dependencies… Phew…

Eclipse Update Manager Select Updates

Actualy, it still bugged me for dependencies for Java Persistence API contained in WTP, but by that stage I really couldn’t be arsed going through the process of adding more stuff to the Update Manager and potentially having to search for further dependencies, so I just deselected the three Java Persistence API files contained in WTP.

OK, with the dependencies sorted, I clicked Next, accepted the agreements, finished, and went to make, and drink a brew (that’s Tea) while the Update Manager downloaded and installed the requested stuff.

MySQL: SQL Explorer Plugin

Eclipse SQL Explorer LogoOnce everything had downloaded and installed, I restarted Eclipse. Everything looked good! Great, in fact. But I also wanted to install a few more plugins, including the MySQL SQL Explorer Plugin - which additionally requires, and depends on Eclipse DTP (Data Tools Project). Eclipse DTP has to be downloaded and installed manually, since there is no automated Update Site. So, I downloaded dtp_1.5.2_022008.zip to my Desktop, and set about extracting and installing the files:

cd ~/Desktop
mkdir DTP
mv dtp_1.5.2_022008.zip DTP
cd DTP
unzip dtp_1.5.2_022008.zip
cd eclipse
sudo cp -R features plugins /opt/eclipse64

If Eclipse is open, restart it. With the DTP installed, I could set about installing the SQL Explorer Plugin. The instructions for installing and configuring the SQL Explorer Plugin can be found in my previous article - Eclipse PDT and MySQL - SQL Explorer Plugin, since I don’t want to regurgitate information, just follow the link if you need to install it, and come back when it’s done.

Note: Actually, now I had the DTP installed, I could download and install the additional Java Persistence API in WTP! Same method: Update Manager, select WTP etcetera, etcetera…

ATF: AJAX Framework Toolkit

Script.aculo.usOnce the SQL Explorer Plugin was installed, I had one final plugin - ATF (the AJAX Toolkit Framework). This can be downloaded as a Site Archive, and the zip file added to Eclipse’s Update Manager. Once downloaded, I opened the Update Manager in Eclipse (Help -> Software Updates -> Find and Install), and clicked on “New Archived Site”, to add a new locally archived site, calling it ATF, and pointing it to the freshly downloaded atf-incubation-SiteArchive-0.2.3M4-v200709141050.zip file. I discovered, however, that the site.xml file contained within the zipped site archive is somewhat out of date and the pointers within are directed to the wrong download locations, so I had to manually locate the additional dependent plugins - Mozilla XULRunner, and Mozilla JS. They can both be added as New Remote Sites to the Update Manager, by clicking on the “New Remote Site” button, and adding the following information:

  • Name: Mozilla JS, URL: http://ftp.mozilla.org/pub/mozilla.org/js/eclipse/
  • Name: XULRunner, URL: http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.8.1.3/contrib/eclipse/

The previously used EMF plugin is also required to satisfy a couple of dependencies, so I selected the ATF, Mozilla JS, XULRunner, and EMF plugins from the list, and clicked Finish. Once the “updates” were found, I selected XULRunner, Mozilla JS, ATF (I deselected the ATF -> Mozilla JS component though, since an updated version was to be downloaded and installed from the Mozilla Server), and also selected the required EMF components. Click through Next etc. to download and install. Once completed, I restarted Eclipse.

In the Window -> Preferences menu by the way, AJAX toolkits such as Script.aculo.us can be added to the ATF module.

Et Voila! I now have a working Eclipse 64 Bit version up and running! Finally!

Oh, if you want a desktop icon, just create a file on your Desktop called Eclipse.desktop,

cd ~/Desktop
gedit Eclipse.desktop

and add the following:

[Desktop Entry]
Categories=;
Encoding=UTF-8
Exec=/opt/eclipse32/eclipse.sh
Hidden=false
Icon=/opt/eclipse64/icon.xpm
Icon[en_US]=/opt/eclipse64/icon.xpm
Name=Eclipse
Name[en_US]=Eclipse
Terminal=false
Type=Application
Version=1.0

written by Hodge \\ tags: , , , , , , ,

Mar 27
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

OK, this is a bit of a cheeky post, since I’m merely extending a previous post “Conky on Ubuntu 64 Bit - .conkyrc” - or elaborating on it - to clarify setting up .conkyrc for Dual Core Processors - specifically for my AMD Turion 64 X2. I’ve had a few requests specifically about this, so here goes…

Now, the part of my .conkyrc file that deals with my Dual Core looks like this:

${color #42AE4A}Usage (Avg):${color #42AE4A} ${freq_dyn_g}Ghz ${color lightgrey}${cpu cpu0}% ${alignr}${color #42AE4A}${cpubar cpu0 5,80}
${color #42AE4A}Usage (Core 1):${color #42AE4A} ${freq_dyn_g cpu1}Ghz ${color lightgrey}${cpu cpu1}% ${alignr}${color #42AE4A}${cpubar cpu1 5,80}
${color #42AE4A}Usage (Core 2):${color #42AE4A} ${freq_dyn_g cpu2}Ghz ${color lightgrey}${cpu cpu2}% ${alignr}${color #42AE4A}${cpubar cpu2 5,80}
${color #42AE4A}Average
${cpugraph cpu0 42AE4A eeeeee}
${color #42AE4A}Core 1 $alignr Core 2
${color #42AE4A}${cpugraph cpu1 25,120 42AE4A eeeeee} ${color #42AE4A} $alignr${color #42AE4A}${cpugraph cpu2 25,120 42AE4A eeeeee}
${color #42AE4A}Processes:${color lightgrey} $processes ${color #42AE4A}Run:${color lightgrey} $running_processes ${color #42AE4A}CPU Temp:${color lightgrey} ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”}
${color #42AE4A}Core 1 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 ‘Core0′ | cut -c13-16 | sed ‘/^$/d’} C ${color #42AE4A}Core 2 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 ‘Core1′ | cut -c13-16 | sed ‘/^$/d’} C

This outputs the following to Conky:

Conky Dual Core CPU Output

Stripping out all the formatting, and colouring gives this:

Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}
Usage (Core 1): ${freq_dyn_g cpu1}Ghz ${cpu cpu1}% ${alignr}${cpubar cpu1 5,80}
Usage (Core 2): ${freq_dyn_g cpu2}Ghz ${cpu cpu2}% ${alignr}${cpubar cpu2 5,80}
Average
${cpugraph cpu0 42AE4A eeeeee}
Core 1 $alignr Core 2
${cpugraph cpu1 25,120 42AE4A eeeeee} $alignr${cpugraph cpu2 25,120 42AE4A eeeeee}
Processes: $processes Run: $running_processes CPU Temp: ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”}
Core 1 Temp: ${execi 8 sensors | grep -A 1 ‘Core0′ | cut -c13-16 | sed ‘/^$/d’} C Core 2 Temp: ${execi 8 sensors | grep -A 1 ‘Core1′ | cut -c13-16 | sed ‘/^$/d’} C

Now the walk through. The first line, Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80} gives the Average clock speed usage for both cores - ${freq_dyn_g} with no parameters, will output the current clock speed usage for the CPU as a whole. Passing cpu0 as a parameter to ${cpu} will output the overall CPU % used, and similarly, passing cpu0 to ${cpubar} will draw the overall % used graph (the parameters 5,80 are just for the height and width.

Now, by passing cpu1 or cpu2 to ${freq_dny_g}, ${cpu} and ${cpubar} Conky will output the same data but for each individual core. This can be extended by passing cpuN where N is the core number, for quad core etc. this could be cpu3 cpu4. So, the first three lines:

Usage (Avg): ${freq_dyn_g}Ghz ${cpu cpu0}% ${alignr}${cpubar cpu0 5,80}
Usage (Core 1): ${freq_dyn_g cpu1}Ghz ${cpu cpu1}% ${alignr}${cpubar cpu1 5,80}
Usage (Core 2): ${freq_dyn_g cpu2}Ghz ${cpu cpu2}% ${alignr}${cpubar cpu2 5,80}

Outputs:

Conky Dual Core CPU Usage

The next lines of the file deal with throughput/usage graphs, ${cpugraph cpu0 42AE4A eeeeee} being the average for the CPU as a whole, since cpu0 is passed as a parameter. 42AE4A and eeeeee are just colour parameters to create a gradient overlay on the graph. As before, passing cpu1 and cpu2 will draw the graphs for the individual cores. The additional parameters, 25,120 are again just height and width parameters.

So, the lines

Average
${cpugraph cpu0 42AE4A eeeeee}
Core 1 $alignr Core 2
${cpugraph cpu1 25,120 42AE4A eeeeee} $alignr${cpugraph cpu2 25,120 42AE4A eeeeee}

Will output:

Conky Dual Core CPU Throughput Graphs

Finally, I have a bunch of other data output, such as total processes, processes running, and CPU temperature. The first line outputs general information about the CPU as a whole:

Processes: $processes Run: $running_processes CPU Temp: ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C”}

$processes outputs the total number of processes, while $running_processes outputs the number of currently running processes on the CPU. To output the overall temperature, I had to call the execi function, and do some tweaking of the output to get the number, so ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o “[0-9]* C”} basically outputs /proc/acpi/thermal_zone/THRM/temperature, pipes the output through grep which searches for the regular expression ‘[0-9]* C’ (which matches a string of numbers followed by a space followed by an upper-case C), and thus outputs just the temperature value - e.g. “45 C”.

To output the temperature of each Core, I once again run the execi function on a couple of piped shell commands, and pipe the output through other shell commands to get the number I want:

Core 1 Temp: ${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C Core 2 Temp: ${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C

Basically what is happening here is I’m running the shell command sensors, piping to grep to search for the string “Core0“, piing this output to cut to trim it, and finally editing out some of the crap I don’t want by piping to sed. This is just repeated for Core1. You may need to customise the output from sensors, by greping, cutting and seding different stuff - experiment by opening a terminal, and running sensors, then just pipe it through the grep, cut, and sed commands until you get the data you want.

So, the final lines together:

Processes: $processes Run: $running_processes CPU Temp: ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep -o "[0-9]* C”}
Core 1 Temp: ${execi 8 sensors | grep -A 1 ‘Core0′ | cut -c13-16 | sed ‘/^$/d’} C Core 2 Temp: ${execi 8 sensors | grep -A 1 ‘Core1′ | cut -c13-16 | sed ‘/^$/d’} C

Output:

Conky Dual Core CPU Misc Info

Of course, this should work on any Linux distro with Conky installed.

Hope that helps someone.

written by Hodge \\ tags: , , , , ,

Mar 27
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

Eclipse SQL Explorer LogoI’ve been using Eclipse PDT for some time now, and since PHP programming invariably involves connecting to a database at some point or another, I wanted to be able to access my MySQL databases from within the Eclipse IDE - even if only to quickly debug SQL statements. I generally use a combination of a locally installed phpMyAdmin, MySQL Administrator, MySQL Query Browser, and now the Eclipse SQL Explorer Plugin, which give me all the functionality I need for Web Application development.

phpMyAdmin, MySQL Administrator and MySQL Query Browser can be installed as follows, by the way:

sudo apt-get install phpmyadmin mysql-admin mysql-query-browser

Installing Eclipse SQL Explorer was pretty straight forward - I simply downloaded the archive package from Sourceforge, saved it to a directory in on my desktop (there is also a standalone client available, so be sure to download “Eclipse SQL Explorer [RCP/Plugin]” if you’re setting it up as an Eclipse plugin - here’s a direct link to the latest plugin file), and extracted the files:

cd ~/Desktop/sqlexplorer
unzip sqlexplorer_plugin-3.5.0.RC5.zip

This created two directories (features and plugins) along with two text files. To install the plugin, I just copied the two directories to my Eclipse root installation directory (see my previous post “Eclipse PDT IDE for PHP MySQL 32 Bit install on 64 Bit Ubuntu“), which is /opt/eclipse32

cp -R features plugins /opt/eclipse32/

Notice there was no need to use the sudo command before copying, since my user owns the eclipse32 folder.

Configuring SQL Explorer

Once installed, I also had to do some additional setup before I could configure SQL Explorer to connect to my local MySQL databases via Eclipse - namely, download and install the Java Connector for MySQL (MySQL JDBC Driver), to enable JDBC connections. The latest driver (5.1 at the time of writing) tar.gz file can be downloaded from the MySQL site here.

Once downloaded, I just extracted the files, and entered the new directory:

cd ~/Desktop/mysqljdbc
tar -zxvf mysql-connector-java-5.1.6.tar.gz
cd mysql-connector-java-5.1.6

The important file here (along with the documentation, of course) is the mysql-connector-java-5.1.6-bin.jar file, which is the driver itself. I guess this could be placed anywhere, since we just need to point the SQL Explorer plugin to it when setting it up in Eclipse, but for convenience and tidiness, I moved it to the /usr/share/mysql directory:

sudo cp mysql-connector-java-5.1.6-bin.jar /usr/share/mysql

With the JDBC driver installed, I could set up the Eclipse SQL Explorer plugin. In Eclipse, I went to Window->Preferences and expanded the new SQL Explorer section, highlighting “JDBC Drivers”, then double clicking on “MySQL Driver” to open the MySQL setup dialog:

Eclipse SQL Explorer Setup

In the MySQL Driver setup, I had to point the plugin to the MySQL JDBC Driver, by clicking on the “Extra Class Path” tab, and then clicking “Add” to point it to /usr/share/mysql/mysql-connector-java-5.1.6-bin.jar. Once added, clicking on “List Drivers” will bring up the list of available drivers in the “Driver Class Name” pull down menu. Only one is listed, and it just so happens to be the one we need - com.mysql.jdbc.Driver:

Eclipse SQL Explorer Setup

Click OK, and the driver is set up! I also clicked the “Set Default” button, since MySQL is currently the only database I connect to. With the Driver set up, I could then set up a connection to my database system. If the “Connections” view is not already available, it has to be selected via the Window->Show View->Other menu, and clicking on the “Connections” view within the “SQL Explorer” folder in this dialog.

With the Connections View available, I could set up the new connection profile, by right clicking in the view and selecting “New Connection Profile”, which opens up a new dialog, in which the new connection data is input:

Eclipse SQL Explorer Setup

It was a pretty simple process to create the connection - I just needed to replace the relevant parameters in the JDBC connections string with my connection details, so

jdbc:mysql://<hostname>[<:3306:>]/<dbname>

became

jdbc:mysql://localhost:3306/mydatabase

Entered the DB username and password, gave the connection a name, selected the newly created MySQL Driver, and clicked OK to save the connection. Double clicking the connection name in the Connections View connects to the DB and brings up an SQL window form which Queries may be run. By default, the results are displayed in a small view at the bottom of the main Eclipse IDE window - although, this can be dragged and placed anywhere. There are also several other views available via the Window->Show View->Other menu within the SQL Explorer section to peruse.

The Eclipse SQL Explorer homepage has extensive documentation available, including a cool section on extending the plugin. Maybe I should learn Java too?

That’s all Folks.

written by Hodge \\ tags: , , , ,

Mar 11
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.67 out of 5)
Loading ... Loading ...

BOINC Statistics output to ConkySince my previous article about Conky, Conky on Ubunty 64 Bit - .conkyrc, I’ve been playing around with trying to get Conky to output some BOINC (SETI@Home data), and through a little digging, found a couple of very useful resources. The first being BOINC’s own client_status.xml file, located on Ubunutu in /var/lib/boinc-client/client_status.xml, which contains a lot of information about BOINC projects, Work Units, Status and so on. The second being a command line application, again built into BOINC - boinc_cmd. boinc_cmd can be executed with a bunch of parameters, such as –get_simple_gui_info and –get_project_status which output to the Terminal a lot of information about Projects and Work Units.

To output BOINC data via Conky, it’s possible to call the boinc_cmd in .conkyrc and strip down the information with grep and sed etc:

${execi 10 boinc_cmd --get_simple_gui_info | grep -m 1 "fraction done:" | tail -n 1 - | sed -e 's/ fraction done: //'}
${execi 10 boinc_cmd --get_simple_gui_info | grep -m 2 "fraction done:" | tail -n 1 - | sed -e 's/ fraction done: //'}

…and so on for each piece of data required for output, but this is pretty labourious, and makes for a rather ugly .conkyrc, so I’ve written a really quick and dirty Perl Script (it’s not pleasant to look at, and needs a LOT of work, so it’s more of a pre Alpha-Alpha! I’m not sure how, or if it will work with multiple projects, since I only have SETI@HOME installed…) - which actually retrieves all the data from the client_status.xml file. The (archived) script, boinc.pl can be downloaded here (and viewed below - just copy and paste the text into a file, and save it as “boinc.pl” if the download doesn’t work for you). It’s also posted over at the Ubuntu Forums. I’ve called it in .conkyrc by adding one simple line:

BOINC:
${color lightgrey}${execi 10 perl ~/ConkyScripts/boinc/boinc.pl}

OK, so that’s actually two lines, but the first line doesn’t really do anything except output the text “BOINC:” to Conky, so it doesn’t count - but it’s much cleaner than potentially dozens of lines, right? The script itself is in my ~/ConkyScripts/boinc directory and has been made executable:

sudo chmod a+x boinc.pl

Here’s the script so far - it’s VERY much Work In Progress, but it outputs the data as shown in the image above:

Edit 15/03/08: I’ve updated the code, so hopefully it’ll work with multiple projects:

#!/usr/bin/perl

$BoincStatePath="/var/lib/boinc-client";
$BoincClientStateFile="client_state.xml";
$StateFile="$BoincStatePath/$BoincClientStateFile";

open(INFO, $StateFile);
@lines = <INFO>;
close(INFO);
sub strip_tags($);

sub convert_time_to_string($);
sub estimate_time_remaining;
$projectCount = 0;
$wuCount = 0;
$wuActive = 0;
$wuActiveTask = 0;

foreach $line (@lines) {

   if ($line =~ /<master_url>/) {
      $projectMasterURL[$projectCount] = strip_tags($line);
   }

   if ($line =~ /<project_name>/) {
      $projectName[$projectCount] = strip_tags($line);
      $projectCount++;
   }

   if ($line =~ /<workunit>/) {
      $wuCount++;
   }

   if ($line =~ /<active_task_state>1/) {
      $wuActive++;
   }

   if ($line =~ /<active_task>/) {
      $wuActiveTask++;
   }

   if ($line =~ /<result_name>/) {
      $wuName[$wuActiveTask] = strip_tags($line);
   }

   if ($line =~ /<fraction_done>/) {
      $wuPercent[$wuActiveTask] = strip_tags($line) * 100;
   }

   if ($line =~ /<project_master_url>/) {
      $wuMasterURL[$wuActiveTask] = strip_tags($line);
   }

   if ($line =~ /<current_cpu_time>/) {
      $wuCPUTime[$wuActiveTask] = convert_time_to_string(strip_tags($line));
      $wuCPUTimeRaw[$wuActiveTask] = strip_tags($line);
   }

}

print "No. Work Units: ".$wuCount.", Active WU: ".$wuActive."\n";

for($i = 0; $i <= $projectCount; ++$i) {
   print $projectName[$i];
   for ($j = 1; $j <= $wuActiveTask; ++$j) {
      if($projectMasterURL[$i] eq $wuMasterURL[$j]) {
         print "WU ".$j.": ".$wuName[$j];
         $estTime = convert_time_to_string(estimate_time_remaining($wuCPUTimeRaw[$j],$wuPercent[$j]));
         print "CPU Time: ".$wuCPUTime[$j]." Time Remaining: ".$estTime."\n";
         print $wuPercent[$j]."% Complete\n";
      }
   }
}

sub strip_tags($) {
   my $string = shift;
   $string =~ s/<(.*?)>//gi;
   $string =~ s/ //gi;
   return $string;
}

sub convert_time_to_string($) {
   $cpuTime = int($_[0]);
   #Calculate the number of days
   if ($cpuTime > 86400) {
      $timeDays = $cpuTime/(24*60*60).":";
   } else {
      $timeDays = "";
   }

   #Calculate the number of hours and minutes
   $timeHours = ($cpuTime/(60*60))%24;
   $timeMinutes = ($cpuTime/60)%60;
   $timeSeconds = $cpuTime%60;
   $cpuTimeString = $timeDays.$timeHours.":".$timeMinutes.":".$timeSeconds;

   return $cpuTimeString;
}

sub estimate_time_remaining {
   $cpuTime = $_[0];
   $currentPercent = $_[1];
   $onePercentTime = $cpuTime/$currentPercent;
   $totalTime = $onePercentTime * 100;
   $estimatedTimeReminaing = $totalTime - $cpuTime;
   return $estimatedTimeReminaing;
}

written by Hodge \\ tags: , , , , ,

Mar 09
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.5 out of 5)
Loading ... Loading ...

Conky ScreenshotI recently installed Conky, which is a highly configurable and “light weight system monitor”. As with many packages, it’s available via the Ubuntu Repositories:

sudo apt-get install conky

The default installation outputs some pretty useful information about the system - CPU usage, RAM/Swap usage, HD IO, HDD space and so on, and there are also some awesome scripts available to pull in other information to the display. The data monitored by Conky is controlled by the .conkyrc file locate in the user Home directory ~/.conkyrc. Opening and editing, or creating this file if it doesn’t exist (Applications -> Accessories -> Text Editor then Save As .conkyrc in the home directory), .conkyrc allows full control of how Conky gathers and displays information. The first section of the file, controls how the physical aspects of Conky is handled - the window size, transparency, position on the desctop etc., and the second part of the file takes a number of variables - both built in to Conky (which gather information such as RAM usage, etc.), and via exec, execi and texeci commands.

The Conky website has a great references on the configuration settings, available variables, and the man page.

I’ve also recently written a post which deals specifically with setting up Dual Core processors - Conky: Dual Core Processors in .conkyrc

As previously mentioned, in addition to Conky’s built in variables, it is possible to execute external shell commands, and even Perl/Python etc. scripts, and have the output sent to Conky for processing. I currently have two scripts installed, both obtained from Ubuntu Forums:

Conky Gmail Revisited, written by lvleph, is a Perl script, which logs into your Gmail account, and checks for new mail periodically (the interval of which is actually controlled via the .conkyrc). The Perl script is easy to download and use. Once I saved the script to ~/ConkyScripts/gmail/gmail.pl I just had to modify the script to enter my Gmail username and password, and make it executable

cd ~/ConkyScripts/gmail/
sudo chmod a+x gmail.pl

I could then call the script from my .conkyrc:

You have ${texeci 360 perl ~/ConkyScripts/gmail/gmail.pl n} new gmail(s).

texeci is a Conky command, to which I passed the parameters 360 (an interval in seconds which the script should run), and the shell command to execute - in this case, perl ~/ConkyScripts/gmail/gmail.pl n (the n is actually a parameter passed to the gmail.pl script!). The original forum post has a great list of installation instructions, thanks to lvleph.

I also added

${execi 360 perl ~/ConkyScripts/gmail/gmail.pl s}

to .conkyrc which calls the script again, but with “s” as the parameter, to output any new email subjects to Conky.

Conky Weather Revisited V2, also written by lvleph, grabs local weather information. It even comes with its own Weather Font! Again, it’s easy to download and incorporate into the .conkyrc file (I recommend the version from Page 3 of the forum thread - just remember to download the font from the front page). Again, I saved this to its own directory ~/ConkyScripts/weather/weather.pl and it was just a matter of calling the script from the .conkyrc as before. Running

./weather.pl

in a terminal window outputs the possible parameters which can be passed to the script - the most important being the area code/city code - in my case THXX0027, for Mae Hongson. Again, the original forum post has a great list of installation instructions, thanks to lvleph.

I’ve also recently written a Perl script, which allows BOINC data to be viewed via Conky. See my recent post on BOINC and SETI@Home with Conky, on Ubuntu.

Desktop with Conky

So, here’s my full .conkyrc file, for anyone who’s interested, which outputs the image above - try and tested on an Acer Aspire 5052, with AMD Turion 64 X2 (Dual Core) Processor:

# set to yes if you want Conky to be forked in the background
background no
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8
# Text alpha when using Xft
xftalpha 0.8
on_bottom yes
# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type override
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 260 5
maximum_width 260
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders no
# border margins
border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white
# Text alignment, other possible values are commented
gap_x 15
gap_y 30
alignment top_right
# Gap between borders of screen and text
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer no
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# boinc (seti) dir
seti_dir /usr/lib/boinc-app-seti/setiathome_enhanced
TEXT
${color #42AE4A}$sysname $kernel $machine - $nodename
${color #42AE4A}Uptime:${color lightgrey} $uptime ${color #42AE4A} Load:${color lightgrey} $loadavg
${color lightgrey}${hr}
${color #42AE4A}Usage (Avg):${color #42AE4A} ${freq_dyn_g}Ghz ${color lightgrey}${cpu cpu0}% ${alignr}${color #42AE4A}${cpubar cpu0 5,80}
${color #42AE4A}Usage (Core 1):${color #42AE4A} ${freq_dyn_g cpu1}Ghz ${color lightgrey}${cpu cpu1}% ${alignr}${color #42AE4A}${cpubar cpu1 5,80}
${color #42AE4A}Usage (Core 2):${color #42AE4A} ${freq_dyn_g cpu2}Ghz ${color lightgrey}${cpu cpu2}% ${alignr}${color #42AE4A}${cpubar cpu2 5,80}
${color #42AE4A}Average
${cpugraph cpu0 42AE4A eeeeee}
${color #42AE4A}Core 1 $alignr Core 2
${color #42AE4A}${cpugraph cpu1 25,120 42AE4A eeeeee} ${color #42AE4A} $alignr${color #42AE4A}${cpugraph cpu2 25,120 42AE4A eeeeee}
${color #42AE4A}Processes:${color lightgrey} $processes ${color #42AE4A}Run:${color lightgrey} $running_processes ${color #42AE4A}CPU Temp:${color lightgrey} ${execi 1100 cat /proc/acpi/thermal_zone/THRM/temperature | grep 'temperature:' | sed -e 's/temperature: //'}
${color #42AE4A}Core 1 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 'Core0' | cut -c13-16 | sed '/^$/d'} C ${color #42AE4A}Core 2 Temp: ${color lightgrey}${execi 8 sensors | grep -A 1 'Core1' | cut -c13-16 | sed '/^$/d'} C
${color lightgrey}${hr}
${color #42AE4A}CPU Usage PID CPU% MEM%
${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #42AE4A} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color #42AE4A} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color #42AE4A}Mem Usage
${color lightgrey} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #42AE4A} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color #42AE4A} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color lightgrey}${hr}
${color #42AE4A}RAM:${color lightgrey} $mem/$memmax ($memperc%) ${alignr}${color #42AE4A}${membar 5,100}
${color #42AE4A}SWAP:${color lightgrey} $swap/$swapmax ($swapperc%) ${alignr}${color #42AE4A}${swapbar 5,100}
${color #42AE4A}HD IO: ${color lightgrey}${diskio}
${color #42AE4A}${diskiograph 42AE4A eeeeee}
${color #42AE4A}Hard Disk Space:
${color #42AE4A} Root ${color lightgrey}${fs_used /}/${fs_size /}${alignr}${color #42AE4A}${fs_bar 5,120 /}
${color #42AE4A} Win ${color lightgrey}${fs_used /media/hda1}/${fs_size /media/hda1}${alignr}${color #42AE4A}${fs_bar 5,120 /media/hda1}
${color #42AE4A} Data ${color lightgrey}${fs_used /media/hda5}/${fs_size /media/hda5}${alignr}${color #42AE4A}${fs_bar 5,120 /media/hda5}
${color lightgrey}${hr}
${color #42AE4A}Network: ${color lightgrey}${addr eth0}
${color #42AE4A}Down:${color lightgrey} ${downspeed eth0} k/s $alignr${color #42AE4A} Up:${color lightgrey} ${upspeed eth0} k/s
${color #42AE4A}${downspeedgraph eth0 27,120 42AE4A eeeeee 180} $alignr${color #42AE4A}${upspeedgraph eth0 27,120 42AE4A eeeeee 25}
${color lightgrey}${totaldown eth0} $alignr${color lightgrey}${totalup eth0}
${color #42AE4A}Power: ${color lightgrey}${execi 2 acpi | sed -e 's/ .*: //'}
${color #42AE4A}You have ${color lightgrey}${texeci 360 perl ~/ConkyScripts/gmail/gmail.pl n} ${color #42AE4A}new gmail(s).
${color lightgrey}${execi 360 perl ~/ConkyScripts/gmail/gmail.pl s}
${color #42AE4A}$font${alignc}Mae Hongson Weather
${color #42AE4A}$font${alignc}Today
${alignc}${voffset -5}${color lightgrey}${font weather:size=30}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c cp}${font}$color${voffset -15}${offset 10}${color lightgrey}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c c}
${voffset 5}${color #42AE4A}$font${alignc}5 Day Forcast
${voffset -5}${font weather:size=30}${alignc}${offset -45}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 1p}${offset 25}${color orange}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 2p}${offset 25}${color cyan}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 3p}${offset 24}${color green}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 4p}${offset 23}${color red}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 5p}${font}$color
${alignc}${offset -15}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 1}${offset 10}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 2}${offset 10}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 3}${offset 10}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 4}${offset 10}${execi 3600 perl ~/ConkyScripts/weather/weather.pl THXX0027 c 5}

The “Post your .conkyrc files w/ screenshots” thread over at Ubuntu Forums has many other .conkyrc examples to peruse.

written by Hodge \\ tags: , , ,

Mar 05
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

IEs4Linux LogoI do a lot of Web Development, and try to build W3C Standards Compliant web sites - that’s why I always develop a website for Firefox first, and it’s also why I despise - with absolute passion - Micro$hite Internet Explorer (including version 7, which although is closer to following W3C’s standards than any previous version, is still crap), because I invariably have to spend twice as long as it took to design and develop the site, hacking CSS and JavaScript code to get it looking anywhere near as good as it looks in FF, in IE. That was a rather long sentence, that, had I been using M$ Word to write this, it would have probably suggested I revise and fragment it. positioniseverything.net has some great articles on IE specific CSS Bugs…

Also, as a Lnux user, and despite the fact that I have a dual boot system, I really resent having to reboot my laptop into a substandard operating system, to test my websites with a substandard web browser. Also add to this the fact that it’s a real pain in the arse to get more than one version of IE installed in XPoo. That’s where IEs4Linux comes in to play…

Admittedly, it borders on Heretic to install such dismally poor software in a Linux environment (I’m talking about IE here, not IEs4Linux!) , but for web development, it’s an unfortunately necessary evil. IEs4Linux works with Wine, and is a small set of scripts which automatically downloads and installs the IE 5.0, IE 5.5, IE 6, and with the latest beta version of IEs4Linux, IE 7 binaries. It also requires cabextract - a small application used to extract M$ Cabinet files.

I already have Wine, and cabextract installed on my Ubuntu, but if they’re not present, they are easy to install:

sudo apt-get install wine cabextract

So, I downloaded the IEs4Linux package to my ~/Documents folder - it can also be downloaded using wget:

cd ~/Documents
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.99.0.tar.gz

Once downloaded, I unpacked, and entered the new directory:

tar -zxvf ies4linux-2.99.0.tar.gz
cd ies4linux-2.99.0

Within the new directory is an executable, ies4linux, which if run:

./ies4linx

IEs4Linux GUIopens a GUI for installing the Internet Explorer binaries. Via the GUI, it is possible to select the IE versions to install (for IE 7, the option is in the Advanced section), along with the Adobe Flash plugin, and also the option to install Desktop and Menu icons/shortcuts. Unfortunately, I ran into a couple of problems running the GUI, and IE didn’t install correctly. Thankfully, however, it is also possible to run the ies4linux executable with command line options, and bypass the GUI all together, with the –no-gui flag. Now, since I didn’t have the GUI to select the extra options, I had to set a bunch of other flags to install everything I wanted, including IE 5.0, 5.5, 7, core fonts, and no desktop shortcuts:

./ies4linux --no-gui --install-ie55 --install-ie5 --beta-install-ie7 --no-desktop-icon --install-corefonts

IE 6 and Adobe Flash are installed by default, but can be switched off with the –no-ie6 and –no-flash respectively. Running ./ies4linux –full-help displays a list of all the options available.

I actually had to run the script a couple of times, since the downloads from the M$ servers timed out, but the script detects what’s already been downloaded, and continues as necessary. Other than that, it was a simple, painless process! I now have IE 5.0, 5.5, 6 and 7 polluting my system, which can be accessed via the menu Applications -> Internet -> IE. The only thing I’ve noticed so far, is that IE 7 is a little clunky and slow, and the Adobe Flash plugin doesn’t always work with IE 7, but other than that, it works well. For IE…

Now, I only wish there was an easier way to get a Standards Compliant website code to work in IE…

written by Hodge \\ tags: , , , , , , ,