Saturday, 29 September 2012

Centos 6/RHEL install VLC and codecs

VLC is one of the more popular media players for Linux. It is an extremely versatile player, being able to play a large variety of file formats & it is a great alternative to SMPlayer.



It will also perform other tasks such as file conversion, video capture and streaming via the media tab which offers a variety of options from convert to stream, capture and others, have a look
on the wiki for more info or you can check the man pages.

$ man vlc 

You can also listen to web radio and podcasts from the View/Playlist menu (Ctrl+L), scroll down the list on the let to the internet link and expand it. Enter the url for a  new podcast with the + sign or use the Icecast Radio Directory or radio feeds

As with SMPlayer it is available in the Rpmforge repo and installation will bring with it some required libraries.

So first get Rpmforge repo

$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

$ sudo vi /etc/yum.repos.d/rpmforge.repo

and disable it by default.

$ sudo vi /etc/yum.repos.d/rpmforge.repo

See Vi and Vim commands

Install it 

$ sudo yum -y --enablerepo=rpmforge install vlc

Run it with

$ vlc

See Fluxbox key bindings for more if using it.

You may want some extra codecs such as Win32, gstreamer etc, or to install SMPlayer also.


You can also install Totem, another popular player with a simple

$ sudo yum -y install totem


if you have Epel repo.


For more repositories see repo page



Monday, 24 September 2012

Centos 6/RHEL convert and mount Bin/Cue to Iso with BinChunker


Sometimes, you have media which is in bin/cue format such as the test_archive.bin/cue which I have backed up.

The majority of programs for manipulating them are Windows only and there doesn't seem to be a way of dealing with them directly on the Linux command line.

Well, you can actually access the individual files within a bin/cue archive using BinChunker and a few commands.

First we need to install bchunk from the Rpmforge repo.


$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

$ sudo vi /etc/yum.repos.d/rpmforge.repo

See vi and vim commands.

Disable it by default set enabled to '0'

Now install BinChunker.

$ sudo yum -y --enablerepo=rpmforge install bchunk



BinChunker

BinChunker can do other things like write audio files to wav but for now we just want the iso conversion

Test already mounted volumes

You can test what is mounted by using one of below as root

# df -H

Filesystem             Size   Used  Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
                        53G   5.5G    45G  11% /
tmpfs                  3.2G      0   3.2G   0% /dev/shm
/dev/sdb2              508M    33M   450M   7% /boot
/dev/mapper/vg_centos-lv_home
                       224G   9.0G   204G   5% /home


# mount

/dev/mapper/vg_centos-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sdb2 on /boot type ext4 (rw)
/dev/mapper/vg_centos-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)


Mount and access the bin/cue files 

Now after moving to the directory containing the test_archive.bin & cue files, issue the command

$ bchunk test_archive.bin test_archive.cue test_archive    

This converts the bin/cue files to an iso file extension which can now be mounted, example terminal output below.

$ ls

test_archive01.iso
test_archive.bin  
test_archive.cue

So first make a directory to mount it

$ sudo mkdir /mnt/iso

Now mount it, remembering the 'what to where' rule

$ sudo mount -o loop /home/anton/test_archive01.iso /mnt/iso

Now its mounted you can view the contents with ls

[anton@Centos iso]$ ls /mnt/iso
01. Introduction                             08. User Interfaces & Desktops
02. System Architecture                      09. Administrative Tasks
03. Linux Installation & Package Management  10. Essential System Services
04. GNU & Unix Commands                      11. Networking Fundamentals
05. More GNU & Unix Commands                 12. Security
06. The Filesystem in a Hierarchy            13. Conclusion
07. ShellsScripting & Data Management        14. Credits

Which in this case shows folders containing videos about Linux.

Or in another example shows the contents of a Salix OS disk


[anton@Centos ~]$ ls /mnt/iso
[BOOT]         isolinux  PACKAGELIST   PACKAGES.TXT.gz
CHECKSUMS.md5  kernels   PACKAGES.TXT  salix

