SiKing

October 8, 2009

Installing Eclipse on Linux Mint (Ubuntu)

Filed under: linux — siking @ 9:21 pm
Tags:

Even thought Eclipse is available in the standard Ubuntu repos, it is not as easy or straightforward to install as other packages. Here is what I did to install the latest Eclipse + Pydev + Subclipse on my Mint 5 :mrgreen: (Ubuntu 8.04 equivalent).

Step 1: Install and update Eclipse

  1. sudo apt-get install eclipse-pydev, or you can just install the package eclipse-pydev from Synaptic. Pydev has Eclipse (and a bunch of other stuff) as a dependency, so you will get both. Subclipse is not available in the repos; no idea why; we will handle that separately below.
  2. Eclipse has it’s own package manager, which is not exactly compatible (in form or function) with APT (note that Synaptic is just a graphical front end for APT). Once the install completes lock the eclipse and eclipse-pydev packages: in Synaptic select the package and then select Package > Lock Version. This will ensure that Synaptic knows it is installed (in case it is a dependency for something else), but it should never mess with trying to update it.
    Eclipse pinned
  3. Start up Eclipse as a normal user, and enter your default working directory. This step will ensure that all the work files that Eclipse needs will be created, and they will be created with the correct permissions and in correct places.
  4. Next you want to update Eclipse. What Eclipse does not do for you, and you just simply have to know, is that you need to do this with root privileges – majority of Eclipse lives in /usr/lib/eclipse. If you skipped the previous step (creating all the work files), then the work files are going to be created with wrong privileges, and subsequently nothing is going to work right; even after I chowned all the ownership on ~/workspace I still had problems. Start Eclipse from a terminal with sudo eclipse. When it asks you where you want to keep your workspace, this time it does not really matter what you tell it – I normally tell it in /tmp.
  5. To update Eclipse, select Help > Software Updates > Find and Install, and follow Scenario 1 from the Eclipse wiki.

Step 2. Update Pydev

  1. Still as root in Eclipse, again select Help > Software Updates > Find and Install. This time select the second option “Search for new features to install”. Pydev was sold and re-licensed, and I suspect the new owners are not interested in keeping Pydev in the repos. So the new version is actually a new product.
  2. I was presented with three sites to search. I did not find anything I was interested in on Callisto Discovery Site. Pydev Extensions is what you want. The Eclipse Project Updates did find things, but I think they buggered up my install, so from now I just avoid them.
    install sites
  3. When presented with the available updates, select Pydev. The Pydev Extensions are a paid feature, and I am not using Mylyn.
    updates
  4. Another restart. If you check, you will notice that the Pydev Extension site has been removed. This means that from now on, to update Pydev, you can go through “Search for updates of the currently installed features” and not the “Search for new features to install” route.

