If you need a large scale wireless deployment or just a public hotspot with out getting into proprietary hardware and software look at http://www.open-mesh.com/. Their hardware is resonably priced and you can expand your wireless coverage just by adding addtional APs.
Tag: Uncategorized
Windows Log file compression in perl
This script will search the location for all .log files and compress them using NTFS.
#!perl #Search osbLocations for *.log files and ntfs compress them. use File::Find; use Win32::OLE; @osbLocations = ( 'E:/obs-win-mthosting2', 'E:/obsr-win-mthosting3', ); $strComputer = '.'; $objWMI = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\cimv2'); foreach (@osbLocations) { find(\&processFile, $_); } sub processFile() { if ( -f and /.log$/ ) { $objFile = $objWMI->Get('Cim_Datafile=\'' . $File::Find::name . '\''); if ($objFile->Compressed != 1) { print $objFile->Name, "\n"; $intRC = $objFile->Compress; # To uncompress change this to objFile.Uncompress if ($intRC != 0) { print 'There was an error compressing the file: ' . $intRC, "\n"; } else { print "File compression successful\n"; } } } }
Server 2008 R2 Missing bootmgr
I was working on a 2008 r2 server, after resizing the C drive the system would not boot. After digging alot I found Dan’s blog that got everything working.
In short boot from the dvd, get to the command prompt and run x:\sources\recovery\StartRep.exe
Export Exchange 2003 email to PST
You can use the Migration Wizard in Exchange 2003 to export email to a pst on a single server.
Cross-Platform Message Box
I needed a cross-platform message box for Windows and Mac. I tried wxperl because its native on the mac but their is a bug with their MessageBox code on the mac.
This is pretty simple code, but uses each O/S’s native message box API to display a dialog. If you have Yes/No buttons and click yes it will perform the item in action. Which for us opens a webpage. You only need a standard perl installation for this code.
$message = “My Popup Message”;
#icons Types (stop, note, caution)
$icon = ‘note’;
#button types (ok, yesno)
$buttons = ‘yesno’;
#action
$action = ‘http://www.google.com’;
if ($^O eq “darwin”)
{
#mac
&macPopup;
}
elsif($^O eq “MSWin32”)
{
#windows
&winPopup;
}
else
{
print “Unknown OS”;
exit;
}
sub winPopup
{
if($icon eq ‘stop’)
{
$ic = ’16’;
}
elsif($icon eq ‘note’)
{
$ic = ’32’;
}
elsif($icon eq ‘caution’)
{
$ic = ’48’;
}
if($buttons eq ‘ok’)
{
$bu = ‘0’;
}
elsif($buttons eq ‘yesno’)
{
$bu = ‘4’;
}
#work around because win32 is not on a mac, but the mac will throw an error
eval{require Win32; };
$result = Win32::MsgBox($message, $ic + $bu);
if(($result == 6) && ($buttons eq ‘yesno’))
{ #do action
system(‘start ‘ . $action);
}
}
sub macPopup
{
if($icon eq ‘stop’)
{
$ic = ‘0’;
}
elsif($icon eq ‘note’)
{
$ic = ‘1’;
}
elsif($icon eq ‘caution’)
{
$ic = ‘2’;
}
if($buttons eq ‘ok’)
{
$bu = ‘{“OK”}’;
}
elsif($buttons eq ‘yesno’)
{
$bu = ‘{“YES”,”NO”}’;
}
#mac way
$result = `/usr/bin/osascript <<-EOF
tell application "System Events"
activate
display dialog "$message" buttons $bu with icon $ic
end tell
EOF`;
chomp($result);
if (($buttons eq 'yesno') && ($result eq 'button returned:YES'))
{
system('open ' . $action);
}
}
WHS Bliss
I just finished upgrading my DNS-323 NAS to a Acer H340 Windows Home Server NAS.
I am also running Ahsay Off-Site backup software on the unit to backup my Macintosh laptops and a couple of friends computer.
So far no complaints. The media streaming to the Xbox 360 is great also.