OpenFiler,part 2

So, I couldn't find the external USB CD/DVD. Now what, system didn't come with CD/dvd drive.  In comes USB stick to the rescue? No, ergh, tried, UNetbootin, to get ISO image onto stick. ISO got to stick but when trying to boot, no good. Kept getting,

"Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block"

Booo..Spent a lot of time trying to resolve. 

Finally broke down and took external WD 1TB USB apart, and swapped HD with a DVD i pulled from one of the desktops. 

And now I'm finally loading and configuring OpenFiler.

Setting up OpenFiler

Found a bunch of limitations with FreeNas. Limitation could be attributed to me not getting it, but not likely.  Need an iscsi drive setup on a 4TB array. MSWIN 2003 not seeing whole drive, only reports 560GB. Weird, cause I swear the first time it connected it showed the full disk. But because I had to ensure this was a replicatable process, the second time I went through the motions only 560gb appeared. And after the 5th try, basically rebuilt the array, reinstalled FreeNas, everything I could do to get it back to virgin state, still 560gb appears. I can write and everything to the 560gb but its 560gb compared to 4TB.  Also the 4TB can't be sliced and diced with FreeNas, at least not that I found or read.


Here we go.

Today felt great.

Woke up showered, felt so awake and refreshed.
Came across some good stuff today, thought I should share.

GoogleMaps Api for .net @ CodeProject.com:
Anyone who stores any type of address data should check this out. This can easily start off as a "bells and whistle" add-on, but watch-out. Beware it will quickly become a feature you can't do with out.

Very eye opening for thoses DBA buried in the trenches. Atleast I know I manage BIG DATA LOL. How do I know it's big? See Pg.4 of his presentation, 100's of gigs and up. WOOT!!!

Weather you use it or not, Deklarit has some good stuff in thier. Gotta check out there demo. Probably 60-80% of developers will be like, "OMG, I suck compared to this." But really check this concept out.

And then

Get that head thinker going. So much great stuff out there. These too, are great to wrap your head around:
Prize winner in Competition "Code Generation 2008 Competition"
But don't just read, download and do proof of concept. Get thier demo and get it working locally. Challenge yourself. I am :)

Back to the grind,TTFN

Hellow Crontab

Need to create a cron job in centoOS5? Here's my quick and dirty.


Applications --> Acessories --> Terminal

You should see terminal window titles, "username@machinename"

Type:
crontab -e
This being your first time, you should just see a bunch of "~" all the way down you screen.

Type:
o
This creates a new entry. Now enter your job info. Format is as follows:

minute hour day month dayofweek command
*           *       *      *           *                  yourPathToFile          

example:
1 * * * * wget -O /dev/null www.WOOT.com/helloCrontab.php

plain english: call helloCrontab.php every minute

ref: System_Administration_Gude.pdf pg.275

After you've type out your command, hit esc, then type ZZ to save. If you don;t want to save then type :q!

To view your new job or see what jobs you have scheduled type:
crontab -l

Enjoy


Bypass Confickers Block for updates

this effectively flushes all addresses it's trying to block. It's worked for me anyway.

NET STOP DNSCACHE

Grant Select for User on All Tables in DB (SQL)

--//Specify DB
USE SaidDB

DECLARE

@login varchar(50)
,@GrantSelectAll VarChar(MAX)

--//Specifiy User to grant permissions to
SELECT @login = 'username'

DECLARE @tables TABLE(ROWID int IDENTITY(1,1), SQLSTR varchar(500))
INSERT INTO @tables
SELECT 'GRANT SELECT ON [' + NAME + '] TO ['+@login +']'
FROM sysobjects
WHERE TYPE = 'U'
AND NAME NOT LIKE 'SYNC%'

SELECT @GrantSelectAll =
(SELECT SQLSTR + CHAR(10)
FROM @tables
FOR XML PATH(''));

PRINT @GrantSelectAll
--// Uncomment when satisfied
--// EXEC(@GrantSelectAll)

Get list serivces in Svchost --> netsvcs. Poor mans Worm Check?

