Sunday, August 12, 2012

Easily rebuild Debian package(s) with debug symbols

You can easily rebuild many (usually only C- and C++-source-based) Debian  (Ubuntu, Mint, ...) packages so that they include the debug symbols. Let me give a quick example for dpkg. (Just replace dpkg with your package name)

For this you need first the source code of the package:
mkdir /tmp/dpkg
cd /tmp/dpkg
apt-get source dpkg
cd dpkg*

Then you want to update the version number of the package so that you can distinguish your build from the default build:
sudo apt-get install devscripts
dch --local ~debug
In the editor just add a description like "Debug build of dpkg for local development" after the star and save the file. Please note that the version number has been automatically changed. 
(If you just want to increment the version number use --increment instead of --local ~debug)

Now you need to rebuild the package. I prefer to use pdebuild (uses pbuilder) to not clutter my system with dozens of development packages. pdebuild will automatically install the development dependencies and build the package inside a chroot environment.
sudo apt-get install pbuilder
sudo bash -c "export DEB_BUILD_OPTIONS='debug nostrip noopt' ; pdebuild --use-pdebuild-internal --buildresult .."
This will rebuild the package with debug symbols and without optimizations and place the .deb file(s) in the parent directory.

Now all you need to do is to install the packages with the debug symbols. I prefer to use gdebi because it also installs the package dependencies for the case that the original packages aren't installed yet.
cd ..
sudo apt-get install gdebi-core
find . -type f -name \*.deb | xargs -n 1 --no-run-if-empty sudo gdebi --non-interactive
Please note that this installs all the created .deb files in the folder but you might want to install only some .deb files! Use this command with care...

And this is it. You can now start to debug with gdb and there will be debug symbols.


There are two more noteworthy items:
First of all with ~debug in the package version your build has a slightly lower version number than the default packages. This means a normal sudo apt-get update && sudo apt-get dist-upgrade will restore the default packages. If you don't want this you might want to put these packages on hold.
Second is that you can discard of the created pbuilder environment with a simple sudo pbuilder clean run.

Saturday, June 23, 2012

VMware - Linux host - Enable 3D-acceleration in clients (S3TC problem)


If you can't enable 3D-acceleration in your VMware VM (missing Aero, Unity not working, ...) then you should check your log-file in your VM directory. If it contains the message "GLManager: Required extension GL_EXT_texture_compression_s3tc is missing" you can try the following steps:


First thing to try is to install libtxc-dxtn for Mesa S3TC support on the Linux host. (On Ubuntu 'apt-get install libtxc-dxtn-s2tc0') After that please ensure that you've restarted VMware Player or Workstation.


Note: This is most of the time an issue with Intel-integrated graphics.


If this doesn't work you can force S3TC to be enabled. For this just install driconf on the Linux host (on Ubuntu 'apt-get install driconf'), run it and force S3TC on with the button on the Image Quality tab. After that please ensure that you've restarted VMware Player or Workstation.


Note #1: Forcing S3TC on might yield unexpected behavior!


Note #2: Forcing S3TC on is done by driconf by setting force_s3tc_enable=true in the ~/.drirc file. For a quick test this can be also done by just exporting force_s3tc_enable=true.


Link #1: http://askubuntu.com/questions/56379/is-there-an-easy-way-to-enable-s3tc-on-intel-graphics
Link #2: http://communities.vmware.com/thread/318693

Sunday, March 18, 2012

Free offline virus scan for Windows

If you are in the urgent need to scan an infected Windows system then you definitely want to do an offline scan. Great that Microsoft now offers 'Microsoft Standalone System Sweeper Beta'.
Link: http://connect.microsoft.com/systemsweeper

Sunday, March 4, 2012

Disable Caps Lock in Ubuntu 11.10+ easily

How to easily disable the Caps Lock key in Ubuntu 11.10+ without fiddling with xmodmap.
Open the Keyboard "Layout application", select the "Layouts" tab and click the "Options" button. A list of rebinding options will appear. Expand "Caps Lock key behavior" and select "Caps Lock is disabled".


Magnet links and Transmission

How to enable Magnet links in Gnome-ish (Gnome 2, Gnome 3, Unity, Cinnamon, ...) desktop environments for Transmission BitTorrent client:



gconftool-2 -t string -s /desktop/gnome/url-handlers/magnet/command "/usr/bin/transmission %s"
gconftool-2 -t bool -s /desktop/gnome/url-handlers/magnet/needs_terminal false
gconftool-2 -t bool -s /desktop/gnome/url-handlers/magnet/enabled true



Source: http://maketecheasier.com/open-magnet-link-in-browser/2010/02/19