Sunday, April 29, 2012

HowTo: Sharing Android smartphone 3G connection with CentOS 6.2

I have a LG P500 Android smartphone running Gingerbread 2.3.3 and I've been meaning to try out if I could share the phone's 3G connection with my CentOS 6.2 laptop. Turns out that it is super easy to do so :)

In this post I'll explain the 2 methods that can be used to share your Android smartphone connection with CentOS 6.2 machine:
  1. USB tethering, wired connection
  2. Portable Wi-Fi hotspot, wireless connection
Though this procedure was executed on Gingerbread 2.3.3 and CentOS 6.2 it should apply to other Android versions as well as other Linux distributions equipped with Network Manager.

USB tethering

Activate the 3G data connection on the Android smartphone, connect the USB cable to the Android device and then to your computer. On the Android smartphone go to Settings -> Wireless & networks -> Tethering & portable hotspot and activate USB tethering.

CentOS' Network Manager with automatically create a wired connection assigning the cdc_ether driver to the USB device thus creating an ethernet interface such as usb0.

When your done just disable the 3G data connection or disable USB tethering on the Android smartphone.

Portable Wi-Fi hotspot

Activate the 3G data connection on the Android smartphone and go to Settings -> Wireless & networks -> Tethering & portable hotspot and activate Portable Wi-Fi hotspot.

Tap the Portable Wi-Fi hotspot settings and then Configure Wi-Fi hotspot. Type in a Network SSID such as MyAndroidAP, select Security and choose WPA2 PSK and type in a password in the Password field.

CentOS' Network Manager will identify Android's wireless Network SSID, connect to it and a Wireless Network Authentication Required pop-up will appear. Select WPA & WPA2 Personal and type in the password that you've chosen while configuring the Android smartphone.

To end the connection disable 3G or the Portable Wi-Fi hotspot.

Saturday, April 28, 2012

HowTo: Enable reiserfs support on CentOS 6.2 and SL6.2

By default RHEL clones such as CentOS and Scientific Linux don't come with ReiserFS filesystem support.

However the ELRepo repository has the kmod-reiserfs package which provides the much needed kernel modules. As such enabling ReiserFS support on RHEL/CentOS/SL 6.2 consists of adding the ELRepo repository, installing the kernel module for ReiserFS and the reiserfs-utils package which provide tools for creating and repairing ReiserFS filesystems.

The required steps are:
  1. $ su
  2. # rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
  3. # rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm
  4. # yum update
  5. # yum install kmod-reiserfs reiserfs-utils
  6. # modprobe reiserfs

Now you can have GNOME Nautilus mount ReiserFS partitions by simply clicking on the partitions and providing root's password.

It should be noted that the reiserfs-utils is also available in the CentOS-extras repository however the version on ELRepo is newer. If you have priorities associated with third party repositories take this into account.

Wednesday, April 25, 2012

Tip: Fix "pa_stream_writable_size() failed: connection terminated" GNOME Totem error

One of these day I launched a Matroska (.mkv) video when all of a sudden Totem crashes with the following error:
 pa_stream_writable_size() failed: connection terminated  
This error popped-up on CentOS 6.2 however upon investigating the error on Google I came across bug reports on several distribution ranging from CentOS 6, SL 6, Fedora 11-14, Ubuntu 9.10-10.10, etc.

The solution consists of changing PulseAudio configuration and reloading it:

  1. $ su
  2. # echo "resample-method = trivial" >> /etc/pulse/daemon.conf
  3. # exit
  4. $ pulseaudio -k

References:
https://bugzilla.redhat.com/show_bug.cgi?id=566915
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/496616
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/644644
http://pulseaudio.org/ticket/759

Tuesday, April 24, 2012

HowTo: Enemy Territory on CentOS 6.2 / SL 6.2

Wolfenstein: Enemy Territory is a free multiplayer FPS that takes place in the World World II pitting two teams (Allies and Axis) against each other for victory.

In this post I'll detail the steps required to install and update Enemy Territory, namely:
1) Download the necessary files
2) Install and update Enemy Territory
3) Install updated Punkbuster files
4) Generate an etkey
5) Fix sound problem
6) Setup widescreen resolution

