The hardest parts of talking to Active Directory (or LDAP) are first learning the query language, and second figuring out what is 'good' to query and what is not. This document will focus on how to talk to active directory in a way that is quick, accurate, and most importantly easy to understand.
Recently I encountered the need to figure out if all the terminated employees from my organization had been disabled within Active Directory, and if all their priveleges had been revoked. Unfortunately, there is no simple way to do this, so I decided to build a report using MSSQL, SQL Server Integration Services, and the .NET DirectoryServices library using the Common Language Runtime (CLR). This tutorial assumes a basic familiarity with SQL Server Interation Services (SSIS), Visual Studio, and other Microsoft development tools.
Enable the rhel-x86_64-server-supplementary-6 RHN channel. This is where the java-1.6.0-sun packages reside, which work much better than openjdk.
rhn-channel -a -c rhel-x86_64-server-supplementary-6 -u $RHN_USERNAME -p $RHN_PASSWORD
Install java and tomcat, then make sure tomcat starts on boot
yum install java-1.6.0-sun tomcat6 chkconfig tomcat6 on
configure: error: C compiler cannot create executables See `config.log' for more details.
What?!? Isn't that the entire purpose of a compiler?!?
As of Java 1.5, there is native SNMP support built in to the JVM. To enable it, there are three Java flags that need to be set. For Tomcat, these should go in the CATALINA_OPTS variable.
Assuming you are not running your JVM as root (you're not, right? RIGHT?!?), snmp-port must be higher than 1024 on a Unix-based system. 9161, for example.
Upgrading from MySQL 5.1
Backup Current Data
Create a backup of your database
mysqldump --opt --all-databases | gzip > ~/mysqldump.sql.gz
Make a separate backup of the `mysql` database, which will come in handy if any recovery operations are required.
mysqldump --opt --databases mysql | gzip > ~/mysql.sql.gz
Also, make a copy of the MySQL configuration files
tar -C /etc -czf /etc/mysql.tar.gz mysql
Remove MySQL 5.1
Now that there are sufficient backups, MySQL 5.1 can be uninstalled.
MySQL Partitions are a great way to rotate data in a table without incurring the overhead of running multiple delete statements. The most common use of this is to partition data by date. You must use MySQL 5.1 (or newer, I presume), and it is recommended to use MySQL 5.1.16 or later in order to take advantage of the ALTER TABLE features that allow adding partitions on existing tables.
It is possible to backup and restore POSIX ACL's using the standard getfacl and setfacl tools.
To backup the ACL's use getfacl
getfacl -R /some/path > backup.acl
Then, to restore the ACL's, use setfacl
This works great to copy ACL's from one server to another.
Prerequisites and Assumptions
- Debian Lenny stable (not backports) packages are used in this document
For a long time I have kept a personal site full of tidbits and snipits of things I had discovered or developed. This was for my own benefit, so that I could keep track of my own thoughts and could access the information from anywhere. Recently, I have decided to try to formalize things a little more in hopes of making this information more useful to other people.