Getting MOOS linking

I started a brand new project in CDT where I was using MOOS and I could not get my simple program to link. While everything looked fine on the surface I just could not get the IDE to link to the MOOS libraries. I know the OS and MOOS itself was not a problem as I had other projects in the same workspace which did link correctly. The only difference between those and this was that I setup this project from scratch, whilst the others I had not. It took me a while to figure it out, but in the end I had to resort to explicitly add the locations for the libs in the C++ project properties in CDT as shown in the screenshot below.

To get this this, you right click on the Project name in Project Explorer in CDT. In the C++ Linker section then explicitly add the two paths shown in the screenshot. I of course had MOOS installed in the default location (binaries are in /usr/local/bin and libraries in /usr/local/lib). So even if you have added paths to CDT and still getting linking issues, I suggest you add it explicitly to the C++ properties.

C++ Project properties

Host files on Ubuntu

If you are newish to Linux (like me) from Windows, then some of the simple things which come quite naturally to you on Windows is a little embarrassing and challenging.

For example, I got a new WHS and wanted to mount the music drive and wanted to create a new host file entry to point to the new WHS. Now on Windows this is quite simple and can be found in YOUR-OS-DRIVE\Windows\system32\drivers\etc\hosts. But on Linux you will find this in \etc\hosts. If you want to edit it you will need to type something like this a shell:

sudo gedit /etc/hosts

sudo is required as you need admin privileges to modify the file. gedit is the graphical editor; you can replace that with another editor of your choice.

Qt Eclipse Integration

If you are working in CDT and Qt then the Qt Eclipse Integration is quite handy and in my opinion much better than using the standalone Qt designer. Installation is pretty straight forward as described here.

Eclipse CDT Blues

Sigh, why is Eclipse CDT to flaky? Well, there might be a slight exaggeration in that but nevertheless, I did not have so many issues with Visual Studio / VC++. 🙄

I have uploaded this particular log file here if anyone is interested.

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb263d1f7, pid=20331, tid=3085625024
#
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing linux-x86 )
# Problematic frame:
# C  [libQtGuiCppIntegration.so.4+0x6531f7]  _ZN16QtCppIntegration12QLineControl18removeSelectedTextEv+0x27
#
# An error report file with more information is saved as:
# /home/amit/hs_err_pid20331.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb263d1f7, pid=20331, tid=3085625024
#
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing linux-x86 )
# Problematic frame:
# C  [libQtGuiCppIntegration.so.4+0x6531f7]  _ZN16QtCppIntegration12QLineControl18removeSelectedTextEv+0x27
#
# An error report file with more information is saved as:
# /home/amit/hs_err_pid20331.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Opening File explorer from a terminal

In Ubuntu if you want to open File Explorer from a terminal (especially as root) then you need to enter the following command: sudo nautilus

If you want this to run as a background process then just add an “&” in the end (without the quotes of course).

Default QT4 path

If you wanted to know the default path where QT4 is installed (on Ubuntu) then look in /usr/share/qt4/bin.

Redirects setup

After moving the blog to  WordPress, almost all my redirects should work now from the old blog posts to the new one. For example if you click on this old url http://desigeek.com/weblog/amit/archive/2009/10/25/installing-openscenegraph-on-ubuntu.aspx it should redirect you and you see the new and correct url.

Overall it was simple to setup via the .htaccess file and some simple regex. The only thing I found the hard way was that I should be using “RedirectMatch” when setting up the regex rule rather than the “Redirect” which is what I was using. You would use Redirect when trying to redirect without any variables.

So, as in my case I wanted to redirect from the old url (of community server) to the new one (of wordpress)

  • Old: http://desigeek.com/weblog/amit/archive/2009/10/25/installing-openscenegraph-on-ubuntu.aspx
  • New: http://desigeek.com/blog/amit/2009/10/25/installing-openscenegraph-on-ubuntu/

So I need to make the following changes:

  • Change the “/weblog” to “/blog”
  • Get rid of “/archive”
  • Get red of the “.aspx” extension

