MV

Friday, May 25, 2012

Switch IP addresses for WordPress

As technical writer, I should be playing with all kinds of tools, so since WordPress is becoming more and more popular, I'd give it a try.

So I installed WordPress on a LAMP stack (as a virtual machine), by following their Famous 5-Minute Install instructions. So all went fine. I used the IP address of my VM to configure my WP database since I don't have a domain name. No problem, I played a bit around with WordPress, tested some configurations, and so on. It really works fine.

Unfortunately after restarting my VM, I got another IP address and I was no longer able to connect to my installation. Not in FireFox, not in Chrome. In FF I got to an login window, but in plain text, so no CSS at all. But the most surprising was that both browsers always tried to reach WordPress via my previous IP address.

After clearing the cache and cookies of my browsers and restarting Apache on my WordPress server I thought my issue would be solved... wishful thinking that was.

Luckily I can trust my dear friend Google. One search query and following the first result got me back in the driving seat.

http://stackoverflow.com/questions/535534/wordpress-host-ip-changed

I only need to change the wp-config.php file and add these two lines:


define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

where I change `example.com` by my IP address.

Monday, May 7, 2012

Den Barkentijn


Om ons verlengd weekend van 1 mei af te sluiten besloten we (ondertekende met wederhelft en onze twee dochters)  om nog eens een hapje te gaan eten op den dijk van Oostduinkerke. Eentje die in ons geheugen zal blijven hangen, helaas in de negatieve zin.

Na eerst wat kuieren op de dijk, besloten we uiteindelijk om ons de installeren op het halfopen terras van De Barkentijn. Niet te veel volk op hun terras op het strand, geen volk binnen, enkel nog een ander gezin op het terras aansluitend aan het etablissement. Niet echt druk dus voor een feestdag.

Om met de deur in huis te vallen: het is een serieuze tegenvaller geworden. Niet zozeer door het eten. Hiervoor moeten ze niet veel onderdoen voor de andere etablissementen op de dijk. Het eten was okee, niet meer niet minder; de gewone kwaliteit zoals je die op de dijk kan verwachten. Niet echt iets wat we zullen onthouden dus.

De service daarentegen zullen we wel nog lang onthouden. Ik denk dat we 3 of 4 mensen van het personeel hebben gezien en allemaal gaven ze ons de indruk dat ze ons liever kwijt dan rijk waren. Het opnemen van het eten en drinken duurde al lang, veel te lang, zeker als je weet dat we minstens 5x gepasseerd zijn geweest door de obers.

De wachttijd voor het leveren van eten en drinken was dan weer wel in orde. Helaas was de bediening dat iets minder. Weerom een gezicht dat op onweer stond, een glimlach kon er echt niet af blijkbaar.

Toen we uiteindelijk wilden betalen, hebben we 3x teken moeten doen naar de ober, toen die dit de 3de keer zag, konden we duidelijk zien dat het hem niet aanstond dat we de rekening vroegen. Hebben de rekening dan maar aan een andere ober gevraagd. Dit was dan ook niet met de meest hartelijke persoon, maar we waren al tevreden dat hij er snel was met de rekening zodat we snel konden afrekenen om daar zo snel mogelijk buiten te zijn. Mochten we punten mogen geven zoals in 'Komen Eten', zou het voor sfeer en service een dikke nul geweest zijn.

Opgelucht om een brasserie/taverne te verlaten, het was een nieuwe ervaring...

Friday, March 30, 2012

Tab usage in Skype on Linux... at last

Skype on my Ubuntu works fine, despite some configuration issues at installation time, but I was tired of all those windows for each and every chat session and even the list of contacts.
Now this is finally over, I have finally a skype version that produces only one window, except when making a call, but I can live with that though.

Add the ppa from this site: https://launchpad.net/~keks9n/+archive/skypetab/
apt-get update and install the package skypetab-ng.

Then instead of launching skype, launch /usr/bin/skypetab-ng!

Not sure if it uses the original Skype, but I think so.


Wednesday, March 28, 2012

Rooting my Acer Liquid MT (S120)

In case I want to root my android again, follow these links instead of always losing too much time in finding the information:

* http://168.site90.net/doku.php?id=mobile:acer-liquid-metal-s120
* http://android.modaco.com/topic/348167-236-acer-official-release-400013emeagen1/

Now I hope to not forget that I wrote down this information in my blog :P

Monday, October 24, 2011

another note to self (get sound through headphones)

sound is not coming through headphone jack, only via built-in speakers on Dell Studio XPS.

After clean install of my laptop with Ubuntu 11.10 64-bit (Oneiric Ocelot), I no longer had sound through my headphones, only via the built-in speakers.