These steps can be pretty much be reproduced in any Linux distribution, though some such as Gentoo and Arch Linux have Enemy Territory packages in their package management systems. It should be noted that the steps were performed on CentOS 6.2 but should translate to future CentOS 6.x releases.

1) Download Enemy Territory 2.60 and 2.60b update

Download et-linux-2.60.x86.run, et-2.60b.zip update, updated Punkbuster and the et-sdl-sound.gz sound fix:

  1. $ wget -c http://ftp.freenet.de/pub/4players/hosted/et/official/et-linux-2.60.x86.run
  2. $ wget -c http://darkstar.ist.utl.pt/games/et-2.60b.zip
  3. $ wget -c http://etkey.org/et_linux.zip
  4. $ wget -c http://nullkey.kapsi.fi/~stuff/et-sdl-sound/et-sdl-sound.gz

 

2) Install and update Enemy Territory

Change to root, attribute execute permissions to the installer, install Enemy Territory 2.60, install the 2.60b update, create a profile and check the game's version:

  1. $ su
  2. # chmod +x et-linux-2.60.x86.run
  3. #./et-linux-2.60.x86.run

Press OK in the popup. Agree with the License Agreement by pressing ENTER at the License Agreement prompt and choosing YES on "Do you agree with the license?" popup that follows. Choose NO at the "Would you like to read the CHANGES file?" popup. You can always read the CHANGES file latter on if you want. Choose the installation path and press OK in the Symlink Path popup. Install both Enemy Territory and Punkbuster. Choose to install the startup menu entries. After this the game installs. Don't choose to start the game immediately as we haven't finished installing everything.

Install the 2.60b update:

  1. # unzip et-2.60b.zip
  2. # cp Enemy\ Territory\ 2.60b/linux/* /usr/local/games/enemy-territory/
  3. # exit

Now start the game, create a player profile identifying profile name, connection speed and clicking on Enable Punkbuster; exit the game. By doing so a .etwolf directory will be created in your home directory which includes a folder containing PunkBuster.

Inside the game you can check the installed version by pulling the console down by pressing ~ and typing version. It should output the following:
 ]\version  
 "version" is:"ET 2.60b linux-i386 May 8 2006" default:"ET 2.60b linux-i386 May 8 2006"  

3) Install updated Punkbuster files

Remove old Punkbuster files, extract the last Punkbuster update and place it in the created profile:

  1. $ rm -rf ~/.etwolf/etmain/pb
  2. $ unzip et_linux.zip -d pb
  3. $ cp -R pb ~./etwolf/etmain/

4) Generate an etkey

Point to http://etkey.org/pages/etkey-home.php, press the Get an ETKEY button, download the file and store it under ~./etwolf/etmain/.

5) Fix sound problem

The most dreadful any Linux Enemy Territory player can witness:
 ------- sound initialization -------  
 /dev/dsp: No such file or directory  
 Could not open /dev/dsp  
 ------------------------------------  
Luckily we can use the SDL backend which Enemy Territory will use as audio device replacing /dev/dsp and OSS.

Install SDL, extract the et-sdl-sound script, make it executable and accessible to all and edit the et launcher to have Enemy Territory use SDL instead of OSS:

  1. # yum install SDL -y
  2. # gzip -d et-sdl-sound.gz
  3. # chmod a+x et-sdl-sound
  4. # chown root:root et-sdl-sound
  5. # mv et-sdl-sound /usr/local/games/enemy-territory/
  6. # vim /usr/local/games/enemy-territory/et

 #!/bin/sh  
 # Needed to make symlinks/shortcuts work.  
 # the binaries must run with correct working directory  
 cd "/usr/local/games/enemy-territory/"  
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.  
 ./et-sdl-sound "$@"  

6) Setup widescreen resolution

If you have a widescreen monitor follow the instructions on my previous blog post HowTo: Widescreen resolutions on Enemy Territory.

And we're done installing Enemy Territory!

Lately I've been playing at [fp].:Demolition_Centre as tangram"FreeBSD~ or tangram"GNU/Linux~. See you on the battlefield :D

