OpenNI – error CS0006: cannot find metadata file `System.Windows.Forms.dll’

During installing the OpenNi kinect drivers, found here: https://github.com/OpenNI/OpenNI, I came across this error:

make[1]: Entering directory `/home/alex/kinect/OpenNI/Platform/Linux-x86/Build/Samples/SimpleViewer.net’
gmcs -out:../../../Bin/Release/SimpleViewer.net.exe -target:winexe -unsafe -o+ -r:OpenNI.net.dll -r:System.Windows.Forms.dll -r:System.Drawing.dll -lib:../../../Bin/Release ../../../../../Samples/SimpleViewer.net/*.cs ../../Res/AssemblyInfo-OpenNI.cs
error CS0006: cannot find metadata file `System.Windows.Forms.dll’
Compilation failed: 1 error(s), 0 warnings
make[1]: *** [../../../Bin/Release/SimpleViewer.net.exe] Error 1
make[1]: Leaving directory `/home/alex/kinect/OpenNI/Platform/Linux-x86/Build/Samples/SimpleViewer.net’
make: *** [Samples/SimpleViewer.net] Error 2

To fix it, simply install the following package:

sudo apt-get install mono-complete

Once finished, re-make and make install and everything should be dandy!

Java – .jar Error 127 /bin/sh: javac: not found.

If you’re getting a similar error to this while trying to compile java files (.jar) then you’re probably missing the jdk, in ubuntu it’s called “sun-java6-jdk” so just go ahead and install that and all should be good!

make[1]: Entering directory `/home/alex/kinect/OpenNI/Platform/Linux-x86/Build/Wrappers/OpenNI.java’
javac -d Release ../../../../../Wrappers/OpenNI.java/src/org/OpenNI/*.java
/bin/sh: javac: not found
make[1]: *** [../../../Bin/Release/org.OpenNI.jar] Error 127
make[1]: Leaving directory `/home/alex/kinect/OpenNI/Platform/Linux-x86/Build/Wrappers/OpenNI.java’
make: *** [Wrappers/OpenNI.java] Error 2

FIX:

sudo apt-get install sun-java6-jdk

Xfce4 Installed on Ubuntu 11.10, Global Menu Remains.

After installing Ubuntu 11.10 I headed straight for an install of gnome-shell, I’ve been using it for a couple of months without any issue and got used to it enough that it wouldn’t impede on my workflow. That was until this release, when it was officially supported by Canonical and all of a sudden it’s broken and mostly useless. So off to Xfce I go, it’s like gnome2 but way more customisable and actually pretty sweet.

However because I installed from a clean Ubuntu install rather than an xubuntu install I noticed that I still have the global menu (or appmenu-*) floating at the top under the default panel. To remove it, since it’s doing nothing and it looks plain stupid with transparency added to the panel.

It’s pretty simple to uninstall, just open up a terminal window and use the following command:

sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

Now just re-start X (log out and in again, restart the computer) and when you return, it should be gone.

And if you ever feel the need to want it back, maybe you want to give unity another try then use the following command:

sudo apt-get install appmenu-gtk3 appmenu-gtk appmenu-qt

Source: http://www.addictivetips.com/ubuntu-linux-tips/how-to-disable-global-menu-in-ubuntu-11-10-tip/

How to Install the ‘gnome-shell-extensions-mediaplayer’ Extension

The mediaplayer widget found on github, created by eonpatapon – (https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer).

I’ve been searching for a while for a good, solid widget style thing that’ll sit in the top of the gnome-shell panel which can control the music that’s playing in banshee, rhythmbox or whatever else you want to use to play your tunes.

 

Installation:

1. First you’ll need to grab some dependencies:
sudo apt-get install git gnome-common gnome-tweak-tool
2. Next download the files from the git repository as below (this will download the folder to whatever directory you’re currently in, in terminal):
git clone https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer.git
3. Once it’s finished download (it shouldn’t take too long it’s only about 2.30MB as of writing this guide), you’ll want to install using the following commands:
cd gnome-shell-extensions-mediaplayer
./autogen.sh --prefix=/usr
make
sudo make install
4. That’s it, it’s installed. Next you’re going to want to enable it, run gnome-tweak-tool and under extensions slide the newly installed extension to ON and it should appear next to the “Universal Access Settings” in the top right.

Fedora 15 Post Installation Guide

Install RPM Fusion

su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

http://rpmfusion.org/Configuration

Enable unsupported video and audio codecs

Get enhanced audio and video support in applications that rely on GStreamer:

sudo yum install gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-ffmpeg

Get enhanced audio and video support in applications that rely on xine backend:

sudo yum install xine-lib-extras-freeworld

http://rpmfusion.org/FAQ

Install Chromium Browser

Make a file called “fedora-chromium-stable.repo” in /etc/yum.repos.d/ and open:

sudo gedit /etc/yum.repos.d/fedora-chromium-stable.repo

Paste in the following, save and exit:

# Place this file in your /etc/yum.repos.d/ directory

[fedora-chromium-stable]
name=Builds of the "stable" tag of the Chromium Web Browser
baseurl=http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-$releasever/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0

[fedora-chromium-stable-source]
name=Builds of the "stable" tag of the Chromium Web Browser - Source
baseurl=http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-$releasever/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0

http://fedoraproject.org/wiki/Chromium

Install Flash

Download the YUM for Linux version from the adobe site – http://get.adobe.com/flashplayer/

Run the following in the folder you downloaded the file to:

su -c 'rpm -ivh adobe-release-i386-1.0-1.noarch.rpm'

Import the GPG key:

su -c 'rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux'

In 32bit run:

su -c 'yum install nspluginwrapper alsa-plugins-pulseaudio flash-plugin'

on 64bit run:

su -c 'yum install nspluginwrapper.{x86_64,i686} alsa-plugins-pulseaudio.i686 --disablerepo=adobe-linux-i386'
su -c 'yum install flash-plugin'

If you’re using Firefox, that should be all done but if you’re using Chromium you’ll need to open Firefox and play a video then close it and run the following:

32bit:

sudo ln -s /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/chromium-browser/plugins/libflashplayer.so

64bit:

sudo ln -s /usr/lib64/mozilla/plugins-wrapped/nswrapper_32_64.libflashplayer.so /usr/lib64/chromium-browser/plugins/nswrapper_32_64.libflashplayer.so

Close and re-open Chromium and head to YouTube to check that it’s working.

http://fedoraproject.org/wiki/Flash

Install Dropbox

Download and install the correct rpm for 32 or 64 bit from the Dropbox website – http://www.dropbox.com/downloading.

Follow this guide to remove the YUM errors you may encounter once the package is installed – http://alexsleat.co.uk/2011/05/24/how-to-fix-error-cannot-retrieve-repository-metadata-repomd-xml-for-repository-dropbox-please-verify-its-path-and-try-again/ .

Install VLC

sudo yum install vlc

Kinect Development – Day 1

Head over to this page if you want some tutorials on getting started with the Kinect and libfreenect, I’ll update more as time goes on and I have free time.

I’ve been meaning to grab myself an Xbox 360 Kinect for a while, not because I’m a big motion controlled game fan but for machine vision development. Within the first month of the Kinect open source drivers being released the coolest things were seen, from motion controlled media centres to 3D modelling. I’ll admit, I’m a little late to the game, mostly due to the amount of work in my final year at university and other general business. Over the summer I’ll have plenty of time to do a couple of projects and hopefully come up with something cool and contribute to the scene.

Anyway enough of the small talk, I’ve decided to blog in as much detail the journey through the development, from the installation of the libraries to writing the first and last bit of code as a sort of a set of tutorials for anyone else who wants to get into it.

There are currently two main sets of drivers/libraries out there libfreenect and OpenNI both sporting hip, cool, open source names. So which one do you choose? Well, here’s a brief description of both.

Let’s start with OpenNI, these are the Official PrimeSense (the people that Microsoft paid to actually create the Kinect) these allow access to audio, video and depth with the addition of PrimeSense’s NITE Middleware. NITE is the software library used for skeletal tracking, hand gesture recognition and scene analyzer (used to separate figures in the foreground from the background) .

Alternatively there is the libfreenect libraries, from the community over at openkinect.org. While these are admittedly lacking slightly in features such as skeletal tracking and hand gesture recognition they much make up for it in the dedication to open source and the creation of the best suite available. These have access to video, microphones, motors and LED with speakers currently being worked on. They work under a variety of language wrappers for most OS’s and will of course by my personal library of choice.

Fortunately, you won’t have to decide which one you’d prefer ’cause you can run them both on the same machine but you’ll have to look into licencing information for releasing projects with OpenNI so it’s unlikely you’ll want to combine them (or even allowed?).

libfreenect Installation:

OpenKinect’s getting started page provides a well enough documented installation guide that anyone should be able to get them up and running under Windows/Linux or OSX. With Ubuntu being the distro of choice for installation guide. - http://openkinect.org/wiki/Getting_Started

If you’re running Arch, there are a few AUR packages available however they all seem to have lacked updates for a few months but the manual build is pretty simple on the getting started page, I’ve also added a quick list of commands to get you there:

Grab the git copy of the libraries:

git clone https://github.com/OpenKinect/libfreenect.git
cd libfreenect/

Make, install:

mkdir build
cd build/
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib64/

Add your user to allow access to the connect by creating a group called video and adding your user to it:
note: this can be skipped if you don’t mind running as root/sudo

sudo nano /etc/udev/rules.d/66-kinect.rules
sudo usermod -G video username

Test the kinect with the example program:

bin/glview

If all went well you should have seen a sight similar to the screenshot above, if not check out the OpenKinect page for more information and see if the problems you’re having haven’t already been resolved.

Error: “end_request: I/O error, dev sr0, sector xxxxx” – Linux

Error:

end_request: I/O error, dev sr0, sector 537392

If you’re getting a similar error filling your screen once you’ve installed Ubuntu, don’t panic. It’s pretty common which is basically because Ubuntu (or any other Linux distro) can’t control your CD/DVD drive properly, it’s probably trying to open/close it but doesn’t know if it has or not. The problem is that you don’t get to see what Ubuntu wrote before because it’s filled your screen up with this error.

If you’ve just installed Ubuntu this probably happened when it wanted you to take the disc out and close the cd tray (if there is one) then hit Enter to finish the installation, so just do that and ignore this error.

Installing packages from CD in Arch Linux

Okay, so you have Arch Linux installed and let’s say you’re wifi isn’t working and you need the package “iwlwifi-3945-ucode-15.32.2.9-2-any.pkg.tar.gz” to fix this but you don’t have a wired connect. What do you do? Blast in your Arch cd, mount it, mount the packages sqfs file and install using pacman.

Mount cdrom:

mkdir /mnt/cdrom/
mount /dev/cdrom /mnt/cdrom/

Mount *-pkgs.sqfs:

mkdir /mnt/pkgs/
mount -o loop core-pkgs.sqfs /mnt/pkgs/
cd /mnt/pkgs/

Install pkg.tar.gz:

pacman -U package-name.pkg.tar.gz

How To: Install Pyrobot in Ubuntu

A quick guide for getting pyrobot running in Ubuntu, I’ve managed to get it running on 32bit and 64bit Ubuntu (10.10) so follow the guide accordingly to whichever architecture you’re using (64bit is about half way down the post).

32-bit

1. Download this file, or copy the below into a file and save it as pyroinstall.sh to your home dir.

#!/bin/sh

currentdir=$(pwd)

sudo apt-get install build-essential python2.6 python2.6-dev python-tk python-numeric libjpeg62-dev libncurses5-dev swig

wget http://pyrorobotics.org/download/pyrobot-latest.tgz

tar -zxvf pyrobot-latest.tgz

cd pyrobot

python configure.py

make

sed -ie 's/-e #!/#!/g' $currentdir/pyrobot/bin/pyrobot
sed -ie 's/-e # /# /g' $currentdir/pyrobot/system/version.py

echo 'export PATH=${PATH}:'$currentdir'/pyrobot/bin' >> $currentdir/.bashrc

Note: The ‘ in the code highlighter I have above won’t work in terminal, there isn’t much I can do about it so you’ll have to re-write it. Also if you’re doing this manually change the “$currentdir” to “~” if you are doing it in your home directory.

2. Make sure this file is in your home directory (e.g /home/alex/pyroinstall.sh) and make it executable:

 chmod +x pyroinstall.sh

3. Run the usual way (as super user because it has to install stuff etc):

 sudo ./pyroinstall.sh

4. It’ll ask you some questions, below are the answers I used – you can use other configurations if you know what you need. I also put the full output in pastebin ’cause it was bunging up the guide - http://pastebin.com/Kc5jyhja

1. 	2.6
2. 	/usr/include/python2.6
3. 	/usr/bin/python2.6
4. 	/etc/X11
5. 	none
6.01	n
6.02	n
6.03	n
6.04	n
6.05	n
6.06	n
6.07	n
6.08	n
6.09	n
6.10	n
6.11	y
6.12	y

5. Once it’s done reboot or run:

 source ~/.bashrc

6. Allow read/write/execute permissions for the pyrobot folder:

 sudo chmod -R 777 ~/pyrobot

You should all be done, try typing the following to get it running!

 pyrobot

64-bit

In order to get pyrobot running on 64bit, you basically need to add -fPIC to CFLAGS in all the relative Makefiles as explained in this mailing list post – http://www.mail-archive.com/pyro-users@pyrorobotics.org/msg00344.html - Lucky for you I’ve already gone through the effort of doing it and compressed it (download here you won’t need to if you are going to run the script though, it’ll do it for you..).

This script should download the file, configure and make and output the path to the .bashrc file for you (similar to the 32bit one does) so download this file, or copy and paste the script below into a file in your home directory:

#!/bin/sh

currentdir=$(pwd)

sudo apt-get install build-essential python2.6 python2.6-dev python-tk python-numeric libjpeg62-dev libncurses5-dev swig

wget http://dl.dropbox.com/u/307455/pyrobot-5.0.0_64bit.tar

tar -zxvf pyrobot-5.0.0_64bit.tar

cd pyrobot

python configure.py

make

echo 'export PATH=${PATH}:'$currentdir'/pyrobot/bin' >> $currentdir/.bashrc

2. Make sure this file is in your home directory (e.g /home/alex/pyroinstall64.sh) and make it executable:

 chmod +x pyroinstall64.sh

3. Run the usual way (as super user because it has to install stuff etc):

 sudo ./pyroinstall64.sh

Steps 4. 5. and 6. are the same as above..

Change Default Editor

If you want to change the default editor from emacs to anything else (this will change the default editor used in other terminal applications too..) use the following commands, just change gedit to whatever you’d like (vi, vim, kedit etc):

echo "export EDITOR=/usr/bin/gedit" >> ~/.bashrc
source ~/.bashrc

Any problems leave a comment and I’ll try and help as best as I can..

HowTo: Fix “Briefly unavailable for scheduled maintenance. Check back in a minute.”

After installing an update to WordPress I received the error:

“Briefly unavailable for scheduled maintenance. Check back in a minute.”

I was unsure if this was down to my hosts servers being temporarily down, going down during the update or if WordPress had simply failed to update whatever it was updating. Turns out it was the latter and it’s really easy to fix, first log on to your ftp, file manager or whatever for your hosting and browse to your wordpress install, in the root of this there should be a .maintenance file, just delete this and everything should be back to normal. Once back in the WordPress dashboard you may be asked to reinstall whatever failed however sometimes it will have completed the install and just not managed to delete this file.