The following rule helped me achieve this:

RedirectMatch 301 /weblog/amit/archive/([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])/(.*)\.aspx$ http://desigeek.com/blog/amit/$1/$2/$3/$4

Of course there are a few more rules I have which I cannot go into details.

Along the way i also discovered a few interesting tools which can help you view the results – one is LiveHTTPHeaders; another good one is http://web-sniffer.net/.

If you are new to this, then a few very good tools online. I would suggest start with this post from Zo and this tutorial on regex.

i still have one outstanding issue where if I want to redirect part of the URL and not the complete thing, I am not sure how to do it. For example if I want to redirect the old url above to just the year/month of the post instead if the actual post, not sure how to go about doing it. So I want the url below to map to the the one below that.

  • URL to Map: http://desigeek.com/weblog/amit/archive/2009/10/25/installing-openscenegraph-on-ubuntu.aspx
  • Should map to: http://desigeek.com/weblog/amit/archive/2009/10/

Linux Hater blog

I was looking for something else and came across the Linux Hater Blog. I am not a Linux hater (am writing this on Ubuntu). Some people might think this is funny, but there is a dark undercurrent running in the posts. I honestly stopped reading after a couple of posts. I don’t know why is there so much hate against Linux in this blog.

Am surprised by the negativity on the blog. I am no Linux expert and am more comfortable in Windows, but having used more of Ubuntu (9.04 and 9.10) over the last few weeks for my studies has made be appreciate some aspects even more. Is it perfect? Of course not, and nor is Windows or OS X or insert-your-favourite-OS-here. Maybe I should try and start a blog hater blog.

Installing VMWare Tools in Ubuntu

I am now running the new Beta of VMWare Workstation 6, and it seems to be working fine in Vista x64 (RTM incase you are curious). The installation of Ubuntu which I am also running natively at home is supported as one of the OS’s in this new version of VMWare and installs without a hitch. However to install VMWare tools after VMWare automatically mounted that was a little more of an issue (especially for a newbie).

Since the two options are either a RPM file or a TAR file (nothing but a zip file) – those are no good for Ubuntu. Essentially you had to “unzip” the tar file and then install that. If you want to do this here are the steps (after the CD has been auto-mounted for you).

  1. Open a Console
    • In Ubuntu, to do this goto Applications => Accessories => Terminal.
  2. Type in the following two commands in the console as one after the other. This essentially sets up the tools needed to compile the code.
    • sudo apt-get install build-essential
    • sudo apt-get install linux-headers-`uname -r`
  3. Change to the directory where you extracted the tar file.
  4. Type in the following command to get this running.
    • sudo ./vmware-install.pl
  5. Just follow the prompts then and voila you are all set.

More Information:

Running Ubuntu

It might seem like a surprise to some of you, but then many others who are reading this probably won’t be surprised to read that I am now running a native instance of Linux on one of my machines are home.

I had an old machine (dual-proc PIII 1 GHz procs with 512 mb RAM) which was running Windows 2003 Server – and it had not been switched on for a while. I had many issues trying to get a working set of Linux. I started with Suse 10.2 and it seems like my blank CD’s were getting corrupt (was at the bottom of the 100 disc set and as you may have read, the bottom few discs are a hit or a miss – seems like the weight on top is not good). Anyway’s, eventually I was able to burn all the ISO’s successfully.

Another irritating situation was the bootable rom was a CD drive and the slave (which was not bootable) was a DVD drive meant I had to first burn all CD’s instead of a DVD for Suse 10.2. After a lot of frustration and misses I finally used the bootable internet installation CD and then install from the DVD (which is in the other drive), this itself was a bit quirky, but I was able to get around it. Eventually when it was up and running the first impressions were good and the resolution was good to and all the hardware was detected and installed.

After running it for a couple of days, I started hitting my knowledge of Linux (i.e. lack of it). It seemed if I wanted to use it as an end user then it was not as as simple as I thought it would be. There were many ways to do the same thing and many programs installed which did the same thing. The initial look and feel which was a lot like Windows (and the Start Menu somewhat like Vista) soon fell apart when I started using it for a couple of days and I started seeing how clunky the interface was!

