<?xml version="1.0" encoding="iso-8859-1"?>
<!-- name="generator" content="pyblosxom/1.3.2 2/13/2006" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
<channel>
<title>One Little Sysadmin   </title>
<link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi</link>
<description>one little sysadmins lazy documentation</description>
<language>en</language>
<item>
  <title>Compiling Firefox 3.0 form source on Debian Etch</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/firefox3.html</link>
  <description><![CDATA[

<p>Here is a list of things I had to do to get Firefox 3.0 to build (I run Debian-PPPC on my work machine so no prebuilt binaries from me. Also why do they making it so fscking hard to find the source if you go to the downloads page?). If you run Debian etch on an x86 platform (i.e. your average pc hardware) you can download thew pre-built binaries and skip steps 2, 3 and 4.</p>

<p>1. Install gtk+2.0 >.2.10.0 from source. The Gtk+2.0 libraries in Debian etch are 2.8.0 so no go otherwise. Download the latest from here:
	<a href="http://www.gtk.org/download-linux.html">http://www.gtk.org/download-linux.html</a>
</p><p>	

This also needs the latest versions  of glib and pango. Download and build theseCreate folders in the /opt directory for each e.g. /opt/glib-2.16.13 /opt/pango-1.20.3 /opt/gtk+-2.12.10. 
</p><p>
You will need to build them in ths order: gib, pango, gtk</p><p>
cd in to the relevant directory then run: 
</b>
<code>./configure -- prefix=/opt/[glib-2.16.3]</code> followed by <code>make</code> and <code> (sudo) make install</code>.
</p><p>
Pango gets built next. To get it to build I needed a wrapper script around configure:
</p><p>
<pre>
#!/bin/bash
CPPFLAGS="-I/opt/glib-2.16.3/include"
LDFLAGS="-L/opt/glib-2.16.3/lib"
PKG_CONFIG_PATH="/opt/glib-2.16.3/lib/pkgconfig"
#GLIB_LIBS="/opt/glib-2.16.3/lib"

export CPPFLAGS LDFLAGS PKG_CONFIG_PATH GLIB_LIBS
PATH="/opt/glib-2.16.3/bin:$PATH"

LD_LIBRARY_PATH="/opt/glib-2.16.3/lib"
export LD_LIBRARY_PATH
./configure --prefix=/opt/pango-1.20.3 
</pre>
<p>chmod +x to make it executable, then run this (e.g. ./build.sh) followed by make and sudo make install</p>
<p>

<p>for gtk itself the wrapper script was:</p>
<pre>
#!/bin/bash
CPPFLAGS="-I/opt/glib-2.16.3/include -I/opt/pango-1.20.3/include"
LDFLAGS="-L/opt/glib-2.16.3/lib -L/opt/pango-1.20.3/lib"
PKG_CONFIG_PATH="/opt/glib-2.16.3/lib/pkgconfig:/opt/pango-1.20.3/lib/pkgconfig"
GLIB_LIBS="/opt/glib-2.16.3/lib"

export CPPFLAGS LDFLAGS PKG_CONFIG_PATH GLIB_LIBS
PATH="/opt/glib-2.16.3/bin:/opt/pango-1.20.3/bin:$PATH"

LD_LIBRARY_PATH="/opt/glib-2.16.3/lib:/opt/pango-1.20.3/lib"
export LD_LIBRARY_PATH
./configure --prefix=/opt/gtk+-2.12.10
</pre>
<p>
the other dependencies I needed could all be installed using aptitude and the regular Debian package.
</p>
<p>
2. Edit .mozconfig:</p><p>
In .mozconfig</p><p>
remove: <code>ac_add_options --enable-default-toolkit=gtk2</code>  from .mozconfig if its in there otherwise it complains <code>"configure: error: Toolkit must be cairo-gtk2"</code>
</p><p>
add: <code>ac_add_options --disable-jemalloc</code>
 really this is not ideal, as  it supposed to improve the memory preformance, quite drmatically by some accounts "As of beta 4 we now use jemalloc on both Windows and Linux. Our automated tests on Windows Vista showed a 22% drop in memory usage when we turned jemalloc on." http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage/ 
</p><p>
remove: <code>ac_add_options --enable-static </code>
conflits with <code> --enable-xul</code> (default)
</p><p>
The final .mozconfig file looked like this:
<pre>
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt-static
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --disable-shared
ac_add_options --disable-tests
ac_add_options --enable-xft
ac_add_options --enable-application=browser
ac_add_options --disable-jemalloc
mk_add_options MOZ_CO_PROJECT=browser
</pre>
</p>
<p>
3. Buld a wrapper script for the mozilla build
<pre>
#!/bin/bash
PKG_CONFIG_PATH="/opt/gtk+-2.12.10/lib/pkgconfig:/opt/pango-1.20.3/lib/pkgconfig
:/opt/glib-2.16.3/lib/pkgconfig"
CPPFLAGS="-I/opt/glib-2.16.3/include -I/opt/pango-1.20.3/include -I/opt/gtk+-2.1
2.10/include"
LDFLAGS="-L/opt/glib-2.16.3/lib -L/opt/pango-1.20.3/lib -L/opt/gtk+-2.12.10/lib"

export  CPPFLAGS LDFLAGS PKG_CONFIG_PATH
PATH="/opt/glib-2.16.3/bin:/opt/pango-1.20.3/bin:/opt/gtk+-2.12.10/bin/:$PATH"
LD_LIBRARY_PATH="/opt/glib-2.16.3/lib:/opt/pango-1.20.3/lib:/opt/gtk+-2.12.10/li
b"
export LD_LIBRARY_PATH

make -f client.mk build
</pre>
</p>
<p>
4.The completed binaries are in ff-opt-static/
I copy the bin directory to the route of my home directory, and rename it Firefox-3.0. I can then sysmlink that to firefox for easy shortcut mamagement. 
</p><p>
Instructions here: <a href="http://www.captain.at/howto-run-firefox-3-debian-etch.php">http://www.captain.at/howto-run-firefox-3-debian-etch.php</a>
</p>
<p>
5. Then make a wrapper script for firefox itself.

<pre>
export LD_LIBRARY_PATH="/opt/glib-2.16.3/lib:/opt/pango-1.20.3/lib:/opt/gtk+-2.1
2.10/lib"
/path/to/firefox-3.0/dist/bin/firefox $*
</pre>
</p>

]]></description>
</item>