Step 3. Install Subclipse

  1. Subclipse is a new feature, so still as root in Eclipse go to “Search for new features to install”.
  2. This time you have to add a New Remote Site. You get the necessary information from the Subclipse site.
  3. After that continue through the wizard. From the presented choices, I only selected Subclipse, minus the Revision Graph which I could not get some dependencies for.
    subclipse updates
  4. You need that JavaHL stuff, and contrary to the way things look above, you did not just install it. :( sudo apt-get install libsvn-javahl
  5. Now it gets complicated! Start up Eclipse, and see if it cluedin and figured out what you just did. From the menus select Window > Preferences, and in the popup window select Team > SVN. Under the SVN Interface, you need to see a version of some kind. If you see “Not Available”, Eclipse did not figure it out.
    Eclipse preferences
  6. If it is not right, first check you got the correct version of everything. There is a Subversion server – Subclipse version compatibility, and then Subclipse – JavaHL version compatibility. So, as an example, I am trying to connect to SourceForge which supports Subversion v1.5. So I will need Subclipse at least v1.4, which needs JavaHL v1.5. I am using Mint5 – Ubuntu Hardy – and according to this, I will need to grab JavaHL from their backports repository. If you are running Intrepid – Mint 6 – or later, you should be fine. Including additional repos in your system I will leave as an exercise to the reader.
  7. If after all of that it is still not working :eek: , you will need to edit your eclipse.ini. I did not have to do this, and I suspect that newer versions of Mint will be the same.

Last word

To remove this mess from your system:

$ sudo bash
# apt-get purge eclipse
# apt-get autoremove
# rm -rf /usr/lib/eclipse

Maybe I’m just spoiled, but all this should not be this difficult!

Update 09/10/26: So apparently I forgot an important step. After doing all these updates you have to rm -rf ~/.eclipse to reset everything on your account. Also, Pydev has been restructured (again), and re-released as version 1.5. Unfortunately, they forgot to notify the update manager, and you have to do it manually – note the ‘Quick Install’ cutesie note on the right hand side.

Did I mention that is beyond-stupid complicated?

September 29, 2009

Big loss for Linux today

Filed under: linux — siking @ 6:33 pm
Tags:

Approximately 2 and half years ago I became a serious proponent, dare I say evangelist, of Linux. As of today that is no longer the case.

Without going into all the boring and filthy details, I had some minor problems running a new 64bit kernel, on somewhat new-ish hardware that almost supports 64bits, with some older software. I tried to downgrade – clean reinstall – to something which I had previously confirmed on another machine works perfectly fine. After the install I had serious problems even connecting to the local network – plain DHCP. This is normally an immediate KO criteria for me, and I don’t even bother trying to figure out anything else. This time I did give it a second chance, only to run into more serious problems. :mad: Well, I’ll just reinstall back what I had at the beginning of the day and live with the small issues, right? Last time, the install took me under 60 minutes. After the second install I could not get anything to work again! How is it possible to use the exact same install media, on the exact same machine, and get two completely different results? After a day of pondering this dilemma – downtime for my employer – I am installing that other system first thing tomorrow morning. :sad:

Here are some myths, that I personally have proven wrong:

Linux is cheaper. You know what? Nobody in the corporate world cares! I have yet to meet anyone anywhere who actually gives a hoot to save money for their employer in this area. Licensing costs for proprietary software, in the corporate world, are somebody else’s problem somewhere else and the software is effectively free to us here.

Linux is technically superior. That may be, but only if you are a geek that reads source code all day. One of my colleagues, whom I respect very much, runs Windows on his desktop, has a MacBook sitting on the desk next to him, wears OpenBSD T-shirts, and runs several different Linuxes in the back room. He is quite fluent in all these OSes. When someone asks him which OS he prefers, his answer is always: “whichever gets the job done the fastest.” The “job” that he is faced with on a daily basis: some marketing drone hassling him to “just get my laptop to work!” Bottom line: All operating systems will have problems. It just so happens that for Windows the problems are assumed by the (l)users, and there is always somebody around who knows how to “just get it to work.” However, if you run into a problem with your Linux machine, everyone just gives you that you-asked-for-it look and a shrug.

I am not expecting to see Linux on the corporate desktop any time soon. :cry:

June 9, 2009

Converting graphics fast

Filed under: iotal, linux — siking @ 9:16 pm

Every once in a while I have to covert/shrink/modify a picture. First off I suck at graphics (one of my sons is WAY better at it), but, like this time, I had to convert something from .svg to .jpeg and shrink it too. The package that you need to do this is imagemagic, and the command is: 'convert <orginal.svg> -resize 150 <target.jpeg>'. There is a huge number of switches that this thing takes. Check it out!

June 8, 2009

Installing VMware Server on Linux Mint (Ubuntu)

Filed under: iotal, linux, virtualization — siking @ 8:52 pm
Tags:

Installing VMware Server is not your typical point-and-click procedure. However, it is quite easy even for those who are a little squeamish with the command line.

Here I will be talking about installing VMware Server version 1.0.9 on Linux Mint 5 – I don’t do the latest’n'greatest anymore. Linux Mint is fully compatible with Ubuntu 8.04, so I would expect this procedure to be very similar, if not identical, for most derivatives and close versions.

VMware are very good at hiding all the useful stuff on their website! :roll: Here are all the pieces you are going to have to download:

  • VMware Server will require you to build kernel modules. You will need kernel header files for that. On Mint/Ubuntu you already have them at /lib/modules/$(uname -r)/build/include. The installer, further below, will be able to figure it out automatically, assuming you have all the defaults for your system.
  • To build stuff, you will need tools. I just grabbed the build-essential package and that had everything.
  • The VMware install guide is linked here – you want the Admin Guide, starting somewhere around page 36. I once accidentally found a much more succinct Install Guide on their page, but I can’t find it again. :( Below is only the relevant distill; however, I would still recommend that you have at least a browse through theirs in case you run into problems. There is also a detailed guide here, which may be of some use if you run into problems.
  • VMware is pushing the newer 2.0 version; older version are here – you want to get the “VMware Server for Linux. TAR Binary.” Right on that same page, notice the register for your free serial number(s) link. The server is free, but they will need an e-mail address where they can push more stuff on you.

First you will need to unpack the TAR Binary. You will only need this once, so you might as well do it in /tmp – which gets automatically emptied each time you reboot. Open up a terminal:

cd /tmp
tar xvf ~/Downloads/VMware-server-1.0.9-156507.tar.gz

And continue with the install:

cd vmware-server-distrib
sudo ./vmware-install.pl

I took defaults for everything except the following:

In which directory do you want to install the binary files?
[/usr/bin] /usr/local/bin

On Ubuntu, or any system that has a package manager, it is good idea to keep stuff you install manually somewhere else. The Linux file system has a place specifically for this purpose, and that place is /usr/local.

If you screw the install up, you can run sudo /usr/local/bin/vmware-uninstall.pl so that it cleans up, and then start again.

Next is the configuration. The installer will prompt you, or you can just run explicitly sudo /usr/local/bin/vmware-config.pl. Any time afterwards you want to change something, you will need to rerun this program. For Linux Mint 6 (Ubunt 8.10) or perhaps later, you might need this patch before you configure the VMware – suggestion is to run the configuration program, if it fails install the patch, if it passes just move on. Again, I took defaults except:

You can safely ignore the complaints about the extensions on the Icons, as well as the wrong version of the gcc compiler.

For networking, make sure you bridge all interfaces (ethernet and wireless). I did not use NAT.

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] /home/vmware/machines

The way I have my disk partitions set up, I had to override where the machine images will be kept. The images will be big, make sure the place you tell it has enough space.

If everything worked fine, you should get a new menu entry Applications > System Tools > VMware Server Console. The first time you try to run it, it will not work. :( If you run vmware from the command line, you will get:

/usr/local/lib/vmware/bin/vmware: /usr/local/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/local/lib/vmware/bin/vmware: /usr/local/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
/usr/local/lib/vmware/bin/vmware: /usr/local/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/local/lib/vmware/bin/vmware: /usr/local/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
/usr/local/lib/vmware/bin/vmware: /usr/local/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/local/lib/vmware/bin/vmware: /usr/local/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)

According to the Gentoo team, this file is useless. Once you delete that, the VMware console should come up normally.

Update 09/06/18:

I just tried to do the above on Ubuntu 8.10 64bit. I did need the patch as mentioned above, and I did not get the error about libgcc_s.so.1 when starting vmware. However, I did run into an issue starting up my virtual machine. At first you get a blank error (as in: “The process exited with an error: End of error message.”), but if you turn on debugging in the advanced options you can see the actual error:

Version mismatch with vmmon module: expecting 138.0, got 137.0.
You have an incorrect version of the `vmmon' kernel module.
Try reinstalling VMware Server.

And they’re not kidding. The fix is that you have to configure vmware twice! :shock:

Then there was a second surprise: my arrow keys (along with a bunch of others) did not work inside vmware. There is an explanation as well as a solution, at the VMware Knowledge Base.

Every once in a while the keyboard will stop responding to mapped keys – things like Crtl-Alt-LArrow to switch desktops – you can run setxkbmap to fix it.

Update 09/06/24:

For some other reasons, I updated my box to Ubuntu 9.04 AMD64. When recompiling vmware I hit some SSL key errors.

Update 09/07/22: Bottom line: If you are going to go with VMware 1.x do not go over Ubuntu 8.04 (Mint 5). After several months of running it on 9.04×64, I feel it is quite unstable! Also, if you do want to virtualize 64bit operating systems, make sure your BIOS supports this thing … upfont. :evil:

May 22, 2009

Linux Backup & Reinstall

Filed under: iotal, linux — siking @ 3:38 pm
Tags:

Last week I spent some time playing with DreamLinux (again), trying to get it onto a thumb-drive / memory-stick / whatever-you-call-those-things (again). Dream hosed my system (again). This time I lost my swap?!?! I’m sorry guys, but that installer sucks! It’s just as well, there were a few changes that I had been wanting to do to my system anyways which would require a complete reinstall.

The procedure that I basically follow is:

  1. Backup home. You have to do this as root, so that hoses the ownership of all the files. I know there is a way to do it correctly and preserve the ownership, but it actually does not matter that much – see further below.
  2. Install the system wiping the drive(s) clean.
  3. Install critical updates. In the case of Mint I do only levels 1 and 2. I am running Mint 5, which is based on Ubuntu 8.04, so at this point I also install the top bugs from Ubuntu 8.04.2.
  4. Clean the system – remove things that you definitely do not want. Install restricted drivers.
  5. Create a second “administrator” account, log in to populate the home.
  6. Crete all other users, log in to each to populate their home. I have an (apparently) weird habit of putting all my users into the group “users” as opposed to the default group == username, and giving their home 700 permissions.
  7. Log in as the “administrator” and restore backups. Can’t restore (or backup for that matter) my own home when I am using it. I used to get around this by running a live-CD, but this seems like so much less work. Change owner and group of all the user’s files to themselves.
  8. Install all apps.
  9. Get my kids to install all games. :lol:

There is one app that, IMHO, should get special attention: Eclipse. Eclipse has it’s own package management built in. I normally install Eclipse along with any plugins that I want through Synaptic, and then I “pin” them – lock that version – so that Synaptic or Mint Update will not try to update these. I then go into Eclipse – have to run it as root in this case – and update the whole thing from within Eclipse.

April 10, 2009

Getting Linux distro name and version

Filed under: iotal, linux — siking @ 9:56 am
Tags:

It appears that I am not the only one that would like a consistent way of getting the Linux distribution name and version number for any and all distros. And it appears there is no solution to this dilemma. The following is my attempt at such a solution.

The script will currently give you correct results for only about 60% of ditros out there. Anyone want to add the algorithm for their fav distro, please do so in the comments. I will try to maintain this up-to-date.

#!/bin/bash

if [ -e /etc/*-version ]; then
	if [ $(egrep -q '[[:alpha:]]' /etc/*-version) ]; then
		# the file contains only the version, not the name
		pushd /etc &> /dev/null
		name=$(ls *-version)
		popd &> /dev/null
		printf ${name%-version}
	fi
	cat /etc/*-version

elif [ -e /etc/lsb-release* ]; then
	# This is probably the most reliable method, if it is available.
	description=$(lsb_release -d)
	echo ${description#Description:}

elif [ -e /etc/issue ]; then
	# This is quite unreliable, as admins are encouraged to edit this file to their heart's desire.
	head -1 /etc/issue | sed {'s/ [@\][[:alpha:]]//g'}

fi

March 15, 2009

Pimp your desktop

Filed under: iotal, linux — siking @ 4:37 pm

If downloading and installing stuff from gnome-look.org is too complicated for you, as it is for me, then try GnomeArtNT.

Got to give credit where credit is due: I first heard about this app at MintCast #5.

February 25, 2009

Wine-ing

Filed under: linux, windows — siking @ 2:10 pm

For the past several days, I have been experimenting with Wine – the WINdows (not!) Emulator. The first, perfectly valid, question is: why bother? Well, I have several devices (iPod, Nokia smart phone, Magellan GPS) that all come with some supporting software – software that will only run under Windows. Allegedly Wine has come a long way. However, I was met with disappointment in every single case. In several cases, the software did not even install, even though the installer said it did. If it did manage to install, it certainly did not work properly, and in most cases it was not able to detect the device it belongs with. Wine is not even able to keep track of what is where, and was not able to uninstall any of the software – rm -rf ~/.wine does the trick nicely. Lucky for me, there are Linux-native replacements that do what I need done.

For my buck, wine is a waste of effort; if I actually need Windows then I will stick with running it in a virtual machine.

February 18, 2009

Launchpad.net PPA changes

Filed under: iotal, linux, ooo — siking @ 10:30 am
Tags:

I got a few third-party repos on my Linux box, and for like the past month I have been getting some errors when refreshing my packages:

W: GPG error: http://ppa.launchpad.net hardy Release: The following
signatures couldn't be verified because the public key is not
available: NO_PUBKEY 60D11217247D1CFF
W: GPG error: http://ppa.launchpad.net hardy Release: The following
signatures couldn't be verified because the public key is not
available: NO_PUBKEY FCA4A9D8F45955CE

All this comes from outdated GPG keys due to some changes at Launchpad.net: info and alternate solution.

The first one comes from OpenOffice.org3 – full instructions here. All you have to do is update your key with: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247D1CFF.

Update 09/09/24: OpenOffice.org3 is no longer available for Hardy / Elyssa.

The second one is from Transmission – again, full instructions. For that one, I did two things: 1) update the repo source to http://ppa.launchpad.net/transmissionbt/ppa/ubuntu (from http://ppa.launchpad.net/bortis/ppa/ubuntu), and 2) update the key with: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 365C5CA1.

For the sake of cleaning up, I would still like to find out how to delete the old keys and perhaps more importantly which keys to get rid of.

As a last bit, I would like to say that all this is the opposite of intuitive – definitely an area for improvement.

January 30, 2009

Desktop system monitor

Filed under: iotal, linux — siking @ 11:50 pm
Tags:

So far I have been using the canned GNOME system monitor, but I decided that I want a little more eye-candy, some more information, basically just more. Googling around a bit, I first looked at Screenlets. After spending a day with it I decided against it, because my desktop ended up way too cluttered once I got everything that I wanted on there – I am keeping it around, however, for another project that I have in mind.

Eventually I found Conky. The nicest thing – in my mind – about it is that it is old-school: the whole thing is configured from a .*rc file, and that uses bash-like syntax.

I am not much of an artist; here is a screenshot of my Conky.
Conky screenshot

I am more of a coder; here is my entire .conkyrc.

alignment bottom_left
border_margin 0
border_width 0
color1 dark slate grey
color2 steel blue
default_color slate grey
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
font -*-helvetica-medium-r-normal-*-11-*-*-*-*-*-*-*
gap_x 20
gap_y 30
minimum_size 300
own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal
pad_percents 2
short_units yes
total_run_times 0
use_xft no

TEXT
${font -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*}${color1}
${alignc}${pre_exec id -un}@${nodename} ${machine}
${if_existing /etc/issue}${alignc}${pre_exec sed {'s/ [@\][[:alpha:]]//g; /^[[:blank:]]*$/ d'} /etc/issue}${endif}
${alignc}${sysname} ${kernel}
${alignc}${uptime} uptime
${color}${font}${hr 2}
${color}CPU ${cpu cpu0}% ${freq}MHz ${ibm_temps 0}°C
${color}FAN ${ibm_fan}RPM
${color}MEM ${memperc}% ${color2}${membar}
${color}SWAP ${swapperc}% ${color2}${swapbar}
${color}sda2 ${fs_free_perc /}% ${color2}${fs_bar /}
${color}sda3 ${fs_free_perc /home}% ${color2}${fs_bar /home}
${color}diskIO ${diskio sda}
${color}${diskiograph sda 30 0000ff ff0000}
${hr 2}
${if_gw}${if_up eth1}
${alignc}WiFi: ${addr eth1}
${alignc}${wireless_essid eth1} ${wireless_link_qual_perc eth1}%
UP ${upspeed eth1}kB/s${alignr}DOWN ${downspeed eth1}kB/s
${upspeedgraph eth1 30,150 ffff00 00ff00}${downspeedgraph eth1 30,150 ffff00 00ff00}
${totalup eth1}${alignr}${totaldown eth1}
${else}
${alignc}Ether: ${addr eth0}
UP ${upspeed eth0}kB/s${alignr}DOWN ${downspeed eth0}kB/s
${upspeedgraph eth0 30,150 ffff00 00ff00}${downspeedgraph eth0 30,150 ffff00 00ff00}
${totalup eth0}${alignr}${totaldown eth0}
${endif}
${alignc}GW: ${gw_ip}
${else}No network
${endif}

Note the ATI symbol is from my desktop wallpaper (the X300 black). If you do not care about how things work as long as they do, then you can stop reading now.

Conky basic tutorial

Following is a discussion of how I built up my Conky config file; I am hoping it will serve as a basic tutorial for anyone who is just starting out.

First thing, I surfed the Internet to see what others have done, and started planning out what I would like to have. Then I got down into the guts of the thing. My Conky basically has three blocks: system stats, hardware stats, and network stats.

The config file has two sections: a configuration section which describes the behaviour of Conky, and a variables section which describes the output – what you will see on the screen – of Conky. The configuration section is allowed to have comments anywhere and only lines that do not start with the # character will actually be used. The variables section starts with the configuration command “TEXT“, and is read literally. This means that you cannot have any comments in there, as they will be treated as text to be displayed.

As a first step I dumped everything from the Conky man page into a new config file (yes, this is really old school :grin: ) 'man -P cat conky > .conkyrc'. Open that up in an editor (vi of course!), delete everything above the line “CONFIGURATION SETTINGS”, and everything starting from line “EXAMPLES” down. Comment out (append the # character in front of) everything else. You now have a blank configuration file that contains all the instructions.

System stats block

This block is displayed with the following variables (code?):

${font -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*}${color1}
${alignc}${pre_exec id -un}@${nodename} ${machine}
${if_existing /etc/issue}${alignc}${pre_exec sed {'s/ [@\][[:alpha:]]//g; /^[[:blank:]]*$/ d'} /etc/issue}${endif}
${alignc}${sysname} ${kernel}
${alignc}${uptime} uptime
${color}${font}${hr 2}

Although messing around with fonts is actually the last thing I did, I will discuss it first. The configuration command font -*-helvetica-medium-r-normal-*-11-*-*-*-*-*-*-* sets the default font. For the system stats block I wanted to use a bigger font, so on the first line of the variables section I just raised the point size and bolded the font. Every line after this will use this new font, until you get to a blank ${font} variable (on the last line of this block), which resets it back to the default. One more thing worth mentioning, is that when I ran conky from the command line, it complained that it could not load the default font. However, it did display the way that I wanted so I just ignored this error.

I also changed the colour of this block with ${color1}; this is actually a variable which is defined in the configuration section with color1 dark slate grey. The colour works similarly to the font, in that it will be in effect until a blank ${color} resets it back to default. The default is defined in the configuration section with default_color slate grey. All these predefined colour names come from your system, and they can be found in /etc/X11/rgb.txt.

Every line in this block starts with the variable ${alignc} which centres all text following it up to the end of that line only.

One the first line that actually displays something, I wanted the login name @ machine name and the machine architecture. Conky provides variables for the machine name and the machine architecture, but surprisingly not the login name. You can get the login name from the system with id -un. Conky has several different ways of running system commands. The most popular is ${exec command} which will be ran periodically, and ${pre_exec command} which will be ran only once. Since the user name does not change, running it only once is good enough.

On the next line I wanted to have the name of the distribution that I am running. Again Conky does not provide a canned way of doing this, and in fact there is no standard way of doing this in the Linux world! I would expect my solution to work on only about 1/3 of all the distros out there. The idea is that there is a file (/etc/issue) that sometimes holds the name of the distro, along with some additional characters – see 'man issue' for more information about this file. I strip of the extra information and any blank lines with the sed command, and again this needs to be executed only once ${pre_exec ...}. The whole thing is wrapped in an if statement, that tests for the existence of this file. If you need to adjust this for your particular distro – good luck. :twisted:

Next two lines show the name of the operating system, the kernel version, and the uptime. All these Conky provides canned variables for. The whole thing is closed with a horizontal line of 2 pixel thickness.

Hardware stats block

${color}CPU ${cpu cpu0}% ${freq}MHz ${ibm_temps 0}°C
${color}FAN ${ibm_fan}RPM
${color}MEM ${memperc}% ${color2}${membar}
${color}SWAP ${swapperc}% ${color2}${swapbar}
${color}sda2 ${fs_free_perc /}% ${color2}${fs_bar /}
${color}sda3 ${fs_free_perc /home}% ${color2}${fs_bar /home}
${color}diskIO ${diskio sda}
${color}${diskiograph sda 30 0000ff ff0000}
${hr 2}

In this block I was changing the colours quite a lot, and so I reset every single line with ${color} whether it needed it or not just to keep things legible, and changed the colour on the line as needed. Again, ${color2} is a variable that is defined in the configuration block with color2 steel blue.

The two variables ${ibm_temps 0} (temperature of the CPU) and ${ibm_fan} (speed of the fan) are architecture dependant, but Conky provides plenty of other canned variables to get this information from other architectures. You will have to consult the manpage.

The degree Celsius took only a little while. There are a lot of suggestions on the Internet, that involve all sorts of hacks, some of which work and some of which don’t and all of which are unnecessary. I just picked a plain font that already contains this symbol. Done!

The rest of the information, hopefully, is self-explanatory, except perhaps for the last graph. The ${diskiograph (device) (height),(width) (gradient colour 1) (gradient colour 2) (scale)} has a lot of options. The device is the Linux naming convention of disks (hda, hdb, sda, sdb, whatever). The height and width are both in pixels. I use only the height, and by having no width, the graph will take up the maximum available width – more on this below. The first gradient colour is what the graph will show on the right side, the second colour is what will be on the left side, and the graph will step between the two in the middle. Unfortunately, I could not get the second colour to “take” – see the screenshot above – no idea if this is a bug or what. Last is the scale of the graph; from the available documentation I could not figure out what exactly this does, so I left it blank and let Conky pick something for me.

Network stats block

This block has the most complicated logic. There are actually two enclosed if statements. The outermost is:

${if_gw}
... network stuff ...
${alignc}GW: ${gw_ip}
${else}No network
${endif}

The only way in Conky to find out if the network is actually connected to anything, is by detecting if there is a gateway, using ${if_gw}. For the moment I will skip the middle “network stuff”. At the end Conky prints, centred, the gateway IP address. If there is no gateway ${else}, then you will get the plain text “No network” at the bottom of Conky. And lastly ${endif} ends the if statement.

Now for the network stuff. As a first attempt I had something like:

${if_up eth0}
... wired network stuff ...
${endif}
${if_up eth1}
... wireless network stuff ...
${endif}

The way that the GNOME network manager works, is that in order to turn on wireless (eth1 in my case), it must turn on all networking first including the ethernet card (eth0 in my case). Using the above, when wireless was on, I would see both the wired and the wireless stuff. So I had to change the logic to:

${if_up eth1}
${alignc}WiFi: ${addr eth1}
${alignc}${wireless_essid eth1} ${wireless_link_qual_perc eth1}%
UP ${upspeed eth1}kB/s${alignr}DOWN ${downspeed eth1}kB/s
${upspeedgraph eth1 30,150 ffff00 00ff00}${downspeedgraph eth1 30,150 ffff00 00ff00}
${totalup eth1}${alignr}${totaldown eth1}
${else}
${alignc}Ether: ${addr eth0}
UP ${upspeed eth0}kB/s${alignr}DOWN ${downspeed eth0}kB/s
${upspeedgraph eth0 30,150 ffff00 00ff00}${downspeedgraph eth0 30,150 ffff00 00ff00}
${totalup eth0}${alignr}${totaldown eth0}
${endif}

Basically, I switched the two around, and combined them into just one if statement: if wireless is on ${if_up eth1}, display wireless stuff, ${else} assume wired is on; end the whole thing with ${endif}. If wired is not on, there will be no gateway, which is already handled by the previously discussed if statement.

The information displayed is almost the same in both the wired and wireless case. First centred line is the device’s IP address. For wireless I have one extra line showing the wireless SSID and the percentage of the quality of the signal, again all centred. Next I show the up speed on the left side of the window, and the down speed on the right side ${alignr} of the window. Next line shows two graphs, back to back: history of the transmission speed, upload first and download second. I force the graphs to be 30 pixels high and 150 wide each. The combined width is, therefore, 300 pixels. This is the widest item in my entire Conky display, and everything else is formated according to this … except when there is no network at all. In the case there is no network, I force the width with the configuration statement minimum_size 300. Lastly, the graphs go from green 00ff00 on the right to yellow ffff00 on the left. Again this variable has an optional scale, just like ${diskiograph ...} above, which I chose not to use for the same reasons as above. Lastly I show the total upload bytes on the left and total download bytes on the right under the graphs.

One thing that may not be clear, is that in both cases there is also the same number of blank lines to maintain the same formatting. In the case of wireless, you will get a blank line right after the ${if_up eth1}, which if you look at my code way above is on the same line as the ${if_gw}. If the wired network is on, the ${if_up eth1} will NOT produce a blank line, but the ${else} will. In both cases, each of the two ${endif} will also produce a blank line. In order to see these in your own code, put any (unique) text on any line that does not have text, and test it that way.

Starting Conky automatically

Get into your session manager (or wherever you manage automatically started programs in your distro), and start Conky with 'conky --daemonize'. This will force it to run in the background. Oddly enough, if I used the background yes configuration command, this messed up my Nautilus.

All the above stuff took me approximately one day to figure out. The following took me four! First suggestion that I can give you, is to take the documentation with a serious grain of salt. From my experimentation, the various configuration commands do not do what they say they should do.

In the Conky FAQ, there is something about turning on the double buffering in your Xorg. For me, this makes no difference whatsoever.

All the important stuff is among the double_buffer and the four own_window* configuration commands. I tried all sots of combinations, until I ended up with:

double_buffer yes
own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal

However, every once in a while, with no warning or an explanation, Conky stops working! In those cases, I usually change the window type to anything else, restart Conky. Change it back restart Xorg. Repeat as necessary; after a few times, it starts behaving again. :shock:

The rest of the configuration commands are just for dressing and are completely optional.

January 27, 2009

Trimming some fat off Mint

Filed under: iotal, linux — siking @ 7:49 am
Tags:

The other day I went poking around in my Sessions Preferences (System > Preferences > Sessions). This is a tool that controls all the running background apps per user basis; versus Service Settings, which controls background processes for the entire machine. What are all those things and how did they get there? Some of them were placed there during initial installation, some showed up after installing certain apps, and some the user (possibly unknowingly) adds himself.

Sessions Preferences

The app has three tabs:

  • Startup Programs lists various programs that you can dis/enable next time you login
  • Current Session lists the currently running programs
  • Session Options has two controls

Unfortunately, I found that disabling certain items in the Startup Programs tab does not necessarily prevent them from showing up in the Current Session tab after a reboot. I am not sure if this is a bug, but it is at the very lest un-intuitive. Here is how I cleaned up my system:

1. Make sure that Startup Programs list what you want / need / consider important. Check everything off to start. Restart your X session – Ctrl-Alt-Backspace will do, as the normal logout may not be working at this point.

2. In Current Sessions kill everything that does not appear in Startup Programs. You will have to 1) select the app in question, 2) click Remove, and lastly 3) click Apply. It is actually sufficient to only Apply the changes after you remove the last one.

At this point I was left with the following:

  • compiz – (hopefully) self-explanatory. If you happen to kill it, it is not obvious how to get it back. I had to run ‘compiz‘ from the command line, and Reload Window Manager using the Fussion-icon utility – this utility is a must and should be installed by default.
  • nautilus – this apparently needs to be running to make a whole bunch of stuff work (desktop wallpaper for example). If you do kill it, you need to run ‘nautilus‘ from the command line and it will be able to figure out the rest on its own.
  • gnome-panel is where you keep everything that you want to launch. If you kill it, just restart it from command line.
  • gnome-session-properties which is the window you’re looking at. Note the trashcan icon next to it – this means that it will not be restarted next time.

3. At this point go into the Session Options, and click Remember Currently Running Applications. To prevent further pollution, make sure to check off Automatically remember running applications when logging out.

4. Lastly go back to Startup Programs, and turn on everything that you know you need. Restart your X session.

If you completely reboot after this, things may take a little longer to come back than usual. This is normal only the first time.

December 27, 2008

More Minty goodness?

Filed under: iotal, linux, ooo — siking @ 9:10 pm

Over the holidays I tried the recently released Linux Mint 6 – Felicia.

Nothing much changed in the installer from version 5 – Elyssa. I think the whole install took something on the magnitude of 15 minutes including formatting the disks – compared to Windows 2000 which was in the range of 45 minutes, and that does not include hunting down all the drivers afterwards. (I needed the Windows to update my BIOS. :razz: ) If you give the installer an Internet connection, it will download something (this will be on top of the 15 minutes install). I did not actually check, but I suspect it downloaded all the language packs which you otherwise get on the Universal DVD. I did have a couple of very minor complaints about the installer. It would be nice if you could turn off swap for the liveCD (yea, I know there is a command-line way of doing it), in case you are going to modify it. The new system did not know about my previous users, even thought I had their homes stored on a separate partition that I mounted as /home. I don’t really get the point of turning on/off the Fortunes in terminal as part of the post-install.

I experienced some problems with video. First I noticed that Xorg takes up more memory – around twice 120MB when idle, compared to twice 80MB. When starting the X server (hard reboot, or even just switching users), the last active user’s desktop would quickly flash by; I thought this at least a little odd. I tried to connect an external monitor (actually a television set with a VGA input), which totally screwed up my video settings. Not only could Felicia not figure out properly what resolution the monitor was, but even after disconnecting the monitor, the settings on my laptop LCD were screwed up on all user accounts, and all of them differently! Turning off the proprietary drivers did not make a difference. After that parts of the screen even temporarily stopped responding, so I would get this deco effect thing happening.

While browsing around I also noticed a bunch of new things in the Startup programs (see System > Preferences > Sessions) which have no description; so I have to go searching to see if I really want them or not. I think the biggest letdown from Felicia is that, just like Ibex, she does not come with OpenOffice.org 3. However, you can upgrade it yourself; here is how. If you do, you can dump ~/.openoffice.org2 the user settings are now stored in ~/.openoffice.org/3.

Update 09/09/24: OpenOffice.org3 is no longer available for Hardy / Elyssa.

Elyssa was exciting, young, slim, and perhaps a little inexperienced, but once you figure out how to touch her, she was open to try anything. Felicia is more mature, putting on the pounds just a little, but dependable; however, underneath she is a new woman, demanding and uncompromising, that you have to learn how to play all over again. In the end, Elyssa is going to be around longer than Felicia even on my machine. Even set up Elyssa XFCE edition on my son’s old Latitude. :mrgreen:

Next Page »

Blog at WordPress.com.