Wednesday, 1 December 2010

WSS: Developing custom form, passing and populate field by querystring

Example: Javascript example by Marc D Anderson of populating fields by querystring
http://sympmarc.com/2008/07/11/using-query-string-variables-to-populate-sharepoint-form-fields/


Code: Getting the querystring parameter using XSL
In the DVWP, you can bind a parameter to the querystring:


<ParameterBindings>
<ParameterBinding Name="ListID" Location="QueryString(ListID)" DefaultValue=""/>
ParameterBindings>
Then call the parameter in the xsl stylesheet:

<xsl:param name="ListID" />
Then you can filter the node set by the parameter:

<xsl:variable name="Rows" select="dsQueryResponse/Rows/Row[@ListID=$ListID]"/>

Resource: Understanding SharePoint's ddwrtdatabind
http://www.bryancook.net/2009/09/understanding-sharepoints-ddwrtdatabind.html

Example: Setting form fields using querystring, step by step guide to create a custom form by Mark Rackley
http://www.endusersharepoint.com/2009/11/03/setting-sharepoint-form-fields-using-query-string-variables-without-using-javascript/

Resource: ASP.NET Form Textbox Validation
http://www.asp101.com/lessons/validation.asp

Resource: Custom form Validation
http://www.4guysfromrolla.com/articles/073102-1.aspx

Code: Submit Button, set page/redirecturl after form submission
You can put any URL insde the redirect curly braces without quotes.
http://www.go4answers.com/Example/solution-controlling-redirect-url-65469.aspx

<input name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}" type="button" value="Save" />

Tuesday, 23 November 2010

Sysadmin: Using telnet to send emails, emails without clients

Open new cmd window.
Type the following:

telnet hostname portnumber e.g. telnet 10.11.11.11 25
helo
mail from: a@a.com
rcpt to: a@a.com
DATA

quit

Thursday, 11 November 2010

Sysadmin: Run Shortcuts

XP Run Command List:


To Access… Run Command
Accessibility Controls access.cpl
Accessibility Wizard accwiz
Add Hardware Wizard hdwwiz.cpl
Add/Remove Programs appwiz.cpl
Administrative Tools control admintools
Adobe Acrobat (if installed) acrobat
Adobe Designer (if installed) formdesigner
Adobe Distiller (if installed) acrodist
Adobe ImageReady (if installed) imageready
Adobe Photoshop (if installed) photoshop
Automatic Updates wuaucpl.cpl
Bluetooth Transfer Wizard fsquirt
Calculator calc
Certificate Manager certmgr.msc
Character Map charmap
Check Disk Utility chkdsk
Clipboard Viewer clipbrd
Command Prompt cmd
Component Services dcomcnfg
Computer Management compmgmt.msc
Control Panel control
Date and Time Properties timedate.cpl
DDE Shares ddeshare
Device Manager devmgmt.msc
Direct X Control Panel (if installed)* directx.cpl
Direct X Troubleshooter dxdiag
Disk Cleanup Utility cleanmgr
Disk Defragment dfrg.msc
Disk Management diskmgmt.msc
Disk Partition Manager diskpart
Display Properties control desktop
Display Properties desk.cpl
Display Properties (w/Appearance Tab Preselected) control color
Dr. Watson System Troubleshooting Utility drwtsn32
Driver Verifier Utility verifier
Event Viewer eventvwr.msc
Files and Settings Transfer Tool migwiz
File Signature Verification Tool sigverif
Findfast findfast.cpl
Firefox (if installed) firefox
Folders Properties folders
Fonts control fonts
Fonts Folder fonts
Free Cell Card Game freecell
Game Controllers joy.cpl
Group Policy Editor (XP Prof) gpedit.msc
Hearts Card Game mshearts
Help and Support helpctr
HyperTerminal hypertrm
Iexpress Wizard iexpress
Indexing Service ciadv.msc
Internet Connection Wizard icwconn1
Internet Explorer iexplore
Internet Properties inetcpl.cpl
Internet Setup Wizard inetwiz
IP Configuration (Display Connection Configuration) ipconfig /all
IP Configuration (Display DNS Cache Contents) ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents) ipconfig /flushdns
IP Configuration (Release All Connections) ipconfig /release
IP Configuration (Renew All Connections) ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS) ipconfig /registerdns
IP Configuration (Display DHCP Class ID) ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID) ipconfig /setclassid
Java Control Panel (if installed) jpicpl32.cpl
Java Control Panel (if installed) javaws
Keyboard Properties control keyboard
Local Security Settings secpol.msc
Local Users and Groups lusrmgr.msc
Logs You Out Of Windows logoff
Malicious Software Removal Tool mrt
Microsoft Access (if installed) msaccess
Microsoft Chat winchat
Microsoft Excel (if installed) excel
Microsoft Frontpage (if installed) frontpg
Microsoft Movie Maker moviemk
Microsoft Paint mspaint
Microsoft Powerpoint (if installed) powerpnt
Microsoft Word (if installed) winword
Microsoft Syncronization Tool mobsync
Minesweeper Game winmine
Mouse Properties control mouse
Mouse Properties main.cpl
Nero (if installed) nero
Netmeeting conf
Network Connections control netconnections
Network Connections ncpa.cpl
Network Setup Wizard netsetup.cpl
Notepad notepad
Nview Desktop Manager (if installed) nvtuicpl.cpl
Object Packager packager
ODBC Data Source Administrator odbccp32.cpl
On Screen Keyboard osk
Opens AC3 Filter (if installed) ac3filter.cpl
Outlook Express msimn
Paint pbrush
Password Properties password.cpl
Performance Monitor perfmon.msc
Performance Monitor perfmon
Phone and Modem Options telephon.cpl
Phone Dialer dialer
Pinball Game pinball
Power Configuration powercfg.cpl
Printers and Faxes control printers
Printers Folder printers
Private Character Editor eudcedit
Quicktime (If Installed) QuickTime.cpl
Quicktime Player (if installed) quicktimeplayer
Real Player (if installed) realplay
Regional Settings intl.cpl
Registry Editor regedit
Registry Editor regedit32
Remote Access Phonebook rasphone
Remote Desktop mstsc
Removable Storage ntmsmgr.msc
Removable Storage Operator Requests ntmsoprq.msc
Resultant Set of Policy (XP Prof) rsop.msc
Scanners and Cameras sticpl.cpl
Scheduled Tasks control schedtasks
Security Center wscui.cpl
Services services.msc
Shared Folders fsmgmt.msc
Shuts Down Windows shutdown
Sounds and Audio mmsys.cpl
Spider Solitare Card Game spider
SQL Client Configuration cliconfg
System Configuration Editor sysedit
System Configuration Utility msconfig
System File Checker Utility (Scan Immediately) sfc /scannow
System File Checker Utility (Scan Once At The Next Boot) sfc /scanonce
System File Checker Utility (Scan On Every Boot) sfc /scanboot
System File Checker Utility (Return Scan Setting To Default) sfc /revert
System File Checker Utility (Purge File Cache) sfc /purgecache
System File Checker Utility (Sets Cache Size to size x) sfc /cachesize=x
System Information msinfo32
System Properties sysdm.cpl
Task Manager taskmgr
TCP Tester tcptest
Telnet Client telnet
Tweak UI (if installed) tweakui
User Account Management nusrmgr.cpl
Utility Manager utilman
Windows Address Book wab
Windows Address Book Import Utility wabmig
Windows Backup Utility (if installed) ntbackup
Windows Explorer explorer
Windows Firewall firewall.cpl
Windows Magnifier magnify
Windows Management Infrastructure wmimgmt.msc
Windows Media Player wmplayer
Windows Messenger msmsgs
Windows Picture Import Wizard (need camera connected) wiaacmgr
Windows System Security Tool syskey
Windows Update Launches wupdmgr
Windows Version (to show which version of windows) winver
Windows XP Tour Wizard tourstart
Wordpad write

Bookmarklets: List of javascript bookmarklets

ASTEROIDS!!!
Play asteroids on any webage.

javascript:var%20s%20=%20document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0);

SPRITE ME
Generates sprite image from any website.

