Install Sun Java with the Firefox Plugin on an Ubuntu Live CD or USB



When running Ubuntu from a live cd or live usb, and trying to install java, the following errors appear:

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory


OR

Setting up sun-java6-bin (6-06-0ubuntu1) ...
Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.

Getting and Preparing the files

Adding the Multiverse and Universe Repositories

Go to 'System', 'Administration', 'Software Sources'.

On the 'Ubuntu Software' tab tick the multiverse and universe boxes.

Click 'Close'. It will ask you to reload/refresh; DO IT!

Getting and Installing Java

Online Install

Do this in a terminal for JRE (basically if you're not a java developer):

* sudo apt-get install sun-java6-jre sun-java6-plugin

Do this in a terminal for JDK (basically if you ARE a java developer):

* sudo apt-get install sun-java6-jdk sun-java6-plugin

Say yes to whatever asks. If you are on a live CD or USB (even if it is Feisty 7.04, Gutsy 7.10, or Hardy 8.04 - I tried them all) you will probably get something like this:

Setting up sun-java6-bin (6-00-2ubuntu2) ...
/usr/lib/jvm/java-6-sun-1.6.0.00/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
dpkg: error processing sun-java6-bin (--configure):
subprocess post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of sun-java6-plugin:
sun-java6-plugin depends on sun-java6-bin (= 6-00-2ubuntu2); however:
Package sun-java6-bin is not configured yet.
dpkg: error processing sun-java6-plugin (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sun-java6-jre:
sun-java6-jre depends on sun-java6-bin (= 6-00-2ubuntu2) | ia32-sun-java6-bin (= 6-00-2ubuntu2); however:
Package sun-java6-bin is not configured yet.
Package ia32-sun-java6-bin is not installed.
dpkg: error processing sun-java6-jre (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
sun-java6-bin
sun-java6-plugin
sun-java6-jre
E: Sub-process /usr/bin/dpkg returned an error code (1)
Fixing that Error
Go into a terminal and do the following:
(Copy and paste using right-click so you don't get any of them wrong)

1.sudo su

2. LD_LIBRARY_PATH=CHANGEME dpkg --configure -a

-----The CHANGEME part should be changed to the location of libjli.so
-----Open your File System, go Ctrl+F, search for 'libjli'
-----Mine was in '/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/jli'
----------so I used LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/jli dpkg --configure -a

3.ln -s / /cow

4. Run whichever of these you used before again:

sudo apt-get install sun-java6-jre sun-java6-plugin
sudo apt-get install sun-java6-jdk sun-java6-plugin

-----Say yes to anything it asks.
-----It should work perfectly this time with no errors.


Verification of Success

In a terminal type:

java -version

Something like this should appear:

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)
In firefox, where you would type a website type:
Code:

about:plugins

You should see something like this (you might have to scroll to find it):
Quote:
Java(TM) Plug-in 1.6.0_06-b02

File name: libjavaplugin_oji.so
Java(TM) Plug-in 1.6.0_06
With a huge table underneath it.

Go to this website: http://java.com/en/download/help/testvm.xml

An applet will run near the bottom if you java is working correctly.




Howto Re-install Grub after windows wipes it out



Basically you have a good install of ubuntu and then realise that you want to dual-boot. You don't want to erase ubuntu, so you install windows. Grub then gets erased and there is NO way to get back into ubuntu.


So do the following:

1) Boot off the LiveCD

2) Open a Terminal (Applications-Accessories-Terminal) and type in the following commands, noting that the first command will put you into the grub "prompt", and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

sudo grub
> root (hd0,0)
> setup (hd0)
> exit

4) Reboot (removing the livecd), and your boot menu should be back.

5) Open the grub file:

sudo gedit /boot/grub/menu.lst

6) Scroll to the bottom and add the following:

title Windows XP
root (hd0,0)
makeactive
chainloader +1

Note that you should also verify that hd0,0 is the correct location for Windows. If you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3).




Howto Configure Evolution to Work with Yahoo! Mail



Before we start you have to pay for a PLUS mail account in order to pop3 it with Evolution or any other e-mail tool.


Procedure to follow

1. Open Evolution and click EDIT -> PREFERENCES from the menu.

2. On the left, ensure MAIL ACCOUNTS is high-lighted. Click ADD.

3. Click FORWARD.

4. Enter your personal information here. You don't have to enter your full name if you don't want your full name to appear in outgoing mail. Click Forward when finished.

5. Select POP for Server Type.

Now add the following for RECEIVING EMAIL (heading at top of the window)

SERVER: plus.pop.mail.yahoo.com:995 (Notice port number at the end)

Username: your Yahoo! username WITHOUT @yahoo.com

