Tuesday, December 23, 2008

Blank screen on startup after installing Ubuntu 8.10? Try this fix

Compiz (a fancy window manager for Linux) is probably causing the problem.

Reboot your computer. When GRUB pops up, it may say "Press ESC to enter menu", or alternatley you may be kicked to the menu if you have multiple OS's installed. Either way, when you get to the OS selection menu, select the menu option (kernel choice) that has the word "Recovery" in it.

Once that's loaded, choose the "drop to root terminal" option (to that effect, the exact wording may be different) from the imtimidating blue menu that pops up.

From there, type the following command.

Code:
sudo apt-get purge compiz compiz-core
Now reboot your computer just in case.

Hope that works...

Tuesday, August 19, 2008

Download a YouTube video using C#

I've posted the code to download a YouTube video using C# at PasteBin -

http://pastebin.com/f396257b6

Original credit goes here - http://krishnan.co.in/blog/post/download-videos-from-youtube-(C).aspx

Saturday, August 9, 2008

Visual C# 2008 Express Edition Setup Error - Setup has encountered a problem while trying to copy...

Recently, I was attempting to install Visual C# Express 2008 Edition on my Windows XP computer and got this error message after downloading the "Web Installer: -

Screenshot -








Error Text -

Setup has encountered a problem while trying to copy:
m:\\$shtdwn$.req
Press Retry to attempt the copy again. Press Cancel to cancel setup.


