Sun 28 Mar 2010
Manage your email better.
Posted by Internat under Uncategorized
No Comments
Sun 28 Mar 2010
Posted by Internat under Uncategorized
No Comments
Fri 26 Mar 2010
Posted by Internat under Oracle, SQL
No Comments
Rounds Timefieldhere to the nearest 5 minutes..
trunc(timefieldhere,'dd') + round(to_char(timefieldhere,'sssss') / 300) / 288)
Mon 22 Mar 2010
Trying to use sed in some stuff and i never want to have to write this kinda crap again so..
grep '^D' Filename | sed -e 's/\(^.\{43\}\)0\(.*\)/\1M\2/g'
That looks for any line in “Filename” that starts with D… then if the 44th character is 0, replace it with an M.
kgo.
grep "^D" Filename | sed -e 's/.*/&XX/'
That looks for anything in Filename and adds “XX” to the end of the line..
Another Useful link
Sun 21 Mar 2010
Posted by Internat under VBS/WSCRIPT
No Comments
For work i had to come up with a way to remap printers since our current print server is on the way out.. I was pondering at home about the best way to do this with minimal work for the service desk or for me, and this is what i came up with.. Easy way to map any old printers to new ones.. Just have to update the findnewPrinter function with the old vs new printers..
'Script to map and remove printers from old print server to new one 'Needs an entry in findNewPrinter function for each mapping 'nfrankish;2010-03-21 Set objNetwork = CreateObject("Wscript.Network") strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Function findNewPrinter(Printername) select case PrinterName case "\\OldPrintServer\OldPrinterQueue" findNewPrinter = "\\newprintserver\newprintqueue" case else wscript.echo "Printer: " & Printername & " not found" findNewPrinter = "" end select end function Set colPrinters = objWMIService.ExecQuery _ ("Select * From Win32_Printer Where Local = FALSE") For Each objPrinter in colPrinters wscript.echo "Printer: " & objprinter.Name & " Default: " & objprinter.default strNewPrinter = findNewPrinter(objprinter.name) if not (strNewPrinter = "") then objNetwork.AddWindowsPRinterConnection strNewPrinter if (objPrinter.default) then objNetwork.SetDefaultPrinter strNewPrinter end if objNetwork.RemovePrinterConnection objprinter.name, true, true end if Next