Use Secure Connection: SSL Encryption

Authentication Type: PASSWORD

Remember Password: Checked (optional)


6. Click FORWARD button.

7. Set the next options to your liking. I place a check mark in the first box and have my yahoo! e-mail checked every 1 minute. That's the only setting chance I make on this window.

8. Click FORWARD.

Now add the following for SENDING EMAIL (heading at top of the window)

Server Type: SMTP

SERVER: plus.smtp.mail.yahoo.com:465 (Notice port number at the end)

Server requires authentication: Check this box

Use Secure Connection: SSL Encryption

Authentication: Plain

Username: your username WITHOUT the @yahoo.com


9. Click FORWARD.

10. Enter a name for this setup. I use: Yahoo!


Click apply and your done. If you've already been trying to get this to work and have a yahoo mail account created, don't click ADD (step 2). Instead click on it and select EDIT. Then enter the above information in the SENDING and RECEIVING tabs.




Howto Improve NVidia Laptop Graphics Performance in Ubuntu



NVidia laptop cards come with a feature called PowerMizer that dynamically underclocks the GPU when it's not being used much. This is great for battery power but horrible for performance when using Desktop Effects (compiz). Unfortunately, NVidia does not provide a way to configure PowerMizer on Linux however, it's not difficult to create a script that will give you maximum speed while on AC power and maximum power savings while on battery.


This HOWTO is aimed primarily at users of NVidia 8 and 9 series laptop graphics cards (though, it may be useful for 7 series users as well). This HOWTO assumes you are running compiz and have already properly configured the NVidia proprietary drivers. If you are not using compiz, this guide will not be useful for you.

Implementation

The first thing we will need is a utility called nvidia-settings. If you've installed the NVidia drivers directly from the NVidia website or using envyng, you can skip this step

sudo apt-get install nvidia-settings

The nvidia-settings has a unique property that, with essentially no CPU/GPU activity, when you ask the card to print all of its information, it causes the card to go to maximum power. The nvidia card only drops a power level every 30 seconds so, we are going to take advantage these two facts to keep the card at maximum power if we are on AC power.

If you have no custom scripts, follow these instructions first

mkdir -p ~/bin

Then, open up gedit and paste the following script


#!/bin/bash

while true; do
if on_ac_power; then
nice /usr/bin/nvidia-settings -q all > /dev/null
fi
sleep 25;
done

Save the script as ~/bin/nvidia-power.sh. Then, start a terminal and type the following:


chmod +x ~/bin/nvidia-power.sh

~/bin/nvidia-power.sh &

disown

exit

If you are on AC power, the card should now be locked at its maximum power but, if you are on battery power, you should see no difference at all (until you next plug your laptop in).

Next, we will need to add this script to run when you login. On gnome, go to System->Preferences->Sessions, click Add. Add a descriptive name for the startup program (maybe, "NVidia Power") and for Command use, "/home/your_username/bin/nvidia-power.sh" (replace your_username with your username). Now the command should run whenever you login.

Testing

Testing is fairly straightforward. Start a terminal and type:

nvidia-settings

Scroll down to the bottom of the window this command brings up and look on the left side for the PowerMizer option. If your laptop is plugged in, you should see that your graphics card is running at full power. Watch it for a minute (the time it takes for the card to normally drop to lowest power) and make sure it stays at the highest power level. Now, unplug your laptop and wait for another minute. After less than a minute, your card should drop down to minimum power (as long as you keep it idle). Now, plug the cable back in and, in less than 30 seconds, the card should come back to full power and stay there.

The one caveat of this approach is that it can take up to 25 seconds for the card to come back up to full power. There are more complex ways to make the card instantly go to full power when plugged in but, on average, it will be at full power within 12 seconds so, it's probably more hassle than it's worth to use more complex methods.




Howto Create Smart Playlists in Songbird



Songbird doesn't have the feature for Smart Playlists built into it (playlists that consist of music matching certain conditions, e.g. "Never been played", or "Recently Added").



How to make a Recently Added playlist:

1. Open Text Editor (Applications>Accessories>Text Editor)

2. Copy and paste:

find "/home/user/Music/" -mtime -30 -type f | egrep -vi '\.jpg$' >recentlyadded.pl

Change /home/user/Music/ to the directory where you store your music.

By default I've defined "recently added" as music that was added in the past 30 days, but you can change the number 30 to a different number if you prefer.

3. Click File>Save As... and call it RecentlyAddedPlaylist.sh (or something else if you prefer).

4. Navigate to the folder where you saved it, right click on it, click Properties.

5. Go to the Permissions tab and tick the box "Allow executing file as program" and click Close.

