Solution for "Kernel panic: CPU too old for this kernel" when installing Ubuntu on Parallels

Shell Script (Bash) posted over 2 years ago by christian

If you get this error on Mac OSX when using Parallels:

   1  Kernel panic: CPU too old for this kernel.

Set the image to boot from CD. In rescue mode open a shell and run the following to install a new kernel:

   1  apt-get update
   2  apt-get install linux-386
   3  apt-get remove linux-server

Tagged osx, parallels, ubuntu, kernel

How to change the default editor in Debian

Shell Script (Bash) posted over 2 years ago by marko

This command changes the default editor system wide. It should work in all Debian derivatives.

   1  sudo update-alternatives --config editor

Tagged default editor, debian, ubuntu, standard editor, oletuseditori

Installing Ultraviolet and Oniguruma

Shell Script (Bash) posted over 2 years ago by christian

First install Oniguruma

Oniguruma is a regular expression engine that Ultraviolet uses to parse text; Ruby also uses Oniguruma by the way. If you don’t have Oniguruma on your system you’ll get this error while installing Ultraviolet (at least on Ubuntu Linux):

   1  oregexp.c:2:23: error: oniguruma.h: No such file or directory

This tells you that you should download and install Oniguruma. For me version 5.8.0 was the only version that worked, so execute this command to get the right version of Oniguruma:

   1  $ wget http://www.geocities.jp/kosako3/oniguruma/archive/onig-5.8.0.tar.gz

You now have the source package on your computer, so decompress it with the following command:

   1  $ tar zxvf onig-5.8.0.tar.gz 

If everything went fine, change current directory:

   1  $ cd onig-5.8.0/

Next, run configure:

   1  $ ./configure

Watch the output closely and fix any errors reported, then run make:

   1  $ make

To build and install Onigurama run:

   1  $ sudo make install

I managed to get the following errors from Ultraviolet with other versions of Oniguruma, but these went away after installing 5.8.0 and re-installing Oniguruma:

   1  Parsing error in // ==UserScript==: wrong number of arguments (2 for 0) #<Textpow::SyntaxNode:0xb7c91780>

Installing Ultraviolet and dependencies

Next install Ultraviolet with RubyGems:

   1  $ sudo gem install -r ultraviolet --include-dependencies
   2  
   3  Select which gem to install for your platform (i486-linux)
   4   1. oniguruma 1.1.0 (mswin32)
   5   2. oniguruma 1.1.0 (ruby)
   6   3. Skip this gem
   7   4. Cancel installation
   8  > 2
   9  Building native extensions.  This could take a while...
  10  Successfully installed ultraviolet-0.10.0
  11  Successfully installed textpow-0.9.0
  12  Successfully installed oniguruma-1.1.0
  13  Successfully installed plist-3.0.0

Test that Ultraviolet works by running the following code with irb:

   1  $ irb
   2  
   3  require 'rubygems'
   4  require 'uv'
   5  puts Uv.syntaxes.join( "\n" )
   6  puts Uv.themes.join( "\n" )
   7  input = <<HTML<<HTML
   8  <html>
   9    <body>
  10    </body>
  11  </html>
  12  HTMLHTML
  13  
  14  puts Uv.parse( input, "xhtml", "html", true, "slush_poppies")

Problems

You might get this error:

   1  require 'uv'
   2  LoadError: libonig.so.2: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/1.8/gems/oniguruma-1.1.0/lib/oregexp.so

This message is a bit confusing. It means Ruby can’t find libonig.so.2, not oregexp.so as you could believe.

To fix this, check if the library has been linked:

   1  $ ldconfig -p|grep libonig

If the library is not linked, add the path to the directory where the file is located to /etc/ld.so.conf:

   1  /usr/local/lib
   2  
   3  include /etc/ld.so.conf.d/*.conf

Then run:

   1  $ ldconfig

Another way of fixing this problem would be to tell the build script to install it to /usr/lib.

Tagged onigurama, ultraviolet, ruby, ubuntu, install, oniguruma

Changing the default terminal emulator the Debian way.

Shell Script (Bash) posted over 2 years ago by marko

Use this to change the terminal emulator that comes with the default installation of Debian (and Ubuntu).

   1  sudo update-alternatives --config x-terminal-emulator

Choose your emulator from the list and hit enter.

Tagged default terminal, debian, ubuntu, x11, linux