Archive for the ‘Uncategorized’ Category

Arch Linux

Friday, December 4th, 2009

So I’ve moved to Arch,
I think this will be the end of my distro hopping, arch can give me everything I need, and with the rolling release it means I never need to upgrade, although I do like to start from scratch every now and again(i keep a very messy home directory).

Check it out. Dont forget to check out the best feature, AUR, similar to opensuse’s build service, but way better.

Beware that the installer is basic, you need to know your way around linux to be able to do anything remotly advanced (raid or LVM).

I’m going to blog more

Thursday, December 3rd, 2009

I haven’t been blogging as much as i’d like to. To change this i’m using this cool blogging client called “charm”
I hope this will make it easier for me to blog more. I have lots of useful stuff to say!

Using an OpenLDAP directory for Thunderbird address book lookups

Friday, March 13th, 2009

I wanted thunderbird to be able to look up addresses in my OpenLDAP directory. It worked out of the box somewhat using the standard inetorgperson attributes. But i wanted to map some of my POSIX attributes so Thunderbird would recognize them and therefore there would be more information in the address book entry.

Here is a table of ldap attributes thunderbird is interested in.

http://www.mozilla.org/projects/thunderbird/specs/ldap.html

This is based on a less than perfect schema that mozilla came up with.

Anyway, Thunderbird already gave me the First name(givenName), lastname(sn), displayname(cn), and email(mail) bits from each address book entry, but i wanted it to fill in the Nickname from the POSIX gecos attribute(It usually contains a little more information than just the name), so this is what had to be done on the OpenLDAP side

my DIT for this example is dc=example,dc=com and my users entries will be in ou=user

First i had to download and install the mozilla LDAP schema  from https://wiki.mozilla.org/MailNews:Mozilla_LDAP_Address_Book_Schema

I had to then define a new “relay” database at the botton of my slapd.conf, it looks something like this:

database                relay
suffix                  “dc=addresses”
relay                   “ou=user,dc=example,dc=com”
overlay                 rwm
rwm-suffixmassage       “ou=user,dc=example,dc=com
map attribute mozillaNickname gecos
map attribute mail *
map attribute uid *
map attribute sn *
map attribute givenname *
map attribute cn *
map attribute *

This will create a second virtual DIT called dc=addresses which will use the “real” ldap directory(ou=user,dc=example,dc=com) as a back-end. This will map the gecos to the mozilla nickname and it will now appear in the users address book entry in thunderbird, it also blocks all information except the bits that are needed like displayname, cn, givenname, sn. It would probably be advisable to apply some ACLs to this aswell just incase.

This is only an example. If you have other attributes that might fit into an address book entry then you can map them to the mozilla atrributes.

LVM progress update cont.

Friday, January 18th, 2008

OK so we’re successfully booted off the new LVM based root filesystem.

