Monday, November 19, 2007

Enable Mail Bundles in Mac OS X 10.5 Leopard

Normally Bundles no longer work after installing Leopard.
I miss Mail.appetizer. To get these working again in Leopard follow these steps:

Quit Mail

Enter these commands in Terminal:

defaults write com.apple.mail EnableBundles -bool YES
defaults write com.apple.mail BundleCompatibilityVersion -int 3

Start Mail

Friday, November 16, 2007

Turn off Translucent Menu Bar in Leopard

sudo defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 1

Thursday, November 8, 2007

Changing the root password on MySQL

Many distributions of Linux have an option to install MySQL. In this case, or even if you compile MySQL, the default password is blank. MySQL can also run on Windows boxen. When you install MySQL, make sure that you set the root password. You can do this:



root@u-1:/home/u-1# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 3.23.47
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> SET PASSWORD FOR root@localhost=PASSWORD('rubberchicken');
Query OK, 0 rows affected (0.06 sec)
mysql>


In this example, we set the root password to rubberchicken. Note from the above that the password wasn't set. If we try this again, we need to use the -p option to enter the password:



root@u-1:/home/u-1# mysql -u root mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
root@u-1:/home/u-1# mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 3 to server version: 3.23.47
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>


To reset a root password that you forgot (using paths on our system):



[root@host root]#killall mysqld
[root@host root]#/usr/libexec/mysqld -Sg --user=root &


You may have better luck with:



mysqld --skip-grant-tables --user=root


Go back into MySQL with the client:



[root@host root]# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 3.23.41
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> USE mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user
-> SET password=password("newpassword")
-> WHERE user="root";
Query OK, 2 rows affected (0.04 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit;
[root@host root]#killall mysqld


Start MySQL the normal way for your system, and all is good. For Red Hat this is:



/etc/init.d/mysqld start

Monday, October 29, 2007

Group Members

Have you ever tried to get a list of group members in a text file.

Well you can do it this way:

dscl /LDAPv3/ldap.company.com -read /Groups/ThisGroup Member > ThisGroupsMembers.txt

Wednesday, October 17, 2007

Join Kerberos

I was having some troubles getting a server to join kerberos.

After some time I found out that the problem was related to a correct dns entry.

So there are two ways to fix this:

a) correct dns
b) if that is not possible due to some reason as in my case you may try this:

Use a text editor to open the /etc/hosts file, then add the following entry to the end of the file:

IP address FQDN

... where IP address is the IP address of the KDC, and FQDN is the fully qualified domain name that you specified on your DNS server.

For example: 123.456.78.910 www.example.com

In Terminal (/Applications/Utilities), execute the following command:
sudo scutil --set HostName
... where FQDN is the fully qualified domain name of this server that was configured on your DNS server.

After that I had no problems to join kerberos using:


sso_util remove -k -a diradminuser -p diradminpassword
rm /etc/krb5.keytab
# rm /Library/Preferences/edu.mit.Kerberos
# rm -R /Library/Preferences/DirectoryService/
rm -R /var/db/krb5kdc/*

/usr/sbin/sso_util configure -r LDAP.HOPRO.EDU -a diradminuser -p diradminpassword -f /LDAPv3/ipaddrofladserver -v 1 all


Hint found here:
Mac OS X Server 10.4: Kerberos authentication services may not successfully start

Wednesday, October 10, 2007

Passwords not working?

Are you running a Mac OS X server and having troubles with your passwords?

The symptoms you see are:

- A user can't log in to some systems
- The /Library/Logs/PasswordService/ApplePasswordServer.Server.log on the relevant password server contains this message:

Dec 5 2005 14:28:26 AUTH2: {0x4322345c67952fc40000016800000685, user1} DIGEST-MD5 authentication failed, SASL error -13 (password incorrect).

Then have a look at this document:

Mac OS X Server: Authentication issues with DIGEST-MD5, "SASL error -13"

Tuesday, August 7, 2007

diskutil resizeVolume

To create a partition for Windows on a iMac with a 150GB disk I used the following commands:

First we need to look at the current disk partitioning:
diskutil list
which returns something like


/dev/disk0
#: type name size identifier
0: GUID_partition_scheme *149.1 GB disk0
1: EFI 200.0 MB disk0s1
2: Apple_HFS MyMac 148.7 GB disk0s2

Then I used the command
diskutil resizeVolume disk0s2 112G MS-DOS Windows 36G

This resizes the Mac partition to 112 GB and creates a second partition in ms-dos format named 'Windows' with a sie of 36 GB

More infos here:
http://www.macgeekery.com/tips/cli/nondestructively_resizing_volumes

A reboot is then required. But wait:
Be sure to set the startup disk first, otherwise your mac will not start up!!!
bless --mount "/Volumes/Macintosh HD" --setBoot

In order to use the newly created volume with netboot, I had to erase the volume.
Otherwise the volume was not visible in NetRestore.
The command to do this is:

diskutil eraseVolume MS-DOS ".Windows XP" /dev/disk0s3