czwartek, 14 lipca 2011

Ubuntu: grub2 info 'error: No video mode activated' at startup

I found a solution to the 'error: No video mode activated' problem and it seems it was caused by the fact that grub2 could not access fonts - which were located on an encrypted root disk under /usr/share/grub. Grub was located on the separate, unencrypted /boot partition. In order to solve the issue I copied the font .pf2 files into the /boot/grub directory:

# cp /usr/share/grub/*.pf2 /boot/grub/

poniedziałek, 11 lipca 2011

Ubuntu: Libreoffice crashes when clicking on Tools->Bibliography database

Today I tried to use the Bibliography feature from the libreoffice writer program on my Ubuntu Natty (11.04) laptop and to my surprise the program after clicking on this option silently crashed (on the left hand side one can find the screnshot from the menu).

The reason of the problem seems to be the missing libreoffice-base package. Once the package has been installed the crash problem has disappeared.

root@krystianek:/var/log# apt-get install libreoffice-base
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libhsqldb-java libservlet2.5-java
Suggested packages:
  libhsqldb-java-doc libhsqldb-java-gcj libmyodbc odbc-postgresql libsqliteodbc tdsodbc mdbtools libmysql-java libpg-java libjtds-java libreoffice-gcj libreoffice-report-builder
The following NEW packages will be installed:
  libhsqldb-java libreoffice-base libservlet2.5-java
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,121 kB of archives.
After this operation, 10.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main libservlet2.5-java all 6.0.28-10ubuntu2 [186 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ natty/main libhsqldb-java all 1.8.0.10-9ubuntu1 [932 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main libreoffice-base amd64 1:3.3.2-1ubuntu5 [2,004 kB]
Fetched 3,121 kB in 12s (253 kB/s)                                                                                                                                                                                                          
Selecting previously deselected package libservlet2.5-java.
(Reading database ... 179188 files and directories currently installed.)
Unpacking libservlet2.5-java (from .../libservlet2.5-java_6.0.28-10ubuntu2_all.deb) ...
Selecting previously deselected package libhsqldb-java.
Unpacking libhsqldb-java (from .../libhsqldb-java_1.8.0.10-9ubuntu1_all.deb) ...
Selecting previously deselected package libreoffice-base.
Unpacking libreoffice-base (from .../libreoffice-base_1%3a3.3.2-1ubuntu5_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for python-support ...
Setting up libservlet2.5-java (6.0.28-10ubuntu2) ...
Setting up libhsqldb-java (1.8.0.10-9ubuntu1) ...
Setting up libreoffice-base (1:3.3.2-1ubuntu5) ...


Shouldn't this option be disabled in the libreoffice writer when the libreoffice-base package is missing?

piątek, 8 lipca 2011

Ubuntu: convert pdf to jpeg

Today I encountered a simple problem namely I wanted to insert a large, high resolution picture from a pdf file into my document - with the print screen I would have to make multiple screens, which should be then connected into one. I decided to check and imagemagick seems to be helpful in this case.
You can invoke the convert utility to dump each page of .pdf document into separate .jpeg as in the example below:

# convert VFTF09_AN116.pdf VFTF09_AN116.pdf.jpg

The output files will be in the following format: VFTF09_AN116.pdf-0.jpg in the current working directory.

wtorek, 5 lipca 2011

Linux: SELinux and kvm making it working

Today I have installed the SELinux from the repo on my Ubuntu Natty box (apt-get install selinux) and the kvm stopped working. Fortunately finding the solution was not that difficult - in my case it was the type that was assigned to the image file. Originally after installation of SELinux it looked like this:

krychu@krystianek:/var/lib/libvirt/images$ ls -lZ
total 27673348
-rw-------. 1 root root system_u:object_r:var_lib_t:s0 10737418240 2011-07-04 22:38 centos-clone.img
-rw-------. 1 root root system_u:object_r:var_lib_t:s0 10737418240 2011-07-04 22:38 centos.img
-rw-------. 1 root root system_u:object_r:var_lib_t:s0 21474836480 2011-07-05 13:57 windows7.img

 It inherited the type after the main dir (var).  After changing it to virt_image_t everything worked fine - please take a look at the commands below:

root@krystianek:/var/lib/libvirt/images# chcon -h -u system_u -r object_r -t virt_image_t *.img
root@krystianek:/var/lib/libvirt/images# ls -lZ
total 27674164
-rw-------. 1 root root system_u:object_r:virt_image_t:s0 10737418240 2011-07-04 22:38 centos-clone.img
-rw-------. 1 root root system_u:object_r:virt_image_t:s0 10737418240 2011-07-04 22:38 centos.img
-rw-------. 1 root root system_u:object_r:virt_image_t:s0 21474836480 2011-07-05 20:42 windows7.img

Voila - great and now the kvm seems to be working again!

poniedziałek, 4 lipca 2011

SCM: Meld tool for comparing versions, merging etc.

I was looking recently for a nice tool for comparing differences between versions on Linux (apart from plugins in Eclipse) and I found a tool called Meld. It is in the standard repo of Ubuntu and can be installed via the apt-get utility. It seems to be a pretty easy to use with a nice looking GUI - although I still have not found a way to compare branches ;)

If you are working on one branch you can compare the differences of the project by typing:

# meld .

in the project's root directory. One can also compare local copy of a file with the last commited version in the svn repo etc. Some samples are presented below:



Although I used meld only for comparing the svn, meld provides also support for other source control management systems like git, cvs etc.

sobota, 2 lipca 2011

Ruby: Ubuntu natty `require': no such file to load -- mkmf (LoadError)

Recently I run into a problem of missing mkmf file, which is referenced by the mechanize module that I was trying to install.

root@krystianek:~# gem1.9.1 install mechanize
Building native extensions.  This could take a while...
ERROR:  Error installing mechanize:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
:29:in `require': no such file to load -- mkmf (LoadError)
    from :29:in `require'
    from extconf.rb:5:in `
'


However the solution to it is very easy - you just need to install the ruby1.9.1-dev (or ruby1.8.1-dev if you are using ruby 1.8) and the problem should be solved:

root@krystianek:~# apt-get install ruby1.9.1-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  ruby1.9.1-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,166 kB of archives.
After this operation, 3,858 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/universe ruby1.9.1-dev amd64 1.9.2.0-2 [1,166 kB]
Fetched 1,166 kB in 15s (77.5 kB/s)                                           
Selecting previously deselected package ruby1.9.1-dev.
(Reading database ... 163593 files and directories currently installed.)
Unpacking ruby1.9.1-dev (from .../ruby1.9.1-dev_1.9.2.0-2_amd64.deb) ...
Setting up ruby1.9.1-dev (1.9.2.0-2) ...
root@krystianek:~# gem1.9.1 install mechanize
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.5.0
Successfully installed net-http-persistent-1.8
Successfully installed net-http-digest_auth-1.1.1
Successfully installed webrobots-0.0.10
Successfully installed mechanize-2.0.1
5 gems installed
Installing ri documentation for nokogiri-1.5.0...
Installing ri documentation for net-http-persistent-1.8...
Installing ri documentation for net-http-digest_auth-1.1.1...
Installing ri documentation for webrobots-0.0.10...
Installing ri documentation for mechanize-2.0.1...
Installing RDoc documentation for nokogiri-1.5.0...
Installing RDoc documentation for net-http-persistent-1.8...
Installing RDoc documentation for net-http-digest_auth-1.1.1...
Installing RDoc documentation for webrobots-0.0.10...
Installing RDoc documentation for mechanize-2.0.1...
root@krystianek:~#


Additionally the mechanize gem requires the libxml2-dev and libxslt1-dev for building the native extensions.