Areas of Interest, as counted by my cat

Category: Linux (Page 1 of 2)

DVD ripping with Handbrake on Linux

We’re enjoying our new Synology NAS, and leveraging DLNA to access music and video from any client on our network, including iPad, Roku, and desktop devices. Audio CD ripping on Linux Mint isn’t a problem, but DVDs are more complicated.

I’m using Handbrake, because it is open source, free, fast, and very configurable. Also, it is available for both Windows and Linux. On the downside, it is not newbie-friendly; not a point-and-click app. “With great flexibility comes a learning curve”. Hence, my decision to write up my process so far.

Installing Handbrake

In Linux Mint, Handbrake is available in the Software Manager. At time of writing, there are three options available. I chose the GUI version that is not flatpak.

Installation was uneventful. The UI is complicated, at first blush, and I’m not qualified to explain it. I will document my steps to rip a DVD.

About commercial DVDs

A DVD is essentially a file system with directories (such as VIDEO_TS) containing files, including menus, videos, FBI warnings, trailers, images, etc. Depending on the DVD, there may be multiple video files for different aspect ratios. Languages, commentaries, and captions seem to be encapsulated in the video files themselves, although there may be multiple video files for different aspect ratios or edits such as Director’s Cut, alternate endings, etc.

Choosing a format (I)

It is possible to create a single .ISO file containing a disc image of the DVD, and copy it to the NAS. There are clients (e.g. VLC) that can open the .ISO and present the disc menu interactively, just like a DVD player. That’s one option. On the downside, .ISO images take up storage space, and you are limited in how to view them over the network. Given our DLNA ecosystem, I wanted to explore extracting the video files into a format that was more compact and streaming-friendly.

There are more formats than you can shake an empty DVD case at, each with advantages and disadvantages. More on this later.

Loading a DVD into Handbrake

Insert the DVD into your drive, and close any application that tries to play it automatically. I chose a commercial release of the film “Galaxy Quest” because they’ll be some extra bonus features and soundtracks to review.

Run Handbrake (the icon is under the Sound & Video menu) and scan the disc for source files. I found the quickest way to scan the disc in Handbrake is to use the File menu, there’s an entry for the optical disc drive:

Handbrake scans the disc and identifies a list of 25 possible source files.

By default, the first file is selected.

Exploring the DVD files

Note that at first glance there is no information about what these source files are, except for their sequence number and their duration. There’s no way to view any DVD “menu” within Handbrake, although Handbrake will generate a set of preview images from each source file to help us identify.

Here’s what I determined from reviewing the preview images for each title:

 1  1:42:00   Feature Presentation
 2    10:07   On Location In Space - Making Of
 3     2:15   unknown sequence 
 4     1:47   unknown sequence 
 5      :40   unknown sequence
 6      :52   unknown sequence
 7     2:02   FX test sequence?
 8     1:30   unknown sequence 
 9      :47   unknown sequence 
10     9:47   unknown sequence
11     1:54   unknown sequence
12     1:12   Trailer #1
13     2:20   Trailer #2
14     1:50   Trailer #3
15     2:09   Tim Allen talking
16      :42   Sigourney Weaver talking
17      :46   Alan Rickman talking
18      :21   Tony Shaloub talking
19      :34   Sam and Daryl talking
20      :21   Sam and Daryl talking
21     1:21   talking head
22      :25   talking head
23      :35   talking head
24      :13   talking head
25      :24   Dreamworks Logo

Handbrake can extract any one of these 25 source files and convert to a stand-alone video file. Galaxy Quest is an “interesting” example, in that the extras aren’t obvious. The actual DVD menu may help decipher this list. Handbrake can’t play the DVD menu, but VLC can. (Or I could put the disc in our DVD Player.)

Looking at the DVD menu in VLC allowed me to compile:

PLAY MOVIE 
SCENE INDEX
SPECIAL FEATURES
    On Location In Space (10:07)
    From The Cutting Room Floor
        PLAY ALL (9:47)
        1. Tech Talk with Sergeant Chen (2:15)
        2. Alex tours his "personalized" quarters (1:47)
        3. A running spat between old flames (0:40)
        4. Guy gets attacked (0:52)
        5. Alex's motivational speech (2:02)
        6. Gwen saves the day (1:30)
        7. The Crew vs. Sarris (0:47)
    Theatrical Trailer (1:54)
    Sneak Preview Trailers
        Chicken Run
        El Dorado
        Road Trip
    Cast and Crew
    Production Notes
SUBTITLES
    English Only Captions ON/OFF
AUDIO
    5.1 ENGLISH DOLBY DIGITAL
    2.0 ENGLISH DOLBY SURROUND
    2.0 THERMIAN DOLBY SURROUND
OMEGA 13

We can now cross-reference this and update that source file list from Handbrake:

 1  1:42:00   Galaxy Quest
 2    10:07   On Location In Space - Making Of
 3     2:15   Deleted Scene - Tech Talk
 4     1:47   Deleted Scene - Alex's quarters
 5      :40   Deleted Scene - Old flames
 6      :52   Deleted Scene - Guy gets attacked
 7     2:02   Deleted Scene - Alex's speech
 8     1:30   Deleted Scene - Gwen saves the day
 9      :47   Deleted Scene - Crew vs Sarris
10     9:47   All Deleted Scenes (alternative)
11     1:54   Theatrical Trailer
12     1:12   Trailer #1 - Chicken Run
13     2:20   Trailer #2 - El Dorado
14     1:50   Trailer #3 - Road Trip
15     2:09   Tim Allen talking
16      :42   Sigourney Weaver talking
17      :46   Alan Rickman talking
18      :21   Tony Shaloub talking
19      :34   Sam and Daryl talking
20      :21   Sam and Daryl talking
21     1:21   Unknown talking head
22      :25   Unknown talking head
23      :35   Unknown talking head
24      :13   Unknown talking head
25      :24   Dreamworks Logo

My guess is that the 15 – 24 “talking heads” clips are somehow part of the “Omega 13” bonus feature, but I couldn’t figure out how to play them from the DVD menu.

Now we have enough information to start the extraction process.

Extracting/Ripping a source file

Let’s start with the Feature Presentation.

Select Title 1 in the Title: dropdown if it isn’t already selected. Note that there are 21 chapters in this source file.

Choosing a format (I)

We need something compatible with common DLNA clients that can retain the multiple audio tracks and subtitle captions; and keep the original DVD image resolution (or close to it). We don’t need HD video, 48kHz sound or 5.1 surround sound. MP4 or MKV seem like a good option.

From the Preset: dropdown, choose Official > Matroska > H.265 MKV 720p30

There are a series of “tab buttons” that select different pages in the UI. We can skip the next two and go directly to Video.

Selecting Video conversion options

The output format preset I’ve recommended here is definitely not the fastest to convert, at least as configured by default. Alternatively I’ve had good results using a different preset, Official > General > Fast 720p30 which is .M4V, and given the debate here, I don’t want to recommend that unilaterally. But it seems faster to process; and the output looks fine; and it is definitely not limited to just Apple clients.

I compared processing time and output file size, limiting the run to just chapters 1-3 of the Galaxy Quest feature presentation:

Fast 720p30 
Render Time:  4:48
Size: 123.5 MB

Matroska H.265 MKV 720p30  
Render Time: 22:04
Size: 108.3 MB

Playing back each of the converted files, I honestly couldn’t tell a difference. They both looked like “perfect” DVD quality rips, and captions and audio soundtrack selections were available.

Hence my personal choice of “Fast 720p30” over the “Matroska”.

That said, just looking at all the options under the Video tab, clearly there is a lot of scope for tweaking; trading off conversion speed for quality, etc. Ideally we want to retain as much of the original quality of the source as possible. However, I don’t recommend changing anything here until we know what the consequences are. Let’s stick with the preset defaults for now.