javascript:(function(){spritemejs=document.createElement('SCRIPT');spritemejs.type='text/javascript';spritemejs.src='http://spriteme.org/spriteme.js';document.getElementsByTagName('head')[0].appendChild(spritemejs);})();

SAML2: Resources

Liberty Alliance Project - SAML2 refresher
http://projectliberty.org/liberty/content/download/4408/29544/file/080828%20LAP%20workshop%20SAML2%20-%20V%20Ake.pdf

SAML2 resource listing
http://www.satyakomatineni.com/akc/display?url=displaynoteimpurl&ownerUserId=satya&reportId=3441

Friday, 22 October 2010

CSS: Constants

$boxstyles='background:#ccc;border-top:1px solid #eee; border-left:1px solid #eee; border-right:1px solid #aaa; border-bottom:1px solid #aaa;padding:.5em;margin:.5em 0';

h1{
$boxstyles
color:#000;
}
div#extras div {
$boxstyles
font-size:80%;
}

/* Company Colours */
$blue='#369';
$green='#363';
$lgreen='#cfc';

[…]

ul#navigation{
background:$blue;
color:#fff;
}
h1{
border-bottom:1px solid $green;
}

Outlook: Saving attachments automatically

Add into outlook rules the following VBScripts:

Sub SaveToFolder(MyMail As MailItem)
Dim strID As String
Dim objNS As Outlook.NameSpace
Dim objMail As Outlook.MailItem
Dim objAtt As Outlook.Attachment
Dim c As Integer
Dim save_name As String
'Place path to sav to on next line. Note that you must include the
'final backslash
Const save_path As String = "X:\SHARE\VCMS CSV\CSV\"

StrID = MyMail.EntryID
Set objNS = Application.GetNamespace("MAPI")
Set objMail = objNS.GetItemFromID(strID)

If objMail.Attachments.Count > 0 Then
For c = 1 To objMail.Attachments.Count
Set objAtt = objMail.Attachments(c)
Save_name = Left(objAtt.FileName, Len(objAtt.FileName) - 4)
'save_name = save_name & Format(objMail.ReceivedTime, "_mm-dd-yyyy_hhmm")
Save_name = save_name & Right(objAtt.FileName, 4)
ObjAtt.SaveAsFile save_path & save_name

Next
End If

Set objAtt = Nothing
Set objMail = Nothing
Set objNS = Nothing
End Sub

Piwik - Web analytics - Open source

Piwik - Web analytics - Open source: "Piwik is a downloadable, open source (GPL licensed) real time web analytics software program. It provides you with detailed reports on your website visitors: the search engines and keywords they used, the language they speak, your popular pages… and so much more.

Piwik aims to be an open source alternative to Google Analytics.

Piwik is a PHP MySQL software program that you download and install on your own webserver. At the end of the five minute installation process you will be given a JavaScript tag. Simply copy and paste this tag on websites you wish to track (or use an existing plugin to do it automatically for you) and access your analytics reports in real time."

Google Analytics: Tracking media and document files

Google Analytics Tracking code - jQuery to index docs, videos, zips, audios

$("a[href*='.pdf'], a[href*='.doc'], a[href*='.xls'], a[href*='.ppt']").click(function() {
pageTracker
._trackPageview('/doc/' + $(this).attr('href'));
});
$
("a[href*='.mov']").click(function() {
pageTracker
._trackPageview('/video/' + $(this).attr('href'));
});
$
("a[href*='.zip']").click(function() {
pageTracker
._trackPageview('/file/' + $(this).attr('href'));
});
$
("a[href*='.mp3']").click(function() {
pageTracker
._trackPageview('/audio/' + $(this).attr('href'));
});

Outlook: Google Calendar Sync

Download Google Calendar Sync and install on your desktop PC where you have outlook running.
After installation you can selection multiple sync options, I choose a one way sync to G-Cal.
On your Iphone goto settings > mail, contacts, calendar > accounts.
Add a new account and select Microsoft Exchange as the account type.

Email will be your gmail address.
Server is m.google.com
Domain is optional so leave it.
Fill out username and password and turn SSL on.

Once you've done this setup sync option on your phone to sync to G-Cal.