Skip to Content


This is bitNixBlog, welcome! Home of all things about, running on or pertaining to nix systems. If there is something you are trying to do and can't remember, come here, you're likely to find the answer. If it's not here, then post when you find out.

Please register and comment!

mysqldump of latest 1000 records

Posted in

You can order and limit mysqldump output using the "--where" option. The --where condition below dumps the latest 1000 records from a table.

mysqldump --where="TRUE ORDER BY id DESC LIMIT 1000"

Here are some other examples.

mysqldump --where="TRUE LIMIT 500"
mysqldump --where="mailbox_id=45"
mysqldump --where="mailbox_id=45 AND TRUE ORDER BY id DESC LIMIT 300"

Damn Cool Kernel Feature

Have a look at this post regarding trapping a dying process in the kernel. If you need to trap a process before the process core dumps, read on to the article.

Windows + Exchange Torture

I'm obviously a Linux/Zimbra guy, but sometimes I am forced to run lab tests against M$ Exchange since ZCS does integrate with it- sorta. I've been placed under the knife and subjected to Windows torture once again to troubleshoot issues with Exchange F/B integration. I just lost two hours of my life trying to figure out WTF when Exchange 2007 could not connect to the AD domain.

The error:

Active Directory server win.corp.zmb.moc is not available. Error message: A local error occurred.

This server is perfectly sound and has 2 test users.

OS: Windows Server 2008

SSH Through SSH SOCKS Proxy

Posted in

Your SSH client can be configured to connect to any host on an internal network through a SSH SOCKS proxy. This maybe necessary in a corporate environment when:

  • there is one SSH proxy server open to the world;
  • there are a number of hosts on the internal corporate network which only allow connections from trusted or "blessed" internal hosts;
  • you just want to have fun with SSH SOCKS proxy.

OS X WebDAV with Zimbra

Posted in

WebDAV is a great protocol for reading and writing files to and from the Zimbra Collaboration Suite and is a great tool for network file storage since it works inside and outside the home network. Mounting and using your ZCS mailbox WebDAV filesystem with Mac OS X is trivial.

1) Mount your mailbox.

    a. Open Finder
    b. In the Go menu, select "Connect to Server..."
    c. Enter your ZCS server address in the server connection dialog in this format:

Substring Replace Strings In A Filename

This nested for loop substring replaces two parts of the filename GagHstqLEOlv5GU5kEDXmmpAoGQ=257-234.msg1. The script was used to restore missing blobs found in a mailbox backup to the live mailstore.

for d in $(find -type d)
  for f in $(ls $d)
    echo "mv -f $d/$f $d/$f2"

This site was helpful for figuring this out:

Ubuntu Hardy: Install Desktop

I run all my Linux N 2 or N 3, but I needed to test some things with Evolution. Also thought I would have a look at the Ubuntu desktop while I was at it, since Ubuntu server does not install it be default.

$ sudo apt-get install ubuntu-desktop
Need to get 475MB of archives.
After this operation, 1903MB of additional disk space will be used.
Do you want to continue [Y/n]? y

Adding A Disk To Ubuntu 8 Hardy For Zimbra

These are the steps for creating a new file system under Ubuntu 8.04 Hardy.

Preserve Log File Descriptor

Have you ever tried to clear a log file by removing the file, then touching a new one only to find your daemon does not write to the new file? So you restart the daemon and it still doesn't work? If you do this, chances are you will have to restart syslogd so it can find the new file descriptor you created when you touched the log.

If you are debugging and want a clear log, a better solution is write empty space to the file like this:

# echo "" > /opt/zimbra/log/zmmailboxd.out

This will empty the file and preserve the file descriptor.

Syndicate content