Author Archives: Randy

PHP IPv4 and IPv6 Network and Subnet Calculator

Just threw together a quick and dirty PHP-based subnet calculator. What sets this one apart from others is that it works with both IPv4 and IPv6 inputs and has subnet splitting capability. Use the first field to enter a network to get details about. The format is CIDR notation ‘1.2.3.4/22’. Use the second field to […]

Windows 7 / Vista DNS Suffix only one level deep

Major annoyance to any organization that has hostnames like foo.bar.domain.com — Windows 7 and Vista appends domain.com to bar, but not foo.bar. After some digging I finally found a registry hack that restores ‘proper’ functionality like any other OS or older version of windows. Create a DWORD ‘AppendToMultiLabelName’ with a value of 1 in: HKEY_LOCAL_MACHINE […]

Categories: Technical and Windows. Comments Off on Windows 7 / Vista DNS Suffix only one level deep

DJBot Rsync Copy

rsync –progress -av –delete -e ssh root@x.x.x.x:/ root –exclude=/dev –exclude=/proc –exclude=/sys –exclude=/tmp –exclude=’*.mp3′ –exclude=’*.MP3′ — exclude=’*.sql.gz’ –exclude=djbot/logs

SQL-fu #1

Nested select with an insert to create multiple rows — used this to add admin privileges for a client in Maia for all their domains: INSERT INTO maia_domain_admins (SELECT t2.domain_id,1013 from postfix_transport t2 WHERE t2.mta_host=’1.2.3.4′);

Search + Replace, Append, Prepend MySQL

Search and replace update [table_name] set [field_name] = replace([field_name],'[string_to_find]’,'[string_to_replace]’); Append update [table_name] set [field_name] = concat([field_name],'[string_to_append]’); Prepend update [table_name] set [field_name] = concat(‘[string_to_prepend]’,[field_name]);

Categories: Uncategorized. Comments Off on Search + Replace, Append, Prepend MySQL

Mcelog – Bad memory?

The original hardware did all kinds of strange things, stuff like SSH not working and RPM checksums failing, random rebooting, ect. I ended up swapping the chassis, mainboard and RAM but kept the HDD’s to avoid an OS reinstall. Now, I’ve gotten this twice on the new box followed by a hard freeze about 2 […]