Next: Audio.

Selecting Audio Tracks

Handbrake makes a default selection but I recommend clicking on + Add All and reviewing.

Normally these are obvious, such as Alternative language dialog, or a Director’s Commentary, etc. Galaxy Quest is a bit of an outlier in that, according to the DVD Menu options (see previous) there are two English-language soundtracks plus an Alien “Thermian” language soundtrack (ha!). I think it would be nice to have two audio tracks available, English and Thermian, and I’d like to alter the default name so that we can tell which is which.

We can remove the 5.1 track because we’ll take our English soundtrack from the 2.0. (5.1 would be fine if it were the only option – but we’ll be converting to Stereo so 2.0 is fine and probably easier for the conversion.)

If we click on the “edit pencil” icon, we can change the name of subtitle Track 3:

Choosing Captions/Subtitles

Next, we select Subtitles. Again, click on + Add All to review the available options:

Why are there two options here? It’s complicated and I don’t fully understand it. Succinctly put:

the closed captions is a data packet inside the mpeg2 video stream and subtitles is a separate stream inside the vob file

“baldrick”, Videohelp forum

Until I have a better handle on which type is best suited to our needs, I retain both to make them available for clients that support them.

Reading List: Handbrake Subtitles: a Complete Guide for First Time Users

VOBSUB are bitmapped overlays, whereas CC608 are text rendered by the player. Probably CC are better, if available, but so far I’ve retained both as available.

Some clients don’t support optional closed caption display, and if we had no other choice, we could choose one of these two subtitle tracks and “burn” them into the rendered video. We wouldn’t be able to turn them off, but they would be displayed by lesser-capable video players. We’d do this by clicking on the “Edit Pencil” against one of the tracks, and changing the option:

(Note to self: Try [x] Set Default Track to see if captions are displayed by default, even by “lesser capable” video player clients.)

Enter the Metadata

Now we select Tags, and change the metadata to suit. At this point, I also change the Save As: output file name that will be created for this Title:

Batch Processing

At this point, we can start the extraction/conversion process immediately, or we can put the job onto a queue and define the next title. Let’s do that: Click on Add To Queue in the toolbar at the top of the window.

The Queue (1) now has one job