Now i want to move everything back onto the dm softraid array. So we delete the old home and root partitions and make them into a new big partition with an LVM label,(I justed yast to do this coz i couldn’t have been arsed looking up the commands.

Now we convert this new big partition into a LVM physical volume:

pvcreate isw_cggibjcgah_Raid_part5

And then add it to the system volume group.

vgextend system isw_cggibjcgah_Raid_part5.

Now we can actually start moving stuff over (on the fly) to the array.

/dev/sda1 is the physical volume we want to release, its currently where root and home is. But this command will move the partitions to any other free physical volumes, which there is only one, the array,  system isw_cggibjcgah_Raid_part5.

pvmove /dev/sda1

But i got an error saying the mirroring module isnt loaded, so we load that:

modprobe dm-mirror

And after this the command will run successfully, It takes a while, depending on the size of your disks.

Now we have a free sda1 physical volume that we can remove out of the volume group.

vgreduce system /dev/sda1

And then make it a non physical volume using

pvremove /dev/sda1.

And that should be it. A successful conversion from standard linux block device to Logical volumes without loosing any data!

Two things to note that may render your system unbootable are these:

  1. Don’t touch your/boot partition/device, grub needs this and cannot read from a logical volume!
  2. Leave your swap space as an ordinary partition too, although the system will attempt to boot even though it cant access any swap space.

BBC iPlayer woes.

Monday, January 14th, 2008

Well I have to hand it to BBC’s IT team, I’ve spent all evening trying to get iPlayer to work where I am in Dublin and I couldn’t manage it. I tried numerous methods like:

  • Numerous proxies on proxy lists around the web
  • VPNing into my work network(I’m amazed this didn’t work)
  • Just going to the website directly(ye this was a dead horse)

One last thing I could do would be to boot my Laptop into windows because the Linux VPN client isn’t the best, but of course that would mean booting into windows.

Putting a LAMP VPS on a diet

Saturday, January 12th, 2008

Having a VPS with 128M of ram and wanting to run LAMP on it successfully is no mean feat. I wanted a selection of php/mysql based applications to run on the server.

  • Wordpress(naturally)
  • Mediawiki
  • Ampache

At first I installed the vanilla apache2 and mysql packages and fired them up because I had no experience of anything else but by default my apache was using up nearly 30mb of ram and had 5 children, mysql was a similar affair except it used a threaded modal instead.. My memory usage quickly shot up to nearly full capacity pretty quickly. A quick Google later and I came across a guy who has optimized mysql for low memory situations, and I scrapped apache and went for the lighter lighttpd.

Heres the changes I made to my.cnf(mysql).

< key_buffer = 16M
< max_allowed_packet = 16M

> key_buffer = 4M
> max_allowed_packet = 2M
54c54
< thread_cache_size = 8

> thread_cache_size = 3
61,62c61,62
< query_cache_limit = 1M
< query_cache_size = 16M

> query_cache_limit = 2M
> query_cache_size = 128K
96c96
< #skip-innodb

> skip-innodb
120c120
< key_buffer = 16M

> key_buffer = 4M

This left mysql using 2.9% of memory, which for a database is not too bad at all.

I then installed lighttpd which required me to enable the universe and multi verse apt sources, this is because lighttpd is under the BSD license. Of course then I needed to install PHP support, this meant installing the php5-cli package and enabling the fastcgi lighttpd plug in using lighty-enable-mod. Then for some reason lighttpd kept crashing when i tried to start it, I looked in the configuration files and narrowed it down to /etc/lighttpd/conf-enabled/10-fastcgi.conf in which i changed the line “PHP_FCGI_CHILDREN” => “4″, to “PHP_FCGI_CHILDREN” => “0″ and that lighttpd started successfully and to my astonishment all my PHP applications worked out of the box, as before with apache, thats mediawiki, wordpress and ampache and with lighttpd sitting at 0.6% memory usage I was laughing. although php-cgi, which handles all the PHP pages was at 5.6% but thats understandable.

Of course strictly speaking this isn’t a LAMPS configuration now more like LLMPS, but it does the job better!

Ubuntu as a server

Friday, January 11th, 2008

I’m not going to lie, I’ve never been that fond of (k)ubuntu. I find it tries to hide a lot of stuff so users cant break much, but I’ve been pleasantly surprised at how it can become a light streamlined server OS suitable for something like a VPS with limited amounts of ram and disk space.

The install given to me by my provider was just 400MB in size. Granted there was a lot of stuff had to be installed right away like the different shells, vim and even man but it cut a lot of the unnecessary software out thats just not needed on a  server.

dmarkey.com is up and running again!

Friday, January 11th, 2008

Finally my website dmarkey.com is up and running again. It has been a long time since i hosted on our shared DSL line in terenure which it performed well but now it has its own dedicated VPS(Virtual private server) with a whopping 128MB of RAM so dont be too hard on it!

I hope to have a good experience with using a VPS for the first time. The VPS company I’m with is the (dirt) cheap http://www.vpsvillage.com which I’ve bought their $10 dollar a month “hut” off them which gives me an Ubuntu based Linux virtual machine(other distributions available), 128M of dedicated RAM and 8G of dedicated disk space and a whopping 256GB of traffic per month. Plenty for a website like this.

I’m thinking of setting up a cron script to monitor the network reliability to see just how well we are performing, maybe ping it every 10 minutes from my workstation in work or something. To be honest though I’m not expect 99.9% uptime, especially not at $10 a month.


Copyright © 2010 All Rights Reserved.
No computers were harmed in the 0.197 seconds it took to produce this page.

dmarkey.com