Sunday, April 22, 2012

HowTo: Firefox Java plugin on CentOS 6.2 / SL 6.2

Enabling Firefox's Java plugin is a necessity these days, especially when you want to do your taxes and the government's online tool demands a Java enabled browser.

OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java programming language. OpenJDK however isn't bundled with the web browser plugin which is a part of Oracle Java.

Fortunately the IcedTea-Web project provides a Java web browser plugin.

On RHEL6 and its clones, icedtea-web depends on java-1.6.0-openjdk and will pull it as a dependency.

In practice, on CentOS 6.2 and Scientific Linux 6.2 if you want to have Firefox working with a Java plugin simply install icedtea-web, like so:

  1. $ su
  2. # yum install icedtea-web

Launch Mozilla Firefox and in the address bar enter about:plugins.

Also you can point Firefox to http://www.javatester.org/version.html and check if you have the Java Run-Time Environment working.

Now we can all submit our tax reports ;)

Saturday, April 21, 2012

Tip: Fixing timezone on CentOS / SL in multi-boot computers

I've installed CentOS and Scientific Linux on two computers each with several operating systems raging from Linux, FreeBSD and Windows. When prompted for Configuring the Time Zone I selected the city nearest to my timezone and left the System clock uses UTC checked.

Wrong!

My system clock was fine on CentOS 6.2 and SL 6.2 but when I booted to one of the other operating systems their clock would be off by 1 hour...

According to the Red Hat Enterprise Linux 6 Installation Guide you should only select System clock uses UTC if RHEL is the only operating system on your computer. So to fix things just use the Time and Date Properties Tool and uncheck the System clock uses UTC option. The tool can be accessed running system-config-date as root or pointing to System -> Administration -> Date & Time.

Simple solution for such an annoying problem ;)

Friday, April 20, 2012

Tip: Fixing Chromuim not compiling with base GCC error on FreeBSD

I haven't updated the ports tree for a month or so imagine my surprise when portmaster aborted with the following message:
 ===>>> Launching child to update chromium-17.0.963.79 to chromium-18.0.1025.162  

 ===>>> Port directory: /usr/ports/www/chromium  

     ===>>> This port is marked IGNORE  

     ===>>> does not compile with base gcc  

     ===>>> If you are sure you can build it, remove the  

         IGNORE line in the Makefile and try again.  

 ===>>> Update for chromium-17.0.963.79 failed  

 ===>>> Aborting update  

Oh!

Quickly browsed through /usr/ports/UPDATING and didn't notice any entry on www/chromium so the next step was checking /usr/ports/www/chromium/Makefile and yes there was an IGNORE line.

I was pretty sure I didn't change the default buid options last time so I browsed to http://www.freshports.org/www/chromium/ and noticed that on chromium-18.0.1025.142 gcc46 and clang were introduced as compilers as base gcc became too old.

Upon running make config on the port I noticed that I hadn't a compiler defined so it was a matter to enabling GCC46 and running portmaster once again to update Chromium.

Of course you can use CLANG instead if you prefer.

Wednesday, April 18, 2012

HowTo: Install LibreOffice on CentOS 6.2 / SL 6.2

Update:

With the release of RHEL, CentOS and SL 6.3 LibreOffice replaces OpenOffice as the default office suite available in the standard repositories. As such this HowTo isn't relevant anymore.
On RHEL / CentOS / SL 6.3 issue yum install libreoffice to install LibreOffice. If you had OpenOffice installed, with the 6.3 release you'll end up pulling libreoffice as part of the upgrade process.

By default, CentOS 6.2 and SL 6.2 come with OpenOffice in the official repositories with LibreOffice nowhere to be found.

In this post I'll go over the steps needed to install LibreOffice on RHEL6 clones such as CentOS 6.2 and Scientific Linux 6.2. Up until recently we'd have to manually download and install LibreOffice, however thanks to the efforts of Nux! a repository in now available and makes everyone life easier.

32 bit users