These can now be viewed in a video player or copied elswhere using cp or file manager if in GUI

For another program which can manipulate isos and complements BinChunker check out Isomaster

Friday, 21 September 2012

Centos 6/RHEL install Isomaster


Isomaster is an excellent free program for manipulating iso files in Linux. Many distros include it as standard kit.


You can build it on Centos 6 if you have the build tools and kernel set up properly, so fix the kernels if necessary. 

Download Isomaster into home directory.

Isomaster-1.3.9                 

Move to /tmp

$ cd /tmp

$ sudo su

# tar xjf /home/<user_name>/isomaster-1.3.9.tar.bz2

# cd /isomaster-1.3.9

# make

# make install

# cd                              out of build directory

# rm -rf /tmp/isomaster-1.3.9     delete build files

# exit                            to unprivileged user

Run it with

$ isomaster

Fluxbox users can put in their /home/<user_name>/.fluxbox/keys file

Mod1 i : ExecCommand isomaster

To run it with 'Alt i'

See Fluxbox key bindings for more.

Wednesday, 19 September 2012

Centos 6/RHEL format USB Drive Command

Like the Zip file/folder commands, I sometimes forget the USB drive format syntax, so I put it here as a reminder.

Often USB drives get clogged up with old files which hide themselves in trash folders not visible, causing phantom 'drive full' notices etc, and you just have to start afresh again and clear out everything at low level without any partitions.

To format a usb drive without partitioning it, first plug it in.

$ sudo su

# fdisk -l              to list disks

You can also use 

$ sudo cat /proc/partitions

But you will just get the device, ie 'sdc' not the path

[root@Centos anton]# fdisk -l

Disk /dev/sda: 320.1 GB, 320071851520 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e6735

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       38914   312056832   8e  Linux LVM

Disk /dev/sdb: 750.2 GB, 750152146432 bytes
255 heads, 63 sectors/track, 91200 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x404a6639

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       91200   732562976    c  W95 FAT32 (LBA)

Disk /dev/mapper/vg_centos-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_centos-lv_swap: 6392 MB, 6392119296 bytes
255 heads, 63 sectors/track, 777 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_centos-lv_home: 259.5 GB, 259463839744 bytes
255 heads, 63 sectors/track, 31544 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdc: 4043 MB, 4043309056 bytes
125 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

I want to format the 4GB drive at the end, /dev/sdc

It needs to be unmounted if it's mounted

# umount /dev/sdc                            then format it  

# mkfs.vfat -I /dev/sdc

The 'I' flag is to access the whole drive

If it already has a partition like below skip the 'I' flag


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       91200   732562976    c  W95 FAT32 (LBA)

So you can format it with

# mkfs.vfat /dev/sdb1

It is usable cross platform in Linux and Windows

You can format to ext2 or ext3 if you want

# mkfs.ext3 /dev/sdc        (no 'I' flag, just a 'y' prompt)

Simple commands to quickly sort out a usb drive









           









Monday, 17 September 2012

Centos 6/RHEL install Avidemux

Avidemux is a very popular cross platform video editing program, ideal for all kinds of video file conversions, appending, cropping, cutting etc.

It is notoriously difficult to build from source and unless you are the developer with easy access to all the dependencies required to build it then it makes sense to find an rpm version to suit.

Finding an good installable version has proved a little elusive for Centos 6/RHEL because of its huge dependency requirement but I finally managed to track one down fom the naulinux-school repo.

To install it first make a naulinux-school repo file

$ sudo vi /etc/yum.repos.d/naulinux-school.repo

See vi and vim commands.

Enter into the file

[naulinux-school]
name=NauLinux School
baseurl=http://downloads.naulinux.ru/pub/NauLinux/6.2/$basearch/sites/School/RPMS/
enabled=0
gpgcheck=1
gpgkey=http://downloads.naulinux.ru/pub/NauLinux/RPM-GPG-KEY-linux-ink