Let’s also add the “Making Of” extra as a second job to the queue. We can do this quickly:

  • Select Title: 2 – 00h10m07s which we identified above as being the documentary featurette “On Location In Space”;
  • Leave the Preset unchanged;
  • Click on Audio; +Add All (observe: only one track; leave it as-is);
  • Click on Subtitles; +Add All (observe: no subtitles available (typical for a bonus feature);
  • Click on Tags; enter metadata and set output file name;
  • Click Add To Queue

Review The Queue

We can view and edit the queue by clicking on the Queue (2) button in the toolbar:

Now we can process the entire queue by pressing Start.

Help! My Computer Is Melting!

You’ll notice that Handbrake is making good use of all cores in your CPU and your cooling fan has cranked up to max.

Resource Monitor shows all CPU cores are maxed? YOU SHOULD BE FINE. It’s what they’re for.

However, if it absolutely positively DOESN’T have to be completed in the shortest possible time, you can tell Handbrake to cool its heels and relax its grip somewhat.

Install cpulimit

Linux Mint has the command-line tool cpulimit in the Software Manager:

After you’ve installed it, I recommend editing the command-line of the Handbrake launch menu item, from:

ghb %f

To:

cpulimit -l 400 ghb %f

The -l option specifies a percentage of CPU resources to the application. The trick here is that 100 = 100% of one CPU core. My system has effectively 8 cores, so “400” means that Handbrake (ghb) will only use 50% of the total CPU core resources. You’ll need to tune that number to suit your system.

Here is my system ripping a DVD:

Ahh… still working quite hard but not red-lining

And now, we wait. <skeleton.png>

Reviewing The Results

The Audio Tracks are available, with our naming:

The subtitle tracks are available:

Now you can see why specifying our own label against the audio and subtitle tracks can be beneficial. Track 1 is actually “English (Wide Screen) [VOBSUB]”; and Track 2 is “English, Closed Caption [CC608]”. They contain the same captions but they are rendered differently (how they are rendered could be player-dependent).

Track 3 adds Chapter identification (e.g. “Chapter 2”) at the bottom of the window. I need to investigate what option controls this.

SQL Server 2017 on Linux Mint

I followed the instructions as laid out here:

My target was a VM instance of Linux Mint 18.3, called “golem”. Everything just works… SQL Server is running automatically after I boot the VM.

Some other links I need to review:

Interestingly, the database properties don’t seem to know about the Linux host:

image

Installing Oracle’s JDK in Ubuntu Linux

Just for my own notes, because I can never remember this stuff.

1. Check the architecture of your host:

colin@Mongpy:~$ uname -m
x86_64

2. Grab the appropriate download from Oracle’s web site:

image

My web browser puts it in the Downloads folder under home.

colin@Mongpy:~$ ls -l ~/Downloads
total 393356
drwxr-sr-x 7 colin colin 4096 Mar 31 12:21 eclipse-installer
-rw-rw-r-- 1 colin colin 185540433 May 25 13:19 jdk-8u131-linux-x64.tar.gz
-rw-rw-r-- 1 colin colin 21944320 Mar 29 14:18 mysql-workbench-community-6.3.9-1ubuntu16.10-amd64.deb
-rw-rw-r-- 1 colin colin 195297254 May 25 12:47 pycharm-community-2017.1.3.tar.gz

3. Open a terminal and get superuser access:

colin@Mongpy:~$ sudo su
[sudo] password for colin:
root@Mongpy:/home/colin#

4. Make a directory and expand the archive:

root@Mongpy:/home/colin# mkdir /opt/jdk
root@Mongpy:/home/colin# tar -zxf ./Downloads/jdk-8u131-linux-x64.tar.gz -C /opt/jdk
root@Mongpy:/home/colin# ls -l /opt/jdk
total 4
drwxr-xr-x 8 uucp 143 4096 Mar 15 01:35 jdk1.8.0_131

5. Review the current default JDK:

root@Mongpy:~# update-alternatives --display java
java - auto mode
link best version is /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
link currently points to /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
link java is /usr/bin/java
slave java.1.gz is /usr/share/man/man1/java.1.gz
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java - priority 1081
slave java.1.gz: /usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz

root@Mongpy:~# update-alternatives --display javac
javac - auto mode
link best version is /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
link currently points to /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
link javac is /usr/bin/javac
slave javac.1.gz is /usr/share/man/man1/javac.1.gz
/usr/lib/jvm/java-8-openjdk-amd64/bin/javac - priority 1081
slave javac.1.gz: /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz

Note the current “priority” is 1081.

6. Set the Oracle version as the default JDK, using a higher priority, say 1090:

root@Mongpy:/home/colin# update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_131/bin/java 1090

update-alternatives: using /opt/jdk/jdk1.8.0_131/bin/java to provide /usr/bin/java (java) in auto mode

root@Mongpy:/home/colin# update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_131/bin/javac 1090

update-alternatives: using /opt/jdk/jdk1.8.0_131/bin/javac to provide /usr/bin/javac (javac) in auto mode

root@Mongpy:/home/colin# update-alternatives --display java
java - auto mode
link best version is /opt/jdk/jdk1.8.0_131/bin/java
link currently points to /opt/jdk/jdk1.8.0_131/bin/java
link java is /usr/bin/java
slave java.1.gz is /usr/share/man/man1/java.1.gz
/opt/jdk/jdk1.8.0_131/bin/java - priority 1090
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java - priority 1081
slave java.1.gz: /usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz

root@Mongpy:/home/colin# update-alternatives --display javac
javac - auto mode
link best version is /opt/jdk/jdk1.8.0_131/bin/javac
link currently points to /opt/jdk/jdk1.8.0_131/bin/javac
link javac is /usr/bin/javac
slave javac.1.gz is /usr/share/man/man1/javac.1.gz
/opt/jdk/jdk1.8.0_131/bin/javac - priority 1090
/usr/lib/jvm/java-8-openjdk-amd64/bin/javac - priority 1081
slave javac.1.gz: /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javac.1.gz

7. Finally, testing:

colin@Mongpy:~$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Cool.

Setting up a LAMP test environment

Not my usual kind of thing, but a possible new client meant preparing a system to stand up a replica of their production environment. These are my notes.

I started by downloading an .iso of ubuntu-12.04-server and deploying it to a new VM.

Critical things to remember:

  • Set up two network adapters in the virtual machine config: NAT, and Host-only networking, as per my notes documented elsewhere;
  • select [X] LAMP server during the deployment to give it Apache/MySQL/PHP in one hit, at startup;
  • install ssh so you can remote into it
$ sudo apt-get install openssh-server openssh-client

Checking for installed status:

$ which php
/usr/bin/php

$ sudo service apache2 status
[sudo] password for colin: ****
Apache2 is running (pid 1107).

$ mysql -u root -p
Enter password: ****
..
mysql>

By default, the Apache web server document root folder appears to be:

$ ls -l /var/www
total 4
-rw-r--r-- 1 root root 177 Dec 6 12:10 index.html
$

Allowing connections to MySQL from outside the server

Edit /etc/mysql/my.conf:

Comment out the line:

#bind-address    = 127.0.0.1

Run the following SQL(might not be required, note the 0 rows affected):

mysql> grant all privileges on *.* to 'root'@'%' identified by '****' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Restart the DB:

$ sudo service mysql stop
mysql stop/waiting

$ sudo service mysql start
mysql start/running, process 1578

And, importantly, test from outside (in my case, my host operating system):

C:\Program Files\MySQL\MySQL Server 5.5\bin> mysql -h 192.168.56.56 -u root -p
Enter password: ****
...
mysql>

In MySQL Workbench:

image

Cool.

Installing FTP server

Just in case we need to move files in and out of the test environment (which we almost certainly will need to do), we’ll set up an FTP server. The most suggested option seems to be something called vsftpd:

Reference: https://www.liquidweb.com/kb/how-to-install-and-configure-vsftpd-on-ubuntu-12-04-lts/

When I tried this, I got an error:

$ sudo apt-get install vsftpd
[sudo] password for colin: ***
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vsftpd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'vsftpd' has no installation candidate

Long story short, the following sequence of instructions worked for me:

1. un-comment the extras.ubuntu.com repositories in /etc/apt/sources.list:

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

2. Remove old information, and update:

$ sudo rm -rf /var/lib/apt/lists/*
$ sudo apt-get update

3. try installing again:

$ sudo apt-get install vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
vsftpd
0 upgraded, 1 newly installed, 0 to remove and 129 not upgraded.
Need to get 124 kB of archives.
After this operation, 342 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main vsftpd amd64 2.3.5-1ubuntu2 [124 kB]
Fetched 124 kB in 1s (91.2 kB/s)
Preconfiguring packages ...
Selecting previously unselected package vsftpd.
(Reading database ... 53560 files and directories currently installed.)
Unpacking vsftpd (from .../vsftpd_2.3.5-1ubuntu2_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up vsftpd (2.3.5-1ubuntu2) ...
vsftpd start/running, process 2229
$

Thank goodness for that!

Some configuration required in /etc/vsftpd.conf, see:

basically

write_enable=YES
local_umask=022

Restart:

$ sudo service vsftpd restart
vsftpd stop/waiting
vsftpd start/running, process 2462
$

Now, testing from the Windows host:

C:\PROGRA~2\WinSCP>WinSCP
winscp> open 192.168.56.56
Searching for host...
Connecting to host...
Authenticating...
Username: colin
Password: ****
Authenticated.
Starting the session...
Session started.
Active session: [1] 192.168.56.56
winscp>

OK, I think it is all ready for us to unpack that archive we got from the client and see about deploying into the test environment.

iMac; Linux; GRUB; OS X: Can’t we all just get along?

I’m not really a fan of OS X. I’m sure the underlying OS is fine – after all, It’s a Unix system. I know this! – but the Finder; the keyboard layout; the relentless updates; but most of all the fuzzy text aggravated me.

After some success with a Bootable USB drive containing a 64-bit Linux Mint ISO, I decided to follow Clem’s excellent instructions here:

http://community.linuxmint.com/tutorial/view/1643

and install Linux Mint 17.1 on my 2013 iMac.

Now, I’m not crazy: I resized the primary OS X partition and divided up the remaining space, just as Clem recommended:

/dev/sda4    30 GB   ext4
/dev/sda5     4 GB   swap
/dev/sda6   500 GB   ext4 

After the Linux install completed, I also followed the “Fixing the boot order” instructions, about installing efibootmgr and making the EFI boot Linux first. Supposedly this was to achieve:

“The boot order should now indicate that it will run Mint first, and if that ever came to fail.. it would then run Mac OS. In other words our MacBook now boots into Grub. From there we can select Mint or press Escape and type “exit” to boot into Mac (we’ll fix the Mac grub entries to make it exit without having to type anything later on in this tutorial).”

I’m not sure what I did wrong… maybe nothing. Maybe we’re just expected to have a complete understanding of EFI and GRUB and bootloader configuration in general, at this point.

Anyway, bottom line: I never saw GRUB, or a menu of boot options, or anything. It just booted straight into Linux. Fortunately the Mac HD volume is visible and accessible under Linux, and I’ve been able to copy my files over as the need arises, from inside Linux Mint. Excellent.

But what if I want to execute a Mac OS X application natively, for some reason? Dammit, I want to dual boot this thing. The normal Option- key (Mac Boot menu) no longer works, and neither does Option-R (to get to the Mac Recovery partition).

After some research, I learned that pressing ‘c’ during the boot process gets us to the GRUB command line. Now I could use the ls -l command to list the partitions:

hd2,gpt1      fat efi
hd2,gpt2 hfsplus 'Mac HD'
hd2,gpt3 hfsplus 'Recovery HD'
hd2,gpt4 ext * 29 GiB
hd2,gpt5 - 5 GiB
hd2,gpt6 ext * 438 GiB

but this still left me with no understand of how to boot into one of them. More research:

http://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time

OK, so I learn about GRUB 2 and the significance of the /etc/grub.d scripts and the /etc/default/grub file, and commenting out the GRUB_HIDDEN_TIMEOUT=0 setting by prefixing it with ‘#’.

Dedoimedo has a really nice tutorial on GRUB here:

That taught me how any changes to these grub config files should be followed up with:

$ sudo update-grub

After that, when I restart, I get the boot menu! Yay. From the partition list (see above) I’m pretty sure that I should be able to add a menu option for the OS X partition.

More research:

http://askubuntu.com/questions/179689/mac-os-x-wont-boot-from-grub-menu-in-ubuntu-precise-on-apple-mba5-2

It suggests adding the following to the /etc/grub.d/40_custom script:

   menuentry "OS X" {
insmod hfsplus
set root=(hd1,gpt2)
chainloader /System/Library/CoreServices/boot.efi
}

Long story short: that works perfectly. After sudo update-grub and a reboot, we have a menu and an option that will boot into OS X.

Thanks, Internet!

“Because it’s there” may not be a good reason

I'm seriously thinking about going back to Windows XP on my little laptop here. For two reasons:

1. Ubuntu 9.04 / Gnome appears to run sluggishly. Is it the EXT4 file system? Is it some optimization I haven't discovered? I have no idea. Since part of the reason of giving Linux a go was to experience a lean, mean OS with no cruft, it seems just wrong to me. 

2. I'm not really having much fun. I thought it would be fun to dabble and learn and maybe even get MonoDevelop and ASP.NET working. Well it's not fun at all. It's tedious. There is much that I don't understand and what little time I have left over for this kind of activity is spent trying to find exactly the right blog post that explains something.

I want my comfort zone back.

Ubuntu Diary – Thunderbird 2 + Lightning 0.9

OK, so I installed the Lightning 0.9 add-on to Thunderbird in order to have Calender functionality, and I didn't notice until yesterday that I can't actually add any events to the calendar! The buttons and menu options are disabled.

This evening some quick googling turned up this reference to Bug# 278853 which is actually misleading because this isn't a bug in Thunderbird at all, but a dependency of Lightning 0.8 and 0.9 on a library that isn't installed on Ubuntu 9.4 by default.

Solution:

  • Uninstall Lightning 0.9 from Thunderbird's add-on dialog;
  • Go to Synaptic Package manager and search for "libstdc" and select to add the libstdc++5 package and apply changes;
  • Re-install Lightning 0.9

Result: I can now add an event to my calender reminding me to record the show "Being Human" on BBC America on the evening of July 25th.

Ubuntu Diary – Day 7

Web Camera

My Sony Vaio FE790G has a built-in web cam, a "Motion Eye" lens located in the top edge of the LCD screen border. Last time I tried Ubuntu, in 8.10, I couldn't get it recognised, but the truth is I didn't do much research and I probably didn't expect it to work. I know that in Windows XP, I needed to install special Sony-provided driver.

This time around, given that I am trying to get as deep into the Ubuntu/Linux world as possible, I did some googling, and found this very lengthy and comprehensive thread from other users of Sony Vaios with Motion Eye web cams. It seems that was was needed was something called a "gspcav" driver.

I actually got as far as downloading the driver source code and attempting to compile it (failed) before I thought to ask Ubuntu/Linux whether the driver was already installed:

    $  modprobe -l | grep gspca
 

This command seems to indicate that this is already present on the system. But how to activate the camera? I tried running Gimp and creating a new image from a scanned source, and some intermediate helper application called xsane popped up and allowed me to "scan" from the camera. The results were not encouraging:

That's me holding up my hand in front of the camera, but you can see my Escher print in the background. Do the three copies of the image represent RGB scans? Is this because the xsane program thinks it is talking to a flatbed scanner? I have no idea, but clearly there is a possibility that I can get the webcam to work. More on this as I get around to it, as having a working web camera is not the highest priority right now.

Printing

"It just works" almost applies. My traditional default printer is a Minolta/QMS Magicolor 2350 EN Laser printer, networked on the LAN. I turned it on and went to System > Administration > Printing. Click on the New toolbar button, and up comes the New Printer dialog, giving me a list of two choices: "Other" or "Network Printer". When I clicked on Network Printer, the list expanded to show an addition entry: "Minolta-QMS magicolor 2350 192.168.100.3". The Location host and port parameters were already filled out with 192.168.100.3 and 9100 respectively. Very cool.

I clicked Next and saw briefly "Searching for drivers…", then "Searching for downloadable drivers…", then a new dialog, "Choose Driver". This gave me three options: Select printer from database; Provide PPD file; Search for a printer driver to download. Always the optimist, I selected Select printer from database. The comprehensive manufacturer list contained three possible choices: KONICA MINOLTA; Minolta; and QMS. I tried each of them, and the closest I could get to was Minolta > magicolor 2300 DL. I tried this, and long story short, it didn't work. (I would have been very surprised if it did.) My test page was rendered as a few garbage characters at the top of what could have been a vast number sheets of paper, had I not switched the printer off.

I tried the third option, Search for a printer driver to download. This appeared to be searching the same database as the first option because I could not find a better match from the results. Time to try google to see if I could find a .PPD file for the printer. I can't remember what search terms I used but it can't have been 10 seconds before I got to this gem:

http://www.openprinting.org/show_printer.cgi?recnum=KONICA_MINOLTA-Magicolor_2350

This led me to download 2350lin_ppds.tar.gz, which contained a bunch of language folders, and inside the English folder was KM2350NP.ppd, which allowed me to select the Provide PPD file option. This worked perfectly. I can now print from applications, in duplex too.

This was no harder than searching for printer drivers in Window XP, in some ways easier, particularly in cases where you don't have a CD from the printer manufacturer stuffed with drivers for your convenience.

Ubuntu Diary – Day 3

I plugged my camera into a spare USB port, and waited. It just works… Ubuntu recognised the attached storage and prompted me for an application. I chose F-Spot Photo Manager because it seemed like the right thing to do, and successfully copied the images to the filesystem. That is a complete success, in my book, except for the following issues:

  • I'd created a folder ~/pictures/camera but for some reason I could not copy the images from the camera to that location. I ended up putting them in ~/pictures instead, and then moving them manually later.
  • By default Ubuntu apparently created a directory called ~/Photos for me but I swear I don't remember seeing it before. Did F-Spot do this, or am I just blind? [Update: The directory was created last night, so I expect F-Spot did it, or perhaps Ubuntu did after it recognised the camera.]
  • I couldn't figure out how to move the images from the camera (thus relieving me of the need to delete them from the camera in a separate operation).

(The camera is a FujiFilm FinePix 602z. The laptop is a Sony Vaio FE790G.)

Ubuntu Diary – Day 2

I have Windows XP running in a Virtual Box 2.2 virtual machine now. I gave it 950 MB of RAM, very smooth now that the VirutalBox Machine Additions are installed. Seemless Mode is mindblowing the first time you see it – that's where you have Windows XP applictions floating in the Ubuntu desktop with no container window. For now I have it set back to "normal" mode. Both it and the host Ubuntu OS seem to be getting their IP addresses via DHCP, I never had to specify an IP although I had some all ready to assign to them. I suspect that static IPs will be required at some point…

This blog website looked a little weird in Ubuntu until I installed the Microsoft Core TrueType fonts for Linux. I should do something about that at some point, I guess. On the other hand, I'm not ashamed that my heritage is Windows, so for now, it can stay the way it is.

The Flash plugin isn't installed by default but it was very straightforward to install. I just followed the "Click here to install" link and it worked. Quicktime was almost as easy – it seems that there is a plugin registered to Quicktime but it needs some codecs, but again, it prompts you for the installation and after a few minutes, it just works. Great.

Now, I have all my Windows documents, etc, backed up on to our NAS drive, and although Ubuntu found the network resource and let me browse it (it helps to use the same username/password for every device on the LAN), it seems that many Ubuntu/Gnome applications won't load files from network drives. The "Open File" dialog will allow you to go there and select a file, but it doesn't seem to take effect. Two examples: Restoring my Firefox bookmarks from a .JSON  backup – I needed to copy the .json file into my home directory on the local filesystem before it worked. Also, copying some truetype fonts in to the /usr/share/fonts folder: I was running the File Browser as root, but it still wouldn't let me drag and drop from the network drive. I had to copy the ttf files to a local temp path, and drag and drop from there.

Speaking of the Linkstation network drive, the Windows VM could see it, no problem. Again – I'm using the same username/password for the Windows login. I realise as I write this that I haven't verified that Windows applications can read and write files on the Linux filesystem, but if VirtualBox is anything like VMWare's software, I'm sure there is a way to set up a shared folder and mount it in Windows Explorer.

« Older posts

© 2024 More Than Four

Theme by Anders NorenUp ↑