If you dont' have OpenOffice installed in your system you just need to run the following commands:

  1. $ su
  2. # rpm -ivh http://li.nux.ro/download/nux/libreoffice.org-rpms/el6/i386/nux-libreoffice.org-rpms-release-0-1.el6.nux.noarch.rpm
  3. # yum install libreoffice.org

If on the other hand you have OpenOffice installed:

  1. $ su
  2. # yum remove openoffice*
  3. # rpm -ivh http://li.nux.ro/download/nux/libreoffice.org-rpms/el6/i386/nux-libreoffice.org-rpms-release-0-1.el6.nux.noarch.rpm
  4. # yum install libreoffice.org

64 bit users

If you dont' have OpenOffice installed in your system you just need to run the following commands:

  1. $ su
  2. # rpm -ivh http://li.nux.ro/download/nux/libreoffice.org-rpms/el6/x86_64/nux-libreoffice.org-rpms-release-0-1.el6.nux.noarch.rpm
  3. # yum install libreoffice.org

If on the other hand you have OpenOffice installed:

  1. $ su
  2. # yum remove openoffice*
  3. # rpm -ivh http://li.nux.ro/download/nux/libreoffice.org-rpms/el6/x86_64/nux-libreoffice.org-rpms-release-0-1.el6.nux.noarch.rpm
  4. # yum install libreoffice.org

And that's it!

Nux is working on Centos 6 desktop oriented remix called Stella so do take a look at his site over at http://www.nux.ro/.

Tip: Enable Bash completion on CentOS 6.2 / SL 6.2

Bash, GNU Bourne-Again SHell, can be made more useful through the use of the bash-completion which provides programmable completion for Bash.

The package is not available the CentOS or Scientific Linux official repositories, so to install it you'll need to setup a third-party repository such as RPMforge or EPEL; in alternative you can always download and install the rpm manually.
$ su
# yum install bash-completion
# source /etc/profile
Examples of usage in which [TAB] means a press of the TAB key:
$ man bas[TAB][TAB]
base base64 basename bash bashbub
blk [TAB][TAB]
blkid         blkiomon      blkparse      blkrawverify  blktrace
$ yum re[TAB][TAB]  
reinstall remove repolist resolvedep
$ yum info bas[TAB][TAB]  
basesystem.noarch bash-completion.noarch bash-doc.i686 bash.i686  
Once you enable shell completion you world... err.. your shell world... will change :)

Tuesday, April 17, 2012

HowTo: Install Dropbox on CentOS 6.2 / SL 6.2

Update 19/05/2012:
The Repoforge repository has added Dropbox packages to their repository. As such, please refer to HowTo: Install Dropbox using Repoforge on CentOS 6.2 / SL 6.2 for up to date and easier instructions.

Dropbox is a Web-based file hosting service that uses networked storage provided by Dropbox, Inc to enable users to store and share files and folders with others across the Internet using file synchronization.

Dropbox is available for a huge variety of operating systems, including Android, Linux, Windows, Mac OS X, among others, so in this HowTo I'll detail the steps required to have it running on RHEL6 clones such as CentOS 6.2 and Scientific Linux 6.2.

This post assumes that you already have a Dropbox account, if you don't get one here.

Though the good folks at Dropbox don't keep a repository for RHEL6 clones, the available repository files work perfectly on CentOS 6.2 and Scientific Linux 6.2.

For a 32-bit system download:
 $ wget -c https://www.dropbox.com/download?dl=packages/fedora/nautilus-dropbox-0.7.1-1.fedora.i386.rpm  
If running a 64-bit instead download:
 $ wget -c https://www.dropbox.com/download?dl=packages/fedora/nautilus-dropbox-0.7.1-1.fedora.x86_64.rpm  
Having downloaded the package it's time to install it:
# rpm -Uvh nautilus-dropbox-0.7.1-1.fedora.*.rpm  
As part of installing the rpm package you'll be forced to restart Nautilus, afterwards point to Applications -> Internet and launch the new Dropbox entry.

Now a series of Dropbox Installation windows will guide you during the rest of the setup. In a matter of minutes you'll have a synchronized Dropbox folder; in my case this means synchronizing 2 Windows systems, 2 Linux systems and 1 Android phone (I'm investigating on how to get it working on FreeBSD).

