Posts tagged ‘Linux’

Sharing Files with Windows from Ubuntu Karmic

We got a desktop running Windows 7 over the Christmas holidays. I hadn’t been faced with the prospect of sharing files with it up until I wanted to play an MP3 file located on my laptop — which is running Ubuntu — from the desktop, which is connected to a better speaker system. As it turns out, sharing files with Windows from Ubuntu has gotten a lot easier with Ubuntu 9.10 Karmic Koala.

Open Nautilus and navigate to the parent directory of the one you’d like to share. Right-click on that directory and select the option “Sharing Options.” In the window that appears, check “Share this folder.” If Samba is not already installed on your system, this will prompt you to install it. The nice thing is that it handles all the interaction with APT and configuration of user accounts and shares for you versus the manual approach that’s been required in the past.

Once the service is installed, if you’d like to share the directory with users without requiring them to enter user credentials, check the box “Guest access.” Finally, click the “Create Share” button. You’ll receive a prompt to restart your session so the setting changes can take effect; go ahead and do this.

When I tried to access the directory from the Windows 7 desktop at this point, I still got prompted for credentials. I tried manually rebooting my laptop and at that point was able to access the files anonymously without further issue. I don’t know if a manual restart is always required, but it did the trick for me.

Hope this helps someone!

OpenOffice Batch Export

I’m currently using Ubuntu Jaunty 9.04 as my primary operating system. I’ve been working with a set of presentation files that were originally in Microsoft PowerPoint format (PPT), but that I converted to OpenOffice Impress format (ODP) when it appeared that OpenOffice had an issue with retaining content formatting when exporting to PPT.

Multiple people have to handle these presentation files, though, and PPT is the most universal format supported by presentation programs like OpenOffice Impress and Keynote. Additionally, when the presentations are actually used, PDF is the required final format.

To alleviate myself of the need to export the ODP version to PDF and PPT manually each time I made changes to a presentation, I did some digging and came across the wonderful unoconv utility, which uses the OpenOffice UNO bindings to allow for conversion of documents between OpenOffice-supported formats.

If you have Ubuntu, installing the unoconv package via synaptic is all it takes to make this utility available to you. The only issue I ran into with that package is that the –list flag to return a list of supported formats returns the error "unable to get gail version number" without any output. Actual document conversion seems to work without issue.

If you don’t have Ubuntu, the unoconv web site makes Red Hat and Debian packages available as well as a tarball of the source code.

Below is the bash script I used.

#!/bin/bash
for file in `ls -1 *.odp`; do
    unoconv -d presentation -f pdf --stdout $file > PDF/${file/%odp/pdf};
    unoconv -d presentation -f ppt --stdout $file > .PPT/${file/%odp/ppt};
done

Building PHP-GTK with Cairo Support on Ubuntu Jaunty

Elizabeth Smith managed to pique my interest and maintain the patience of Job long enough for me to successfully build PHP 5.3.0RC1 with PHP-GTK including Cairo support on Ubuntu Jaunty. The process was a bit arduous, as Ubuntu apparently has a rather “interesting” automake package, so I thought I’d document it here for anyone who might be interested in repeating the process.

I’m assuming here that you want to use as many available Ubuntu packages as is feasible, aside from maybe PHP itself, in order to minimize the amount of manual compilation necessary. To that end, there are a number packages you will need to install before getting started that do not come with a standard Jaunty installation.

sudo apt-get install subversion cvs libcairo2-dev libgtk2.0-dev

If you plan to build PHP from source, you will also need a few more packages.

sudo apt-get install build-essential autoconf libxml2-dev

Once you’ve got all the dependencies installed, the first step will be to grab a copy of PHP. You’ve got a few options in that regard.

Assuming you do a custom build, here’s how I did it.

./configure --with-gettext --disable-cgi --without-pear \
    --prefix=`pwd`/build/php_build
make
make install

