Tuesday, 28 May 2013

Dmidecode, or Desktop Mangement Interface, is a very useful tool for finding out details of the system hardware on your Centos 6 or RHEL box.

Dmidecode outputs information about your hardware as recorded in the BIOS. You can also obtain the information about maximum supported system configuration. This includes model
name, serial number, BIOS version, asset tag and other
details depending on the
manufacturer. This will often include usage status for the CPU sockets,
expansion slots (e.g. AGP, PCI, ISA) and memory module slots, and the
list of I/O ports (e.g. serial, parallel, USB). Important to note is that it does not scan your hardware but reports what information the bios holds on it. It should be run as root user.

Monday, 20 May 2013

Abiword is a lightweight cross platform open source Office program which runs nicely on Linux, probably a little quicker than two of the major applications which are also available, Open Office and LibreOffice. It is twinned with the Abicollab project which allows multiple participants to work on the same document.

It comes with a useful array of tables, bullets, lists, images, footnotes, endnotes and styles with other features including mail merge & internationalisation.

It also has an extensible plugin architecture with a variety of plugins ranging from Document Importers to a Thesaurus, Image Importers and a Text Summarizer.

It can accomplish a wide range of tasks in document handling, for example it can import WordPerfect documents or graphics, view SVG graphics and work with Palm database files.

A large choice of file types is supported, including PDF which makes it ideal to use in conjunction with Print to PDF for Firefox, you can open web pages you have saved to PDF for further editing in Abiword if necessary.

AbiWord
offers a simple text editor where you input formulas in LaTeX format
for equation handling, and it features a powerful drop down styling menu
accessed from the format
toolbar, in addition to the Stylist, a facility to quickly change parts
of the current document.It can be used
in a server environment thanks to the powerful built in command line
interface which enables you to generate form letters, print documents or
convert to any file format from the command line.

With features like these and the cross platform functionality including a portable version, Abiword is becoming a must have for the Linux desktop. To install it, first enable nux-dextop repoDisable it or set priorities for it, then use as below.

Friday, 17 May 2013

Here is a list of repos which are useful for extra packages while building up your system. You can use them manually and have them set at disabled until you need them or you can experiment with yum priorities which is the recommended way. Using priorities you can control which repo gets used if multiple repos supply the same packages. If using yum priorities you will need to perform some tasks to start with.

priority=1 Greatest prioritypriority=99 Lowest priorityAny repo not assigned a priority number will default to 99.

But it can become a little more complex, see the link above.

You can play around with the priorities settings for the repos you have installed, with the more useful ones set at around 10-20 and the less used ones set at 40-50 & with the include an exclude flags.

Read the manual for additional yum commands as you proceed, especially the 'includepkgs=' and/or 'exclude=' options.

$ man yum$ man yumdb $ man yum.conf

Centos Repos

You can search an invidual repos contents by disabling them all and enabling the one you want to view, first get a list of your installed repos, repolist may not list all of them so$ yum repolist or if some are excluded$ ls /etc/yum.repos.d/

$ yum --disablerepo=\* --enablerepo=nux-dextop list all

You can enable additional Centos repos in the base repo file

$ sudo vi /etc/yum.repos.d/CentOS-Base.repo

Scroll down, for example, to enable centosplus or contrib and set enabled to 1.

You can then set priorities on each with the exclude= command to filter out packages you don't require in a space separated list.[base] priority=1exclude=php* kernel* [update] exclude=(exclude packages you dont want updating) priority=1

$ sudo vi /etc/yum.repos.d/naulinux-school.repoEnter into the file[naulinux-school]name=NauLinux Schoolbaseurl=http://downloads.naulinux.ru/pub/NauLinux/6.2/$basearch/sites/School/RPMS/enabled=0gpgcheck=1gpgkey=http://downloads.naulinux.ru/pub/NauLinux/RPM-GPG-KEY-linux-inkSave the file and run yum

