Dec 8, 2010

Cleaning my Debian system

I've come across some utilities that help in removing old files that lie on the filesystem and all they do is waste disk space.

There are some debian tools to deal with "orphaned" packages, like deborphan. Its usage is pretty simple:

# deborphan
.. follows a list of "orphaned" packages

I find more interesting the utility named "cruft". I use it like this:

# cruft -d /usr/lib > report.cruft.txt

This checks for files that must be in the system and files that should not be in the filesystem.

# cat report.cruft.txt | grep libGL
/usr/lib/FGL.renamed.libGL.so.1.2
/usr/lib/libGL.la
/usr/lib/libGL.so.180.44
/usr/lib/libGLcore.so.180.44
/usr/lib/xorg/FGL.renamed.libGL.so.1.2

These files should not have been there. So, I can delete them.

I'm not aware of all the options yet, but I'll look into it when I have some time to spend...

It's convenient to check what package provides some file:

# apt-file search libGL.so.1
fglrx-glx: /usr/lib/libGL.so.1
fglrx-glx: /usr/lib/libGL.so.1.2
libgl1-mesa-glx: /usr/lib/libGL.so.1
libgl1-mesa-glx: /usr/lib/libGL.so.1.2
...

Also, you can use dpkg:

# dpkg -S libGL.so.1

Nov 12, 2009

May 24, 2008

Linux electronic Whiteboard (2)

Many thanks to vanhtu1987 for his GREAT contributions (in fact, almost all of the work)

Dec 21, 2007

Linux electronic Whiteboard

After seeing this I decided to try it in GNU/Linux. After some time of no sleeping, I suceeded.

It's very basic, a bit buggy, but It works.

If you are a gentoo user, check this howto, written by stone.

If using Ubuntu 7.10 (gutsy gibbon):
  • First, make sure bluetooth is working
  • Download the program
  • Extract the file "demo" (no need for a configuration file now)
  • sudo apt-get install lswm libcwiid0 libsdl1.2debian libxext6 libxtst6
  • sudo ln -s /usr/lib/libXtst.so.6 /usr/lib/libXtst.so
  • Now we are ready to execute it: ./demo
  • Put the wiimote in discovery mode (press 1+2)
  • If the computer cannot connect with the wiimote, you can try to pass the wiimote address as the first argument: "./demo thewiimoteaddress". To obtain this address, execute "lswm", as you press 1+2 in the wiimote.
  • When the wiimote is connected, you should see four crosses and small rectangle at the center of the screen
  • Point the wiimote to the screen, and start moving your IR pen.
  • The position of the IR pen will show in the little square at the center of the screen. You can use it to adjust the wiimote so the distance between the points at the corners is maximized.
  • With the IR pen, click at the crosses, in this order: top-left, top-right, bottom-left, bottom-right.
  • After each click on the each cross, you have to press spacebar (you will notice that the cross you have to click is blinking)
  • When you press the spacebar the fourth time, the IR pen and the mouse pointer will be in sync. You can start to use your electronic whiteboard
  • To exit, press any wiimote's key.
If that version does not work for you, you can try earlier releases here.

If you want to compile it yourself, check the project in google code (go to the source tab if you want to browse the code).

UPDATE: I opened another branch in the project, with experimental code from vahtu1987 (a great contributor to the project). Here, check the svn/branches/cpp folder.

If you have subversion installed on your system (sudo apt-get install subversion), you can get a working copy just typing:

$ svn checkout http://linux-whiteboard.googlecode.com/svn/trunk/ linux-whiteboard-read-only

You need to install some development libraries:

$ sudo apt-get install libcwiid0-dev libsdl1.2-dev libxext-dev libbluetooth-dev

Maybe you will need to make a link for the libXTst library:

$ sudo ln -s /usr/lib/libXtst.so.6 /usr/lib/libXtst.so

If you can't get it working, post a comment. I will try to help you!!

GOOD LUCK, and happy hacking (linus dixit).

Dec 9, 2007

Perl

Perl has to be the most beautiful language that a computer can speak. Well, we all know that the computer speak in binary, really. Perl is a reasonable man-machine interface. I teach it to my students because it is powerful. It's a tool that let you do great things with computers.

I have used some computer languages: Basic, Pascal, C, C++, ADA... I liked C (i still use it), but the others... uff... they have serious flaws (there is no "perfect language")... all languages have pitfalls. I like C because it trusts the programmer, it let you do crazy things (take a integer and treat like a char or a string...). C++ and JAVA in the other hand, impose a developing model too strict. Specifically, they obligue us to use Objects. I think Object-Oriented languages are fine, and the OO metodology has its points, but I don't like to be obligated to think in some way. There are many situations that Objects are fine for, as there are many other situations that Objects feel ankward.

Nov 4, 2007

Fun with Debian

I am a long time linux user. My choice of distro is DEBIAN. I am amazed with this project, what has done and what is doing now.

The last little program that has come to my attention is "Qalculate", a powerful calculator. The windows calculator feels like a one-year boy TOY. It can do financial conversions, graphics, base changes, operation edits, etc... TRY IT!!!

Also, recently my Debian Unstable crashed while doing an upgrade (X-window-system was broken due to dependency problems, etc...), and I was forced to downgrade. Well, not exactly downgrade the system, I now have a mix of Unstable and Testing (the book "The Debian System" was of great help).

I can only say that we are very fortunate to have things like the GNU system, the Debian Project, all these free software that is so fantastic, in more aspects than one. I mean, it is great from the ethical point of view to use free software (in the sense Stallman says), and it is great from the technical point of view (I think UNIX and his derivatives are the technically superior OS).

Aug 13, 2007