<item>
  <title>Mirroring Debian Installs</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/mirroring_debian_installs.html</link>
  <description><![CDATA[
<h3>Problem: You need to ensure a consistent set of packages across boxes</h3>
<h3>Solution</h3>
<p>Debian makes it remarkably easy to make sure you have the asme software across boxes, as you might need to do for mirrored high availability boxes, for instance.</p>
<p>First set up one box so you have the set of packages you require.It takes three steps</p>
<ol>
<li><code>dpkg --get-selections [>dpkg.out]<code> </li>
<li> <code>[cat dpkg.out] | sudo dpkg --set-selections</li>
<li>dselect install</li>
<p>The first step takes place on the master box with the setup, the other two on the new, target box</p>
<p>to brake it down a little more:<br />
Step 1 outputs a list of installed packages, this is fed as STDIN to  dpkg --set-selections on the target box which gives it a list of packages that the third step then actually installs. You can do this all with one command line<br />
code>dpkg --get-selections | ssh root@newbox dpkg --set-selections; ssh root@newbox dselect install'</code>
</p>
<p> hat tip to <a href="http://www.aarontrevena.co.uk">Aaron Trevena</a>. This is all derived form an email he sent to the <a href="http://www.gglug.org.uk>Gllug</a> mailing list.




]]></description>
</item>

<item>
  <title>Post Install Debian Configuration</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/debian_postconfig.html</link>
  <description><![CDATA[
<h3>being a list of annoyances and things that got left out</h3>
<ol>
<li><strong>Edit apt sources list</strong> &mdash; the system will reboot, but expect a CD to be in place unless you xcoment it out in /etc/apt/sources list, apparently there are people in the world without  'net connections  who are busy installing Debian from all 300 CD's. I gues they are a bit sensitive about this and don't like to be upset. At least they are not still doing installs with floppies &mdash; those were the days. <em>update</em> Apprarently it does comment it out for you, but puts a sefcond entry in, go figure. </li>
<li><strong>Install openssh-server</strong> &mdash; who wants remote access to a web server anyway</li>
<li><strong>Install sudo</strong>  &mdash; just in case you don't want to, like, be root all day.</li>
<li><strong>Install vim</strong> &mdash; whats with all this nano shit anyway.</li>
<li><strong> sudo update-alternatives --config editor</strong> so you can actually use it. <em>update</em> so apparently <code>aptitude remove nano</code> has the same effect.</li>
<li><strong>Install bzip2</strong> &mdash; for when you really want to compress the shit out of something. Oh and zip & unzip for dealing with those you know what using clients.</li>
<li><strong>Install screen</strong> &amp; <strong>sysv-rc-conf</strong> &mdash; You won't regret it.</li>


]]></description>
</item>

<item>
  <title>e2fsadm is missing</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/no_e2fsadm.html</link>
  <description><![CDATA[
<h3>Resizing LVM2 without e2fsadm</h3>
<p>e2fsadm is missing in Debian with LVM2 so you will have a hard time following the LVM howto if you want ot resize a volume.
from:<a href="http://lists.debian.org/debian-edu/2005/12/msg00266.html">http://lists.debian.org/debian-edu/2005/12/msg00266.html</a>
<pre>
With lvm1 you can use e2fsadm:

  # e2fsadm -L +2G /dev/volume_group/logical_volume

  With lvm2 you need to do manually what e2fsadm does:

  # lvresize -L +2G /dev/volume_group/logical_volume
  # e2fsck -f /dev/volume_group/logical_volume
  # resize2fs /dev/volume_group/logical_volume

   The above adds 2 GB to the volume
</pre>

]]></description>
</item>

