Mon, 30 Jun 2008
Compiling Firefox 3.0 form source on Debian Etch
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.
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: http://www.gtk.org/download-linux.html
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.
You will need to build them in ths order: gib, pango, gtk
cd in to the relevant directory then run:
./configure -- prefix=/opt/[glib-2.16.3] followed by make and (sudo) make install.
Pango gets built next. To get it to build I needed a wrapper script around configure:
#!/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
chmod +x to make it executable, then run this (e.g. ./build.sh) followed by make and sudo make install
for gtk itself the wrapper script was:
#!/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
the other dependencies I needed could all be installed using aptitude and the regular Debian package.
2. Edit .mozconfig:
In .mozconfig
remove: ac_add_options --enable-default-toolkit=gtk2 from .mozconfig if its in there otherwise it complains "configure: error: Toolkit must be cairo-gtk2"
add: ac_add_options --disable-jemalloc
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/
remove: ac_add_options --enable-static
conflits with --enable-xul (default)
The final .mozconfig file looked like this:
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
3. Buld a wrapper script for the mozilla build
#!/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
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.
Instructions here: http://www.captain.at/howto-run-firefox-3-debian-etch.php
5. Then make a wrapper script for firefox itself.
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 $*
posted at: 21:23 | path: / | permanent link to this entry
Tue, 10 Jun 2008
Mirroring Debian Installs
Problem: You need to ensure a consistent set of packages across boxes
Solution
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.
First set up one box so you have the set of packages you require.It takes three steps
dpkg --get-selections [>dpkg.out]-
[cat dpkg.out] | sudo dpkg --set-selections - dselect install
- Edit apt sources list — 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 — those were the days. update Apprarently it does comment it out for you, but puts a sefcond entry in, go figure.
- Install openssh-server — who wants remote access to a web server anyway
- Install sudo — just in case you don't want to, like, be root all day.
- Install vim — whats with all this nano shit anyway.
- sudo update-alternatives --config editor so you can actually use it. update so apparently
aptitude remove nanohas the same effect. - Install bzip2 — 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.
- Install screen & sysv-rc-conf — You won't regret it.
The first step takes place on the master box with the setup, the other two on the new, target box
to brake it down a little more:
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
code>dpkg --get-selections | ssh root@newbox dpkg --set-selections; ssh root@newbox dselect install'
hat tip to Aaron Trevena. This is all derived form an email he sent to the posted at: 15:44 | path: / | permanent link to this entry
Wed, 23 Apr 2008
Post Install Debian Configuration
being a list of annoyances and things that got left out
posted at: 16:48 | path: / | permanent link to this entry
e2fsadm is missing
Resizing LVM2 without e2fsadm
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:http://lists.debian.org/debian-edu/2005/12/msg00266.html
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
posted at: 15:37 | path: / | permanent link to this entry
Mon, 14 Apr 2008
Making a usb hard drive appear in Linux
Problem: You plug in a usb hardrive but it does not show up (in dmesg)
Solution
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[sudo] modprobe usb-storage (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 fdisk [/dev/sdb] to delete the existing partition and create a new one, then makefs [-t ext3] [/dev/sdb1] to create the file system.
posted at: 10:55 | path: / | permanent link to this entry
Tue, 18 Mar 2008
pyblosxom: flavour does not exist
Problem: pyblosxom says flavour does not exist
solution
The relevant config file entry:py['default_flavour'] = "1024px"
needs to refer to the name of the flavour without the .flav extension. Yes it took me a day to work this one out. You can laugh now.
posted at: 11:30 | path: / | permanent link to this entry
Mon, 17 Mar 2008
Making Apache NOT rewrite something
Problem: You want to do a universal rewrite with apache but ignore certain things
Solution
from the apache config for this blog:
RewriteCond %{REQUEST_URI} !^/images/(.*)$
RewriteRule ^(.*)$ /cgi-bin/pyblosxom.cgi?$1 [L]
That first line says don't(!) apply the rewrite to anything that matches /images/+ one or more charcters. e.g./images/background.gif
via: http://httpd.apache.org/docs/2.2/rewrite/rewrite_flags.html
Better probably:
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]
from: http://arj.nvg.org/2004/Dec/21
posted at: 13:48 | path: / | permanent link to this entry
SSH/SCP etc hanging in Scripts
Problem:You write a script using scp, rsync over ssh, ssh and it hangs when exiting
This is a known problem (see the the SSH FAQ, with a shed load of argument over it. It might have been fixed in some later versions, but it wasn't working for me.
Solution/Workaround
Try putting shopt -s huponexit in bashrc if you use Bash. Didn't seem to do it for me. Alone. So also...
Putting < /dev/null > /dev/null 2>&1 & (as reccomended by the FAQ) or just >& /dev/null(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.
Gotcha
It might seem like its still hanging. Its probably not, it just takes a long time to exit. Patience! Grasshopper.posted at: 13:45 | path: / | permanent link to this entry
Thu, 13 Mar 2008
Welcome to One Little Sysadmin
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.
Lather, rinse, repeat.
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.
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.
Hence this, blog the little stuff, anyold how, tag it, forget it.
Then when I get that sense of deja vu I can come back and search for it here....and maybe write some proper documentation.
Thats the theory anyhow...
...and I get to use vi as a blogging interface...
posted at: 17:28 | path: / | permanent link to this entry