Archive for December, 2008

Logitech QuickCam E3560

Works with Ubuntu Intrepid and the proposed repository, along with V4l package from ppas:

Webcam

Installing Bazaar Distributed Version Control on SLES 10 SP2

I chose to install from source, the process is (tested on SLES 10 SP2 i386):

  • wget –no-check-certificate https://launchpad.net/bzr/1.10/1.10/+download/bzr-1.10.tar.gz
  • zypper in python-devel python-xml
  • tar xvfz bzr-1.10.tar.gz
  • cd bzr-1.10/
  • ./setup.py install

Now you should be able to run bzr from the command line.

Tags: , ,

Finally

AMD has released source code for 3d on R600 / R700 cards. This is awesome news. Now I am 50 / 50 on whether to keep using nvidia, or switch back to ATI (I have a 3870 sitting on my desk that I took out in frustration and bought an nvidia instead). With NVidia releasing their VPDAU this even further complicates the issue as it totally rocks.

64-bit Java browser plugin

We now have flash and java in 64-bit browsers. What are you waiting for?

64-bit java

To install the 64-bit java-plugin:

  • Download the plugin
  • cd /opt
  • sudo sh location_of_download.bin
  • cd /usr/lib/mozilla/plugins
  • sudo ln -s /opt/jre1.6.0_12/lib/amd64/libnpjp2.so
  • Restart Firefox

Also I used Sun Java JRE, which is installed like this:

  • sudo apt-get install sun-java6-jre
  • sudo update-alternatives –config java
  • Pick the one with sun java

Tags: , , ,

Why?

Maybe someone can answer this for me, I am confused. Why does the following code print ‘read(): Resource temporarily unavailable’ 80% of the time? That is the EAGAIN code, which is the same as WOULD BLOCK which means there is no data waiting to be read, but select is returning 1 saying there is data:

#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/errno.h>

int main(int argc, char** argv)
{
	int fd = open("/dev/lp0", O_RDWR | O_NONBLOCK);
	int ret = 0;
	int status = 0;
	char buffer[1024];
	char teststr[] = "This is a test\n";
	char XMIT_STATUS_OFFLINE[] = {0x10,0x04,0x02};
	char XMIT_STATUS_ERROR[] = {0x10,0x04,0x03};
	char XMIT_STATUS_ROLL[] = {0x10,0x04,0x04};
	char XMIT_STATUS_SLIP[] = {0x10,0x04,0x05};
	fd_set rfds;
	FD_ZERO( &rfds );
	FD_SET( fd, &rfds );
	struct timeval sleep;
	sleep.tv_sec = 5;
	sleep.tv_usec = 0;

	/* Offline status */
	ret = write(fd, XMIT_STATUS_OFFLINE, sizeof(XMIT_STATUS_OFFLINE));
	//printf("write() returned %d\n", ret);

	do {
		ret = select( fd + 1, &rfds, NULL, NULL, &sleep );
	} while (ret < 0 && (errno == EINTR));

	ret = read(fd, buffer, 1024);
if(ret == -1) {
		perror("read(): ");
	} else {
		status = buffer[0];
		if((status & 0x04) != 0)
		{
			printf("The cover is open.\n");
		} else {
			printf("OFFLINE is good.\n");
		}
	}
        close(fd);
        return 0;
}

Fedora 10

Trying out Fedora 10. Points of fun:

Edited for ignorance..