<item>
  <title>Making a usb hard drive appear in Linux</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/usb_hardrive.html</link>
  <description><![CDATA[
<h3>Problem: You plug in a usb hardrive but it does not show up (in dmesg)</h3>
<h3>Solution</h3>
Most of the time when you plug in a usb hard drive is shows up in dmes as the first available scsci drive /dev/sda. /dev/sdb etc, as the relevant kernel modules are loaded at boot time. Occasionally it doesn't, as is the case with this Mac, running Debian PPC, that I use as a desktop.

In this case you need to issue
<code>[sudo]  modprobe usb-storage</code> (as root), and all should be well. You can now mount it as usual, or if its a new disk, anbd you want to get rid of the windows partition it probably came with, do a <code>fdisk [/dev/sdb]</code> to delete the existing partition and create a new one, then <code> makefs [-t ext3] [/dev/sdb1] </code> to create the file system.


]]></description>
</item>

<item>
  <title>pyblosxom: flavour does not exist</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/no_flavour.html</link>
  <description><![CDATA[
<h3>Problem: pyblosxom says flavour does not exist</h3>
<h3>solution</h3>
The relevant config file entry:
<code>py['default_flavour'] = "1024px"</code>
needs to refer to the name of the flavour without the <code>.flav</code> extension. Yes it took me a day to work this one out. You can laugh now.

]]></description>
</item>

<item>
  <title>Making Apache NOT rewrite something</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/no_rewrite.html</link>
  <description><![CDATA[
<h3>Problem: You want to do a universal rewrite with apache but ignore certain things</h3>
<h3>Solution</h3>
<p>from the apache config for this blog:</p>
<pre>
RewriteCond %{REQUEST_URI} !^/images/(.*)$
RewriteRule    ^(.*)$      /cgi-bin/pyblosxom.cgi?$1  [L]
</pre>
<p>That first line says don't(<strong>!</strong>) apply the rewrite to anything that matches <strong>/images/</strong>+ one or more charcters. e.g.<em>/images/background.gif</em><br />
via: <a href="http://httpd.apache.org/docs/2.2/rewrite/rewrite_flags.html">http://httpd.apache.org/docs/2.2/rewrite/rewrite_flags.html</a></p>
<p>Better probably:</p>
<pre>
RewriteEngine on

# If the requested file or directory does not exist
RewriteCond %{REQUEST_FILENAME} !-F
# Try serving it through Pyblosxom
RewriteRule ^(.*)$ /pyblosxom.cgi/$0 [L]

# Replace index.html with Pyblosxom
RewriteRule ^$ /pyblosxom.cgi [L]
</pre>
<p>from: <a href="http://arj.nvg.org/2004/Dec/21">http://arj.nvg.org/2004/Dec/21</a> 
</p>

]]></description>
</item>

<item>
  <title>SSH/SCP etc hanging in Scripts</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/ssh_hangs.html</link>
  <description><![CDATA[

<h3>Problem:You write a script using scp, rsync over ssh, ssh and it hangs when exiting</h3>
<p>This is a known problem (see the <a href="http://www.openssh.com/faq.html#3.10">the SSH FAQ</a>, with a <a href="http://bugzilla.mindrot.org/show_bug.cgi?id=52">shed load</a> of argument over it. It might have been fixed in some later versions, but it wasn't working for me.</p> 
<h3>Solution/Workaround</h3>
<p>Try putting <code>shopt -s huponexit</code> in <code>bashrc</code> if you use Bash. Didn't seem to do it for me. Alone. So also...</p>
<p> Putting <code>< /dev/null > /dev/null 2>&1 &</code> (as reccomended by the FAQ) or just <code> >& /dev/null</code>(as I did) at the end of the relevant line seems to do the trick. The FAQ doesn't really make this clear. It makes it seems like this is just part of the test, oh well never mind.</p>
<h3>Gotcha</h3>
It might seem like its still hanging. Its probably not, it just takes a long time to exit. Patience! Grasshopper.</p>


]]></description>
</item>

<item>
  <title>Welcome to One Little Sysadmin</title>
  <link>http://www.onelittlesysadmin.com/cgi-bin/pyblosxom.cgi/welcome.html</link>
  <description><![CDATA[
<p>So you come across a problem, you scratch around, you get a clue as to what it might be, you google a bunch of stuff, try and bunch more then you fix it. Then the next problem comes along. </p>
<p>Lather, rinse, repeat.</p>
<p>Then six months later you come acroos a problem, and five mniutes later you get an eerie sense of deja vu. But you will be buggered if you can remeber what you did.<p>
<p>This is why documentation is important.But lets face it, its not easy and few people enjoy doing it. Sure sometimes you come across a big problem, you find the solution and you document it. But all the little stuff gets left behind.</p>
<p>Hence this, blog the little stuff, anyold how, tag it, forget it.</p>
<p>Then when I get that sense of deja vu I can come back and search for it here....and maybe write some proper documentation.</p>
<p>Thats the theory anyhow...</p>
<p><small>...and I get to use vi as a blogging interface...<p>

]]></description>
</item>

</channel>
</rss>