After reading some forum (can't find the web page again!), I determined that it was probably related to the fact that Windows had decided to use my ext3 formatted hard disk drive (mounted locally using Ext2 IFS) to extract temporary files to, and this was causing some issues with the installer. The easy solution is to simply download the Visual Studio Express Editions DVD ISO (link here should work, if not Google for "Offline Install), and either burn it to a DVD and run the installer that way, or use a ISO mounting utility like Daemon Tools to mount it in a virtual DVD Drive.

Hope this saves someone a little time.

Wednesday, July 2, 2008

Fixing rdp MIME type in Ubuntu Linux

If you've ever been presented with the problem of downloading a dynamically generated (or even static) rdp (Remote Desktop) file from within Firefox in Linux and you were optimistically expecting Firefox to recognize it and open it in some graphical interface like tsclient, you were probably sorely disappointed - you might have gotten a message like -

You have chosen to open
example.rdp
Which is a: BIN file

In this instance, you are only granted the option to Save the file to your computer.

To fix this, you need to configure Linux to automatically recognize this MIME type so that Firefox recognizes the file type as something besides binary (for some reason you can't directly add the recognition in Firefox without extensions).

To do this, you need to add the rdp MIME info into the file /etc/mime.types. Run the following two commands to quickly achieve this -

sudo -i
echo "application/x-rdp rdp" >> /etc/mime.types

This simply appends the rdp MIME info to the file.

Trying download a rdp file from Firefox now (you don't need to restart it). When the Save dialog pops up (and actually recongnizes the file type!), press the "Browse..." button to open the Application Helper selection dialog.

In the resulting window, locate the "Location" bar and type /usr/bin/tsclient (for example, if you have this installed). Press "Open" to continue. Firefox should now associate .rdp files with tsclient. Press "OK" on the open dialog to proceed.

The Terminal Services Client GUI will open. You may wish to change the various options using the tabular interface provided. This application is richer than the built in Windows Terminal Services client itself!

The next time you click on a n RDP file, Firefox should remember the association and ask you if you want to open the file in tsclient. If the "Open with" field in Firefox's Open dialog on attempts subsequent to this tutorial is blank, press "OK" regardless. tsclient should still launch.

Side note: to use tsclient, you need the packages

* tsclient
* rdesktop

So just

sudo apt-get install rdesktop tsclient

Sunday, April 20, 2008

Ubuntu 8.04 Notes and Tips

I currently run Ubuntu 8.04 on an old eMachines desktop, and on my Toshiba A215-4767 laptop.

Here I will update the Linux community with my experiences installing and maintaining this crazy operating system on two machines.

Getting VirtualBox set up

For getting VirtualBox properly set up and configured, this guide will point you in the right direction. The steps are pretty much the same for 8.04 (Hardy Heron).

The highlights of the guide are these -

(1) Two versions to choose from - OSE vs Non-Free

"There are two versions of VirtualBox, the OSE (opensource edition) and the closed source, binary one. The OSE edition is the one you will find in the Ubuntu repositories (add/remove programs), but it lacks some features of the binary one, most notably, USB support. For this reason, I would advice using the binary. For Hardy, download it here (link many change eventually)

(2) Add yourself to vboxusers group

After installing, you will get a warning that you need to add users to the vboxusers group. Let's do so now:

System menu > administration > users and groups > manage groups

Select the “vboxusers” group > properties > check any users you want to be able to use VB.

Now log out, and log in again for these changes to become effective.

(3) Fix USB error #1 - VERR_FILE_NOT_FOUND

You may at some point get the error - "Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND)":

To fix it, we need to enable usbfs. Open a terminal and type:

sudo gedit /etc/init.d/mountdevsubfs.sh

Find this part:

# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb


remove the # sign in front of the last 4 lines so it looks like this:

# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb

Reboot Ubuntu.

Restart virtualbox, select your VM, then click settings. You should have no error messages now.

(4) Fix USB Error #2 - Permissions

You might also encounter a USB permissions problem with VirtualBox. (see here)

The fix? Open up a terminal and type in the following -

sudo gedit /etc/fstab

Add the following to the bottom of the text file -

 none  /proc/bus/usb  usbfs  devgid=46,devmode=664  0  0

(This assumes the group plugdev is group ID 46 on your machine - that's the default group ID for pulgdev anyway, so it shoulden't be a problem)

Now, plugdev, which handles plugable devices, can interact correctly with VirtualBox (after a reboot, probably)


Toshiba A215-4767 Specific Notes

Installing Ubuntu 8.04 on the Toshiba A215-4767 is a fairly simple process. There are only two components that take any real configuration - the wireless and sound setup.

Be sure to attach an Etherent wired connection to your laptop before the install or directly after it. You need to do this because you need to install ndiswrapper to get wireless access, and the simplest way to get it is from the online repositories. (You can install it from the installer CD, but I have been unable to determine how to set that up properly)

(1) Wireless setup (per this site)

Instructions for Atheros wireless card:

Download drivers:

XP 32-bit
XP 64-bit

Extract the drivers and take note of where you extracted them.
Open a terminal a type in the following -

Code:
sudo -i
echo "blacklist ath_pci" >> /etc/modprobe.d/blacklist
rmmod ath_pci

apt-get install ndiswrapper-utils-1.9 ndiswrapper-common

ndiswrapper -i net5211.inf

ndiswrapper -l
look for something like this:
net5211 : driver installed
device (168C:001C) present (alternate driver: ath_pci)


modprobe ndiswrapper
echo "ndiswrapper" >> /etc/modules

After a reboot wireless should work. You should see available wireless networks in the network manager. Note: every few bootups, Ubuntu doesn't get the MAC Address for the wireless card correctly. (Andrew's note - haven't noticed this problem yet) So far it looks like the easiest way to correct this is to go into /etc/ndiswrapper/net5211 and look for the file with a symbolic link. Edit it and replace the line that says
mac_address|XX:XX:XX:XX:XX:XX
and replace the X's with your MAC address.


(2) Sound setup (per this site)

After the inital boot and some updates, but you notice that the sound stops working after a reboot.

To fix this issue, you need to upgrade to the cutting edge version of Alsa. The easiest way to do this is to just use the backports modules.

1) Enable backports in software sources (System Menu> Administration> Software Sources--> Updates--> check "Enable Backports")

2)Then open a terminal and type in uname -r (this will tell you what kernel you're running (eg 386 or generic)

2) In a terminal, type -

sudo aptitude install linux-backports-modules-hardy-generic

OR

sudo aptitude install linux-backports-modules-hardy-386

depending on what kernel you have.

4) In a terminal
sudo gedit /etc/modprobe.d/alsa-base
this will open a file in gedit(the text editor). scroll down the page and
add this as the last line
options snd-hda-intel model=toshiba

(5) Reboot. This will upgrade your alsa to the 1.0.15RC3 and your sound will be fixed.