Save the file (set disabled)

$ sudo yum -y --enablerepo=naulinux-school install avidemux

Run it with

$ avidemux

Fluxbox users can put in the /home/<user_name>/.fluxbox/keys file

Mod1 a : ExecCommand avidemux

To run it with 'Alt a'

See Fluxbox key bindings for more.

More repos.

Wednesday, 12 September 2012

Centos 6/RHEL install Opera Browser + Opera to Mobile Plugin + Flash Plugin

Opera Browser, with its large plugin library, has some very useful functionality and is an ideal addition to Chrome and Firefox on a minimal Centos desktop.

Otherwise called 'Extensions' there are quite a few of them, some better than others but overall a huge and diverse selection.


Install Opera

To install Opera you will need some codecs, so bring those first from Rpmforge.

Get the repo if not already installed.

$sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

$sudo vi /etc/yum.repos.d/rpmforge.repo  

and disable it by default.

$sudo vi /etc/yum.repos.d/rpmforge.repo

Set enabled to '0'

Now the codecs

$sudo yum -y --enablerepo=rpmforge install compat-libstdc++-33 libdvdcss libdvdread libdvdplay libdvdnav lsdvd libquicktime flash-plugin mplayer mplayer-gui gstreamer-ffmpeg gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly

Now go to http://www.opera.com/browser/ and download the Desktop browser, the Centos rpm package is fine

Install it with

$sudo rpm -Uvh <opera_file_name>.rpm

Run it with 

$opera

See Fluxbox key bindings for more if using it.

Flash/Java Plugins

Just symlink Mozilla plugins to Opera plugins directory.

If you have Firefox/Flash and Java already then just

