RTFM

[Read This Fine Material] from Joshua Hoblitt

Skeleton template of a tree of multi-release/arch yum repos

| 0 comments

I’ve posted a simple skeleton template that I use for setting up local yum repos for RHEL/Centos.  There should be sufficient directions in the README (copied below).


Description
===========

This is a very simple template of a yum repository. It is the structure that I
use for maintaining a local repo of RPMs for RHEL/Centos 4/5/6.

USAGE
=====

There is a trivial makefile at the top level of the tree that will run the
[createrepo](http://createrepo.baseurl.org/) utility on the 2nd level of
directories in the tree and create/update a non-GPG signed yum repository. The
tree structure should be as follows:

    .
    |-- 4
    | |-- i386
    | `-- x86_64
    |-- 5
    | |-- i386
    | `-- x86_64
    `-- 6
    |-- i386
    `-- x86_64

The `createrepo` command will be run on (4|5|6)(i386|x86_64) but not the first
level dirs (4|5|6). After `createrepo` finishes running, you should have one usage repo for each major release number and architeture.

    .
    |-- 4
    | |-- i386
    | | `--repodata
    | `-- x86_64
    | `--repodata
    |-- 5
    | |-- i386
    | | `--repodata
    | `-- x86_64
    | | `--repodata
    `-- 6
    |-- i386
    | `--repodata
    `-- x86_64
    `--repodata

To create/modify the working repos just run after adding/removing RPMs from the appropriate $releasever/$basearch and your yum repo is ready for use.

    # copy rpm(s) to some arch dir like 5/x86_64
    makefile

Adding a different arch just recreates creating a directory in the correct
place. For example, to add RHEL5 PPC support:

    mkdir 5/ppc64
    # copy some .rpms --> 5/ppc
    makefile

PUPPET EXAMPLE
==============

Here is a simple example of a puppet class that will setup the repo with the
Yumrepo type. It should work for RHEL/Centos 3/4/5/6 and beyond.

    class yum-local {

      case $operatingsystem {
        'redhat', 'centos': {
          yumrepo { 'local':
            descr => 'my local repo',
            baseurl => 'http://example.org/nso/$releasever/$basearch',
            enabled => 1,
            gpgcheck => 0,
            priority => 1,
          }
        }
      }
    }

Setting the default locale on Gentoo to UTF8 encoding

| 1 Comment

Gentoo has two good documents on dealing with UTF8 and localization that should be reviewed.

I decided to set my system wide default away from ANSI to UTF8 as gnome-terminal seems to inherit LANG from XDM and there doesn’t seem to be a way to tell it to ignore LANG and default to UTF8. This is really annoying since most RHEL5.x based distros default to UTF8. Here is a quick little shell snippet to set the locale to US/English/UTF8.

#!/bin/bash
cat > /etc/locale.gen <<"END"
# /etc/locale.gen: list all of the locales you want to have on your system
#
# The format of each line:
# <locale> <charmap>
#
# Where  is a locale located in /usr/share/i18n/locales/ and
# where  is a charmap located in /usr/share/i18n/charmaps/.
#
# All blank lines and lines starting with # are ignored.
#
# For the default list of supported combinations, see the file:
# /usr/share/i18n/SUPPORTED
#
# Whenever glibc is emerged, the locales listed here will be automatically
# rebuilt for you.  After updating this file, you can simply run `locale-gen`
# yourself instead of re-emerging glibc.
en_US.UTF-8 UTF-8
en_US ISO-8859-1
END
locale-gen
echo "LANG=en_US.utf8" > /etc/env.d/02locale
env-update
source /etc/profile
locale

Retaining archive links when moving from Blogger to MoveableType

| 0 comments

When I converted from Blogger to MT, I renamed the blog path from ‘blog’ to ‘rftm’. The MT importer was clever enough to try to save all of the blogger “permanent” link names. However, since MT and Blogger use different archiving conventions, all the Google indexed links to archive files broke. Here are the rules I used in the Apache2 VHOST to fix the breakage I noticed.

# rename blog path from /blog -> /rtfm
RedirectMatch ^/?blog/(.*)$ http://joshua.hoblitt.com/rtfm/$1

# map from blogger style YYYY_MM_DD_archive.htmlf files to MT YYYY/DD dirs
RedirectMatch ^/?rtfm/(\d{4})_(\d{2})_.._archive.html$ http://joshua.hoblitt.com/rtfm/$1/$2/

# blogger left overs still index by google on 2011-08-03
Redirect /rtfm/labels/resume.html http://joshua.hoblitt.com/resume/joshua_hoblitt-resume.pdf

Encrypted google search

| 0 comments

Today on g+ Matt Curtis & Chris Gianelloni shared links to two news stories about ISP hijacking search results. [1] [2]  This is exactly the sort of situation that SSL/TLS was intended to protect against and I suspect that this sort of behaviour will only increase as ISP try to find new ways to monetize their traffic.  Imagine if your POTS provider (OK – imagine you still have a POTS provider) decided to hijack your outbound phone calls and redirect them to a competitor.  Since many of us get service via a regulated (“franchised”) monopoly, there really should be administrative rules that prevent hijacking and differentiated billing for different “types” of traffic (like billing you extra for netflix packets as that cuts into your ISPs cable business).  My ISP already redirects you to a “search” page for “failed” DNS requests.  DNSSEC can’t get here fast enough…

Any ways, back to search… I have taken action to prevent this sort of mischief by setting https://encrypted.google.com/ as FireFox’s homepage and used the add-to-search-bar addon to make that the default search engine used by the “search bar”.  There are good instructions here on how to make this change for Firefox/Opera/Chrome that I need not duplicate.

Hopefully, Mozilla/Google will decide to make this the default for future shipping versions of FF.