Fixing Dropbox YUM repository error:
As a side effect of installing Dropbox YUM repository whenever you try to use YUM you'll get the following error:
 http://linux.dropbox.com/fedora/6/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"  
 Trying other mirror.  
 Error: Cannot retrieve repository metadata (repomd.xml) for repository: Dropbox. Please verify its path and try again  
The error originates from the fact that we're not using a RHEL6 repository but a Fedora 16 one. To fix the error edit the dropbox.repo file and replace baseurl=http://linux.dropbox.com/fedora/$releasever/ with baseurl=http://linux.dropbox.com/fedora/16/.
 # vim /etc/yum.repos.d/dropbox.repo  
 [Dropbox]  
 name=Dropbox Repository  
 #baseurl=http://linux.dropbox.com/fedora/$releasever/  
 baseurl=http://linux.dropbox.com/fedora/16/  
 gpgkey=http://linux.dropbox.com/fedora/rpm-public-key.asc  
It is advisable that you keep an eye out on Dropbox Linux page https://www.dropbox.com/install?os=lnx as the repository might change by the time of Fedora 17.

Monday, April 16, 2012

HowTo: Enable NTFS read and write access on CentOS 6.2 / SL 6.2

Whether we like it or not sooner or latter an USB key or an USB HDD formatted with NTFS filesystem will make acquaintances with our systems. With than in mind, this post aims to explain the steps needed to enable read and write capabilities to a CentOS 6.2 and SL 6.2 systems though the same steps should be applicable to latter versions of the RHEL clones.

To be able to mount and access NTFS filesystems on a CentOS 6.2 or SL 6.2 desktop, the fuse-ntfs-3g and gnome-vfs2-ntfs packages have to be downloaded and installed from either the RPMforge or EPEL repository.

For this how to I'll be using the RPMforge, so let's start by adding the repository:

On a 32-bit system:
$ su 
# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt 
# rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm  


On a 64-bit system:
$ su 
# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt 
# rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm 


After setting up the repository, proceed to install the required packages. It should be noted that ntfsprogs will also be installed as an dependency to gnome-vfs2-ntfs:
# yum install fuse-ntfs-3g gnome-vfs2-ntfs 
# hash 


fuse-ntfs-3g provides the opensource ntfs-3g driver that allows for full read-write access to NTFS, gnome-vfs2-ntfs allows GNOME VFS clients to use the NTFS library while ntfsprogs is a suite of NTFS utilities that includes ntsinfos (shows information on NTFS volumes), ntfslabel (show or sets NTFS volume labels) and nftsmount (mount read/write NTFS volumes) among others.

The NTFS volumes will appear in GNOME and double clicking them will mount them and make them browsable in Nautilus.

Friday, April 13, 2012

HowTo: Get etkey and Punbuster files on Enemy Territory

As of October 2011 EvenBalance ended it's Punkbuster support for Wolfenstein: Enemy Territory. As such, fresh installs of Enemy Territory are without the required etkey file and new Punkbuster GUID aren't generated.

What does this mean to the end user?

On a fresh install you'll need:
  1. etkey
  2. updated Punkbuster files
To circumvent these issues the community came up with the following solutions:
  1. point to http://etkey.org/pages/etkey-home.php, press the Get an ETKEY button, download the file and place it in ~/.etwolf/etmain/
  2. download the last up to date Punkbuster files from here, extract the files and placed them in a directory named pb in ~/.etwolf/
I'll update or create HowTo on how to install and setup Wolfenstein: Enemy Territory in a near future.

Thursday, April 12, 2012

Tip: Enemy Territory Master Server is back online!

Wolfenstein: Enemy Territory is once again online as announced at the Splash Damage Forum. The post can be found here.

Paul's interim master server is still working and most likely will continue to do so. So if you've used my tip to use the interim master server you are advised to remove the interim server address from the /etc/hosts file.

Happy fragging!

HowTo: Permenantely disable repositories in CentOS / SL