Next, use Subversion to check out a copy of Cairo extension. If you did a custom PHP build, you can just place it on the same directory level as that.

svn co svn://whisky.macvicar.net/php-cairo cairo

At the present moment, the easiest way to install the Cairo extension is manually as a PECL extension. So, compile using the phpize utility in your PHP build.

cd cairo
../php-5.3.0RC1/build/php_build/bin/phpize
./configure --prefix=`pwd`/build/php_build \
    --with-php-config=../php-5.3.0RC1/build/php_build/bin/php-config

It’s at this point that Ubuntu’s “interesting” automake package comes into play. The Makefile generated by phpize will be missing a critical flag -DCOMPILE_DL_CAIRO in its CFLAGS setting value. Open the Makefile in any text editor and find the line that looks like this.

CFLAGS = -g -O2

Append the missing flag to the line so it looks like this, then save it.

CFLAGS = -g -O2 -DCOMPILE_DL_CAIRO

At that point, just continue the compilation process for the Cairo extension as normal.

make
make install

Now use CVS to check out a copy of the PHP-GTK extension. Place it on the same directory level as cairo.

export CVSROOT=:pserver:cvsread@cvs.php.net:/repository
cvs -q checkout -P php-gtk

If the phpize utility is not in your PATH, you’ll have to assign it to an environmental variable as those are the only two ways that the buildconf utility you’re about to use will pick it up.

export PHPIZE=../php-5.3.0RC1/build/php_build/bin/phpize

Execute the buildconf utility to generate the configure script, then execute it.

./buildconf
./configure --prefix=`pwd`/build/php_build \
    --with-php-config=../php-5.3.0RC1/build/php_build/bin/php-config

To have the PHP-GTK extension take advantage of the presence of the Cairo extension, you’ll need to add a flag to the CFLAGS setting in its Makefile. Open that, find the line that looks exactly like the original one modified in the Cairo Makefile, and append the flag -DHAVE_CAIRO to it so it looks like this.

CFLAGS = -g -O2 -DHAVE_CAIRO

At that point, continue the compilation process normally just as with the Cairo extension. Once that’s done, since the extensions were compiled as PECL extensions, you’ll need to enable them in your php.ini file.

If you did a custom build of PHP, just copy the php.ini-development file in the root of the extracted tarball directory to lib/php.ini within your build directory as this is where PHP will look for it by default. If you’re using PHP 5.3.0RC1, there is a syntax error around line 581 of that file. A URL should be commented out using a semicolon but isn’t. Note that the extension_dir setting needs to be set and, if you use a relative path, it must be relative to the current working directory from which PHP is invoked (the root PHP build directory in my case).

extension_dir = "lib/php/extensions/no-debug-non-zts-20090115"
extension=cairo.so
extension=php_gtk2.so

At this point, if you execute your php binary with the -m switch, you should get a list of extensions loaded. cairo and php-gtk should be among them and you shouldn’t see any errors before the extension listing. To take this for a test spin, there’s a particular demo file for PHP-GTK with Cairo support in the php-gtk checkout.

cd php-5.3.0RC1/build/php_build
bin/php php-gtk/demos/examples/cairo_support.php

If this works as expected, you should see a nifty little PHP-powered clock widget on your desktop.

Many thanks to Elizabeth for her help in putting this tutorial together and for all the very cool people working on the PHP-GTK project. You can find them in the #php-gtk channel on the Freenode IRC network. At the present time, some of them are in the process of revamping the PHP-GTK docs. In the meantime, you can check out the GTK docs for more current information.

Running Spaz on Ubuntu Ibex 64bit

It took some digging to find it, but I finally found a way to make Spaz work on the Ubuntu Ibex installation on my Sony Vaio VGN-NR298E (with an Intel C2D 64bit processor). Up until I figured this out, I had been getting nothing but a non-responsive black box when I tried to launch Spaz.

