Tommy’s revised

Think you know the linux digg command? Ever try to do some simple network discovery with it? This script by Tommy Johnson does some nice condensed discovery. Just pass a domain for the argument.


That is all!

echo "MX points to:"
dig MX $1 +short | sort -n
echo ""
echo "A points to:"
dig A $1 +short
echo ""
echo "www points to:"
dig A www.$1 +short
echo ""
echo "mail points to:"
dig A mail.$1 +short
echo ""
echo "SOA Nameserver declared:"
echo `dig SOA $1 +short | awk '{print $1}'`
echo ""
#echo "oldmail points to:"
#dig A oldmail.$1 +short
domain1=( $(echo $1 | awk -F '.' '{print $1}'))
domain2=( $(echo $1 | awk -F '.' '{print $2}'))
domain3=( $(echo $1 | awk -F '.' '{print $3}'))
domain2=( $(echo $domain2.$domain3 | sed 's/[:.:]$//') )
first=( $(dig NS +short $domain2 | sed 's/[:.:]$//') )
second=( $(dig +short NS $domain2 @$first | sed 's/[:.:]$//') )
#echo "Authoritative nameserver for TLD is: "$second
#echo '+===============================================+'
echo "Name Servers as reported by registrar:"
echo `dig NS $domain1.$domain2 @$second | grep "AUTHORITY SECTION" -A3 | grep -v AUTHORITY | awk '{print $5}'`
echo "IPs declared by registrar:"
echo `dig NS $domain1.$domain2 @$second | grep "ADDITIONAL SECTION" -A3 | grep -v ADDITIONAL | awk '{print $5}'`
#echo '+===============================================+'
echo ""
echo "Name Servers in zone file are:"
dig NS $1 +short
dig NS $1 | grep "ADDITIONAL SECTION" -A3 | grep -v ADDITIONAL | awk '{print $5}'
echo "txt record is:"
dig txt $1 +short

WordPress 3.0 Ajax Notes

Collecting up some WordPress 3.0 and Ajax notes.

Nice round look at current state of Ajax and WordPress:

Here’s the WordPress Trac discussion for implementation in WordPress 3.0:

WP Super Edit & Some WordPress TinyMCE Notes

Discussion on wp-hackers centering around a simpler api for creating simple buttons.


There’s an example to add a quick button to TinyMCE at:

To do this in a WP plugin, you’d hook to mce_buttons_2 (or 3, or 4) to add your button to the list. Then you’d hook up a filter on tiny_mce_before_init to add your javascript code to the $initArray[‘setup’]. That should be pretty much that, really.

Someone suggested to combine that a simple button api with the shortcode api to create a simple visual editor button api. Probably way to many use cases to cover, but it is an interesting concept. Some groundwork exists in the Super Emoticons code for WP Super Edit.

Fixing The Custom CSS Plugin

That plugin is custom to, so it’s not really for wide usage yet. But I did find these notes for WPMU usage:

I needed to do two things to make it work:

On line 131 change is_int() to is_numeric():

if ( is_numeric( $blog_id ) ) {
switch_to_blog( $blog_id );
$current_plugins = apply_filters( ‘active_plugins’, get_option( ‘active_plugins’ ) );

Then in my .htaccess add the following:

RewriteRule ^custom-css.php /index.php [L,QSA]

Now works a treat.

Mega Menus

Mega Menu Notes from UDWEB list:


Sample Code:
Mega Menu Code Sample 1