Tuesday, December 30, 2014

Maximum Cache TTL Microsoft DNS Server MSDNS

Open up regedit and navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
Create a new DWORD "MaxCacheTtl" with a DECIMAL setting of 300 (for 300 seconds)

Then restart the DNS service (not required)

Negative Caching Microsoft DNS Server MSDNS

Open up regedit and navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNSCache\Parameters
Create a new DWORD "NegativeCacheTime" with a DECIMAL setting of 30 (for 30 seconds)

Then restart the DNS service

Thursday, November 13, 2014

IPv6 Supernetting Subnetting Ruby

#!/usr/local/bin/ruby -w
require 'ipaddr' 

# /32 CIDR -> /40's (LONG)
(0..255).each { |x|  puts IPAddr.new("1234:5678:#{sprintf("%02x",x)}00::0").to_i }

# /32 CIDR -> /48's (LONG)
(0..255).each { |x|  puts IPAddr.new("1234:5678:00#{sprintf("%02x",x)}::0").to_i }

IPv6 To PTR RDNS PHP

<?php
$addr = inet_pton($ip);
$unpack = unpack('H*hex', $addr);
$hex = $unpack['hex'];
$arpa = implode('.', array_reverse(str_split($hex))) . '.ip6.arpa';
?>

Wednesday, September 24, 2014

Kill All Processes In Linux Via Search GREP

Sometimes killall -9 simply doesn't work with all processes and as a result you are left searching/GREPing for process names to kill them off.

This Simplifies this task by killing all processes that are the result of that search:
kill -9 `ps -ef | grep processname | grep -v grep | awk '{print $2}'`

Monday, September 8, 2014

Change Clock Date Time Sync On Xen Linux VPS

Set the following in sysctl.conf on your VPS. This will allow your VPS to have a clock that is not forcibly synced with the host node.
xen.independent_wallclock = 1