Friday, 16 January 2009
Thursday, 8 January 2009
Sysadmin: Free Busy Http Request
http://[exchange server]/public/?cmd=freebusy&start=2009-01-08T07:00:00&end=2009-01-08T17:00:00&interval=30&u=SMTP:[email address]
Output:
<a:response xmlns:a="WM">
<a:recipients>
<a:item>
<a:displayname>All Attendees</a:displayname>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
<a:item>
<a:displayname>Joe Blogs</a:displayname>
<a:email type="SMTP">jb@jb.com.au</a:email>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
</a:recipients>
</a:response>
Response results are broken into half hour timeslots from 7 AM to 5 PM.
These half hour slots return a single integer.
0 means Free
1 means Tentative
2 means Busy
3 means Out of Office
4 means Unable to find you in exchange dude!
Output:
<a:response xmlns:a="WM">
<a:recipients>
<a:item>
<a:displayname>All Attendees</a:displayname>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
<a:item>
<a:displayname>Joe Blogs</a:displayname>
<a:email type="SMTP">jb@jb.com.au</a:email>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
</a:recipients>
</a:response>
Response results are broken into half hour timeslots from 7 AM to 5 PM.
These half hour slots return a single integer.
0 means Free
1 means Tentative
2 means Busy
3 means Out of Office
4 means Unable to find you in exchange dude!
Sunday, 4 January 2009
Sysadmin: Standby System using command line
In the run window type:
%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
Monday, 1 December 2008
TSQL: How to send e-mail without using SQL Mail in SQL Server
Was looking for a way to send email out of SQL without using xp_sendmail. Came across this KB article on Microsoft's site:
http://support.microsoft.com/kb/312839
http://support.microsoft.com/kb/312839
Misc: Debugging using Filemon
After fixing this issue, somehow it reappeared and I checked everything I knew how to check and couldn't figure it out until I found a post than mentioned using Filemon to figure out where the denied access was happening, so I thought I would post how I fixed it incase other people are still having problems:
1) Download Filemon from http://www.sysinternals.com/Utilities/Filemon.html to your server. Unzip and run it.
3) Press Ctrl+L or click the "Filter" button in the menu bar (it looks like a funnel).
4) Uncheck "Log Reads" and "Log Successes" so you don't have hundreds of entries coming up every second. Click OK.
5) Press Ctrl+X or click on the "Clear" button to clear the list.
6) Try your ASP script again and voila, you should have an entry whose result is "ACCESS DENIED" in your list along with the file path and user.
7) Now you can find and right-click on the folder, go to properties->security and grant that user write permission in that directory.
In my case the folder was the "pickup" folder NOT in Intepub (as so many message boards suggest), but in Program Files->Exchsrv directory, and the user was not IUSR_COMPUTERNAME (as so many boards suggest), but NETWORK SERVICE as the exchange application pool on my server is running under the "network service" identity.
Whatever your unusual configuration, you should be able to pinpoint the problem using Filemon.
1) Download Filemon from http://www.sysinternals.com/Utilities/Filemon.html to your server. Unzip and run it.
3) Press Ctrl+L or click the "Filter" button in the menu bar (it looks like a funnel).
4) Uncheck "Log Reads" and "Log Successes" so you don't have hundreds of entries coming up every second. Click OK.
5) Press Ctrl+X or click on the "Clear" button to clear the list.
6) Try your ASP script again and voila, you should have an entry whose result is "ACCESS DENIED" in your list along with the file path and user.
7) Now you can find and right-click on the folder, go to properties->security and grant that user write permission in that directory.
In my case the folder was the "pickup" folder NOT in Intepub (as so many message boards suggest), but in Program Files->Exchsrv directory, and the user was not IUSR_COMPUTERNAME (as so many boards suggest), but NETWORK SERVICE as the exchange application pool on my server is running under the "network service" identity.
Whatever your unusual configuration, you should be able to pinpoint the problem using Filemon.
Friday, 21 November 2008
Javascript: Find query in page
A simple search for string within a webpage, similar to CTRL+F.
HTML
JavaScript
HTML
<form name="form1" onsubmit="search(document.form1, frametosearch); return false">
<input name="findthis" size="15" title="Press 'ALT s' after clicking submit to repeatedly search page" type="text">
<input class="searchbtn" value="Find" accesskey="s" type="submit">
</form>
JavaScript
/******************************************
* Find In Page Script -- Submitted/revised by Alan Koontz
* Visit Dynamic Drive (http://www.dynamicdrive.com/) for full source code
* This notice must stay intact for use
******************************************/
// revised by Alan Koontz -- May 2003
var TRange = null;
var dupeRange = null;
var TestRange = null;
var win = null;
// SELECTED BROWSER SNIFFER COMPONENTS DOCUMENTED AT
// http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var nom = navigator.appName.toLowerCase();
var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie = (agt.indexOf("msie") != -1);
var is_ie4up = (is_ie && (is_major >= 4));
var is_not_moz = (agt.indexOf('netscape')!=-1)
var is_nav = (nom.indexOf('netscape')!=-1);
var is_nav4 = (is_nav && (is_major == 4));
var is_mac = (agt.indexOf("mac")!=-1);
var is_gecko = (agt.indexOf('gecko') != -1);
var is_opera = (agt.indexOf("opera") != -1);
// GECKO REVISION
var is_rev=0
if (is_gecko) {
temp = agt.split("rv:")
is_rev = parseFloat(temp[1])
}
// USE THE FOLLOWING VARIABLE TO CONFIGURE FRAMES TO SEARCH
// (SELF OR CHILD FRAME)
// If you want to search another frame, change from "self" to
// the name of the target frame:
// e.g., var frametosearch = 'main'
//var frametosearch = 'main';
var frametosearch = self;
function search(whichform, whichframe) {
// TEST FOR IE5 FOR MAC (NO DOCUMENTATION)
if (is_ie4up && is_mac) return;
// TEST FOR NAV 6 (NO DOCUMENTATION)
if (is_gecko && (is_rev <1)) str =" whichform.findthis.value;" win =" whichframe;" frameval="false;" frameval="true;" win =" parent.frames[whichframe];" strfound="win.find(str);" strfound="win.find(str,">= 1)) {
if(frameval!=false) win.focus(); // force search in specified child frame
strFound=win.find(str, false, false, true, false, frameval, false);
// The following statement enables reversion of focus
// back to the search box after each search event
// allowing the user to press the ENTER key instead
// of clicking the search button to continue search.
// Note: tends to be buggy in Mozilla as of 1.3.1
// (see www.mozilla.org) so is excluded from users
// of that browser.
if (is_not_moz) whichform.findthis.focus();
// There are 7 arguments available:
// searchString: type string and it's the item to be searched
// caseSensitive: boolean -- is search case sensitive?
// backwards: boolean --should we also search backwards?
// wrapAround: boolean -- should we wrap the search?
// wholeWord: boolean: should we search only for whole words
// searchInFrames: boolean -- should we search in frames?
// showDialog: boolean -- should we show the Find Dialog?
}
if (is_ie4up) {
// EXPLORER-SPECIFIC CODE revised 5/21/03
if (TRange!=null) {
TestRange=win.document.body.createTextRange();
if (dupeRange.inRange(TestRange)) {
TRange.collapse(false);
strFound=TRange.findText(str);
if (strFound) {
//the following line added by Mike and Susan Keenan, 7 June 2003
win.document.body.scrollTop = win.document.body.scrollTop + TRange.offsetTop;
TRange.select();
}
}
else {
TRange=win.document.body.createTextRange();
TRange.collapse(false);
strFound=TRange.findText(str);
if (strFound) {
//the following line added by Mike and Susan Keenan, 7 June 2003
win.document.body.scrollTop = TRange.offsetTop;
TRange.select();
}
}
}
if (TRange==null || strFound==0) {
TRange=win.document.body.createTextRange();
dupeRange = TRange.duplicate();
strFound=TRange.findText(str);
if (strFound) {
//the following line added by Mike and Susan Keenan, 7 June 2003
win.document.body.scrollTop = TRange.offsetTop;
TRange.select();
}
}
}
if (!strFound) alert ("String '"+str+"' not found!") // string not found
}
Sysadmin: FTP scripts
@echo off
setlocal
::---------------------------------
:: Start Logging
::---------------------------------
set logfile="C:\_Job_Import_Export\EC\FTP Log\ECLicence.Log"
::---------------------------------
:: Setup Variables
::---------------------------------
set f=%temp%\ftpc.txt
::---------------------------------
:: Compose ftp commands file
::---------------------------------
echo open 192.168.0.1>>%f%
echo user username password>>%f%
echo binary>>%f%
echo cd _job_import_export>>%f%
echo cd "EC">>%f%
echo mput "C:\data\location\*.csv">>%f%
echo bye>>%f%
::---------------------------------
:: Execute ftp command
:: Use "-d" key for verbose output
:: Use "-i" key no interactive mode
::---------------------------------
echo ------------------------>>%logfile%
echo %date% %time% : Start FTP job>>%logfile%
echo ------------------------>>%logfile%
ftp -n -d -i -s:%f% >> %logfile%
::---------------------------------
:: Cleanup temp script
::---------------------------------
del /f /q %f%
::---------------------------------
:: %date% %time% : Backup files
::---------------------------------
L:
cd\
cd "data\location"
echo ------------------------>>%logfile%
echo %date% %time% : Backing Up Files>>%logfile%
echo ------------------------>>%logfile%
move *.csv "backups">>%logfile%
echo ------------------------>>%logfile%
echo %date% %time% : Job Completed>>%logfile%
echo ------------------------>>%logfile%
echo =-=-=-=-=-=-=-=-=-=-=-=->>%logfile%
endlocal
Javascript: getElementsByClassName
/*
Written by Jonathan Snook, http://www.snook.ca/jonathan
Add-ons by Robert Nyman, http://www.robertnyman.com
*/
function getElementsByClassName(oElm, strTagName, oClassNames){
var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
var arrRegExpClassNames = new Array();
if(typeof oClassNames == "object"){
for(var i=0; i<oClassNames.length; i++){
arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
}
}
else{
arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
}
var oElement;
var bMatchesAll;
for(var j=0; j<arrElements.length; j++){
oElement = arrElements[j];
bMatchesAll = true;
for(var k=0; k<arrRegExpClassNames.length; k++){
if(!arrRegExpClassNames[k].test(oElement.className)){
bMatchesAll = false;
break;
}
}
if(bMatchesAll){
arrReturnElements.push(oElement);
}
}
return (arrReturnElements)
}
Tuesday, 21 October 2008
Excel: View column as numbers instead of ABC
In Excel:
Tools > Options > General > R1C1 reference style
Tools > Options > General > R1C1 reference style
Google: Link to Maps
Only to pinpoint a position:
With Start and End address:
http://maps.google.com/maps?q=park+road,woolloongabbaWith Start and End address:
http://maps.google.com/maps?saddr=queen+street,brisbane&daddr=eagle+street,brisbane
Subscribe to:
Posts (Atom)