Friday, November 19, 2010

Multimedia (MP3, MPEG-4, AVI, DiVX, etc.) support in Fedora 13

Why doesn’t Fedora support MP3 ‘out of the box’?

Fedora cannot include support for MP3 or DVD video playback or recording. MP3 formats are patented, and the patent holders have not provided the necessary licenses. Fedora also excludes other multimedia software due to patent, copyright, or license restrictions, such as Adobe Flash Player and RealNetworks RealPlayer.

That doesn’t mean you can’t play .mp3 files in Fedora, it just takes a bit of work (not much).

Follow these instructions to get mp3 and other multimedia support on your Fedora 13.
Open a terminal and become root, then run this command:

# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
# rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Now, Install all other plug ins..

# yum -y install gstreamer-plugins-bad gstreamer-plugins-ugly xine-lib-extras-nonfree gstreamer-ffmpeg

After successful installation, open Amarok or any other multimedia player and try to play the mp3 file and see if all goes fine and you are able to hear the music.

XMMS
To install xmms and make it MP3-capable, start by doing this:

# yum install xmms xmms-mp3

MPEG, QuickTime, AVI, and DVDs
MPEG (the format used on DVDs) represents itself as an open standard, but most Linux distributions won't ship software that read it because of blocking patents held by MPEGLA. AVI and Apple QuickTime have proprietary codecs covered by patents, so most Linux distributions won't ship software that decodes them, either.

Unfortunately, the alternate front end xine is even more broken. It can be installed this way:

# yum install xine xine-lib libdvdcss

Doing this will also install a number of support libraries, including the libdvdcss plugin

VLC Player:
# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
# yum -y install vlc

Wednesday, November 10, 2010

Restore GRUB

GRUB is a boot loader commonly used with linux operating system. It can be used to managed dual boot environment where linux and windows can coexist easily in a same machine without problem provided you install the windows OS first so that when you install linux, GRUB will overwrite Windows boot loader and automatically detect and manage both operating system the next time you boot your computer. Problems will happen if you alter your partitions outside the knowledge of GRUB, for example, you create new partition in your hard drive using windows. This will cause GRUB to automatically go into GRUB shell when boot. To restore back your GRUB is very simple, just follow easy steps below:

1. find in which partition does GRUB store its configuration file, which is your /boot partition. (hd0,2) means third partition of the first hard drive
grub> find /boot/grub/stage1
(hd0,2)

2. set the root for GRUB to be (hd0,2)
grub> root (hd0,2)

3. write GRUB to the Master boot record(MBR) of your hard drive. Change (hd0) to (hd0,2) to write GRUB to your /boot partition instead
grub> setup (hd0)

4. Reboot machine
grub> reboot

All those steps can also be used using livecd, if let say the grub shell did not come out but you cannot boot your machine or you cannot boot your linux due to messed up GRUB. just boot from livecd, open a terminal, and type "grub" as a superuser to go to GRUB shell

Tuesday, November 9, 2010

Create bootable Live USB drives for Linux distributions without burning a CD

UNetbootin allows you to create bootable Live USB drives for Ubuntu, Fedora, and other Linux distributions without burning a CD. It runs on both Windows and Linux. You can either let UNetbootin download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you've already downloaded one or your preferred distribution isn't on the list.

Requirements

  • Microsoft Windows 2000/XP/Vista/7, or Linux.
  • Internet access for downloading a distribution to install, or a pre-downloaded ISO file

Features

UNetbootin can create a bootable Live USB drive, or it can make a "frugal install" on your local hard disk if you don't have a USB drive. It loads distributions either by downloading a ISO (CD image) files for you, or by using an ISO file you've already downloaded.



The current version has built-in support for automatically downloading and loading the following distributions, though installing other distributions is also supported


Installation & Screenshots

1. If using Windows, run the file, select an ISO file or a distribution to download, select a target drive (USB Drive or Hard Disk), then reboot once done.






2. If using Linux, make the file executable (using either the command chmod +x ./unetbootin-linux, or going to Properties->Permissions and checking "Execute"), then start the application, you will be prompted for your password to grant the application administrative rights, then the main dialog will appear, where you select a distribution and install target (USB Drive or Hard Disk), then reboot when prompted.

 
3. After rebooting, if you created a Live USB drive by selecting "USB Drive" as your install target, press the appropriate button (usually F1, F2, F12, ESC, or backspace) while your computer is starting up to get to your BIOS boot menu and select USB drive as the startup target; otherwise if there's no boot selection option, go to the BIOS setup menu and change the startup order to boot USB by default. Otherwise, if you did a "frugal install" by selecting "Hard Disk" as your install target, select the UNetbootin entry from the Windows Boot Menu as the system boots up.

Configuring Ldap for Server and Client

compat-openldap.i386 0:2.1.30-6.4E
openldap-clients.i386 0:2.2.13-6.4E
openldap-devel.i386 0:2.2.13-6.4E
openldap-servers.i386 0:2.2.13-6.4E
openldap-servers-sql.i386 0:2.2.13-6.4E

yum install *openldap* -y

chkconfig --levels 235 ldap on
service ldap start

slappasswd
New password:
Re-enter new password:
{SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW

vi /etc/openldap/slapd.conf

#68 database        bdb
#69 suffix          "dc=example,dc=com"
#70 rootdn          "cn=admin,dc=example,dc=com"
#71 rootpw          {SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW


create users test1 and test2

Migrate local user to LDAP (We assume that users test1 and test2 exist in our system)
grep root /etc/passwd > /etc/openldap/passwd.root
grep test1 /etc/passwd > /etc/openldap/passwd.test1
grep test2 /etc/passwd > /etc/openldap/passwd.test2

Update default settings on file /usr/share/openldap/migration/migrate_common.ph
#71 $DEFAULT_MAIL_DOMAIN = "example.com";
#74 $DEFAULT_BASE = "dc=example,dc=com";

cd /usr/share/openldap/migration
migrate_passwd.pl /etc/openldap/passwd.root /etc/openldap/root.ldif
migrate_passwd.pl /etc/openldap/passwd.test1 /etc/openldap/test1.ldif
migrate_passwd.pl /etc/openldap/passwd.test2 /etc/openldap/test2.ldif

Update root.ldif file for the "admin" of LDAP Server

vi /etc/openldap/root.ldif

#1 dn: uid=root,ou=People, dc=example,dc=com
#2 uid: root
#3 cn: admin
#4 objectClass: account

Create a domain ldif file

cat /etc/openldap/example.com.ldif

dn: dc=example,dc=com
dc: example
description: LDAP Admin
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject

dn: ou=People, dc=example,dc=com
ou: People
description: Users of example
objectClass: organizationalUnit

Import all users in to the LDAP

ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f  /etc/openldap/example.com.ldif

ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f  /etc/openldap/root.ldif

ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f  /etc/openldap/test1.ldif

ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f  /etc/openldap/test2.ldif

service ldap restart

Test LDAP Server

ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'

Client Configuration
authconfig-tui

use LDAP

Server: ldap.example.com
Base DN: dc=example,dc=com