Save to a vbs, I called mine ValidateNetsvcsInfo.vbs

This will attempt to connect to all your machines and compare to a known good service name list. If it doesn't exists then something is up and you should tack action.
-------------------------------------------------------------------

wscript.echo "GetNetSvcsInfo Running"

CALL GetNetSvcsInfo("YourMachineName")

wscript.echo "GetNetSvcsInfo Complete"

sub GetNetSvcsInfo(Server)
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = Server

strKnown = "AeLookupSvc, AppMgmt, AudioSrv, BITS, Browser, CryptSvc, DMServer, EventSystem, " & _
"helpsvc, HidServ, Ias, Iprip, Irmon, LanmanServer, LanmanWorkstation, Messenger, " & _
"Netman, Nla, Ntmssvc, NWCWorkstation, Nwsapagent, Rasauto, Rasman, Remoteaccess, " & _
"Sacsvr, Schedule, Seclogon, SENS, Sharedaccess, ShellHWDetection, Themes, TrkSvr, " & _
"TrkWks, uploadmgr, W32Time, winmgmt, WmdmPmSN, WmdmPmSp, Wmi, wuauserv, WZCSVC, xmlprov"

strPath = SPLIT(Wscript.ScriptFullName,".")(0) & "_Results.log"

'wscript.echo "winmgmts:\\" & strComputer & "\root\default:StdRegProv"

On Error Resume Next

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
If err.number <> 0 then
WSCRIPT.Echo strComputer & " is offline or access is denied"
WriteText strPath ,strComputer & " is offline or access is denied"
err.clear
Exit Sub
End If

On Error GOTO 0


strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\SvcHost"
strValueName = "netsvcs"
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,arrValues

For Each strValue In arrValues
IF LEN(TRIM(strValue)) > 0 THen
IF instr(strKnown,strValue) = 0 THen svList = svList & strValue & vbcrlf
ENd IF
Next

IF LEN(TRIM(svLIst)) > 0 Then
WriteText strPath , strComputer & "--------------------------"
WriteText strPath ,svList
End If

End Sub


Sub WriteText(strFilePath, strText)
'Props: http://www.rgagnon.com/wshdetails/wsh-0003.html
Dim objFileSystem, objOutputFile
Dim strOutputFile

Const OPEN_FILE_FOR_APPENDING = 8

' generate a filename base on the script name
strOutputFile = strFilePath

Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.OPenTextFile(strOutputFile,OPEN_FILE_FOR_APPENDING , TRUE)

objOutputFile.WriteLine(strText)
objOutputFile.Close

Set objFileSystem = Nothing

End Sub

Another gem, Inspect Task Scheduler for rundll.exe

Really? Should there ever be rundll.exe scheduled? Well not in environment, so that raises red flags. I root them out with this.


@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
Echo GET'EM...

SET FOUNDLOG=C:\Logs\FOUND_AT.bat

DEL /Q %FOUNDLOG%

call:RUNONHOST MachineNameX
IF EXIST %FOUNDLOG% (
::DEL /Q %FOUNDLOG%
ECHO YOUR GOT PROBLEMS!!!
) ELSE (
ECHO THIS HOUSE IS CLEAN
PAUSE
)
GOTO :EOF

:RUNONHOST
SETLOCAL
SET HOST=%1
:: Run it
ECHO CHECKING TASKS ON: !HOST!

FOR /F "skip=2 delims==^R" %%x IN ('AT \\%HOST%') DO (
SET _Search=%%x
ECHO !_Search!
::Check if line contains "rundll"
FOR /l %%a in (0,1,80) DO (
SET word=!_Search:~%%a,6!
IF "!word!"=="rundll" (
:: Output delete with id
ECHO FOUND
FOR /F "tokens=1-8 delims=. " %%h IN ("!_Search!") DO (
ECHO \\%HOST% -- %_Search%
ECHO AT \\%HOST% %%h /DELETE >>%FOUNDLOG%
)
)
)

)
ENDLOCAL
GOTO :EOF