The update from Ubuntu 13.04 to 13.10 failed for me with the error message:

Your python install is corrupted. Please fix the /usr/bin/python symlink.

The reason was that I used update-alternatives to manage my two Python versions (2.7 and 3.3). The following solved the issue for me:

(The expected version can be found out via: python /usr/share/python/pyversions.py -i)

References

  • [1] One of many forum entries that describes this solution

When we encounter strange, unexplainable problems with text files, hidden characters may be reason. This article describes several possibilities to tackle line-ending and whitespace problems.

Correcting mixed line endings

If a file has mixed line endings, the standard tool flip may help you:

A check with file reveals that the file test.txt has mixed line endings. Flip unifies the line endings to Unix (-u) or Windows (-m) standard:

Examining files

vim can show whitespace characters, if you enable the option list. In command mode, execute the following to show whitespaces like tabs or line endings. Unfortunately, the editor does not differentiate between different types of line endings.

Use :set nolist to return to normal view. With :set ff the program identifies the line ending standard.

If you need to get a detailed picture of the whitespace characters in your document, the octal file viewer od may be helpful, it displays the file as octal values and (interpreted) ASCII characters:

The results looks as follows:

Using cat -v text.txt, you can see bogus (non-Unix) line endings  being marked with a special symbol: ^M

Show one’s own/other’s groups

Show all groups on the system (with group id):

Create new group

Add user to group

Assign a specific home directory and shell to a user

If the user shall only be allowed to do SCP/SFTP transfers, then an appropriate login shell is scponly.

 

 

 

Some image processing programs expect the file extension to be in lower case. Many digital cameras, however, tend to use an uppercase extension (JPG in case of the Panasonic TZ-31).

The following Bash one-liner renames all JPG files in the current folder to have the lowercase jpg extension afterwards. The ${…} expression is called parameter expansion, which is quite a powerful mechanism:

Links

  • [1] Manpage of the Bash (see Section on Parameter Expansion)
  • [2] Parameter Expansion explained on bash-hackers.org

If you ever wondered, what the rc in all the startup files for Unix application means, here is the answer:

The rc stands for run commands.

This conventional pattern in file names is believed to originate in the 1960s from the runcom facility at MIT. See also this quote coming from Brian Kernighan and Dennis Ritchie:

“There was a facility that would execute a bunch of commands stored in a file; it was called runcom for “run commands”, and the file began to be called “a runcom”. rc in Unix is a fossil from that usage.”

Links

  • [1] Wikipedia (EN): Run commands

When being at my workplace at home, I like to use an external monitor instead of the laptop display (Acer TravelMate 5730G). I did not always want to open up the display control in Kubuntu in order to change between between primary (laptop) and secondary (external monitor) device. I came up with two small scripts which perform the switching in both directions. One is shown below, the other one is analogous.

This effectively switches on both displays and then disables VGA-0. You can find out about your connectors’ names by running xrandr without arguments or xrandr –verbose which also gives you the CRTC number (supported controllers) which needs to be set manually sometimes (see line CRTCS in the verbose output).

However, recently I noticed there is a more reliable tool called disper which has been developped for facilitating the monitor management with Nvidia graphics cards. Yet, it also works perfectly for my ATI mobile Radeon HD 3650 graphics chip.

The package can be installed from the regular Ubuntu repositories:

Afterwards you may easily switch monitors with one short command as the help (disper –help)  suggests:

The primary (secondary) display is the first (second) display returned by –list. On my machine, neither cloning (–clone) nor extending the display (–extend) work properly, unfortunately.

Links

  • [1] Short intro on disper in the ubuntuusers Wiki (German)