$sudo ln -s /usr/lib/mozilla/plugins/* . /usr/lib/opera/plugins

(or lib64)

to install those plugins to Opera

If not, go to the links, follow the steps, then repeat the above.

Opera plugins

Opera is loaded with useful tools, once of which is the Opera to Mobile plugin, which enables you to send a url to an Android or Ios mobile device that you have connected to your computer.

Open up Opera and the main menu, go to 'extensions' 'get extensions'. In the search box type 'mobile' and you should get an array of plugins related to the search. Select the 'Opera to Mobile' plugin and add it to Opera.

Once done you can send any url to an external device to view after some self explanatory configuration. You do need to have Chrome installed on the device, a point to note is that Chrome only works on Android 4 upwards.

Lots of other useful plugins are available if you take a look through the list, try also Developer Briefcase, which has Opera Mini functionality along with a few other things. Another one is Drop2Mobile which has similar functionality to the above.

Monday, 10 September 2012

Centos 6/RHEL Package Manager (Webmin)

With a minimal installaton of Centos 6, without all the bells and whistles of Gnome etc you may be wondering how to manage packages, especially if you are not a yum expert.

Well one way is to use Webmin, a unix system management program developed by Jamie Cameron, which has a section in the System tab for software packages.

This provides a way of managing your packages which, while not as fully featured as (for example) Synaptic, gives you a basic management system which you can install with a few clicks.


You can install Webmin by following this guide



Even if you don't use any of Webmin's other features, you will probably find the package management tool useful.



Saturday, 8 September 2012

Centos 6/RHEL install and setup Webmin

Webmin is an established program for managing many aspects of unix systems. Written by Jamie Cameron, it has become an essential tool for the minimal Linux Desktop, with a multitude
of functions covering a wide range of tasks.

It is an impressive piece of work, made all the more so when you consider it was written almost entirely by a single author over something like half a lifetime. Mr Cameron is unquestionably a formidable talent in the web engineering world.

Consisting of CVS, Postfix Mail and SSH Servers and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd, there are Network, Hardware and Cluster sections to complement the above giving a pretty comprehensive management system which makes life easier for the Linux user.

The web server and all CGI programs are written in Perl

You should find it invaluable in managing your Linux system as it can accomplish a huge variety of tasks with ease, a veritable Swiss army knife for Unix.

It is also a perfect fit for a minimal Centos 6/RHEL system. 

Here's what it looks like on Centos 6 using Chrome Browser


Install Webmin via the Webmin repo

$ sudo vi /etc/yum.repos.d/webmin.repo

Enter the text below

[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

Import the gpg key

# rpm --import http://www.webmin.com/jcameron-key.asc

$ sudo yum -y install webmin

Make sure it's running 

$ sudo service webmin status

$ sudo service webmin start

To run automatically at startup use chkconfig

$ sudo chkconfig --level 2345 webmin on

Run it in any browser, address it http://localhost:10000

(Ignore the install message)

Once installed it will automatically update when a new version is released as shown in the image below.


Upgrading Webmin

A similar procedure is seen below for other software updates.


Updating other software packages

Webmin performs a vast array of maintenance tasks, below are examples of the Boot up and Shutdown tab in the System section and the Unused Modules section.


Bootup and Shutdown

Unused Modules 

Fluxbox or other window manager users (if using Chrome Browser) can create a shortcut to http://localhost:10000 

Click the tools menu and select 'create application shortcut'

That's it, pretty straightforward and a very useful installation.

There are no man pages so a useful source of extra information can be found at http://doxfer.webmin.com/Webmin




Thursday, 6 September 2012

Centos 6/RHEL using Remark command


You can use the remark command to syntax highlight syslog files and the output of programs such as ping, traceroute, make, gcc and others.

Highlight the text using regular expressions and specific rule formats.

First download the regex-markup program.

$ wget http://savannah.nongnu.org/download/regex-markup/regex-markup-0.10.0-1.x86_64.rpm

$ sudo rpm -Uvh regex-markup-0.10.0-1.x86_64.rpm

The syntax is:

command1 | remark /path/to/config
command2 arg1 arg2 | remark /path/to/config

Examples

$ ping -c 4 minimallinux.blogspot.com | remark /usr/share/regex-markup/ping

PING blogspot.l.google.com (173.194.34.76) 56(84) bytes of data.
64 bytes from lhr14s19-in-f12.1e100.net (173.194.34.76): icmp_seq=1 ttl=54 time=16.8 ms
64 bytes from lhr14s19-in-f12.1e100.net (173.194.34.76): icmp_seq=2 ttl=56 time=17.9 ms
64 bytes from lhr14s19-in-f12.1e100.net (173.194.34.76): icmp_seq=3 ttl=56 time=16.8 ms
64 bytes from lhr14s19-in-f12.1e100.net (173.194.34.76): icmp_seq=4 ttl=56 time=17.7 ms

$ ping -c 6 minimallinux.blogspot.com | remark /usr/share/regex-markup/traceroute


PING blogspot.l.google.com (173.194.41.75) 56(84) bytes of data.
64 bytes from lhr08s01-in-f11.1e100.net (173.194.41.75): icmp_seq=1 ttl=56 time=18.8 ms
64 bytes from lhr08s01-in-f11.1e100.net (173.194.41.75): icmp_seq=2 ttl=54 time=18.0 ms
64 bytes from lhr08s01-in-f11.1e100.net (173.194.41.75): icmp_seq=3 ttl=54 time=18.8 ms
64 bytes from lhr08s01-in-f11.1e100.net (173.194.41.75): icmp_seq=4 ttl=56 time=18.8 ms
64 bytes from lhr08s01-in-f11.1e100.net (173.194.41.75): icmp_seq=5 ttl=54 time=19.3 ms
64 bytes from lhr08s01-in-f11.1e100.net (173.194.41.75): icmp_seq=6 ttl=56 time=17.9 ms

Create a bash shell function and add it to your ~/.bashrc file:

ping() { /bin/ping $@ | remark /usr/share/regex-markup/ping; }

Go here for more examples