This resolved my issue:

open /etc/modprobe.d/alsa-base.conf
Add this line at the end of the file: options snd-hda-intel model=dell-m6
Logout/login and problem is solved.

Experienced this issue already in 10.10 (if my memory doesn´t let me down)

Monday, July 25, 2011

Ejabberd cluster on Ubuntu Server

Two years ago, I created a blog about the clustering of ejabberd nodes, running on OpenSolaris.

This message here has the same purpose but now running on Ubuntu Servers and linked to an openldap server. I used 9.04 (Jaunty Jackalope), but I think there shouldn't be too much changes in earlier or later versions.

I used the following setup:
3 ejabberd nodes (ejabberd1, ejabberd2, and ejabberd3)
1 OpenLDAP Server

Installation and Configuration First ejabberd



Make sure that your are logged in as root user.

1. Install ejabberd:
$ apt-get install ejabberd
2. Configure ejabberd to get users from the openldap server
* adapt /etc/ejabberd/ejabberd.cfg:

** %% Admin user: in this example the user must be listed in the LDAP
** %% Hostname
** %% List of LDAP servers: {ldap_servers, [""]}.
--> make sure that ejabberd node can reach ldap server using its
hostname (possibly adapt /etc/hosts)
** %% Encryption .. LDAP Servers (LDAPS): {ldap_encrypt, }.
--> tls, ssl, none, ...
** %% Port connect to LDAP server: {ldap_port, }.
** %% LDAP Manager: {ldap_rootdn, ""}.
--> e.g. {ldap_rootdn, "cn=admin,dc=example,dc=com"}.
** %% Password of LDAP manager: {ldap_password, ""}.
** %% LDAP attribute that holds user ID: {ldap_uids, [{"uid", "%u"}]}.

3. Modify /usr/sbin/ejabberdctl: ERLANG_NODE=ejabberd@`hostname`
--> not single quotes but back single quotes around hostname
4. Start ejabberd: /etc/init.d/ejabberd start

Check if ejabberd is running:

$ ejabberdctl status
Node ejabberd@ejabberd1 is started. Status: started
ejabberd is running


Installation and Configuration Other ejabberd Nodes



1. Install ejabberd:
$ apt-get install ejabberd
2. Copy ejabberd.cfg from first node
3. Copy ejabberdctl from first node
4. Copy /var/lib/ejabberd/.erlang.cookie from node 1 to new node.
5. Start ejabberd: /etc/init.d/ejabberd start

Check if ejabberd is running:

$ ejabberdctl status
Node ejabberd@ejabberd2 is started. Status: started
ejabberd is running


Now synchronize the databases is the tricky part. Thanks to this blog it is a piece of cake.
Just perform the steps below to synchronize the database of node 2 with the first node:

1. Start ejabberd in debug mode:
$ ejabberdctl debug
You arrive in an Erlang shell.
2. Enter the following commands:

* FirstNode = 'ejabberd@first', %%where first is the hostname of the first node (!) Make sure that the line ends with a comma, indicating that there are other commands to follow
* mnesia:stop(),
* mnesia:delete_schema([node()]),
* mnesia:start(),
* mnesia:change_config(extra_db_nodes, [FirstNode]),
* mnesia:change_table_copy_type(schema, node(), disc_copies).

3. End the debug session by pressing Ctrl-c, Ctrl-c

Your second node now runs ejabberd with the same database as on the first node.
Repeat this procedure for other ejabberd nodes which must serve the same database.

Web Interface ejabberd
----------------------
By default there is a webinterface available for ejabberd on http://:5280/admin

Log on with an LDAP user who has been added to the list of Admin users in ejabberd.cfg, login name is in the format user@domain, e.g. admin@example.com

Configuring OpenLDAP on Ubuntu Server

This message shows you how an easy setup of OpenLDAP. I configured this to test a new ejabberd clustering setup using Ubuntu Servers. So I decided why not to integrate OpenLDAP with the ejabberd cluster, which is likely a more useful setup.

Most of the documentation is taken from https://help.ubuntu.com/community/OpenLDAPServer.

Setup:
Simple Dual-core server 1024 MB RAM, running Ubuntu Server 9.04.
Make sure that you are connected to the Internet and that you are logged on as
root.

Installing the necessary packages:
* Install the following packages:
** slapd: ldap server daemon
** ldap-utils: ldap utilities
** db4.2-util: ?, not sure if this one is necessary

When installing these packages you will be asked for a password for the LDAP
directory administrator, which is not the root password of the server on which
you're installing OpenLDAP.

Reconfigure the LDAP tree:

$ dpkg-reconfigure slapd
Omit OpenLDAP server configuration? ... No
DNS domain name: ... example.com
Name of your organization: ... Whatever & Co
Admin Password: ******
Confirm Password: ******
OK
BDB
Do you want your database to be removed when slapd is purged? ... No
Move old database? ... Yes
Allow LDAPv2 Protocol? ... No


Check if ldap works:

$ ldapsearch -x -b dc=example,dc=com


Generate an encrypted password with slappasswd:

$ slappasswd
New password:
Re-enter password:
{SSHA}d2BamRTgBuhC6SxC0vFGWol31ki8iq5m


This example shows what happens when using "secret" for the password, but your
result may vary!

Create the file /etc/ldap/slapd.conf and add the following content:


suffix "dc=example,dc=com"
directory "/var/lib/ldap"
rootdn "cn=admin,dc=example,dc=com"
rootpw {SSHA}d2BamRTgBuhC6SxC0vFGWol31ki8iq5m


As root password use the generated password with the slappasswd tool.

Edit the file /etc/ldap/ldap.conf and uncomment the following line:


BASE dc=example,dc=com


Restart the LDAP service:

/etc/init.d/slapd restart


Populating the LDAP Tree
------------------------
Now that your LDAP directory is ready, you can start populating it. This will
be a 'classical' entry intended to be very compatible with Unix accounts
(posix), directories (like addressbooks), and classical accounts (for web
applications). But really it's just a starting point.

An LDAP directory can be fed with a ldif file ("ldap directory interchange
format" file). Create this file init.ldif somewhere on your system:


dn: dc=example,dc=com
objectClass: dcObject
objectClass: organizationalUnit
dc: example
ou: Example Dot Com

dn: cn=admin,dc=example,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:

dn: ou=people,dc=example,dc=com
objectClass: organizationalUnit
ou: people

dn: ou=groups,dc=example,dc=com
objectClass: organizationalUnit
ou: groups

dn: uid=loboloco,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: loboloco
sn: Loco
givenName: Lobo
cn: Lobo Loco
displayName: Lobo Loco
uidNumber: 1000
gidNumber: 10000
userPassword:
gecos: Lobo Loco
loginShell: /bin/bash
homeDirectory: /home/lobo
shadowExpire: -1
shadowFlag: 0
shadowWarning: 7
shadowMin: 8
shadowMax: 999999
shadowLastChange: 10877
mail: lobo.loco@example.com
postalCode: 31000
l: Brussels
o: Example
mobile: +32 (0)3 xxx xx xx
homePhone: +32 (0)475 xxx xxx
title: System Administrator
postalAddress:
initials: LL

dn: cn=example,ou=groups,dc=example,dc=com
objectClass: posixGroup
cn: example
memberUid: loboloco
gidNumber: 10000

dn: cn=example2,ou=groups,dc=example,dc=com
objectClass: posixGroup
cn: example2
gidNumber: 10001


In the example above, the directory structure, a user and group have been
defined. In other examples you might see the objectClass: top added in every
entry, but that is default behavior so you don't have to add it explicitly.

As with the LDAP root password, these passwords can be generated with
slappasswd using the MD5 or CRYPT hashing scheme. See man slappasswd).


Examples slappasswd:
(http://www.zytrax.com/books/ldap/ch14/)
Generate an SSHA password suitable for use as rootpw (in slapd.conf) or for use in a LDIF file for userPassword or authPassword attributes.


# no options required
slappasswd

# prompts twice for password string and then outputs
{SSHA}kjhfhfehflejhfvlldkl

# save to a file using normal re-direction
slapppasswd > /tmp/slappassword

# generate {SSHA} encoding of password secret
slappasswd -s secret

# generate {MD5) encoding of password secret
slappasswd -s secret -h {MD5}


To place the output in LDIF or slapd.conf, save to a file and copy, paste to
relevant file if GUI editing tools are being used. If vi is being used,
navigate to location in file where password is to be inserted then use :r
!slappasswd [opts] - this runs the command and inserts stdout into editing file at last cursor position. Alternatively save the output of slappasswd to a file, navigate to insert location in vi and execute :r /path/to/file - inserts file
contents into last cursor location.

When you're done, write and close the file.

Now, add your entries to the LDAP:

stop LDAP daemon: /etc/init.d/slapd stop

delete the content that was automatically added at installation:
rm -rf /var/lib/ldap/*

add the new content: slapadd -l init.ldif

correct permissions on the database:
chown -R openldap:openldap /var/lib/ldap

start LDAP daemon: /etc/init.d/slapd start

Your LDAP Server is up and running.