Daniel 'MaTachi' Jonsson

Monthly Archives: November 2011

How to Compile a gtkmm Project in Code::Blocks

To compile a C++ application using gtkmm in Code::Blocks, do the following steps:

  1. Open Project > Build Options…
  2. Select your project.
  3. On the Compiler settings tab, select Other options and add this to the field:
    `pkg-config gtkmm-3.0 –cflags`
  4. Select the Linker settings tab and type the following line in the Other linker options text area:
    `pkg-config gtkmm-3.0 –libs`

How to Fix Power/Battery Problem with Linux Kernel 3.x on Ubuntu 11.10

I have installed Ubuntu 11.10 on my laptop but I noticed that it drained a lot more of the battery than it should do. Apparently there are a couple of fixes to this:

To add pcie_aspm=force, i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1 to GRUB, do the following steps:

  1. Open the terminal and run: sudo gedit /etc/default/grub
  2. Add:
    pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1
    to
    GRUB_CMDLINE_LINUX_DEFAULT=”",
    so it should look somewhat like:
    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1″
  3. Close gedit and save the document.
  4. Now run the following line in the terminal to update GRUB:
    sudo grub-mkconfig -o /boot/grub/grub.cfg
  5. After a restart of your computer the new settings should get activated.

How to Set Up Egit with Github in Eclipse

When I the other day tried to set up Egit in Eclipse Indigo with Github I had major problems with guides not working. Two of the tutorials I tried where:

I got many errors and such… :/

But I found a really good post describing how to set it up in a current version of Eclipse:

2. In eclipse, configure the remote push
a. Window > Show View > Git > Git Repositories will add a repository explorer window.
b. In the repository window, select the repository and expand and right-click Remotes and choose Create Remote.
c. Copy the github repository URI from the github repository page and paste this in the URI box.
d. Select ssh as the protocol but then go back to the URI box and add “git+” at the beginning so it looks like this: git+ssh://git@github.com/UserName/ProjectName.git
e. In the Repository Path box, remove the leading slash
f. Hit next and cross your fingers. If your get “auth fail” restart eclipse and try step 5 again.
g. When you get past the authentication, in the next dialog select “master” for source ref, click “Add all branches spec” and “Finish”.

Now try a push to github. This worked for me but with all the fiddling around I’m not sure these instructions are perfect….

Link to the post: http://www.eclipse.org/forums/index.php/mv/msg/200890/648905/#msg_648905