It was then Karan suggested I should check out Ubuntu instead. As per him the problem with Suse is they change so many things in non-standard ways, unless you have been using it for a while and are familiar with it – definitely not for someone like me who had used Unix (including Microsoft’s flavor called Xenix) but never Unix – never seriously atleast. Can’t say I had heard of Ubuntu till then, but after a bit of research it seemed like the logical choice.

The installation went of smooth (the partitioner was much better than Suse), and it seemed like it was a much better experience from an enduser point of view. The only issue was that the screen resolution was at 1024×768 even though I had Suse running at 1280×1024. I searched online for a resolution and could not find anything that will fix this. As this resolution was “too big”, I formatted and switched back to Suse, but in the end decided that the higher resolution was a lower priority than a more usable Linux distro. Also since this was not going to be my primary machine, I was not that fussed about the resolution. I was in for a pleasant surprise though when I installed Ubuntu again, as this time (for some weird reason) the resolution it identified was 1280×1024!

I will be posting more of my Linux findings here over the next few weeks, however this would be lower priority than some of the other stuff I have been doing. Big Smile

Looking for a Linux distro?

Not sure which Linux distro to use, well, then check this out – if my calculations are correct there are 234 different distros available – wow! If you still cannot make up your mind then just run Windows! 🙂

CopySourceAsHTML For Visual Studio 2005

If you read the Ten Essential Tools Visual Studio Add-Ins Every Developer Should Download Now in MSDN Mag, then you are aware of CopySourceAsHTML which unfortunately works for only Visual Studio 2003. But if you are using VS 2005, fear not as Derick Bailey has updated the add-in. There is no installer (yet), but you can download the code and build it, which will locally also install the add-in.

What flavor of Linux to run?

What? Me ask what flavor of Linux to run? With all the hype of Star Wars, have I been consumed by the dark side??? On the contrary, I have been running a version in a virtual environment, and now have a old old machine, where I am comfortable running it natively. So, what version do you recommend and why? I do need a GUI since its been a while I worked in any of the Linux/Unix shells? I think I can guess the version Karan is going to recommend. 😉

Study finds Windows more secure than Linux

Seattle Times has a story from the RSA Conference, where surprisingly they find Windows is more secure than Linux. No, this is not a study done by Microsoft. They compared Windows Server 2003 and Red Hat Enterprise Server 3 running databases, scripting engines and Web servers (Microsoft’s on one, the open source Apache on the other).

Their criteria included the number of reported vulnerabilities and their severity, as well as the number of patches issued and days of risk — the period from when a vulnerability is first reported to when a patch is issued. On average, the Windows setup had just over 30 days of risk versus 71 days for the Red Hat setup, their study found. “That’s a very surprising statistic, and I must say the first time I saw this statistic I thought you messed with my database,” Ford said to Thompson. Their presentation started jokingly, with Ford reeling off Windows jabs and praising the virtues of freely shared software that’s developed collaboratively over the Internet. But they concluded with statistics showing that the Windows setup had a clear advantage over the Linux alternative.

The setups were hypothetical, however. Both were in the most basic configuration, an approach that some in the audience suggested may tilt the results in favor of Windows, which comes with more features. Ford said the idea was to represent what an average system administrator may do, as opposed to a “wizard” who could take extra steps to provide plenty of security on a Linux setup, for instance.

Linux Vulnerabilities Creep Toward the Desktop – another FUD?

LinuxInsider writes about the Linux vulnerabilities creeping towards the Desktop. Though the question is this another FUD? Smells like one…

As Linux increasingly hits the enterprise and consumer mainstream, a growing number of security threats are emerging which prey on holes in applications and files managed by desktop users.

According to some industry observers, a focus on digging bugs out of end-user applications makes perfect sense – not just as a means of protecting users, but as a method for wresting converts away from Microsoft.

[Listening to: Track 01 – New Artist (38) – New Title (38) (05:09)]