Sample Active Directory command line php script

Here is a sample Active Directory php script that you can user for debugging and testing your configuration

Login in your host, save the php script below, give it a name, e.g. "ad_test.php" and change the following variables at the beginning to match your configuration:

$basedn = "DC=domain,DC=company,DC=com";
$ldapuser = 'username@domain.company.com';
$ldappass = "yoursupersecretpass";
$ldapserver = "ldap.domain.company.com";
$ldapport = 389; // 389 is the default port number for AD servers
$uid = "username"; // uid to search for

Then run the script:
user@host:~/tests$ php ad_test.php

Monitoring mail server network traffic and bandwidth usage

Below you can see some useful commands which will assist you for troubleshooting and monitoring traffic on your mail server.

Say for example, that you have a case where you want to find out how much traffic your POP3 server is consuming. You can get this information from your mail server's log file.

If we assume a postfix/dovecot mail server, the log file format, is like this:

How to free-up space allocated to text/image fields in Sybase ASE

This how-to explains how to reclaim space from a Sybase ASE text field.


First of all, if you want your text/image fields to use the least possible space, you must define them to allow nulls on table creation, or when altering the table.

You can easily monitor the space used by text and image fields using sp_spaceused:
sp_spaceused objname, 1

Easy XML and RSS integration in PHP


This post shows how to get XML and/or RSS data from external sites to our site using PHP.
Using this method we could integrate various PHP based CMS's like Drupal, Joomla, Wordpress with external XML feeds.

Getting external RSS feeds

Now consider for example, that you want to get the first two news items from the BBC RSS news feed.
You can do this very easily and quickly using the following piece of code:

Drupal 7 minor version upgrade

Steps for upgrading 7.x version of Drupal to any later 7.x version

Preupgrade steps

  1. Make a full backup of all files, directories, and your database(s) before starting, and save it outside your Drupal installation directory. Instructions may be found at http://drupal.org/upgrade/backing-up-the-db
  2. It is wise to try an update or upgrade on a test copy of your site before applying it to your live site. Even minor updates can cause your site's behavior to change.

Personal outsourcing!

A security check on a US company has reportedly revealed one of its staff was outsourcing his work to China.
The software developer, in his 40s, is thought to have spent his workdays surfing the web, watching cat videos on YouTube and browsing Reddit and eBay.

Useful linux localization related commands

Below you can find some linux localization related commands

Set local timezone

dpkg-reconfigure tzdata


Restart all deamons (or reboot)
Check: /etc/timezone


Display all localization settings, eg: locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=