6. Double click on the file and click Run in Terminal

7. Open Songbird

8. Click on File>Import a Playlist...

9. Navigate to your home folder.

10. The playlist won't be visible, so just type "recentlyadded.pl" and click Open.

11. You should now see a playlist of all the songs you've added in the past 30 days.

To update the playlist, simply run steps 6 to 10 again.




Howto Install Ubuntu on an external hard drive on an Acer Aspire laptop



If you want to install Ubuntu on an external hard drive on an Acer Aspire laptop follow this procedure

1) Buy a MyBook 320GB hard drive at Wal-Mart (by Western Digital) for ~$100

**NOTE: The next step is only necessary if you need wireless internet access through a router**


2) Buy a Zonet wireless card (your Aspire's built-in wireless IS NOT compatible with Ubuntu)

3) Follow the MyBook's [sarcasm]extremely difficult[/sarcasm] installation instructions to get it working in Windows Vista.

4) DO NOT USE THE ZONET CARD, Windows can and will mess up its internal settings.

5) Once the MyBook is working, attempt to format it to NTFS. When the format is just A LITTLE BIT done, purposefully end the format to corrupt the drive. I know it sounds stupid, but it works.

6) Download the latest version of Ubuntu (8.04 at the time of writing) as a LiveCD.

7) Write the ISO to a CD, I used a CD-RW. Most Aspire laptops come with NTI CD Maker, so use that if you have it.

8) This step was a mistake. If you're trying to reproduce this, skip to step 9. Restart your laptop to find that the BIOS won't load from CDs. Reenter Windows in frustration.

9) Go into the CD with windows to bring up the Ubuntu menu inside Windows.

10) Choose to use the LiveCD (I think the top option) and use the 3rd option (to get help with startup).

11) It will rewrite your BIOS to allow booting from the LiveCD on startup.

12) Restart again and load the LiveCD.

13) Boot into "normal install" (first button on CD menu).

14) Enter GParted and find your new 320GB hard disk.

15) There should be 1 partition with an "unknown" format. Delete the partition and apply it.

16) Close GParted and restart. Go back into the normal install like before.

17) Hit Install on your Ubuntu desktop.

18) Answer the questions as normal until it asks you where to install it to.

19) Choose to take up the entire 320GB drive.

20) Install Ubuntu as normal, you don't need to change any of the advanced settings.

21) When complete, reboot into the new GRUB bootloader and choose to start Ubuntu.

22) It will start from your external HD and boom, you have Ubuntu!

**NOTE: If you DON'T want wireless internet access, skip to step 29**

23) Shut down and put your Zonet card in. Go back into Ubuntu.

24) In Ubuntu, go to the network options.

25) Set your computer's built-in wireless device to 'roaming mode' if you haven't already.

26) Set your Zonet card to manual configuration. Enter your router's SSID and choose "Automatic DHCP configuration" in the dropdown list.

27) Apply these and let it change the interface.

28) Start Firefox, and with any luck, you're connected now!

29) Enjoy!




Howto install Fedora Directory Server (DS) 1.04 on Ubuntu 8.04 (Hardy Heron)



A directory server provides a centralized directory service for your intranet, network, and extranet information. Directory Server integrates with existing systems and acts as a centralized repository for the consolidation of employee, customer, supplier, and partner information. You can extend Directory Server to manage user profiles and preferences, as well as extranet user authentication.



Preparing your system

cd /home/

mkdir fds

cd fds

sudo apt-get install ssh

Download Fedora Directory Server Pre-built rpm

wget -c http://directory.fedoraproject.org/download/fedora-ds-1.0.4-1.FC6.i386.opt.rpm

Installing Alien Package

sudo apt-get install alien

Convert .rpm Package to .deb Package

sudo alien --scripts fedora-ds-1.0.4-1.FC6.i386.opt.rpm

Install Dependencies

wget http://mirrors.kernel.org/debian/pool/main/t/termcap-compat/termcap-compat_1.2.3_i386.deb

wget http://mirrors.kernel.org/debian/pool/main/libc/libc/libc5_5.4.46-15_i386.deb

wget http://mirrors.kernel.org/debian/pool/main/l/ld.so/ldso_1.9.11-15_i386.deb

sudo dpkg --install ldso_1.9.11-15_i386.deb

sudo dpkg --install libc5_5.4.46-15_i386.deb

sudo dpkg --install termcap-compat_1.2.3_i386.deb

Installing Java Run Time Environment

sudo apt-get install sun-java6-bin

Installing Apache2-mpm-worker

sudo apt-get install apache2-mpm-worker

sudo ln -s /usr/sbin/apache2 /usr/sbin/httpd

Installing .deb package

