Friday 19 October 2012

Customise your Fedora17 Desktop experience

Thanks to the following posts, at the bottom, I found out about dconf-editor and gnome-tweak-tool.  Now I can configure those things that had been annoying me with the new simplified Gnome experience.
  • yum install dconf-editor gnome-tweak-tool
  • gnome-tweak-tool
  • dconf-editor
While dconf-editor has a lot more stuff a few changes did not activate but they did using gnome-tweak-tool.  See how you go.  There is also a lot of other good advice on the 2nd  link.


References: 
  • http://askubuntu.com/questions/129985/how-to-make-the-date-appear-next-to-the-time-indicator-in-gnome-classic
  • http://smashingweb.info/fedora-17-post-installation-guide-things-to-do-after-installing-fedora-17/

Friday 27 July 2012

Building Handbrake on Fedora 17

References:
  • https://trac.handbrake.fr/wiki/CompileOnLinux
Commands:
  1. yum groupinstall "Development Tools" "Development Libraries" "X Software Development" "GNOME Software Development"
  2. yum install yasm zlib-devel bzip2-devel fribidi-devel dbus-glib-devel libgudev1-devel webkitgtk-devel libnotify-devel gstreamer-devel gstreamer-plugins-base-devel

Thursday 14 June 2012

Kickstart Fedora 17 from Spacewalk

References

  • https://fedorahosted.org/spacewalk/wiki/HowToKickstartCobbler
  • https://fedorahosted.org/spacewalk/wiki/ManagingFedoraSystems

Kickstart with registration to Spacewalk

Fedora 17 has some 26,000 packages on the Base Channel.  The Distribution Tree's repodata, as supplied by a DVD ISO image, has a few thousand.  Guess what:
  1. there are four packages required as dependencies of Spacewalk-client v1.7 that are not on the standard DVD ISO!
  2. the packages on the Base Channel from spacewalk are not accessible during a kickstart because the repodata for the base channel is supplied externally from Spacewalk, the Distro-Tree.  However, child channels' repodata are available during a kickstart.  Who designs this rubbish?

The solution is to create a new "child channel" of the Fedora 17 Base Channel in your spacewalk server.  The name is irrelevant but it seems to be convention to put "-tools" in its name.  Once you have your empty child channel add the following four packages from the parent/base channel.  Essentially these four packages will be frozen in time so even as the parent channel receives updates the child channel will not, unless compare the parent and child and promote the updates into the child channel manually.
  • m2crypto
  • python-dmidecode
  • python-gudev
  • python-hwdata
I also had to add a few packages manually to the kickstart's package list that were not being installed for me even though spacewalk had put instructions into the kickstart to use some of the commands from these packages.  Maybe I had another issue but I don't think so.  So manually add the following packages to the kickstart software packages list:
  • rhn-client-tools
  • rhn-setup

Distro-Trees

In regard to "distro-trees" you need some files from three directories from the DVD ISO image, at least for Fedora17.  This is a huge space saver.  It is strange that we have to use the metadata from a static DVD image.  However I understand the requirement from vmlinuz, initrd.img and squashfs.img.

  • images/pxeboot/vmlinuz
  • images/pxeboot/initrd.img
  • LiveOS/squashfs.img
  • repodata/*

Spacewalk Profile Re-connect option

If you enable "Re-connect to the existing system profile. Do not create a new system profile." in a kickstart profile under System Details -> Details -> Spacewalk Profile then your brand new system will fail to register on the first kickstart.  Manually register it once and from then on it will continue using the existing profile.

Monday 11 June 2012

sha512 password hashes for /etc/shadow

cat passwd_hash_sha512.pl
#!/usr/bin/perl
#===============================================================================
#
# FILE: passwd_hash_sha512.pl
#
# USAGE: ./passwd_hash_sha512.pl
#
# DESCRIPTION: Generate the password hash for /etc/shadow using the sha512 algorithim.
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Andrew Spurrier,
# COMPANY:
# VERSION: 1.0
# CREATED: 11/06/12 21:00:15
# REVISION: ---
#===============================================================================

use strict;
use warnings;

my $salt = join "", (".", "/", 0..9, "A".."Z", "a".."z")[rand 64, rand 64, rand 64, rand 64];
my $pass1;
my $pass2;


$salt="\$6\$$salt\$";
print "$salt\n";

# request and verify the password from the user.
system "stty -echo";
print "The following password will be converted into a hash using sha512. The output is suitable for /etc/shadow.\n";
print "Password: ";
chomp($pass1 = <stdin>);
print "\n";
print "Verify: ";
chomp($pass2 = <stdin>);
print "\n";
system "stty echo";

if ($pass1 ne $pass2)
{
print "The passwords did not match.\n";
exit 1;
}

print "Password Hash is: ";
print crypt($pass1, $salt) . "\n";

exit 0;

Wednesday 30 May 2012

Spacewalk and RHEL6

Register RHEL6 client with Spacewalk

Reference:

  • http://linuxinternetworks.com/register-clients-in-spacewalk/ 

Instructions

  1. First set a couple of variables to help the following instructions work with more versions:
    BASE_ARCH=$(uname -i)
    BASE_REL=$(sed -e '/.*release /s///' -e 's/\..*//' /etc/redhat-release)
  2. Install the Space walk client for your architecture:
    rpm -Uvh http://spacewalk.redhat.com/yum/1.7/RHEL/$BASE_REL/$BASE_ARCH/spacewalk-client-repo-1.7-5.el$BASE_REL.noarch.rpm
    wget --directory-prefix=/tmp ftp://mirror.optus.net/epel/$BASE_REL/$BASE_ARCH/epel-release*.noarch.rpm && rpm -Uvh /tmp/epel-release*.noarch.rpm
  3. Install the client packages:
    yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin
  4. Register the client:
    rhnreg_ks --serverUrl=https://<fqn_spacewalk_server>/XMLRPC --activationkey=1-<activation_key_label>