yum, Yellowdog Updater Modified,  is  an  interactive, rpm based, package manager. It can automatically perform system updates, including dependency analysis and obsolete processing based on "repository" metadata.

In this post I'll go over 3 methods that can be used to permanently disable repositories in CentOS.

Method 1: yum-config-manager

yum-config-manager command can be used to disable repositories. To disable a YUM repository, log in as root, identify the repository ID and use yum-config-manager to disable it:

For example, assuming you'd want to disable ELRepo repository:
$ su
# yum repolist all
# yum-config-manager --disable elrepo

Method 2: edit repository file
Login as root and edit the repository file under /etc/yum.repos.d/ and change the enable flag enable=1 to enable=0.

For example, assuming you'd want to disable ELRepo repository:
$ su
# vim /etc/yum.repos.d/elrepo.repo
# Enabled repository
[elrepo]
name=ELRepo.org Community Enterprise Linux Repository - el6
baseurl=http://elrepo.org/linux/elrepo/el6/$basearch/
mirrorlist=http://elrepo.org/mirrors-elrepo.el6
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0
# Disabled repository
[elrepo]
name=ELRepo.org Community Enterprise Linux Repository - el6
baseurl=http://elrepo.org/linux/elrepo/el6/$basearch/
mirrorlist=http://elrepo.org/mirrors-elrepo.el6
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

Upon running yum repolist you'll notice that the disabled repository no longer shows.
# yum repolist all

Method 3: remove repository file
Of course you can always use blunt force and simply remove the repo file from /et/yum.repos.d/.

For example, assuming you'd want to disable (in this case remove is a better word) the ELRepo repository:
$ su
# rm /etc/yum.repos.d/elrepo.repo

Run yum and check if the repository has been removed:
# yum repolist all

For further information on yum and its immense uses :
$ man yum

Tuesday, April 10, 2012

HowTo: Install NVIDIA drivers on CentOS 6.2 / SL 6.2

By default, RHEL clones such as CentOS 6.2 and SL 6.2 assign the nouveau X11 driver to NVIDIA graphics card. nouveau is a fine driver, miles away from the old nv; however if you want 3D performance (or a compiz powered desktop) you'll need to turn to NVIDIA and its closed source drivers.

CentOS official repositories don't contain packages for NVIDIA closed source driver so one needs to add a third party repository that has the driver available, such as the ELRepo repository.

Adding the ELRepo consists of importing the public GPG key and installing the repository:
# rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org 
# rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm 
Having added the repository we can finally install the driver (yum pulls nvidia-x11-drv as a dependency) and reboot:
# yum install kmod-nvidia
# reboot
Know Issues
By installing NVIDIA closed source drivers, the plymouth graphical boot will no longer be available. In other worlds, the pretty CentOS and SL logos on a black background will be replaced by a bottom horizontal progress bar.

Monday, April 9, 2012

HowTo: Install Adobe Flash Player on CentOS 6.2

Update 15-07-2012: the folks at the Repoforge have added flash-plugin to their repository. If you prefer to use their package follow the instructions at http://linux-bsd-sharing.blogspot.pt/2012/07/howto-install-adobe-flash-player-using.html.
 
To install Adobe Flash Player you'll need to change to root, install Adobe's YUM repository, import the associated GPG key, update the repositories and install Adobe Flash Player.

For a 32-bit CentOS 6.2 installation, run the following commands:
$ su
# rpm -ivh http://linuxdownload.adobe.com/linux/i386/adobe-release-i386-1.0-1.noarch.rpm 
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux 
# yum check-update 
# yum install flash-plugin 

Launch Mozilla Firefox and in the address bar enter about:plugins. An Shockwave Flash entry should be available.

If you point to System -> Preferences you'll notice that a new entry named Adobe Flash Player is now available.

Fire up a random Youtube clip and have fun ;)

HowTo: Enable desktop effects on CentOS 6.2 / SL6.2

In previous versions of CentOS and Fedora the Desktop Effects menu under System -> Preferences allowed for the use of 3D desktop effects courtesy of compiz.

To enable the menu in CentOS 6.2 and SL 6.2 you'll need to install both compiz-gnome and desktop-effects packages assuming 3D drivers are installed.