Name : delugeVersion : 1.3.3Release : 1.el6.nuxArchitecture: noarchSize : 0Packager : http://li.nux.ro/Group : Applications/InternetURL : http://deluge-torrent.org/Repository : nux-dextopSummary : A GTK+ BitTorrent client with support for DHT, UPnP, and PEXSource : deluge-1.3.3-1.el6.nux.src.rpmDescription :Deluge is a new BitTorrent client, created using Python and GTK+. It isintended to bring a native, full-featured client to Linux GTK+ desktopenvironments such as GNOME and XFCE. It supports features such as DHT(Distributed Hash Tables), PEX (µTorrent-compatible Peer Exchange), and UPnP(Universal Plug-n-Play) that allow one to more easily share BitTorrent dataeven from behind a router with virtually zero configuration of port-forwarding.

Thursday, 9 May 2013

Not strictly for Linux but a very handy tool nonetheless, a Web Page PDF Printer Plugin for Firefox. There are probably a number of occasions when you view an article online and want to download it to save, but the only format available is a html page. Print pages to PDF is a handy Firefox Plugin which facilitates the downloading of suitable articles in PDF fomat.

Based on Wkhtmltopdf, QT and Webkit, it is a powerul little tool for converting chosen pages to PDF. All that is required on Linux is the X11 client libraries, which you will have if running a desktop. So as you can see below just drop it down from the toolbar as and when you need it. Capture the page and put it away.

You can add a button to the toolbar menuif you use it on a regular basis, so pdf on speedbutton is available. So head over to Print to Pages and get your PDF button. If you need Firefox also then version 20 for Centos/RHEL with some cool features is available below as PrintPagestoPDF won't work on later versions.

Sunday, 5 May 2013

Occasionally, you might have a problem develop which stops you gaining access to your system either as user or root, even to do a rescue operation. This could be for a variety of reasons, such as you change a crucial script or an external script you use causes a system lock up.

It means you have to mount the Logical Volumes on which your Centos 6 system is based, find the offending file or script and fix, delete or replace it using an alternative method.

So you need to perform a rescue operation whilst using a Live CD to gain access, because in the case of user/root login failure this may probably be the best or only way to do it.

As a recent example a
maven shell script in the /etc/profile.d directory was incorrect and
caused all system commands to disappear, ie no ls, cat, rm, su, sudo. Additionally, it prevented logging on as anyone, so the steps below were
taken in order to fix the problem.

Use a Centos or Debian Live CD because when you are attempting a rescue you don't want the additional stress of hunting down needed but potentially obscure packages, you just want to be able to get them easily, do the job and finish. The package we need here is lvm2 which is in both Centos and Debian repos.

So first download Centos 6.4 Live CD iso or Debian Live CD iso and burn it to a disk or put it on a USB stick. (Not described in this post). Once done, boot from it, whether disk or USB and once you are in the live environment you can bring up the terminal emulator or use the console, run fdisk and list the available drives. UseCtrl+Alt+F4 to stop X server and go to the console. The live disk uses sudo for root access.

The sda3 entry is not suitable to mount in the normal manner because you do not have the correct path, so you need to do a little more probing to find this.First install the tools package with apt$ sudo apt-get install lvm2And issue the command to find the LV Group which is under VG $ sudo pvs

PV VG Fmt Attr PSize PFree /dev/sda3 vg_centos lvm2 a-- 267.79g 0

'vg_centos' is fine to start with, but we need a little more. Issue the command to display the directories and path.$ sudo lvdisplay

You will probably have a swap also but above just shows the directories we are interested in.

The LV Path is what we use to mount the Logical Volumes, and nowwe have the full and correct path, they can be mounted as normal, we just need a directory to mount them into, so create a newroot directory. (As unprivileged user or root)

$ sudo mkdir newroot $ sudo mount /dev/vg_centos/lv_root /newroot

$ sudo mount /dev/vg_centos/lv_home /newroot

Depending which directory you want to access.

Use vgchange to make them active $ sudo vgchange -a y 3 logical volume(s) in volume group "vg_centos" now activeNow you can navigate to the
/newroot directory either in the terminal or using the file manager and
access the file you need to fix, replace or delete.

Straighforward mounting of the Volume Group in Centos 6 usinga Live CD.

Using chrootUse chroot if necessary as in the image below, doing this and then running the mount command shows the newly mounted volumes for the 'damaged' system as they appear in the newroot directory

Test already mounted volumes You can test what is mounted by using one of below as root# df -H