applications


Ubuntu: How to compile PrecoSAT v.570 under ubuntu 11.10

By downloading PrecoSAT from http://fmv.jku.at/precosat/ and trying to install it on Ubuntu 11.10 32-bit (Oneiric Ocelot) by:

    • Decompressing the files
    • and calling ./configure && make

I got the following error at make:

g++ -O3 -m32 -static -Wall -Wextra -DNDEBUG -DNLOGPRECO -DNSTATSPRECO  -c precomain.cc
In file included from precomain.cc:23:0:
precosat.hh:164:31: error: ‘ptrdiff_t’ has not been declared
precosat.hh:270:13: error: ‘ptrdiff_t’ has not been declared
make: *** [precomain.o] Error 1

which can be resolved by adding

#include <cstddef>

at the includes in the file precosat.hh


Ubuntu 11.10 (Oneiric Ocelot): Installing KVM 2

Without any additional comments, we managed to install KVM over a fresh installation of Ubuntu 11.10 (Oneiric Ocelot).

To do this we installed the following packages from the repositories and added our user to the libvirtd group.

We called kvm-ok to make sure that our hardware supports KVM properly and thus having better performance.
Installation Commands:

sudo apt-get install kvm libvirt-bin
sudo adduser $USER libvirtd
sudo apt-get install virt-viewer
sudo apt-get install python-vm-builder
sudo apt-get install bridge-utils
sudo apt-get install virtinst #for cloning

After these we created a virtual machine with the following command:

sudo vmbuilder kvm ubuntu --suite oneiric --flavour virtual --arch amd64 --mem 1024 --cpus 2 -o --libvirt qemu:///system --ip 192.168.0.100 --hostname uranus --part vmbuilder.partition --user userName --name MyName MySurname --pass myPassword --addpkg unattended-upgrades --addpkg acpid --addpkg nano

where in general, what it does is, create an Ubuntu Oneiric Ocelot JeOS virtual machine that has an AMD64 architecture, 1GB of RAM, 2 Virtual CPUs, it’s name is uranus, has a user with the username userName, has pre-installed some applications like nano and enabled automatic updates for the system.


Include more filetypes to a WordPress Installation Media Library

In the folder <Installation Path>/wp-includes/ there is a file called functions.php, inside this file there is a function called get_allowed_mime_types().
This function is in charge of defining an Array of mime types keyed by the file extension with a regex corresponding to those types.

So in order to add a new file-type to the white-list you just have to add a new line with the following format in the list:

'jpg|jpeg|jpe' => 'image/jpeg',

Where, on the left you define the extensions you want to be accepted separated by the vertical bar character (“|”) and on the right you give a file definition.