Fight for the Internet 1!

Thursday, January 21, 2010

KDE 4.3 Fails to Load after System Update (Solution)

After installing my system updates yesterday, KDE 4.3 failed to load upon reboot this morning. It boots until it reaches the KDE login screen (with KDM) but it will let me log in from there at all.

The last updates installed were:
  • Package: xserver-common, version 2:1.6.4-2ubuntu4.1
  • Package: xserver-xorg-core, version 2:1.6.4-2ubuntu4.1
Though I suspect that the recent updates to gcc/g++ and libc/libstdc++ may have also affected this. I can't be sure.

Either way, I don't know exactly what the problem was, but here is the solution I found. My '.Xauthority' file in my home directory was the problem. I don't know what was wrong with it, but after I cleared that file of all contents, KDM let me log in normally. I hope this fix works for anyone else.

Tuesday, January 12, 2010

NetBeans with native OS Look and Feel

I have my own system color preferences, mostly low contrast and dark, in order to be gentle on my eyes. I know Java's programs tend to have good integration into the native "Look and Feel" of the working Operating System.

I have been trying out NetBeans recently on Kubuntu 9.10 Karmic and I had not been able to get the native colors to be enabled, until just tonigh.

NetBeans needs to be invoked with the following command argument --laf .

To get GTK/QT Look and Feel working, run NetBeans with this command argument:
netbeans --laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel

Monday, January 11, 2010

VirtualBox wins an award for Best Technology of 2009 from InfoWorld

InfoWorld has published it's opinions on this year's best technologies, and Sun's VirtualBox 3.1 is one. They find it to be a compelling high performance, cross-platform virtualization software alternative to VMware Workstation, noting that VirtualBox definitely supersedes this competitor in scalability.

VirtualBox 3.x supports up to 32 virtual CPUs per VM, while VMware Workstation supports just 4. "Add to this improved snapshot capabilities and 2-D acceleration for virtualized applications, and you have a solution nipping at VMware's heels in the general desktop virtualization space," writes InfoWorld's Randall C. Kennedy.

Another feature highlighted is VirtualBox's teleportation capability. The command-line function allows users to use a simple syntax to move a VM running under VirtualBox on one system and "teleport" it to another VirtualBox system, all the while preserving the VM's runtime state.

The most remarkable feature of VirtualBox is the speed with which it has developed into a real competitor in the desktop virtualization market. "In a little over a year, Sun has turned this relatively unknown fledgling from an obscure German software developer (Innotek) into a potent threat," observes Kennedy. "Our advice to VMware (and Microsoft): Be afraid. Be very afraid."

InfoWorld article: http://www.infoworld.com/print/105458

Friday, January 8, 2010

Convenient Audio Converter for Linux


I recently discovered a handy audio conversion program that does not have much publicity (mostly because the program is written by a French person, and not covered in any English websites I could readily find).

The program is called XCFA (X Convert File Audio). It supports a wide range of conversion for input and output formats, and when using it under Ubuntu, it offers the option to (attempt to) automatically install any missing dependencies (such as support for FLAC, AAC, etc). It has additional features besides conversion, but I won't cover those here.