compiz-gnome provides the compiz window manager and integration with the GNOME desktop environment while desktop-effects had a simple but useful menu to turn on/off the compiz effects.

  1. $ su
  2. # yum install desktop-effects compiz-gnome

Now simply point to System -> Preferences -> Desktop Effects and enable the Compiz option. I personally like to also enable the Windows Wobble when Moved option ;)

Tip: Using Linux to check if CPU has Intel VT-x

To verify if a Intel CPU supports the company's technology for virtualization take a look at /proc/cpuinfo and check for the vmx CPU flag.
 $ grep vmx /proc/cpuinfo 
If your interested in reading the ouput of /proc/cpuinfo in more detail:
 $ cat /proc/cpuinfo | less 
The procfs filesystem contains loads of process and system information and /proc/cpuinfo in particular contains information regarding the CPU, such as vendor, cache size, clockspeed, cores and CPU flags.

HowTo: fsck an ext2 partition in FreeBSD

The fsck available in FreeBSD's base system doesn't work on Linux file formats such as ext2 and ext3. For that end one first needs to install sysutils/e2fsprogs.

Bellow I'll explain how to install sysutils/e2fsprogs and use the supplied fsck.ext2 on a ext2 partition.

First, install the port:
$ su
# cd /usr/ports/sysutils/e2fsprogs
# make install clean
# rehash

Now the fsck.ext2, fsck.ext3 and fsck.ext4 commands are available. Assuming the /dev/ad4s1 as being the faulty partition, run:

# fsck.ext2 /dev/ad4s1
e2fsck 1.42 (29-Nov-2011)
/dev/ad4s1 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/ad4s1: 37/10040 files (13.5% non-contiguous), 13062/40128 blocks

And that's it ;)

Sunday, April 8, 2012

Tip: Fixing yum --disablerepo not working on CentOS 6.2

I came across a weird situation while meddling with repositories in CentOS 6.2.

# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: ftp.dei.uc.pt
 * c6-media:
 * extras: ftp.dei.uc.pt
 * updates: ftp.dei.uc.pt
file:///media/CentOS/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/CentOS/repodata/repomd.xml
Trying other mirror.
file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrecorder/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
repo id                         repo name                                 status
base                            CentOS-6 - Base                           4,764
c6-media                        CentOS-6 - Media                              0
extras                          CentOS-6 - Extras                             0
updates                         CentOS-6 - Updates                            0
repolist: 4,764

So I figured that disabling the c6-media repository would fix things, however iIssuing yum --disablerepo=c6-media resulted in yum displaying it's help file.

While investigating the issue I came across Red Hat Bugzilla – Bug 689208 in which a user faced the same exact problem under Fedora 14.

The solution is:
# yum-config-manager --disable c6-media
Loaded plugins: fastestmirror, refresh-packagekit
================================ repo: c6-media ================================
[c6-media]
bandwidth = 0
base_persistdir = /var/lib/yum/repos/i386/6
baseurl = file:///media/CentOS/,
   file:///media/cdrom/,
   file:///media/cdrecorder/
cache = 0
cachedir = /var/cache/yum/i386/6/c6-media
cost = 1000
enabled = 0
enablegroups = True
exclude =
failovermethod = priority
gpgcadir = /var/lib/yum/repos/i386/6/c6-media/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/i386/6/c6-media/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
hdrdir = /var/cache/yum/i386/6/c6-media/headers
http_caching = all
includepkgs =
keepalive = True
mdpolicy = group:primary
mediaid =
metadata_expire = 21600
metalink =
mirrorlist =
mirrorlist_expire = 86400
name = CentOS-6 - Media
password =
persistdir = /var/lib/yum/repos/i386/6/c6-media
pkgdir = /var/cache/yum/i386/6/c6-media/packages
proxy =
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
username =


Now running yum update works as expected:
# yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: ftp.dei.uc.pt
 * extras: ftp.dei.uc.pt
 * updates: ftp.dei.uc.pt
Setting up Update Process
No Packages marked for Update


Success ;)