Most of this comes from this tutorial on getting Twhirl and other AIR-based apps running on Ubuntu 64bit.

  1. Start by creating a new directory and and making it the current working directory. I just called it “Software” in my case.
    mkdir Software
    cd Software
  2. Install the AIR 1.5 SDK for Linux.
    mkdir air_1.5_sdk
    cd air_1.5_sdk
    wget -c http://airdownload.adobe.com/air/lin/download/latest/air_1.5_sdk.tbz2
    bunzip2 air_1.5_sdk.tbz2
    tar -xf air_1.5_sdk.tar
    rm -f air_1.5_sdk.tar
    cd ..
  3. Install Spaz.
    mkdir SpazAIR
    cd SpazAIR
    wget -c http://funkatron.com/getspaz
    unzip SpazAIR.air
    cd ..
  4. If you’re running 64bit, install the getlibs installer so you can easily get 32bit versions of libraries that AIR needs. Otherwise, skip this step. I believe the KDE equivalent to the libgnome-keyring0 package is kdewallet. Both should be installed by default on 32bit systems.
    wget -c http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs
    chmod +x ./getlibs
    ./getlibs libgnome-keyring.so.0 libgiogconf.so libgvfsdbus.so \
        libgioremote-volume-monitor.so
  5. Launch Spaz from the directory created in the first step.
    air_1.5_sdk/bin/adl -runtime air_1.5_sdk/runtimes/air/linux \
        -nodebug SpazAIR/META-INF/AIR/application.xml SpazAIR
  6. I didn’t find the default font used in the main tweet area to be very appealing, so I added this line to the User Theme CSS area of Settings.
    div.status-text { font-family: Tahoma; }

The only issue I ran into was receiving this error whenever I try to post: “An ActionScript error has occurred: Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.” Oddly, it doesn’t prevent posts from going through, though it is rather annoying. I have brought it up in a Spaz Google Group thread and hope to work with the developer to troubleshoot the issue further at some point in the future.

Oracle XE 10gR2 on Kubuntu 64-bit

So I started poking around for instructions on installing Oracle XE 10gR2 on my Kubuntu Hardy 64-bit installation recently. I came across this article from Oracle, which seemed like exactly what I wanted. Unfortunately, it assumes that the intended host operating system is 32-bit, which causes issues if you try to install XE through apt as the Oracle article suggests. After following these instructions, I immediately received this error:

W: Failed to fetch http://oss.oracle.com/debian/dists/unstable/Release \ Unable to find expected entry main/binary-amd64/Packages in \ Meta-index file (malformed Release file?)

After that, any apt command issued (related or not) produced this error.

E: The package oracle-xe needs to be reinstalled, but I can't find an \ archive for it.

And finally, when I resorted to using this excellent guide instead, I ran into this problem because of the earlier failed installation.

dpkg: regarding oracle-xe-universal_10.2.0.1-1.1_i386.deb containing \ oracle-xe-universal: oracle-xe-universal conflicts with oracle-xe oracle-xe (version 10.2.0.1-1.0) is present and broken due to failed \ removal or installation.dpkg: error processing oracle-xe-universal_10.2.0.1-1.1_i386.deb \ (--install): conflicting packages - not installing oracle-xe-universalErrors were encountered while processing: oracle-xe-universal_10.2.0.1-1.1_i386.deb

Luckily, I was able to find a solution to purge the failed installation from the system.

dpkg --remove --force-remove-reinstreq oracle-xe-universal

One thing that the Oracle article was useful for was creating a swap file large enough for Oracle to use, as the issue described in the article with not having enough swap space did arise when I initially tried the installation. Beyond that, the non-Oracle guide mentioned earlier worked like a charm and I now have a working XE installation on my system.

Dual-Booting XP and Kubuntu on a Sony Vaio

So it turns out the Holy Grail, Promised Land, or whatever you want to call it, does exist after all. After a number of different approaches and attempts, I finally got my Sony Vaio VGN-NR298E dual-booting Kubuntu and Windows XP. The solution turned out to be a well-known one: nLite.