The general use is to start the program, go to the Files tab, and import the music you want to convert. It analyzes the input files and presents you with your options for conversion. (If you open a lot of files, it can be a little slow, but it's fast when opening just a few.) It's pretty straightforward and this is one of the nicer audio conversion tools I have used since dBpoweramp back in Windows. (I would not quite call this dBpoweramp for Linux, but it's the closest I have used in years, and certainly a viable alternative.)

Included is a picture of me using it to convert a bunch of my flac files to MP3s.

It appears to be available in Ubuntu in version 9.10 Karmic or later, which does not surprise me too much as the program is fairly new.

Sunday, January 3, 2010

Virtualbox + Games = Solution to last major hurdle?

Just a quick post. This is probably old news to many of you, but I continue to have high hopes for VirtualBox solving the Gaming issue with Non-Windows system (i.e. Linux). My hope is that using VirtualBox, people will eventually be able to simply play their Windows videogames in Linux.

There are people already dabbling with this idea and things continue to improve.

Here are a couple of articles talking about success stories with gaming through VBox:
http://www.dedoimedo.com/computers/virtualbox-3-directx.html
http://vmetc.com/2009/07/18/video-of-working-windows-directx-games-in-virtualbox-302-on-ubuntu-904/

These articles are somewhat old and VirtualBox has already released newer versions with even more 3D acceleration support. According to some of the information I have seen about porting videogames to Linux, one of the biggest hurdles is the 3rd party applications used. This is frequently things like login software, sound systems, or anti-cheating. These are often proprietary, totally closed source, random applications that can be really a problem for porting.

Using VirtualBox, it lets Windows handle everything but the direct video rendering, which is passed up to the host OS, where it is offloaded to the resident GPU. Assuming this pass-through can be done with minimal performance loss, this option for gaming is basically awesome, since it lets Windows handle all the nasty software pitfalls.

I remember when I learned about Virtualization software years ago, and naively thought I would be able to play my videogames through it. Now several years later, this is slowly becoming a reality. Using VirtualBox, the Linux community might be able to overcome much of the last major hurdle for Linux adoptation into the Desktop Market. Namely, gaming.

Tuesday, November 17, 2009

Ubuntu 9.10 Karmic Nvidia-settings parse fail with xorg.conf

There is a bug in Ubuntu 9.10 Karmic with the default /etc/X11/xorg.conf involving Nvidia. If you try running 'kdesu nvidia-settings' or 'gksu nvidia-settings', then try to save with "Save to x confguration file" button, but receive the error:
Failed to parse existing X config file '/etc/X11/xorg.conf'
I found the problem by running:
sudo nvidia-settings 2>/dev/null

VALIDATION ERROR: Data incomplete in file /etc/X11/xorg.conf.
Undefined Device "(null)" referenced by Screen "Default Screen".

Erreur de segmentation
My default /etc/X11/xorg.conf looks like this:
Section "Screen"
Identifier "Default Screen"
DefaultDepth 24
EndSection

Section "Module"
Load "glx"
EndSection

Section "Device"
Identifier "Default Device"
Driver "nvidia"
Option "NoLogo" "True"
EndSection
To fix the problem, just remove the Section "Screen" part. IF YOU NEED HELP EDITING CONFIGURATION FILES UNDER LINUX, please see this link: http://awesomelinux.blogspot.com/2010/09/how-to-edit-configuration-file.html

The final version (before you edit it with the nvidia-settings program) should look like this:
Section "Module"
Load "glx"
EndSection

Section "Device"
Identifier "Default Device"
Driver "nvidia"
Option "NoLogo" "True"
EndSection

Sunday, September 20, 2009

Tab Complete with Bash Functions

About two years ago I had trouble figuring out how to program bash shell script functions to use tab-completion options. Here is what I learned, hopefully it will help someone out there, someday.

How to programming TAB completion into bash functions, programs and other such things.

Minimum Requirements
Here are the minimum requirements for BASH tab completion.
Code:
# 'local' can only be used within a function, exclude it if not using a function
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local opts="--whatever --tabbing --options --you --want"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))

Lastly, you need one more line after this somewhere in the file, usually after your function:

complete -F "function_name" -o "default" "function_name"
# Replace function_name with your function
Example
A simple example with the current code:

Code:

function sd
{
# 'local' can only be used within a function, exclude it if not using a function
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local opts="--whatever --tab --options --you --want to have!"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
if [[ ! $* =~ \n ]]; then # Check command been submitted, no more tab-completing
  echo "Command submitted"
  ... # more bash code, dealing with submitted command arguments
fi 

}
complete -F "sd" -o "default" "sd"
# complete -F "sd" -o "nospace" "sd" ## Use this if you do not want a space after the completed word
Slighty Advanced
You can manipulation the string input however you want, just make sure you clear COMPREPLY, and grab the current command prompt info, and append them using compgen.