sudo dpkg -i fedora-ds_1.0.4-2_i386.deb

Creating a user and group for the daemon

sudo groupadd fds

sudo useradd -s /bin/false -g fds fds

Running Fedora-ds Setup Program

sudo /opt/fedora-ds/setup/setup -k

Please select the install mode:
1 - Express - minimal questions
2 - Typical - some customization (default)
3 - Custom - lots of customization
Please select 1, 2, or 3 (default: 2) 1

Hostname to use (default: facility-srv1.it-mgt.com)
Server user ID to use (default: nobody) fds
Server group ID to use (default: nobody) fds

Fedora configuration directory server
administrator ID [admin]:
Directory Manager DN [cn=Directory Manager]:

sudo cp /opt/fedora-ds/setup/install.inf /opt

sudo chmod 640 /opt/install.inf

sudo pico /opt/install.inf

Add the directive for ApacheRoot at the end of the file
...
[admin]
SysUser= root
Port= 16000
ServerIpAddress=
ServerAdminID= admin
ServerAdminPwd= dsadmin
ApacheDir= /usr/sbin
ApacheRoot= /usr/lib/apache2

Rerun the setup script with the new ApacheRoot directive

sudo /opt/fedora-ds/setup/setup -s -f /opt/install.inf

You can now use the console. Here is the command to use to start the console:

cd /opt/fedora-ds

./startconsole -u admin -a http://facility-srv1.it-mgt.com:/

Adjusting the admin-server's httpd.conf file

sudo pico /opt/fedora-ds/admin-serv/config/httpd.conf

Comment out the following apache module

#LoadModule log_config_module /usr/lib/apache2/modules/mod_log_config.so

Starting the admin-server

sudo /opt/fedora-ds/start-admin

Persistent startup

sudo pico /etc/inti.d/local

#! /bin/sh
/opt/fedora-ds/slapd-fossedu/start-slapd
/opt/fedora-ds/start-admin

sudo chmod +x /etc/init.d/local

sudo update-rc.d local defaults 80




HowTo enable empty password login in Ubuntu



ou want to enable a password less account in Gnome for your family/friends who have access to your computer.

This is different than not typing a password (autologin)


How to - by example

Create a user (system/administration/user and groups)
You can put fancy characters in the real name but not in the username.
You are obliged to enter a password. We will get read of it afterwards.

example:
username: guest
real name: invité (or guest or whatever you want to display in the graphical greeter later on)
profile: desktop user (DO NOT use administrator)
password: password

click ok and close the users and groups tool.

Remove the password for the guest user
open a terminal

sudo passwd -d guest

Authorize login with no passwords in gdm

sudo sed -i 's/#PasswordRequired=false/PasswordRequired=false/' /etc/gdm/gdm.conf

Authorize login with no passwords in pam

sudo sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth

You can now log in with your guest user with no password.

If you want a graphical greeter screen, select it in system/administration/login window [local tab] (example: human list)




Howto Backup all installed programs/packages in Ubuntu/Kubuntu



PROBLEM: Lets say you have set up your *buntu box. Now you want to backup all the installed deb files so that you can restore them quickly and efficiently.


These commands will do that for you.

Open a terminal and paste the following into it:

$ sudo apt-get install dpkg-repack fakeroot

$ mkdir ~/dpkg-repack; cd ~/dpkg-repack

$ fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`

(the last command will take some time)

Now if you scroll to your home folder, you should find a folder called "dpkg-repack" which should have all the deb files of all your installed packages.

Reinstall Packages

If you want to re-install the packages, navigate to the folder with the packages and input the following command in the terminal:

sudo dpkg -i *.deb






This is a very short and simple tutorial on how to remove the locked screen login prompt after resume from suspend or hibernation in Ubuntu 8.04 (Hardy).


All you have to do is comment out a single line in a specific configuration file.

First, lets bring up a terminal window. Applications -> Accessories -> Terminal

Now that we have a terminal up, let's enter the command

gksudo gedit /etc/default/acpi-support

This will grant authoritative access to the configuration file which handles suspend and hibernation operations and utility.

Once the file is open in gedit text editor, let's scroll down to the line

# Comment this out to disable screen locking on resume

LOCK_SCREEN=true

LOCK_SCREEN is a boolean variable that has a true and false value. Rather than change its value to false, let's simply comment it out by placing a # before LOCK_SCREEN so that the enter line becomes,

#LOCK_SCREEN=true

Let's now save and we're done. Reboot or Ctrl-Alt-BackSpace (to restart Ubuntu) for changes to take effect and you can now try to suspend or hibernate and your changes should be there.

To set LOCK_SCREEN again, repeat the process, but remove the # instead.