Install Spacewalk on RHEL6

Links
Instructions
wget rpm -Uvh http://spacewalk.redhat.com/yum/1.7/RHEL/6/x86_64/spacewalk-repo-1.7-5.el6.noarch.rpm

Fedora16 with horde

Amazing, I have got horde with a postgres backend to work on Fedora16.

Links:
Install Postgres:
yum install php-pgsql postgresql postgresql-server
chkconfig postgresql on
postgresql-setup initdb
service postgresql start
su - postgres
cp /usr/share/horde/scripts/sql/create.pgsql.sql .
vim create.pgsql.sql  -- (set a password for the horde user)
psql -d template1 -f create.pgsql.sql
(if all the tables and indexes don't fly up the screen as they are created then you have a problem.  For me it took awhile to get pg_hba.conf correct.  See supplementary points below.)
exit  -- (return to the root user)
psql -h 127.0.0.1 -p 5432 -U horde -d horde  -- (to test logging into the horde database as the horde user.)
rm /var/lib/pgsql/create.pgsql.sql


Supplementary Points:
  • Horde is out of date in the Fedora16 repository!  I persisted thinking that things will be easier if I use the Fedora packages :-(
  • http://your-server/horde/test.php -- is not working and the doco I have found so far is not relevant for activating the test feature.
  • Turn off selinux as the provided policies are not good enough.  (Now that I've saved you some time maybe you can work on the selinux policies for me???)
  • Add the following to /etc/php.ini and service httpd restart for fedora16_x86-64:
    • extension_dir = "/usr/lib64/php/modules"
  •  Add the following to /var/lib/pgsql/data/pg_hba.conf before the "local all all peer" line to allow the horde database user to login via a localhost TCP socket.  Don't forget to reload the database configuration service postgresql reload :

local horde horde md5
host  horde horde 127.0.0.1/8 md5
host  horde horde ::1/128 md5
local horde postgres  ident
  • Clean out the postgres database to retry the horde initialisation:

su - postgres
psql
DROP DATABASE horde;
DROP USER horde;

Saturday 26 May 2012

rsync of block devices

How to clone virtual disks as logical volumes with resume?

Some clever folks are working on patches to "rsync" to allow the copying of block devices:  http://lists.samba.org/archive/rsync/2010-June/025164.html

Paul Whittaker fixed me up with just such a patched version of rsync so I can move my VM disks around my network more efficiently.  The only thing to note is /dev/mapper/<logical_volume> is a symbolic link and you must use /dev/<vg>/<lv> to access the real block device.  

The example below is me running an "rsync" check over a previously cloned volume that failed to cleanly complete when using my favourite "nc" (netcat) method.  A three minute verify is not bad for an 8GB virtual disk!
root@blackdouglas> rsync -vP --inplace --copy-devices jd:/dev/mapper/JD-vm_canobolissmith_ROOT /dev/mapper/BD1-vm_canobolissmith_ROOT
JD-vm_canobolissmith_ROOT
           0 100%    0.00kB/s    0:03:18 (xfer#1, to-check=0/1)

sent 741502 bytes  received 370826 bytes  3570.88 bytes/sec
total size is 0  speedup is 0.00
root@blackdouglas>