With it, I was able to not only roll the drivers for my SATA drive into a custom XP CD, but also SP2 as well. It also offers options to include other drivers as well as post-SP2 Windows hotfixes and custom configuration options. I have to give major kudos to the nLite folks, as I imagine I would have given up at attempting to do this had it not worked as splendidly as it did.

So, without further ado, here’s the final recipe for succes in this endeavor. Obligatory disclaimer: I take no responsibility should you not have the same success or suffer damages by following these instructions. Other obligatory disclaimer: The only reason I went to this much trouble to dual-boot to XP is because I can’t find another solution that allows me to play my games.

  1. Download nLite. Use it to make a local copy your Windows XP CD.
  2. Download the standalone Service Pack 2 installer. Point nLite to it as a service pack to include.
  3. Download the Intel 82801HEM/HBM SATA AHCI Controller driversExtract them for unattended installation and point nLite to them.
  4. At this point, you can choose other drivers to include on the CD. Below is a list of those that are relevant to the Vaio. Be sure to have either Ethernet or Wifi drivers included in the CD or on a storage medium that Windows can recognize natively without external drivers.
  5. I ran into a small issue at this point that may or may not be pertinent to your case: the only machine on which I had a CD burner available was a Linux server machine. nLite was helpful in this regard, though, and offered an option to make the ISO file it created mkisofs-compatible. Using this, I was able to copy the ISO over the network to the Linux server, use mkisofs to test it and cdrecord (man page examples on this utility are helpful) to burn it.
  6. Boot the custom CD. Note that you no longer have to hit F6 at the point where you normally would to install custom drivers; the installer will simply detect that they’re available on the CD and load them from there. Installation should be pretty normal after this point. Partition your drive however you like, being sure to leave enough room for Kubuntu to load. You’ll probably notice the installer forces you to leave 8 MB free, presumably for the NT boot loader. Once you’re in Windows, you can reset your screen resolution and manually install any drivers you didn’t roll into the CD. Once you’re connected, install any further Windows updates that might be necessary.
  7. Once XP is set up to your liking, pop the Kubuntu CD in, boot from it, and access the installer on the desktop once KDE has loaded. In order to not have Kubuntu overwrite your XP installation, you’ll have to opt to partition manually. You’ll notice that the installer sees the 8 MB that XP made you reserve earlier. I’m not sure why, but the installer sees this as free space. At any rate, I just consolidated that space into the Kubuntu partition and let it set aside its 3 MB to load GRUB. I’m not sure how to keep the NT boot loader and not load GRUB, so if you prefer that route, you’ll have to dig around on your own to find out how. Set up your root and swap partitions and continue.
  8. Installation should again proceed fairly normally. Once you’ve loaded your installation for the first time, connect your machine to an ethernet cable and launch Adept, the package manager GUI for Kubuntu. Do a search for Windows and you should find a package called Windows Wireless Drivers. Install this for wireless if you need it. Beyond that, install updates and you should be good to go.

And that’s all there is to it, folks. It was a wild ride to figuring out the process, so I hope my efforts help someone else looking to do the same thing. Cheers!

More Kubuntu Developments

I finally figured out how to control the monitor brightness via this forum thread using the xbacklight command. I’m really happy for that, because it was a bit of a strain on my eyes and I couldn’t find a way to do it through the desktop manager. One other nice point about the forum thread is that it also walks you through how to execute this command automatically when battery power kicks in.

Kubuntu doesn’t install it by default, but if you search Adept for ndiswrapper, you should get an option to install Windows WiFi Drivers. This includes drivers for the Intel PRO/Wireless 4965 AG/AGN card, and once installed, it worked without requiring me to track down and install drivers manually.

I wanted to see if some of my games would work under Kubuntu. I tried Wine, but wasn’t able to get it to run Warcraft III without crashing immediately after selecting the play option from the splash screen. Apparently the supporting libraries for my particular graphics card (Intel 965 chipset) are fairly buggy when it comes to hardware acceleration.

I also attempted to install VMware in order to run the game in a virtual machine, but that was a dead end as well: the game won’t run with the display drivers provided by VMware tools and that it’s not possible to install the host machine’s drivers and have them work correctly. Incidentally, this forum thread provided some feedback about how to remove a partial installation so that aptitude will allow you to do a reinstallation. sudo dpkg –purge –force-remove-reinstreq vmware-server ended up doing the job.

So, as much as I hated the idea of having to go back to Windows, I set out to configure my system to dual-boot. Small problem: I have a SATA drive, which requires special drivers that Hitachi claims can only be installed via a floppy drive. My laptop doesn’t have one, and I’m not overly inclined to purchase an external one just to install XP.

My friend Jeff Jones pointed me to a forum thread detailing how to integrate the SATA drivers as well as Service Pack 2 into a custom XP CD. Since I didn’t have another existing XP installation, I had to use a VMware machine. It took some digging to find the Intel 82801HEM/HBM SATA AHCI Controller drivers and how to extract them for unattended installation. I used XP-ISO-Builder to create a custom ISO image and  DeepBurner Free to burn it to CD.

In attempting to boot with the CD, though, I got as far as being prompted to install the drivers before being presented with the error “The file iaStor.sys is corrupted.” Setup wouldn’t proceed any further, so I gave up on it for now. If you have any experience with a working solution rolling SATA drivers into a custom XP CD, I’d be interested to know. Feel free to leave a comment on this blog entry.

Kubuntu + Vaio = Nice

So the tax return ended up coming in around my birthday. Since it had been a long while since I’d gotten an upgrade, I decided to treat myself to a new Sony Vaio VGN-NR298E. The first order of business once I got it, of couse, was to wipe it clean of Windows Vista. Not having ever settled on a Linux distro of preference before, I decided to give Kubuntu 7.10 a try.

After installing and booting up for the first time, I found that the wireless didn’t work right out of the box. I was able to find this forum thread, which included a link to the Intel PRO/Wireless 4965 AG/AGN network card drivers in the section marked “Wlan.” I installed ndiswrapper-common and ndiswrapper-utils-1.9, the latter of which appeared to include a version of the netw4x32 driver. However, when I issued the command ndiswrapper -l, it indicated that the driver was invalid. I removed it with ndiswrapper -r netw4x32, then downloaded the latest version from the aforementioned link and installed it as per the forum thread’s directions.

I also needed a solution to allow me to manage the music and files on my Creative Zen Vision: W. I’d had great experiences with their MuVo line, but I have to say that the experience with the Zen hasn’t been nearly as good. Creative has extremely subpar Windows-only software for interacting with the hardware, the design of which was obviously intended to keep third parties from developing their own software.

Oddly enough, I’d never heard of this before, but Gnomad2 was quite the excellent solution for my situation. It’s a simple program with an FTP client-like interface for transferring music and files to and from the Zen. If you enable the universe and multiverse repositories, you should be able to find it by searching Adept.

I also ran into the reputable difficulties with the keyboard function keys. The volume function keys will only let me toggle the volume up and down a single level relative to its current level. The brightness keys don’t work at all, which is annoying as I end up missing the feature that worked fine on my old Dell Inspiron 1150. I’ve tried a few suggested solutions for getting these to work, but no luck so far. Any feedback on this is welcome.

I couldn’t adjust myself to Konqueror as it felt like an unfamiliar, slow, and crippled version of Firefox. I ended up installing that along with the Flash Player add-on for it and my usual group of extensions. I also found the default installation lacking a program capable of playing some video formats, so I installed VLC (also available from Adept).

Overall, though, I think I’m liking Kubuntu. Hopefully Lorna Jane will be able to help me get further accustomed to it.