<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0em 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0em 1em;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)

<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations

----
Also see AdvancedOptions
<<importTiddlers>>
In Socialtext Unplugged, the selected pages of your Socialtext workspace are displayed as individual "tiddlers" on the page. When the mouse passes over a tiddler a short toolbar menu appears at the top right. Use the commands here to manipulate that particular tiddler: notably closing and editting it. (You can double click on a tiddler as a shortcut to directly enter edit mode).

Over on the right hand side of the window are commands that affect the entire page, in particular "close all" which can be useful to clear the decks when many tiddlers are open at once.

The user is encouraged to ensure that they can SaveChanges before embarking on widespread editing.
Welcome to Socialtext Unplugged. This is a specially designed web page that you can use to view and edit your Socialtext content without having to be online to your Socialtext server.

There are three steps to using Socialtext Unplugged:
* First, learn how to SaveChanges to your local hard drive. This keeps your work safe even if you close your browser or have to reboot your computer
* Secondly, find out how to BrowseAndEdit your content while it is unplugged
* Thirdly, when you can reconnect to your Socialtext server, you can SyncChanges to save your unplugged changes to the server so that other people can see them too

You should also check your system meets the SystemRequirements.
Socialtext Unplugged lets you browse and edit your content while you're offline. When you make a change you need to SaveChanges to save the change to your local hard drive, before later performing a SyncChanges to synchronise the change back to the server.

The procedure for SaveChanges is slightly different for different browsers:
* SavingOnInternetExplorer
* SavingOnFireFox
* SavingOnSafari
* SavingOnOpera
You can save changes with any version of FireFox, and also many other browsers in the FireFox family, such as Camino on the Mac and MiniMo on mobile devices. The procedure is:
# Click the button labelled 'save changes' over in the right hand sidebar
# If prompted with an "Internet Security" dialog as follows, click the checkbox labelled "Remember this decision" and then the "Allow" button
## "A script from "file://" is requesting enhanced capabilities that are UNSAFE and could be used to compromise your machine or data..."
# You should then see a message at the top right of the window saying "Main TiddlyWiki file saved"
If you accidentally //deny// permission instead, you may need to UnravelFireFoxPermissions.
You can save changes with Internet Explorer versions 6 and 7, but not the earlier versions. The procedure is:
# Click the button labelled 'save changes' over in the right hand sidebar
# If prompted as follows, click "Yes":
## "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?"
# You should then see a message at the top right of the window saying "Main TiddlyWiki file saved"
Note that there is currently [[a bug|http://trac.tiddlywiki.org/tiddlywiki/ticket/39]] that prevents Internet Explorer from saving correctly if you have specified a backup directory in AdvancedOptions.
To SaveChanges on Opera, see the instructions for using the TiddlySaver Java applet.
To SaveChanges on Safari, see the instructions for using the TiddlySaver Java applet.
<<search>><<closeAll>><<permaview>><<newTiddler 'New Tiddler' fields:'server.host:"https://saturn.ffzg.hr%2C%20saturn.ffzg.hr:443" server.workspace:"rot13" wikiformat:socialtext'>><<newJournal 'DD MMM YYYY' fields:'server.host:"https://saturn.ffzg.hr%2C%20saturn.ffzg.hr:443" server.workspace:"rot13" wikiformat:socialtext'>><<saveChanges>><<backstage sync>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
Dobrica Pavlinušić's random unstructured stuff
Socialtext Unplugged
https://saturn.ffzg.hr/rot13/
[[SocialtextScreenStyle]]
[[SocialtextStyleOverrides]]
[[Styles HorizontalMainMenu]]
<<sync>>
@@The user interface for synchronization is not finalized@@
To synchronize your changes back to the Socialtext server:
# click on [[Sync]] in the right-hand sidebar
<<tabs txtMoreTab Orphans 'Orphaned tiddlers' TabMoreOrphans Shadowed 'Shadowed tiddlers' TabMoreShadowed>>
Under FireFox, you can run into problems if you accidentally click 'Deny' on the permission request dialog, and have selected //Remember this decision//.

To reverse the effects, first locate the file {{{prefs.js}}} in your FireFox profile directory. Under Windows you'll find it at something like {{{C:\Documents and Settings\Jeremy\Application Data\Mozilla\Firefox\Profiles\o3dhupu6.default\prefs.js}}}, where {{{Jeremy}}} is the name of your windows profile and {{{o3dhupu6}}} will be a similar string of gobbledegook. On the Mac it'll be at {{{~/Library/Application Support/Firefox/Profiles/o3dhupu6.default/prefs.js}}} and on most versions of Linux, at {{{~/.mozilla/firefox/o3dhupu6.default/prefs.js}}}.

Open the file in a text editor and find the line {{{user_pref("capability.principal.codebase.p0.denied", "UniversalXPConnect");}}} and simply replace the word {{{denied}}} with {{{granted}}}.
//(Thanks to JonScully for figuring out this fix)//
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler references > fields syncing jump'></div>
<div class='workspace' id='st-page-wiki-title' macro='view socialtext.workspace'></div>
<div class='title' id='st-page-titletext' macro='view title'></div>
<div class='subtitle'>
Created on <span macro='view created date [[MMM DD, 0hh:0mm]]'></span>.
Updated by <span macro='view modifier link'></span>
on <span macro='view modified date [[MMM DD, 0hh:0mm]]'></span></div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></span></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
/***
To use, add {{{[[Styles HorizontalMainMenu]]}}} to your StyleSheet tiddler.
See http://www.w3schools.com/css/css_colors.asp for a color chart.
***/
/*{{{*/
#mainMenu {position:relative;left:auto;width:auto;text-align:left;line-height:normal;padding 0em 1em 0em 1em;font-size:normal;}
#mainMenu br {display:none;}
#mainMenu {background:#336699;}
#mainMenu {padding:2px;}
#mainMenu .button, #mainMenu .tiddlyLink {padding-left:0.5em;padding-right:0.5em;color:white;font-size:115%;}

#displayArea {
	margin-top:0;margin-right:20em;margin-bottom:0;margin-left:1em;
	padding-top:.1em;padding-bottom:.1em;
}
/*}}}*/
|''Type:''|socialtext|
|''URL:''|https://saturn.ffzg.hr%2C%20saturn.ffzg.hr:443 |
|''Workspace:''|rot13|
|''WorkspaceList:''||
|''Description:''|Dobrica Pavlinušić's random unstructured stuff|
The TiddlySaver Java applet allows TiddlyWiki from a {{{file://}}} URL to save changes Safari, Opera and other browsers.

It is a small file named [["TiddlySaver.jar"|TiddlySaver.jar]] that must be placed in the same directory as your TiddlyWiki file. Before you can use it, you need to give it the necessary privileges by editting your {{{.java.policy}}} file.

For Windows, the file will be at {{{C:\Documents and Settings\your-user-name\.java.policy}}}. Add the following lines (substituting the directory of your TiddlyWiki file as appropriate):
{{{
grant codeBase "file:${user.home}/My Documents/tiddlywiki-folder/*" {
  permission java.io.FilePermission "${user.home}${/}My Documents${/}tiddlywiki-folder${/}*", "read,write";
};
}}}
On Mac OS X, the file is found at {{{/Users/your-user-name/.java.policy}}}:
{{{
grant codeBase "file:${user.home}/Documents/tiddlywiki-folder/*" {
  permission java.io.FilePermission "${user.home}${/}Documents${/}tiddlywiki-folder${/}*", "read,write";
};
}}}
It can be tricky creating files whose name starts with a period, so you can use this [[pre-built .java.policy file|.java.policy]]. The same file is suitable for Macs too, just edit it and delete the "My " bit, leaving just "Documents". Make sure you save it in the right place for each operating system!

If you have trouble setting up the permissions correctly, you can try granting broader permissions to the applet like this:

{{{
grant codeBase "file://localhost/home/users/Desktop/
TiddlySaver.jar"
 { permission java.security.AllPermission; };
}}}

Note that there is currently [[a bug|http://trac.tiddlywiki.org/ticket/172]] that prevents TiddlySaver from working if you have specified a backup directory in AdvancedOptions.
/***
|''Name:''|SocialtextLocaleOverrides|
|''Description:''|Text changes for Socialtext|
***/

//{{{
merge(config.views.wikified.tag,{
	labelNoTags: "No Tags",
	labelTags: "Tags"});

merge(config.commands.references,{
	text: "incoming links",
	tooltip: "Show tiddlers that link to this one",
	popupNone: "No incoming links"});
//}}}
/***
|''Name:''|SocialtextTweaksPlugin|
|''Description:''|Allows changes to be synchronised with a Socialtext server|
|''Source:''|http://stunplugged.tiddlywiki.com/#SocialtextTweaksPlugin|
|''Author:''|JeremyRuston (jeremy (at) osmosoft (dot) com)|
|''Version:''|1.0.2|
|''Date:''|Jun 15, 2006|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.2|

Make minor configuration tweaks specific to Socialtext Unplugged
***/

//{{{
// Ensure that the SocialtextTweaksPlugin is only installed once.
if(!version.extensions.SocialtextTweaksPlugin) {
version.extensions.SocialtextTweaksPlugin = {installed:true};
// Check version number of core code
if(version.major < 2 || (version.major == 2 && version.minor < 2))
	{alertAndThrow("SocialtextTweaksPlugin requires TiddlyWiki 2.2 or later.");}

merge(config.defaultCustomFields,{
	wikiformat:'socialtext',
	'server.host':'https://saturn.ffzg.hr%2C%20saturn.ffzg.hr:443'
});

config.options.chkSinglePageMode = true;
config.options.chkEnableAnimations = true;

} // end of "install only once"
//}}}
/***
|''Name:''|SocialtextFormatterPlugin|
|''Description:''|Allows Tiddlers to use [[Socialtext|http://www.socialtext.com/]] text formatting|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''Source:''|http://www.martinswiki.com/#SocialtextFormatterPlugin|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/formatters/SocialtextFormatterPlugin.js|
|''Version:''|0.9.4|
|''Date:''|Jan 21, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.1.0|

This is the SocialtextFormatterPlugin, which allows you to insert Socialtext formated text into a TiddlyWiki.

The aim is not to fully emulate Socialtext, but to allow you to work with Socialtext content off-line and then resync the content with your Socialtext wiki later on, with the expectation that only minor edits will be required.

To use Socialtext format in a Tiddler, tag the Tiddler with SocialtextFormat or set the tiddler's {{{wikiformat}}} extended field to {{{socialtext}}}

Please report any defects you find at http://groups.google.co.uk/group/TiddlyWikiDev
***/

//{{{
// Ensure that the SocialtextFormatter Plugin is only installed once.
if(!version.extensions.SocialtextFormatterPlugin) {
version.extensions.SocialtextFormatterPlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 1))
	{alertAndThrow('SocialtextFormatterPlugin requires TiddlyWiki 2.1 or later.');}

SocialtextFormatter = {}; // 'namespace' for local functions

wikify = function(source,output,highlightRegExp,tiddler)
{
	if(source && source != '') {
		var w = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
		var out = output;
		if(tiddler && (tiddler.isTagged(config.parsers.socialtextFormatter.formatTag) || (tiddler.fields.wikiformat==config.parsers.socialtextFormatter.format)) ) {
			var d1 = createTiddlyElement(output,'div','content-display-body','content-section-visible');
			var d2 = createTiddlyElement(d1,'div','wikipage');
			out = createTiddlyElement(d2,'div',null,'wiki');
		}
		var time1,time0 = new Date();
		w.subWikifyUnterm(out);
		if(tiddler && config.options.chkDisplayInstrumentation) {
			time1 = new Date();
			var t = tiddler ? tiddler.title : source.substr(0,10);
			displayMessage("Wikify '"+t+"' in " + (time1-time0) + " ms");
		}
	}
};

stDebug = function(out,str)
{
	createTiddlyText(out,str.replace(/\n/mg,'\\n').replace(/\r/mg,'RR'));
	createTiddlyElement(out,'br');
};

SocialtextFormatter.Tiddler_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
	if((this.fields.wikiformat==config.parsers.socialtextFormatter.format) || this.isTagged(config.parsers.socialtextFormatter.formatTag)) {
		// update the links array, by checking for Socialtext format links
		this.links = [];
		var tiddlerLinkRegExp = /(?:\"(.*?)\" ?)?\[([^\]]*?)\]/mg;
		tiddlerLinkRegExp.lastIndex = 0;
		var match = tiddlerLinkRegExp.exec(this.text);
		while(match) {
			var link = match[2];
			this.links.pushUnique(link);
			match = tiddlerLinkRegExp.exec(this.text);
		}
	}/* else {
		return SocialtextFormatter.Tiddler_changed.apply(this,arguments);
	}*/
	this.linksUpdated = true;
};

SocialtextFormatter.wafl = function(w)
{
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var lm2 = lookaheadMatch[2];
		switch(lookaheadMatch[1]) {
		case 'image':
			var img = createTiddlyElement(w.output,'img');
			img.src = w.tiddler.title + '/' + lm2;
			createTiddlyText(img,lm2);
			break;
		case 'file':
			var s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			var a = createTiddlyElement(s,'a');
			a.href = w.tiddler.title + '/' + lm2;
			createTiddlyText(a,lm2);
			break;
		case 'link':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createTiddlyElement(s,'a');
			var t = w.tiddler ? w.tiddler.title + ':' : '';
			a.setAttribute('href','#' + t + lm2);
			a.title = 'section link';
			createTiddlyText(a,lm2);
			break;
		case 'weblog':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			var text = lm2;
			var link = 'Weblog: ' + lm2;
			createTiddlyText(createTiddlyLink(s,link,false,null,w.isStatic),text);
			break;
		case 'section':
			a = createTiddlyElement(w.output,'a');// drop anchor
			t = w.tiddler ? w.tiddler.title + ':' : '';
			a.setAttribute('name',t + lm2);
			break;
		case 'date':
			createTiddlyText(w.output,lm2);
			break;
		case 'user':
			var oldSource = w.source;
			w.source = lm2;
			w.nextMatch = 0;
			w.subWikifyUnterm(w.output);
			w.source = oldSource;
			break;
// Shortcut expansions - not strictly syntax
		case 'google':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'http://www.google.com/search?q='+lm2);
			createTiddlyText(a,lm2);
			break;
		case 'fedex':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'http://www.fedex.com/Tracking?tracknumbers='+lm2);
			createTiddlyText(a,lm2);
			break;
		case 'map':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'http://maps.google.com/maps?q='+lm2);
			createTiddlyText(a,lm2);
			break;
		case 'wikipedia':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'http://en.wikipedia.org/wiki/'+lm2);
			createTiddlyText(a,lm2);
			break;
		case 'rt':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'http://rt.socialtext.net/Ticket/Display.html?id='+lm2);
			createTiddlyText(a,lm2);
			break;
		case 'stcal':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'https://calendar.socialtext.net:445/view_t.php?timeb=1&id=3&date='+lm2);
			createTiddlyText(a,lm2);
			break;
		case 'svn':
			s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
			a = createExternalLink(s,'https://repo.socialtext.net/listing.php?rev='+lm2+'sc=1');
			createTiddlyText(a,lm2);
			break;
		default:
			w.outputText(w.output,w.matchStart,w.nextMatch);
			return;
		}
		w.nextMatch = this.lookaheadRegExp.lastIndex;
	} else {
		w.outputText(w.output,w.matchStart,w.nextMatch);
	}
};

SocialtextFormatter.presence = function(w)
{
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var p = lookaheadMatch[1];
		var text = lookaheadMatch[2];
		var link;
		var src;
		if(p=='aim') {
			link = 'aim:goim?screenname=' + text + '&message=hello';
			src = 'http://big.oscar.aol.com/sleepleft?on_url=http://www.aim.com/remote/gr/MNB_online.gif&amp;off_url=http://www.aim.com/remote/gr/MNB_offline.gif';
		} else if(p=='yahoo'||p=='ymsgr') {
			link = 'ymsgr:sendIM?'+text;
			src = 'http://opi.yahoo.com/online?u=chrislondonbridge&f=.gif';
		} else if(p=='skype'||p=='callto') {
			link = 'callto:'+text;
			src = 'http://goodies.skype.com/graphics/skypeme_btn_small_green.gif';
		} else if(p=='asap') {
			link = 'http://asap2.convoq.com/AsapLinks/Meet.aspx?l='+text;
			src = 'http://asap2.convoq.com/AsapLinks/Presence.aspx?l='+text;
		}
		var s = createTiddlyElement(w.output,'span',null,'nlw_phrase');
		var a = createExternalLink(s,link);
		var img = createTiddlyElement(a,'img');
		createTiddlyText(a,text);
		img.src = src;
		img.border='0';
		img.alt = '(' + lookaheadMatch[1] + ')';
		if(p=='aim') {
			img.width='11'; img.height='13';
		}
		w.nextMatch = this.lookaheadRegExp.lastIndex;
	}
};

config.formatterHelpers.singleCharFormat = function(w)
{
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[0].substr(lookaheadMatch[0].length-2,1) != ' ') {
		w.subWikifyTerm(createTiddlyElement(w.output,this.element),this.termRegExp);
	} else {
		w.outputText(w.output,w.matchStart,w.nextMatch);
	}
};

config.socialtext = {};
config.socialtext.formatters = [
{
	name: 'socialtextHeading',
	match: '^\\^{1,6} ?',
	termRegExp: /(\n+)/mg,
	handler: function(w)
	{
		var len = w.matchText.trim().length;
		var e = createTiddlyElement(w.output,'h' + len);
		var a = createTiddlyElement(e,'a');// drop anchor
		var t = w.tiddler ? w.tiddler.title + ':' : '';
		len = w.source.substr(w.nextMatch).indexOf('\n');
		a.setAttribute('name',t+w.source.substr(w.nextMatch,len));
		w.subWikifyTerm(e,this.termRegExp);
	}
},

{
	name: 'socialtextTable',
	match: '^\\|(?:(?:.|\n)*)\\|$',
	lookaheadRegExp: /^\|(?:(?:.|\n)*)\|$/mg,
	cellRegExp: /(?:\|(?:[^\|]*)\|)(\n|$)?/mg,
	cellTermRegExp: /((?:\x20*)\|)/mg,
	handler: function(w)
	{
		var table = createTiddlyElement(w.output,'table');
		var rowContainer = createTiddlyElement(table,'tbody');
		var prevColumns = [];
		w.nextMatch = w.matchStart;
		this.lookaheadRegExp.lastIndex = w.nextMatch;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
			var r = this.rowHandler(w,createTiddlyElement(rowContainer,'tr'),prevColumns);
			if(!r) {
				w.nextMatch++;
				break;
			}
			this.lookaheadRegExp.lastIndex = w.nextMatch;
			lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		}
	},
	rowHandler: function(w,e,prevColumns)
	{
		this.cellRegExp.lastIndex = w.nextMatch;
		var cellMatch = this.cellRegExp.exec(w.source);
		while(cellMatch && cellMatch.index == w.nextMatch) {
			w.nextMatch++;
			var cell = createTiddlyElement(e,'td');
			w.subWikifyTerm(cell,this.cellTermRegExp);
			if(cellMatch[1]) {
				// End of row
				w.nextMatch = this.cellRegExp.lastIndex;
				return true;
			}
			// Cell
			w.nextMatch--;
			this.cellRegExp.lastIndex = w.nextMatch;
			cellMatch = this.cellRegExp.exec(w.source);
		}
		return false;
	}
},

{
	name: 'socialtextList',
	match: '^[\\*#]+ ',
	lookaheadRegExp: /^([\*#])+ /mg,
	termRegExp: /(\n+)/mg,
	handler: function(w)
	{
		var stack = [w.output];
		var currLevel = 0, currType = null;
		var itemType = 'li';
		w.nextMatch = w.matchStart;
		this.lookaheadRegExp.lastIndex = w.nextMatch;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
			var listType = lookaheadMatch[1] == '*' ? 'ul' : 'ol';
			var listLevel = lookaheadMatch[0].length;
			w.nextMatch += listLevel;
			if(listLevel > currLevel) {
				for(var i=currLevel; i<listLevel; i++) {
					stack.push(createTiddlyElement(stack[stack.length-1],listType));
				}
			} else if(listLevel < currLevel) {
				for(i=currLevel; i>listLevel; i--) {
					stack.pop();
				}
			} else if(listLevel == currLevel && listType != currType) {
				stack.pop();
				stack.push(createTiddlyElement(stack[stack.length-1],listType));
			}
			currLevel = listLevel;
			currType = listType;
			var e = createTiddlyElement(stack[stack.length-1],itemType);
			w.subWikifyTerm(e,this.termRegExp);
			this.lookaheadRegExp.lastIndex = w.nextMatch;
			lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		}
	}
},

{
	name: 'socialtextQuoteByLine',
	match: '^>+',
	lookaheadRegExp: /^>+/mg,
	termRegExp: /(\n)/mg,
	element: 'blockquote',
	handler: function(w)
	{
		var stack = [w.output];
		var currLevel = 0;
		var newLevel = w.matchLength;
		var i;
		do {
			if(newLevel > currLevel) {
				for(i=currLevel; i<newLevel; i++) {
					stack.push(createTiddlyElement(stack[stack.length-1],this.element));
				}
			} else if(newLevel < currLevel) {
				for(i=currLevel; i>newLevel; i--) {
					stack.pop();
				}
			}
			currLevel = newLevel;
			w.subWikifyTerm(stack[stack.length-1],this.termRegExp);
			createTiddlyElement(stack[stack.length-1],'br');
			this.lookaheadRegExp.lastIndex = w.nextMatch;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			var matched = lookaheadMatch && lookaheadMatch.index == w.nextMatch;
			if(matched) {
				newLevel = lookaheadMatch[0].length;
				w.nextMatch += newLevel;
			}
		} while(matched);
	}
},

{
	name: 'socialtextRule',
	match: '^----+$\\n+',
	handler: function(w)
	{
		createTiddlyElement(w.output,'hr');
	}
},

{
	name: 'socialtextPreformatted',
	match: '^\\.pre\\s*\\n',
	lookaheadRegExp: /^.pre\s*\n((?:.|\n)*?)\n.pre\s*\n/mg,
	element: 'pre',
	handler: config.formatterHelpers.enclosedTextHelper
},

{
	name: 'socialtextHtml',
	match: '^\\.html',
	lookaheadRegExp: /\.html((?:.|\n)*?)\.html/mg,
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			createTiddlyElement(w.output,'span').innerHTML = lookaheadMatch[1];
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
},

{
	name: 'macro',
	match: '<<',
	lookaheadRegExp: /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*)>>/mg,
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[1]) {
			w.nextMatch = this.lookaheadRegExp.lastIndex;
			invokeMacro(w.output,lookaheadMatch[1],lookaheadMatch[2],w,w.tiddler);
		}
	}
},

{
	name: 'socialtextExplicitLink',
	match: '(?:".*?" ?)?\\[',
	lookaheadRegExp: /(?:\"(.*?)\" ?)?\[([^\]]*?)\]/mg,
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var link = lookaheadMatch[2];
			var text = lookaheadMatch[1] ? lookaheadMatch[1] : link;
			createTiddlyText(createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler),text);
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
},

{
	name: 'socialtextExternalLink',
	match: '(?:".*?" ?)?<[a-z]{2,8}:',
	lookaheadRegExp: /(?:\"(.*?)\" ?)?<([a-z]{2,8}:.*?)>/mg,
	imgRegExp: /\.(?:gif|ico|jpg|png)/g,
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var link = lookaheadMatch[2];
			var text = lookaheadMatch[1] ? lookaheadMatch[1] : link;
			this.imgRegExp.lastIndex = 0;
			if(this.imgRegExp.exec(link)) {
				var img = createTiddlyElement(w.output,'img');
				if(lookaheadMatch[1]) {
					img.title = text;
				}
				img.alt = text;
				img.src = link;
			} else {
				createTiddlyText(createExternalLink(w.output,link),text);
			}
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
},

{
	name: 'socialtextUrlLink',
	match: config.textPrimitives.urlPattern,
	handler: function(w)
	{
		w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch);
	}
},

{
	name: 'socialtextBold',
	match: '\\*(?![\\s\\*])',
	lookaheadRegExp: /\*(?!\s)(?:.*?)(?!\s)\*(?=[$\s\|\._\-,])/mg,
	termRegExp: /((?!\s)\*(?=[$\s\|\.\-_,]))/mg,
	element: 'strong',
	handler: config.formatterHelpers.singleCharFormat
},

{
	name: 'socialtextItalic',
	match: '_(?![\\s_])',
	lookaheadRegExp: /_(?!\s)(?:.*?)(?!\s)_(?=[$\s\|\.\*\-,])/mg,
	termRegExp: /((?!\s)_(?=[$\s\|\.\*\-,]))/mg,
	element: 'em',
	handler: config.formatterHelpers.singleCharFormat
},

{
	name: 'socialtextStrike',
	match: '-(?![\\s\\-])',
	lookaheadRegExp: /-(?!\s)(?:.*?)(?!\s)-(?=[$\s\|\.\*_,])/mg,
	termRegExp: /((?!\s)-(?=[$\s\|\.\*_,]))/mg,
	element: 'del',
	handler: config.formatterHelpers.singleCharFormat
},

{
	name: 'socialtextMonoSpaced',
	match: '`(?![\\s`])',
	lookaheadRegExp: /`(?!\s)(?:.*?)(?!\s)`(?=[$\s\.\*\-_,])/mg,
	termRegExp: /((?!\s)`(?=[$\s\.\*\-_,]))/mg,
	element: 'tt',
	handler: config.formatterHelpers.singleCharFormat
},

{
	name: 'socialtextParagraph',
	match: '\\n{2,}',
	handler: function(w)
	{
		createTiddlyElement(w.output,'p');
	}
},

{
	name: 'socialtextLineBreak',
	match: '\\n',
	handler: function(w)
	{
		createTiddlyElement(w.output,'br');
	}
},

{
	name: 'socialtextNoWiki',
	match: '\\{\\{',
	lookaheadRegExp: /\{\{((?:.|\n)*?)\}\}/mg,
	element: 'span',
	handler: config.formatterHelpers.enclosedTextHelper
},

{
	name: 'socialtextTrademark',
	match: '\\{tm\\}',
	handler: function(w)
	{
		createTiddlyElement(w.output,'span').innerHTML = '&trade;';
	}
},

{
	name: 'socialtextWafl',
	match: '\\{(?:[a-z]{2,16}): ?.*?\\}',
	lookaheadRegExp: /\{([a-z]{2,16}): ?(.*?)\}/mg,
	handler: SocialtextFormatter.wafl
},

{
	name: 'socialtextPresence',
	match: '(?:aim|yahoo|ymsgr|skype|callto|asap):\\w+',
	lookaheadRegExp: /(aim|yahoo|ymsgr|skype|callto|asap):(\w+)/mg,
	handler: SocialtextFormatter.presence
},

{
	name: 'socialtextMailTo',
	match: '[\\w\.]+@[\\w]+\.[\\w\.]+',
	lookaheadRegExp: /([\w\.]+@[\w]+\.[\w\.]+)/mg,
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var text = lookaheadMatch[1];
			createTiddlyText(createExternalLink(w.output,'mailto:'+text),text);
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
},

{
	name: 'socialtextHtmlEntitiesEncoding',
	match: '&#?[a-zA-Z0-9]{2,8};',
	handler: function(w)
	{
		createTiddlyElement(w.output,'span').innerHTML = w.matchText;
	}
}
];

config.parsers.socialtextFormatter = new Formatter(config.socialtext.formatters);
config.parsers.socialtextFormatter.format = 'socialtext';
config.parsers.socialtextFormatter.formatTag = 'SocialtextFormat';

} // end of 'install only once'
//}}}
/***
|''Name:''|SocialtextAdaptorPlugin|
|''Description:''|Adaptor for moving and converting data to and from Socialtext Wikis|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com) and JeremyRuston (jeremy (at) osmosoft (dot) com)|
|''Source:''|http://www.martinswiki.com/#SocialtextAdaptorPlugin|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/SocialtextAdaptorPlugin.js|
|''Version:''|0.5.1|
|''Date:''|Feb 25, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|

Socialtext REST documentation is at:
http://www.eu.socialtext.net/st-rest-docs/index.cgi?socialtext_rest_documentation

***/

//{{{
if(!version.extensions.SocialtextAdaptorPlugin) {
version.extensions.SocialtextAdaptorPlugin = {installed:true};

function SocialtextAdaptor()
{
	this.host = null;
	this.workspace = null;
	return this;
}

SocialtextAdaptor.mimeType = 'text/x.socialtext-wiki';
SocialtextAdaptor.serverType = 'socialtext';
SocialtextAdaptor.serverParsingErrorMessage = "Error parsing result from server";
SocialtextAdaptor.errorInFunctionMessage = "Error in function SocialtextAdaptor.%0";

SocialtextAdaptor.prototype.setContext = function(context,userParams,callback)
{
	if(!context) context = {};
	context.userParams = userParams;
	if(callback) context.callback = callback;
	context.adaptor = this;
	if(!context.host)
		context.host = this.host;
	if(!context.workspace && this.workspace)
		context.workspace = this.workspace;
	return context;
};

SocialtextAdaptor.doHttpGET = function(uri,callback,params,headers,data,contentType,username,password)
{
	return doHttp('GET',uri,data,contentType,username,password,callback,params,headers);
};

SocialtextAdaptor.doHttpPOST = function(uri,callback,params,headers,data,contentType,username,password)
{
	return doHttp('POST',uri,data,contentType,username,password,callback,params,headers);
};

SocialtextAdaptor.fullHostName = function(host)
{
	if(!host)
		return '';
	if(!host.match(/:\/\//))
		host = 'http://' + host;
	if(host.substr(host.length-1) != '/')
		host = host + '/';
	return host;
};

SocialtextAdaptor.minHostName = function(host)
{
	return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : '';
};

// Convert a page title to the normalized form used in uris
SocialtextAdaptor.normalizedTitle = function(title)
{
	var n = title.toLowerCase();
	n = n.replace(/\s/g,'_').replace(/\//g,'_').replace(/\./g,'_').replace(/:/g,'').replace(/\?/g,'');
	if(n.charAt(0)=='_')
		n = n.substr(1);
	return String(n);
};

// Convert a Socialtext date in YYYY-MM-DD hh:mm format into a JavaScript Date object
SocialtextAdaptor.dateFromEditTime = function(editTime)
{
	var dt = editTime;
	return new Date(Date.UTC(dt.substr(0,4),dt.substr(5,2)-1,dt.substr(8,2),dt.substr(11,2),dt.substr(14,2)));
};

SocialtextAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
	this.host = SocialtextAdaptor.fullHostName(host);
	context = this.setContext(context,userParams,callback);
	if(context.callback) {
		context.status = true;
		window.setTimeout(function() {callback(context,userParams);},0);
	}
	return true;
};

SocialtextAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
	this.workspace = workspace;
	context = this.setContext(context,userParams,callback);
	if(context.callback) {
		context.status = true;
		window.setTimeout(function() {callback(context,userParams);},0);
	}
	return true;
};


SocialtextAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
	context = this.setContext(context,userParams,callback);
	var uriTemplate = '%0data/workspaces';
	var uri = uriTemplate.format([context.host]);
	var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getWorkspaceListCallback,context,{'accept':'application/json'});
	return typeof req == 'string' ? req : true;
};

SocialtextAdaptor.getWorkspaceListCallback = function(status,context,responseText,uri,xhr)
{
	context.status = false;
	context.statusText = SocialtextAdaptor.errorInFunctionMessage.format(['getWorkspaceListCallback']);
	if(status) {
		try {
			eval('var info=' + responseText);
		} catch (ex) {
			context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
			if(context.callback)
				context.callback(context,context.userParams);
			return;
		}
		var list = [];
		for(var i=0; i<info.length; i++) {
			var item = {
				title:info[i].title,
				name:info[i].name,
				modified:SocialtextAdaptor.dateFromEditTime(info[i].modified_time)
				};
			list.push(item);
		}
		context.workspaces = list;
		context.status = true;
	} else {
		context.statusText = xhr.statusText;
	}
	if(context.callback)
		context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.getTiddlerList = function(context,userParams,callback)
{
	context = this.setContext(context,userParams,callback);
	var uriTemplate = '%0data/workspaces/%1/pages?order=newest';//!! ? or ;
	var uri = uriTemplate.format([context.host,context.workspace]);
	var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerListCallback,context,{'accept':'application/json'});
	return typeof req == 'string' ? req : true;
};


SocialtextAdaptor.getTiddlerListCallback = function(status,context,responseText,uri,xhr)
{
	context.status = false;
	context.statusText = SocialtextAdaptor.errorInFunctionMessage.format(['getTiddlerListCallback']);
	if(status) {
		try {
			eval('var info=' + responseText);
		} catch (ex) {
			context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
			if(context.callback)
				context.callback(context,context.userParams);
			return;
		}
		var list = [];
		for(var i=0; i<info.length; i++) {
			var tiddler = new Tiddler(info[i].name);
			tiddler.modified = SocialtextAdaptor.dateFromEditTime(info[i].last_edit_time);
			tiddler.modifier = info[i].last_editor;
			tiddler.tags = info[i].tags;
			tiddler.fields['server.page.id'] = info[i].page_id;
			tiddler.fields['server.page.name'] = info[i].name;
			tiddler.fields['server.page.revision'] = String(info[i].revision_id);
			list.push(tiddler);
		}
		context.tiddlers = list;
		context.status = true;
	} else {
		context.statusText = xhr.statusText;
	}
	if(context.callback)
		context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
	var info = {};
	var host = this && this.host ? this.host : SocialtextAdaptor.fullHostName(tiddler.fields['server.host']);
	var workspace = this && this.workspace ? this.workspace : tiddler.fields['server.workspace'];
	uriTemplate = '%0%1/index.cgi?%2';
	info.uri = uriTemplate.format([host,workspace,SocialtextAdaptor.normalizedTitle(tiddler.title)]);
	return info;
};

SocialtextAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
	return this.getTiddlerRevision(title,null,context,userParams,callback);
};

SocialtextAdaptor.prototype.getTiddlerRevision = function(title,revision,context,userParams,callback)
{
	context = this.setContext(context,userParams,callback);

	// request the page in json format to get the page attributes
	if(revision) {
		var uriTemplate = '%0data/workspaces/%1/pages/%2/revisions/%3';
		context.revision = revision;
	} else {
		uriTemplate = '%0data/workspaces/%1/pages/%2';
		context.revision = null;
	}
	uri = uriTemplate.format([context.host,context.workspace,SocialtextAdaptor.normalizedTitle(title),revision]);

	context.tiddler = new Tiddler(title);
	context.tiddler.fields.wikiformat = 'socialtext';
	context.tiddler.fields['server.host'] = SocialtextAdaptor.minHostName(context.host);
	context.tiddler.fields['server.workspace'] = context.workspace;
	var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerCallback,context,{'accept':'application/json'});
	return typeof req == 'string' ? req : true;
};


SocialtextAdaptor.getTiddlerCallback = function(status,context,responseText,uri,xhr)
{
	context.status = false;
	context.statusText = SocialtextAdaptor.errorInFunctionMessage.format(['getTiddlerCallback']);
	if(status) {
		try {
			eval('var info=' + responseText);
			context.tiddler.tags = info.tags;
			context.tiddler.fields['server.page.id'] = info.page_id;
			context.tiddler.fields['server.page.name'] = info.name;
			context.tiddler.fields['server.page.revision'] = String(info.revision_id);
			context.tiddler.modifier = info.last_editor;
			context.tiddler.modified = SocialtextAdaptor.dateFromEditTime(info.last_edit_time);
		} catch (ex) {
			context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
			if(context.callback)
				context.callback(context,context.userParams);
			return;
		}
		context.status = true;
	} else {
		context.statusText = xhr.statusText;
		if(context.callback)
			context.callback(context,context.userParams);
		return;
	}
	var uriTemplate = context.revision ? '%0data/workspaces/%1/pages/%2/revisions/%3' : '%0data/workspaces/%1/pages/%2';
	var host = SocialtextAdaptor.fullHostName(context.tiddler.fields['server.host']);
	var workspace = context.workspace ? context.workspace : context.tiddler.fields['server.workspace'];
	uri = uriTemplate.format([host,workspace,SocialtextAdaptor.normalizedTitle(context.tiddler.title),context.revision]);
	var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerCallback2,context,{'accept':SocialtextAdaptor.mimeType});
};

SocialtextAdaptor.getTiddlerCallback2 = function(status,context,responseText,uri,xhr)
{
	context.tiddler.text = responseText;
	if(status) {
		context.status = true;
	} else {
		context.status = false;
		context.statusText = xhr.statusText;
	}
	if(context.callback)
		context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.getTiddlerRevisionList = function(title,limit,context,userParams,callback)
{
	context = this.setContext(context,userParams,callback);

	var uriTemplate = '%0data/workspaces/%1/pages/%2/revisions?accept=application/json';
	if(!limit)
		limit = 5;
	var uri = uriTemplate.format([context.host,context.workspace,SocialtextAdaptor.normalizedTitle(title),limit]);

	var req = SocialtextAdaptor.doHttpGET(uri,SocialtextAdaptor.getTiddlerRevisionListCallback,context);
	return typeof req == 'string' ? req : true;
};

SocialtextAdaptor.getTiddlerRevisionListCallback = function(status,context,responseText,uri,xhr)
{
	context.status = false;
	if(status) {
		var content = null;
		try {
			eval('var info=' + responseText);
		} catch (ex) {
			context.statusText = exceptionText(ex,SocialtextAdaptor.serverParsingErrorMessage);
			if(context.callback)
				context.callback(context,context.userParams);
			return;
		}
		list = [];
		for(var i=0; i<info.length; i++) {
			var tiddler = new Tiddler(info[i].name);
			tiddler.modified = SocialtextAdaptor.dateFromEditTime(info[i].last_edit_time);
			tiddler.modifier = info[i].last_editor;
			tiddler.tags = info[i].tags;
			tiddler.fields['server.page.id'] = info[i].page_id;
			tiddler.fields['server.page.name'] = info[i].name;
			tiddler.fields['server.page.revision'] = info[i].revision_id;
			list.push(tiddler);
		}
		var sortField = 'server.page.revision';
		list.sort(function(a,b) {return a.fields[sortField] < b.fields[sortField] ? +1 : (a.fields[sortField] == b.fields[sortField] ? 0 : -1);});
		context.revisions = list;
		context.status = true;
	} else {
		context.statusText = xhr.statusText;
	}
	if(context.callback)
		context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.putTiddler = function(tiddler,context,userParams,callback)
{
	context = this.setContext(context,userParams,callback);
	context.tiddler = tiddler;
	context.title = tiddler.title;
	var uriTemplate = '%0data/workspaces/%1/pages/%2';
	var host = context.host ? context.host : SocialtextAdaptor.fullHostName(tiddler.fields['server.host']);
	var workspace = context.workspace ? context.workspace : tiddler.fields['server.workspace'];
	var uri = uriTemplate.format([host,workspace,tiddler.title,tiddler.text]);
	//var req = doHttp('POST',uri,tiddler.text,SocialtextAdaptor.mimeType,null,null,SocialtextAdaptor.putTiddlerCallback,context,{"X-Http-Method": "PUT"});
	var req = SocialtextAdaptor.doHttpPOST(uri,SocialtextAdaptor.putTiddlerCallback,context,{"X-Http-Method": "PUT"},tiddler.text,SocialtextAdaptor.mimeType);
	return typeof req == 'string' ? req : true;
};

SocialtextAdaptor.putTiddlerCallback = function(status,context,responseText,uri,xhr)
{
	if(status) {
		context.status = true;
	} else {
		context.status = false;
		context.statusText = xhr.statusText;
	}
	if(context.callback)
		context.callback(context,context.userParams);
};

SocialtextAdaptor.prototype.close = function()
{
	return true;
};

config.adaptors[SocialtextAdaptor.serverType] = SocialtextAdaptor;
} //# end of 'install only once'
//}}}
/***
SocialtextStyleOverrides
***/

/*{{{*/
.headerShadow {padding: 2em 0em .5em 1em;}
.headerForeground {padding: 2em 0em .5em 1em;}

#st-page-wiki-title {
	font-size: 80%;
}
.subtitle {
	font-style: italic;
	font-size 80%;
}

/* from #st-tags */
.tagged {
	border-color: #bbeebb;
	background-color: #f4fff4;
}

.tagged .listTitle {
	color: #595;
	font-weight: bold;
}

.tagged .button {
	color: #000;
}

.selected .tagged {
	background-color: ColorPalette::TertiaryLight;
	border: 1px solid ColorPalette::TertiaryMid;
}

/* from #st-incoming-links */
.tagging {
	border-color: #ebb;
	background-color: #fff4f4;
}

.tagging .listTitle {
	color: #b78;
	font-weight: bold;
}

.tagging .button {
	color: #999;
}

.selected .tagging {
	background-color: ColorPalette::TertiaryLight;
	border: 1px solid ColorPalette::TertiaryMid;
}

.tiddler {/* Tiddler body */
	border:1px solid #ccc;
	margin:0.5em;
	background:#fff;
	padding:0.5em;
}

.viewer blockquote {border-left: 0px solid}

.tiddlyLinkNonExisting {
	font-style: italic;
	border-bottom: 1px dashed;
}

.editor input, .editor textarea {
	background: #ffd;
	border-style: solid;
	border-color: #888 #ccc #ccc #888;
	border-width: 2px;
}

.tabContents {white-space: nowrap;}

#displayArea {margin: 1em 20em 0em 14em;}

#sidebar {
	position: absolute;
	right: 3px;
	width: 21em;
	font-size: .9em;
}

#sidebarOptions .button {
	border-color: #eee;
}

#sidebarTabs .tabContents {
	width: 20em;
	overflow: hidden;
}

.viewer tt {
	font-size: 1.2em;
	line-height: 1.4em;
}

ul {list-style-type: square;}
ul ul {list-style-type: circle;}

ol {list-style-type: decimal;}
ol ol {list-style-type: decimal;}
ol ol ol {list-style-type: decimal;}
ol ol ol ol {list-style-type: decimal;}
ol ol ol ol ol {list-style-type: decimal;}
ol ol ol ol ol ol {list-style-type: decimal;}

/*}}}*/
/***
SocialtextScreenStyle
http://www.eu.socialtext.net/static/2.0.0.1/css/st/screen.css
***/

/*{{{*/
body {
	font-family: Arial, sans-serif;
	color: #000;
	background: #eee;
	margin: 0;
}

/* Wiki Navigation */

.st-wiki-nav {
	clear: both;
	margin-left: 10px;
	margin-right: 10px;
}
.st-wiki-nav-content {
	background: url('../../images/st/wiki-nav/solid.gif') repeat-x left bottom;
	margin-left: 24px;
	margin-right: 24px;
	padding-top: 3px;
	min-height: 24px;
}
* html .st-wiki-nav-content {
	padding-bottom: 3px;
	height: 24px;
}

.st-wiki-nav-right {
	background: url('../../images/st/wiki-nav/right-round.gif') no-repeat bottom right;
}

.st-wiki-nav-left {
	background: url('../../images/st/wiki-nav/left-round.gif') no-repeat bottom left;
}

#st-home {
	float: left;
	margin-right: 60px;
	padding-top: 2px;
}

#st-home-link {
	color: white;
	text-decoration: none;
	font-weight: bold;
	font-family: Helvetica, sans-serif;
	font-size: 90%;
}

#st-editing-prefix-container {
	border-collapse: collapse;
	width: 100%;
	padding: 0px;
	margin: 0px;
	margin-bottom: -20px;
}

#st-editing-prefix-container tr td {
	margin: 0px;
	padding: 0px;
}

#st-editing-title {
	color: black;
	background-color: white;
	text-decoration: none;
	font-weight: bold;
	font-family: Helvetica, sans-serif;
	font-size: 90%;
	margin-bottom: 0.4em;
}

#st-wiki-title-invite {
	font-size: 50%;
	font-family: Helvetica, sans-serif;
}

#st-wiki-title-central-page-link {
	font-size: 50%;
	font-family: Helvetica, sans-serif;
}

#st-wiki-title-invite a {
	color: #00f;
}

#st-wiki-logo {
	text-align: center;
	clear: both;
}

#st-wiki-logo-image {
}

.st-wiki-nav-actions {
	float: right;
	color: black;
	font-size: 75%;
	padding-top: 3px;
}

.st-wiki-nav-actions a {
	padding: 2px;
	color: white;
	text-decoration: none;
	font-family: Helvetica, sans-serif;
}

/* Wiki Subnav */

#st-wiki-subnav {
	margin-top: 2px;
	font-size: 70%;
	font-weight: bold;
	font-family: Helvetica, sans-serif;
	color: #888;
}

#st-wiki-subnav a {
	padding: 2px;
	color: #008;
	text-decoration: none;
}

#st-wiki-subnav-right {
	float: right;
	margin-right: 6em;
}

#st-wiki-subnav-left {
	float: left;
	margin-left: 6em;
}
* html #st-wiki-subnav-left {
	margin-left: 3em;
}

/* Wiki Navigation Search Bar */

#st-search-form {
	margin: 0;
	padding: 0;
	padding-top: 1px;
}

#st-search-form .button-table {
	float: left;
	font-size: 79%;
	font-weight: bold;
	margin-left: 5px;
	margin-top: 1px;
}

#st-search-form #st-search-term {
	float: left;
	font-size: 60%;
}

/* Content Outline */

#st-content-border, #st-edit-border {
	position: relative;
	clear: both;
	margin-left: 3px;
	margin-right: 2px;
	margin-bottom: 0px;
	margin-top: 0px;
	border-bottom: 1px solid #eee;
}

#st-content-border-left, #st-edit-border-left {
	background: url('../../images/st/page-shadow/left.gif') left top repeat-y;
	position: relative;
}

#st-content-border-right, #st-edit-border-right {
	background: url('../../images/st/page-shadow/right.gif') right top repeat-y;
	position: relative;
}

#st-content-border-top, #st-edit-border-top {
	position: relative;
	background: url('../../images/st/page-shadow/top.gif') left top repeat-x;
}

#st-content-border-bottom, #st-edit-border-bottom {
	background: url('../../images/st/page-shadow/bottom.gif') left bottom repeat-x;
	position: relative;
}

#st-content-border-left-top, #st-edit-border-left-top {
	background: url('../../images/st/page-shadow/left-top.gif') left top no-repeat;
	position: relative;
}
#st-content-border-right-top, #st-edit-border-right-top {
	background: url('../../images/st/page-shadow/right-top.gif') right top no-repeat;
	position: relative;
}

#st-content-border-left-bottom, #st-edit-border-left-bottom {
	background: url('../../images/st/page-shadow/left-bottom.gif') left bottom no-repeat;
	position: relative;
}

#st-content-border-right-bottom, #st-edit-border-right-bottom {
	background: url('../../images/st/page-shadow/right-bottom.gif') right bottom no-repeat;
	padding-top: 5px;
	padding-bottom: 9px;
	position: relative;
}

* html #st-content-border-right-bottom, * html #st-edit-border-right-bottom {
	padding-top: 4px;
	padding-left: 7px;
	padding-right: 8px;
	position: relative;
}

.st-content-width-controller {
	width: 100%;
	position: relative;
	border-collapse: collapse;
}
.st-content-width-controller td {
	vertical-align: top;
}
.st-content {
	position: relative;
	background-color: white;
	margin-top: 0px;
	margin-left: 7px;
	margin-right: 8px;
	margin-bottom: -1px;
	border-left: 1px dotted #80a9f3;
	border-right: 1px dotted #80a9f3;
	border: 1px solid #80a9f3;
	padding: 6px 12px 12px 12px;
}
* html .st-content {
	margin-top: 0px;
	margin-left: 0px;
	margin-right: 0px;
}

/* This textarea is only for Safari. However, if we use display:none; here Safari ignores the .value operation in JS */
#st-raw-wikitext-textarea {
	width:1px;
	height:1px;
	margin:0;
	padding:0;
}

/* Action Buttons */
.button-table, .button-table tr td {
	border-collapse: collapse;
	margin: 0;
	padding: 0;
}
.button-rounded {
	background: url('../../images/st/grey-button/left-top-rounded.png') top left no-repeat;
	margin: 0;
}
.button-rounded-right-top {
	background: url('../../images/st/grey-button/right-top-rounded.png') top right no-repeat;
	margin: 0;
}
.button-rounded-left-bottom {
	background: url('../../images/st/grey-button/left-bottom-rounded.png') bottom left no-repeat;
	margin: 0;
}
.button-rounded-right-bottom {
	background: url('../../images/st/grey-button/right-bottom-rounded.png') bottom right no-repeat;
	margin: 0;
}
.button-straight {
	background: url('../../images/st/grey-button/left-top-straight.png') top left no-repeat;
	margin: 0;
}
.button-straight-right-top {
	background: url('../../images/st/grey-button/right-top-straight.png') top right no-repeat;
	margin: 0;
}
.button-straight-left-bottom {
	background: url('../../images/st/grey-button/left-bottom-straight.png') bottom left no-repeat;
	margin: 0;
}
.button-straight-right-bottom {
	background: url('../../images/st/grey-button/right-bottom-straight.png') bottom right no-repeat;
	margin: 0;
}
.button-content {
	font-size: 90%;
}
.button-content a {
	display: block;
	padding: 2px;
	padding-left: 10px;
	padding-right: 10px;
	font-family: Helvetica, Verdana, sans-serif;
	font-weight: bold;
	text-decoration: none;
	color: black;
}

.button-content input.submit {
	border: 0px;
	padding: 2px;
	padding-left: 10px;
	padding-right: 10px;
	font-family: Helvetica, Verdana, sans-serif;
	font-weight: bold;
	text-decoration: none;
	color: black;
	background-color: transparent;
}

/* Personal Homepage */

#st-homepage {
	background: white url('../../images/st/homepage/blue-fade.gif') top left no-repeat;
}

#st-homepage-layout {
	margin-top: 15px;
	clear: both;
	width: 100%;
	border-collapse: collapse;
}

#st-homepage-layout tr td.st-homepage-layout-cell {
	padding: 5px;
	vertical-align: top;
}

#st-homepage-layout-dashboard {
	width: 50%
}

#st-homepage-layout-notes {
	width: 50%;
}

#st-homepage-notes, #st-homepage-dashboard {
	text-align: left;
	width: 95%;
}

#st-user-greeting, #st-wiki-title {
	font-family: Helvetica, Verdana, sans-serif;
	font-size: 150%;
}
#st-wiki-title {
	margin-left: 5px;
}

#st-user-greeting {
	position: relative;
	text-align: right;
	float: right;
}

#st-group-notes-content, #st-personal-notes-content {
}

.st-homepage-section {
	margin-bottom: 15px;
}

#st-homepage-notes .st-homepage-section {
	background-color: white;
	border: 1px solid #aaa;
	padding: 15px;
}

.st-homepage-section-title {
	font-size: 110%;
	font-family: Helvetica, Verdana, sans-serif;
}

#st-homepage-notes .st-homepage-section-title {
	color: #aaa;
	text-decoration: underline;
}

.st-homepage-notes-edit-link {
	background: url('../../images/st/homepage/edit-icon.gif') no-repeat left top;
	display: block;
	text-indent: -2000px;
	height: 13px;
	width: 36px;
	text-decoration: none;
	padding:0;
}
* html .st-homepage-notes-edit-link {
	border:1px solid white;
}

.st-homepage-notes-edit {
	font-family: Verdana, sans-serif;
	font-size: 65%;
	float: right;
}

.st-homepage-notes-content {
	font-size: 85%;
	margin-top: 10px;
	padding-top: 0px;
	padding-bottom: 0px;
	font-family: Verdana, Helvetica, sans-serif;
}

#st-dyk {
	border-color: #cca !important;
	background-color: #ffe !important;
}

#st-dyk-title {
	color: #e4a020 !important;
	text-decoration: none !important;
}


/* Homepage Simple List */

#st-whats-new-title-link {
	background: url('../../images/st/homepage/icon-28-pages.gif') no-repeat left top;
}
#st-watchlist-title-link {
	background: url('../../images/st/homepage/icon-28-star.gif') no-repeat left top;
}
#st-wikis-title-link {
	background: url('../../images/st/homepage/icon-28-group.gif') no-repeat left top;
}
.st-homepage-simplelist-title-link {
	display: block;
	padding-left: 32px;
	min-height: 32px;
}
* html .st-homepage-simplelist-title-link {
	height: 32px;
}

.st-homepage-simplelist-title {
}

.st-homepage-simplelist-table {
	margin-left: 25px;
	border: 1px dashed #ddd;
	border-collapse: collapse;
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 80%;
	width: 95%;
}

.st-homepage-simplelist-table td {
	padding: 2px;
}

.st-homepage-simplelist-table tr.st-homepage-simplelist-row-odd {
	background-color: #f3f7f7;
}

.st-homepage-simplelist-table tr.st-homepage-simplelist-row-even {
	background-color: white;
}

.st-homepage-simplelist-table a {
	color: #4f55dd;
	text-decoration: none;
}

.st-homepage-simplelist-table a:visited {
	color: #551a8b;
}

.st-homepage-simplelist-subleft {
	font-size: 80%;
	margin-left: 1em;
	color: #666;
}

.st-homepage-simplelist-right {
	width: 20%;
}

.st-homepage-simplelist-subright {
	font-size: 80%;
	color: #666;
}

.st-homepage-simplelist {
}

.st-homepage-simplelist-header {
	min-height: 35px;
}

.st-homepage-simplelist-header .button-table {
	float: right;
	margin-right: 15px;
	font-size: 95%;
}

.st-homepage-simplelist-header .button-table .button-content {
	padding: 1px;
}

.st-homepage-whatsnew-author, .st-homepage-whatsnew-date {
	color: #555;
}
.st-homepage-whatsnew-attribution {
	padding-left: 1em;
	font-size: 80%;
	color: #aaa;
}

/* Homepage Wikis List */

#st-wikis-title {
}

/* Data and Templates */

.st-jst-template, .st-json {
	display: none;
}

/* Page Sidebox Common Styles */

#st-page-boxes-toggle {
	position: relative;
	float: right;
	text-align: right;
	font-family: Verdana, Arial, sans-serif;
	font-weight: bold;
	font-size: 80%;
	margin-bottom: 0.7em;
}

#st-page-boxes-toggle-link {
	text-decoration: none;
}

#st-page-boxes-underlay {
	float: right;
	margin-top: -10px;
	margin-right: 10px;
	background: white;
	z-index: 198;
	clear: both;
	margin-left: 15px;
}
* html #st-page-boxes-underlay {
	margin-right: 4px;
}
#st-page-boxes {
	background: inherit;
	position: absolute;
	right: 23px;
	z-index: 199;
	margin-top: 15px;
	margin-left: 20px;
}
#st-page-boxes, #st-page-boxes-underlay {
	width: 225px;
	/* padding-left: 15px; */ /* Gives the white border effect, cwest dislikes it. */
}

.st-page-box {
	border: 1px solid black;
	padding: 5px;
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 80%;
	margin-top: 15px;
}

.st-page-box-title {
	font-family: Helvetica, Verdana, sans-serif;
	font-weight: bold;
	margin-bottom: 10px;
}

.st-page-box-listing {
	margin: 0;
	padding: 0;
}

.st-page-box-listing-entry {
	display: block;
}

.st-page-boxes-nobacklinks {
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 90%;
	color: #888;
}

.st-page-box-first {
	margin-top: 0px;
}

/* Page Display */

#st-page-content {
	clear: left;
	margin-top: 6px;
	margin-bottom: 0;
	padding-bottom: 0;
}

#st-page-content, #st-page-content td {
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 90%;
}

#st-page-wiki-title {
	font-family: Helvetica, Verdana, sans-serif;
	font-size: 65%;
	font-weight: bold;
	color: #aaa;
	margin-bottom: 0.2em;
	margin-top: 0.1em;
	padding-top: 0;
}

#wiki {
	margin: 0;
	padding: 0;
}

#st-page-title {
}

#st-page-titletext, .st-page-title {
	font-family: Helvetica, Verdana, sans-serif;
	font-size: 150%;
	font-weight: bold;
	color: #888;
	border-bottom: 1px solid #888;
}

#st-newpage-pagename-edit {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	color: #000;
	border: 1px solid black;
	padding-left: 0.3em;
	background-color: #ffd;
}

#st-page-details {
	font-style: italic;
	font-size: 75%;
	font-family: Georgia, serif;
	margin: 6px 10px 0 10px;
}

#st-page-details-feed-icon {
	vertical-align: middle;
	border: none;
}

#st-page-stats {
	float: right;
	vertical-align: middle;
}

#st-attribution {
	float: left;
	margin-bottom: 10px;
}

#st-page-editing-wysiwyg {
	background: #ffd;
	border-style: solid;
	border-color: #888 #ccc #ccc #888;
	border-width: 2px;
	width: 100%;
}

#st-page-editing-toolbar {
	margin-left: -6px;
	overflow: hidden;
	float: left;
	height: 25px;
}

#wikiwyg_wikitext_textarea {
	margin-top: 4px;
	background: #ffd;
	border-style: solid;
	border-color: #888 #ccc #ccc #888;
	border-width: 2px;
	width: 100%;
	font-family: monospace;
}

#st-page-maincontent {
}

#st-page-editing, #wikiwyg_wikitext_textarea {
}

#st-page-editing-pagebody-decoy, #st-page-editing-wysiwyg {
	display: none;
}

#st-editing-tools-edit {
	display: none;
}

#st-mode-wysiwyg-button
{
	font-size: 70%;
	margin-left: 4em;
}

#st-mode-wikitext-button
{
	font-size: 70%;
}

#st-edit-tips
{
	font-size: 70%;
}

.wikiwyg_button {
	background: #FFFFFF;
	border: 1px solid #FFFFFF;
	cursor: pointer;
	width: 20px;
	height: 20px;
	vertical-align: bottom;
}

.wikiwyg_button:hover {
	border: 1px outset;
}

.wikiwyg_button:active {
	border: 1px inset;
}

#wikiwyg_toolbar {
	display: none;
}

/* Sidebox Pagetools: Revisions, Watchlist */
#st-side-box-pagetools {
	border-collapse: collapse;
}

#st-rewind-norevisions {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 11px;
	color: #777;
	text-decoration: none;
}

#st-side-box-pagetools a {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 11px;
	color: #555;
	text-decoration: none;
}

/* Page View Tags/Incoming Links Sidebox */

#st-tags {
	background: #f4fff4;
	border-color: #bbeebb;
	color: #999;
}

#st-tags-title {
	color: #595;
}

#st-tags-addlink, #st-tags-addbutton {
	font-weight: bold;
}

#st-tags-listing {
	margin-bottom: 5px;
}

#st-tags-addinput, #st-tags-message, #st-tags-suggestion {
	display: none;
}

#st-tags-deletemessage {
	font-size: 90%;
	color: #555;
	display: none;
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}

#st-tags-suggestion {
	margin-top: 2px;
}

.st-tags-level1 {
	font-size: 90%;
}

.st-tags-level2 {
	font-size: 100%;
}

.st-tags-level3 {
	font-size: 110%;
}

.st-tags-level4 {
	font-size: 120%;
}

.st-tags-level5 {
	font-size: 130%;
}

.st-tags-tagline .st-tags-tagdelete {
	text-decoration: none;
	color: #ccc;
}

.st-tags-tagline a {
	text-decoration: none;
	color: #444;
}

#st-tags-field {
	width: 95%;
}

#st-incoming-links {
	border-color: #ebb;
	background-color: #fff4f4;
}

#st-incoming-links-title {
	color: #b78;
}

#st-attachments {
	border-color: #bbe;
	background-color: #f4f4ff;
}

#st-attachments-uploadbutton, #st-attachments-managebutton {

}
#st-attachments-buttons-uploadbutton {
	margin: 0px;
	padding: 0px;
	padding-left: 2px;
}
#st-attachments-buttons-managebutton {
	margin: 0px;
	padding: 0px;
	padding-right: 2px;
}

#st-attachments-buttons td {
	padding-right: 3px;
	font-size: 99%;
}

#st-attachments-buttons {
	border-collapse: collapse;
	margin: 0px;
	padding: 0px;
	margin-top: 5px;
}

#st-attachments-title {
	color: #77b;
}

.st-attachments-line {
	width:100%;
	overflow:hidden;
}

/* Actions Bar */

#st-actions-bar-spacer {
	clear:both;
	height:0.5em;
	overflow:hidden;
}

#st-actions-bar-spacer-clear {
	clear:both;
	height:1px;
	overflow:hidden;
}


#st-actions-bar, #st-editing-tools-bar {
	margin-left: 30px !important;
	margin-right: 30px !important;
}

/* Footer */
#st-footer {
	margin-top: -8px;
	margin-bottom: 5px;
	clear: both;
}

/* Socialtext Attribution */

#st-socialtext-attribution {
	clear: both;
	text-align: center;
	font-size: 80%;
	font-family: Helvetica, sans-serif;
}

#st-socialtext-attribution-link {
	text-decoration: none;
}

#st-socialtext-attribution-image {
	border: 0;
}


/* Page Actions */

#st-edit-button-border-left-middle, #st-login-to-edit-button-border-left-middle {
	background: url('../../images/st/button-blue/left-middle.gif') left top repeat-y;
}
#st-edit-button-border-right-middle, #st-login-to-edit-button-border-right-middle {
	background: url('../../images/st/button-blue/right-middle.gif') right top repeat-y;
}

#st-edit-button-border-left-top, #st-login-to-edit-button-border-left-top {
	background: url('../../images/st/button-blue/left-top.gif') left top no-repeat;
}
#st-edit-button-border-right-top, #st-login-to-edit-button-border-right-top {
	background: url('../../images/st/button-blue/right-top.gif') right top no-repeat;
}

#st-edit-button-border-left-bottom, #st-login-to-edit-button-border-left-bottom {
	background: url('../../images/st/button-blue/left-bottom.gif') left bottom no-repeat;
}

#st-edit-button-border-right-bottom, #st-login-to-edit-button-border-right-bottom {
	background: url('../../images/st/button-blue/right-bottom.gif') right bottom no-repeat;
}

#st-edit-button-link, #st-login-to-edit-button-link {
}

#st-comment-button-border-left-middle {
	background: url('../../images/st/button-purple/left-middle.gif') left top repeat-y;
}

#st-comment-button-border-right-middle {
	background: url('../../images/st/button-purple/right-middle.gif') right top repeat-y;
}

#st-comment-button-border-left-top {
	background: url('../../images/st/button-purple/left-top.gif') left top no-repeat;
}

#st-comment-button-border-right-top {
	background: url('../../images/st/button-purple/right-top.gif') right top no-repeat;
}

#st-comment-button-border-left-bottom {
	background: url('../../images/st/button-purple/left-bottom.gif') left bottom no-repeat;
}

#st-comment-button-border-right-bottom {
	background: url('../../images/st/button-purple/right-bottom.gif') right bottom no-repeat;
}

#st-comment-button-link {
}

#st-save-button-border-left-middle {
	background: url('../../images/st/button-green/left-middle.gif') left top repeat-y;
}
#st-save-button-border-right-middle {
	background: url('../../images/st/button-green/right-middle.gif') right top repeat-y;
}

#st-save-button-border-left-top {
	background: url('../../images/st/button-green/left-top.gif') left top no-repeat;
}
#st-save-button-border-right-top {
	background: url('../../images/st/button-green/right-top.gif') right top no-repeat;
}

#st-save-button-border-left-bottom {
	background: url('../../images/st/button-green/left-bottom.gif') left bottom no-repeat;
}

#st-save-button-border-right-bottom {
	background: url('../../images/st/button-green/right-bottom.gif') right bottom no-repeat;
}

#st-save-button-link {
}

#st-preview-button-border-left-middle {
	background: url('../../images/st/button-gold/left-middle.gif') left top repeat-y;
}
#st-preview-button-border-right-middle {
	background: url('../../images/st/button-gold/right-middle.gif') right top repeat-y;
}

#st-preview-button-border-left-top {
	background: url('../../images/st/button-gold/left-top.gif') left top no-repeat;
}
#st-preview-button-border-right-top {
	background: url('../../images/st/button-gold/right-top.gif') right top no-repeat;
}

#st-preview-button-border-left-bottom {
	background: url('../../images/st/button-gold/left-bottom.gif') left bottom no-repeat;
}

#st-preview-button-border-right-bottom {
	background: url('../../images/st/button-gold/right-bottom.gif') right bottom no-repeat;
}

#st-preview-button-link {
}

#st-cancel-button-border-left-middle {
	background: url('../../images/st/button-crimson/left-middle.gif') left top repeat-y;
}
#st-cancel-button-border-right-middle {
	background: url('../../images/st/button-crimson/right-middle.gif') right top repeat-y;
}

#st-cancel-button-border-left-top {
	background: url('../../images/st/button-crimson/left-top.gif') left top no-repeat;
}
#st-cancel-button-border-right-top {
	background: url('../../images/st/button-crimson/right-top.gif') right top no-repeat;
}

#st-cancel-button-border-left-bottom {
	background: url('../../images/st/button-crimson/left-bottom.gif') left bottom no-repeat;
}

#st-cancel-button-border-right-bottom {
	background: url('../../images/st/button-crimson/right-bottom.gif') right bottom no-repeat;
}

#st-cancel-button-link {
}

#st-edit-more-button-border-left-middle {
	background: url('../../images/st/button-blue/left-middle.gif') left top repeat-y;
}
#st-edit-more-button-border-right-middle {
	background: url('../../images/st/button-blue/right-middle.gif') right top repeat-y;
}

#st-edit-more-button-border-left-top {
	background: url('../../images/st/button-blue/left-top.gif') left top no-repeat;
}
#st-edit-more-button-border-right-top {
	background: url('../../images/st/button-blue/right-top.gif') right top no-repeat;
}

#st-edit-more-button-border-left-bottom {
	background: url('../../images/st/button-blue/left-bottom.gif') left bottom no-repeat;
}

#st-edit-more-button-border-right-bottom {
	background: url('../../images/st/button-blue/right-bottom.gif') right bottom no-repeat;
}

#st-edit-more-button-link {
}

.st-page-action-button-link {
	min-height: 24px;
	min-width: 100px;
	text-align: center;
	font-family: Helvetica, Verdana, sans-serif;
	font-size: 90%;
	text-decoration: none;
	color: #fff;
	font-weight: bold;
	display: block;
	padding-top: 8px;
	padding-bottom: 0px;
	margin-bottom: -3px;
	width: 100%;
	margin-left: -2px;
}
* html .st-page-action-button-link {
	padding-top: 5px;
	padding-bottom: 0px;
	height: 24px;
}

.st-page-action-button {
	float: left;
	margin: 0;
	padding: 0;
	margin-right: 10px;
	min-height: 20px;
	border-collapse: collapse;
	width: 100px;
}

/* Attach File Interface */

#st-attachments-attachinterface {
	font-family: Helvetica, sans-serif;
	font-size: 90%;
	display: none;
	position: fixed;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	z-index: 2000;
	background-image: url('../../images/st/popup/bg.png');
}
#st-attachments-manageinterface {
	font-family: Helvetica, sans-serif;
	font-size: 90%;
	display: none;
	position: absolute;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	z-index: 2000;
	background-image: url('../../images/st/popup/bg.png');
}

* html #st-attachments-attachinterface {
	background-image: none;
}
* html #st-attachments-manageinterface {
	background-image: none;
}
* html .popup-overlay {
	background-image: url('../../images/st/popup/bg.png');
	background-color: #000;
	opacity: .70;
	position: absolute;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	z-index: 2001;
}

#st-attachments-attach-interface {
	z-index: 2002;
	background-color: #fff;
	color: #000;
	border: 4px solid #ccc;
	padding: 1em;
	width: 520px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10%;
	position: absolute;
	top: 0px;
}

* html #st-attachments-attach-interface {
}

#st-attachments-attach-formtarget {
	width: 0px;
	height: 0px;
	border: 0;
	padding: 0;
	margin: 0;
}

#st-attachments-attach-message {
	font-size: 90%;
	font-family: Verdana, Arial, Helvetica, Sans-Serif;
}

#st-attachments-attach-title {
	font-weight: bold;
	font-size: 120%;
}

#st-attachments-attach-close {
	float: right;
	margin-top: 6px;
}

#st-attachments-attach-uploadbutton {
	float: right;
	margin-right: 6px;
	margin-top: 6px;
	padding-bottom: 0;
}

#st-attachments-attach-fileprompt {
	margin: 0.2em 0 0.4em 0;
	padding-bottom: 0px;
}

#st-attachments-attach-submit {
	font-size: 90%;
	font-weight: bold;
}

#st-attachments-attach-filename {
	font-size: 90%;
}

#st-attachments-attach-uploadmessage {
	font-weight: bold;
	margin-bottom: 1em;
	display: none;
}

#st-attachments-attach-error {
	font-weight: bold;
	color: #f00;
	margin-bottom: 1em;
	display: none;
}

#st-attachments-attach-list {
	display: none;
	color: #666;
	font-size: 90%;
	margin-top: 1em;
	margin-bottom: 1em;
	border-top: 1px solid #4949BA;
	border-bottom: 1px solid #4949BA;
	background-color: #F5F5F5;
	padding: 3px;
}

.st-attachments-attach-listlabel {
	font-size: 90%;
	color: #4949BA;
}

/* Queue File Dialog */

#st-attachmentsqueue-interface {
	font-family: Helvetica, sans-serif;
	font-size: 90%;
	display: none;
	position: fixed;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	background-image: url('../../images/st/popup/bg.png'); /* Don't forget IE hack for ship! */
	z-index: 2000;
}

* html #st-attachmentsqueue-interface {
	background-image: none;
}

#st-attachmentsqueue-dialog {
	z-index: 2002;
	background-color: #fff;
	color: #000;
	border: 4px solid #ccc;
	padding: 1em;
	width: 530px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10%;
	position: absolute;
	top: 0px;
}

* html #st-attachmentsqueue-dialog {
}

#st-attachmentsqueue-fileprompt {
	margin-bottom: 0.4em;
	margin-top: 0;
	padding-bottom: 0;
}

#st-attachmentsqueue-title {
	font-weight: bold;
	font-size: 120%;
}

#st-attachmentsqueue-close {
	float: right;
	margin-top: 6px;
}

#st-attachmentsqueue-uploadbutton {
	float: right;
	margin-right: 6px;
	margin-top: 6px;
	padding-bottom: 0;
}

#st-attachmentsqueue-submit {
	font-size: 90%;
}

#st-attachmentsqueue-filename {
	font-size: 90%;
}

#st-attachmentsqueue-message {
	font-size: 90%;
	font-family: Verdana, Arial, Helvetica, Sans-Serif;
}

#st-attachmentsqueue-uploadmessage {
	font-weight: bold;
	margin-bottom: 1em;
	display: none;
}

#st-attachmentsqueue-error {
	font-weight: bold;
	color: #f00;
	margin-bottom: 1em;
	display: none;
}

#st-attachmentsqueue-list {
	display: none;
	color: #666;
	font-size: 90%;
	margin-top: 1em;
	margin-bottom: 1em;
	border-top: 1px solid #4949BA;
	border-bottom: 1px solid #4949BA;
	background-color: #F5F5F5;
	padding: 3px;
}

.st-attachmentsqueue-listlabel {
	font-size: 90%;
	color: #4949BA;
}

/* Lists */

tr.st-trbg-even, tr.st-trbg-even td{
	background-color: #f3f7f7;
}

tr.w-st-even-row, tr.w-st-even-row td {
	background-color: #f3f7f7;
}

.query-results-header-title, .query-results-header-last-edit-by {
	text-align: left;
}


.query-results-row-revisions {
	text-align: right;
}

.query-results-content {
	font-size: 85%;
	border-collapse: collapse;
	border: 1px dashed #ddd;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
}

.query-results-row {
	border-collapse: collapse;
	border: 1px dashed #ddd;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
}

.query-results-row a {
	text-decoration: underline;
	color: #00f;
}

.query-results-row td {
	font-family: Verdana;
	padding: 0.3em;
	border-left: 1px dashed #ddd;
	border-right: 1px dashed #ddd;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
}

.query-results-header-row {
	border-collapse: collapse;
	border: 1px dashed #ddd;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
}

.query-results-header-row a {
	text-decoration: underline;
	color: #00f;
}

.query-results-header-row th {
	font-family: Helvetica;
	padding: 0.3em;
	border-left: 1px dashed #ddd;
	border-right: 1px dashed #ddd;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
}

div.st-actionbutton {
	float: left;
}

div#deleteme-st-actions-bar {
	clear: both;
	margin: 0.8em 20px 0.2em auto;
	padding: 0;
}

/* Manage File Interface */



#st-attachments-manage-interface {
	z-index: 2002;
	background-color: #fff;
	color: #000;
	border: 4px solid #ccc;
	padding: 1em;
	width: 520px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10%;
	position: absolute;
	top: 0px;
}

#st-attachments-manage-filetable {
	height: 150px;
	margin: 0;
	padding: 0;
	width: 100%;
	overflow: auto;
	border: 1px solid #ccc;
}

#st-attachments-manage-filelisting tbody td {
	font-size: 90%;
}
#st-attachments-manage-filelisting {
	width: 100%;
	border-collapse: collapse;
	border: 0;
	margin: 0;
	padding: 0;
}

#st-attachments-manage-fileheader {
	background: #ccc;
	font-weight: bold;
	border-bottom: 1px black solid;
}

#st-attachments-manage-close {
	float: right;
	margin-top: 3px;
	margin-right: -2px;
	font-weight: bold;
}

#st-attachments-manage-delete {
	margin-top: 3px;
	float: left;
	font-weight: bold;
}

.st-attachments-manage-filerow {
	border-bottom: 1px solid #ccc;
}

.row-odd {
	background-color: #eee;
}

.row-even {
	background-color: #fff;
}

.row-on {
	background-color: #009 !important;
	color: white !important;
}

.row-on a {
	color: #fff !important;
}

#st-attachments-manage-deletemessage {
	color: red;
}

/* Page tools icons */

#st-pagetools-print {
	background: url('../../images/st/pagetools/print.gif')
	left center no-repeat;
}

#st-pagetools-email {
	background: url('../../images/st/pagetools/email.gif')
	left center no-repeat;
}

#st-pagetools-tools {
	background: url('../../images/st/pagetools/tools.gif')
	left center no-repeat;
}

/*
 #st-pagetools-watch {
	background: url('../../images/st/pagetools/watch-blue.gif')
	left center no-repeat;
}
*/


/* *********** Settings *********** */

#st-settings-pane {
}
* html #settings-pane { font-size: 85%;}

.settings-start-table {
}
* html .settings-start-table { font-size: 90%;}

#st-settings-select {
	padding: 0px 10px 10px 10px;
	vertical-align: top;
	width: 1px;

	background-color: #eff1ec;
	border: none;
}

#st-settings-section {
	padding: 0px 10px 10px 10px;
	vertical-align: top;
}

.settings-top-header {
	margin-top: 1em;
	font-weight: bold;
	width: 15em;
}

.settings-header {
	margin-top: 1em;
	font-weight: bold;
}

.settings-selections {
	padding: 0px 0px 0px 20px;
	line-height: 1.5em;
}

.settings-selections a:visited, .settings-selections a:active {
	color: #0000ff;
}

.settings-link {
	clear: both;
	display: block;
}

.settings-section-left {
	text-align: right;
}

.settings-label {
	font-weight: bold;
}

.settings-help {
	color: #888;
}

.settings-comment {
}

.users-invite-message {
	padding: 0.5em 0.5em 0.5em 2em;
	background-color: #eee;
	/* This seems necessary to fix an IE bug that sometimes
		causes the text in this div to be invisible */
	z-index: 1000;
}

.workspace-entry-header {
	margin-top: .5em;
	font-weight: bold;
}

.workspace-entry {
	margin-left: 3em;
}

.workspace-entry-p {
	margin-top: .5em;
	margin-bottom: .75em;
}

.workspace-subentry {
	font-style: italic;
	font-weight: bold;
	margin-left: 1.5em;
}

.preferences-td {
	padding:.5em 0 1.5em 0;
}

.preferences-query {
	text-align: left;
}

.preference-radio {
	background-color: #cec;
}
.user-settings-listall-headings td {
	background-color: #eff3ef;
}

#st-settings-save {
	padding-bottom: 0.5em;
}

.standard-button-cancel {
	font-weight: bold;
	background-color: #71004b;

	border-left: 1px solid #aaa;
	border-top: 1px solid #aaa;
	border-bottom: 2px solid #333;
	border-right: 2px solid #333;
	color: #f4f3b9;
	width: 8em;
}

.standard-button-submit {
	font-weight: bold;
	background-color: #656084;

	border-left: 1px solid #aaa;
	border-top: 1px solid #aaa;
	border-bottom: 2px solid #333;
	border-right: 2px solid #333;
	color: #f4f3b9;
	width: 8em;
}

#st-settings {
	font-family: Verdana, Arial, Helvetica, Sans-Serif;
	font-size: 90%;
}


/* Listview Tabs */


#st-listview a:visited {
	color: #551a8b;
}
#st-listview-tabs ul {
	display: block;
	list-style: none outside;
	margin: 0 0 0 4em;
	padding: 0;
	font-family: Helvetica, Arial, Sans-serif;
	font-size: 80%;
}

#st-listview-tabs li {
	display: block;
	float: left;
	margin: 0 0.8em 0 0;
	padding: 3px 0.6em 0 0.6em;
	border: 1px solid #d8d8d8;
	border-bottom: 1px solid rgb(128, 169, 243);
	background-color: #f4f4f4;
	position: relative;
	bottom: -2px;
}

#st-listview-tabs li.spacer {
	margin: 0 0.8em 0 2em;
}

#st-listview-tabs a {
	color: #bbb;
	text-decoration: none;
}

#st-listview-tabs li.selected {
	background-color: #fff !important;
	border: 1px solid rgb(128, 169, 243) !important;
	border-bottom: 1px solid #fff !important;
	font-weight: bold !important;
}

#st-listview-tabs li.selected a {
	color: #000 !important;
}

/* Category List Display */

#st-category-display-links {
	margin-bottom: 1em;
	font-size: 90%;
}

#st-tag-listbody {
	font-family: Helvetica, Verdana, sans-serif;
}

/* Attachments List Display */

#st-attachments-list-body table.button-table {
	margin-top: 0.1em;
	font-size: 80%;
}


/* ********** PageTools Menu ************** */

div#st-editing-tools {
	float: left;
}

div#st-pagetools {
	z-index: 300;
	font-family: Helvetica, Verdana, sans-serif;
	font-size: 10px;
	float: right;
	margin: 18px 0 0 0em;
	color: #000;
	vertical-align: bottom;
	position: relative;
}

#st-pagetools a {
	text-decoration: none;
	color: black;
	padding-left: 17px;
}

#st-pagetools span {
	color: inherit;
	padding-left: 17px;
	vertical-align: top;
}

#st-pagetools span.st-watchlist-link {
	color: inherit;
	vertical-align: top;
}

.st-watchlist-link {
	cursor: pointer;
}

div#st-pagetools ul.level2 {
	z-index: 300;
	margin: 0;
	padding: 0;
	background: white;
	border: 1px solid #CCC;
	border-width: 0 1px;
}

div#st-pagetools li {
	position: relative;
	list-style: none;
	margin: 0;
	float: left;
	width: 7em;
	line-height: 11px;
}

div#st-pagetools ul ul li:hover {
	background: #BFE2FF;
}

div#st-pagetools li a {
	display: block;
	text-decoration: none;
}

div#st-pagetools>ul a {
	width: auto;
}

div#st-pagetools ul ul {
	position: absolute;
	width: auto;
	display: none;
}

div#st-pagetools ul ul li {
	line-height: 1.5em;
/*	width: 100%; */
	width: 14em;
}

.first {
	border-top: 1px solid #CCC;
}

.separator {
	border-bottom: 1px solid #CCC;
}

div#st-pagetools ul ul li a {
	border-bottom: 1px solid #CCC;
	padding-left: 15px;
	padding-right: 3px;
	margin-right: 3px;
	border: 0px;
}

div#st-pagetools li.submenu li.submenu:hover {
	z-index: 300;
	background-color: #BFE2FF;
}

div#st-pagetools ul.level1 li.submenu:hover ul.level2 {
	display:block;
}

div#st-pagetools ul.level2 {
	top: 1.0em;
	left: -9.5em;
}

/*

=head2 Revision List Display

Change these styles to update the page revision list.

*/

#st-revision-list-table {
	border-collapse: collapse;
	font-size: 85%;
	color: #000;
}

.st-page-title-decorator {
	color: #C80000;
}

.st-revision-header-emphasis {
	color: #C80000;
}

.st-revision-list-compare-button-row {
}

.st-revision-list-compare-button-cell {
	padding-top: 0.3em;
	text-align: center;
}

.st-revision-list-compare-button {
}

#st-revision-list-header-row {
}

#st-revision-list-header-select {
	padding: 6px 2px 2px 2px;
	text-align: center;
}

#st-revision-list-header-revision {
	padding: 6px 2px 2px 2px;
	text-align: left;
}

#st-revision-list-header-edited-by {
	padding: 6px 2px 2px 2px;
	text-align: center;
}

#st-revision-list-header-date {
	padding: 6px 2px 2px 2px;
	text-align: center;
}

.st-revision-list-row {
	border-collapse: collapse;
	border: 1px dashed #ddd;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
}

.st-revision-list-row td {
	font-family: Verdana;
	padding: 0.3em;
	border-left: 1px dashed #ddd;
	border-right: 1px dashed #ddd;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
}

.st-revision-list-row-select {
	padding: 3px 0 2px 0;
	text-align: center;
}

.st-revision-list-row-select-old {
}

.st-revision-list-row-select-new {
}

.st-revision-list-row-revision {
}

.st-revision-list-row-revision-link {
}

.st-revision-list-row-edited-by {
}

.st-revision-list-row-date {
}

/* Revision Menu */

#st-pagetools.st-revision-view-bar {
	float: left;
}

ul.st-revision-menu {
	list-style: none;
	margin: 0;
	padding: 0.2em;
	font-size: 80%;
}

ul.st-revision-menu li {
	float: left;
	padding: 0 0.4em 0 0.4em;
	border-right: thin solid #000000;
}

ul.st-revision-menu li.st-last {
	border-right: none;
}

#st-restore-revision-button {
	font-size: 80%;
}

/*

=head2 Revision Compare Display

When comparing two revisions of a page, these styles apply.

*/

#st-revision-compare-table {
	background-color: #f0f0f0;
}

#st-revision-compare-table td {
	background-color: white;
}

.st-revision-compare-old {
	background-color: #fdd;
	text-decoration: line-through;
}
.st-revision-compare-new {
	background-color: #dfd;
	font-weight: bold;
}

/* Weblog View */

#st-weblog {
	padding: 0;
}

#st-content-weblog-display-width-controller {
}
#st-content-weblog-display-width-controller-nav {
	width: 230px;
	margin-left: 15px;
	border-left: 5px solid #ddd;
	margin-top: -1px;
}

#st-weblog-content {
	font-family: Verdana, Helvetica, sans-serif;
	margin-top: -1px;
	margin-bottom: -1px;
	border-top: 1px solid #80a9f3;
	border-bottom: 1px solid #80a9f3;
}

#st-weblog-title {
	font-family: 'Trebuchet MS', Verdana, Helvetica, sans-serif;
	font-family: 'Times New Roman', serif;
	background-color: #80a9f3;
	color: #fff;
	font-size: 150%;
	font-weight: bold;
	padding: 0.2em;
	padding-left: 1em;
}

#st-weblog-wikititle {
	font-family: Helvetica, Verdana, sans-serif;
	font-style: italic;
	font-size: 40%;
	color: #fff;
	margin-bottom: 0.2em;
	margin-top: 0.1em;
	padding-top: 0;
}

#st-weblog-titletext {
	font-family: Helvetica, Verdana, sans-serif;
	font-weight: bold;
	color: #fff;
}

div.st-weblog-entry {
	margin-top: 0.2em;
	margin-bottom: 4.8em;
	padding: 0 1.5em 0 1.5em;
}

.st-page-title {
	clear: both;
}

div.st-weblog-entrytitle span.text {
	font-family: Helvetica, Verdana, sans-serif;
	font-size: 150%;
	font-weight: bold;
	color: #000;
}

.st-weblog-entrycontent {
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 90%;
	border-bottom: 1px solid #888;
}

.st-weblog-byline {
	float: left;
	text-align: left;
	font-style: italic;
	font-size: 70%;
	font-family: Verdana, Helvetica, sans-serif;
}

.st-weblog-post-links {
	float: right;
	text-align: right;
	font-size: 70%;
	font-family: Verdana, Helvetica, sans-serif;
}

#st-weblog-archives, #st-weblog-navigation {
	position: relative;
	float: right;
	width: 230px;
}

#st-weblog-archives {
	margin-top: 15px;
	clear: right;
}

#st-weblog-archives-title, #st-weblog-navigation-title {
	margin-left: 15px;
	font-family: Helvetica, sans-serif;
	font-size: 95%;
	font-weight: bold;
	color: #999;
	border-bottom: 2px solid #f99;
	padding-bottom: 5px;
	padding-top: 5px;
	margin-bottom: 5px;
}

#st-weblog-navigation-content {
	margin-left: 15px;
	font-size: 80%;
}

#st-weblog-archives ul {
	margin: 0;
	padding: 0;
}

#st-weblog-archives ul li {
	/* list-type: none; */
	display: block;
	font-size: 80%;
	font-family: Helvetica, sans-serif;
	padding-left: 15px;
}

#st-weblog-newpost {
	padding: 0.5em 0.7em 0.3em 0.3em;
}

#st-weblog-newpost-button {
}

#st-weblog-actionbar-chooseweblog {
	float: right;
}

#st-weblog-postbyemail {
	font-size: 70%;
	font-family: Verdana, Helvetica, sans-serif;
	color: #def;
	padding-top: 0.4em;
}

#st-weblog-postbyemail-link {
	color: #00c;
}

.st-weblog-chooseprompt {
	font-size: 90%;
	font-family: Verdana, Helvetica, sans-serif;
	padding-right: 0.2em;
	color: #000;
}

.st-spacer {
	padding-right: 0.1em;
	padding-left: 0.1em;
}

.st-weblog-preventries {
	padding-bottom: 20px;
	clear: both;
}
.st-weblog-nextentries {
	clear: both;
}

div.st-weblog-entrynav {
	margin-top: 0.2em;
	margin-bottom: 1.8em;
	padding: 0;
}

span.st-weblog-previousentries, span.st-weblog-nextentries {
	font-size: 90%;
	font-family: Verdana, Helvetica, sans-serif;
	padding-left: 1em;
}

/* ******* Page Stats ******** */

#st-usagereport-navbar {
	font-size: 80%;
	padding: 0;
	margin: 0;
}

#st-usagereport-date {
	font-weight: bold;
	margin-top: 1em;
}

#st-page-usagereport h1 {
	font-size: 1.3em;
	font-weight: bold;
	margin-top: 1.2em;
	margin-bottom: 0.3em;
}

#st-page-usagereport h2 {
	font-size: 1.1em;
	font-weight: bold;
	margin-top: 0.8em;
	margin-bottom: 0.3em;
}

/* New Page */
#st-newpage-save, #st-newpage-duplicate {
	display: none;
	position: fixed;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;
	background: url('../../images/st/popup/bg.png'); /* Don't forget IE hack for ship! */
	z-index: 2000;
}

#st-newpage-save-interface {
	background-color: #fff;
	color: #000;
	border: 4px solid #ccc;
	padding: 0.5em;
	width: 450px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10%;
	position:absolute;
	top:0px;
	z-index:2003;
}

#st-newpage-duplicate-interface {
	background-color: #fff;
	color: #000;
	border: 4px solid #ccc;
	padding: 0.5em;
	width: 530px;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10%;
	position:absolute;
	top:0px;
	z-index:2003;
}

#st-newpage-save-title, #st-newpage-duplicate-title {
	margin: 0;
	padding: 0;
	font-weight: bold;
	font-family: Helvetica, sans-serif;
	font-size: 100%;
}

#st-newpage-save-prompt, #st-newpage-duplicate-prompt {
	font-family: Helvetica, sans-serif;
	font-size: 90%;
	margin-bottom: 0.4em;
}

#st-newpage-save-buttons, #st-newpage-duplicate-buttons {
	margin-top: 0.8em;
	text-align: right;
}

.st-newpage-duplicate-option {
	font-family: Helvetica, sans-serif;
	font-size: 90%;
	margin: 0;
	padding: 0;
}

#st-newpage-duplicate-pagename {
	font-size: 90%;
}

.st-newpage-duplicate-emphasis {
	background-color: #FFFF00;
	font-weight: bold;
}

#st-newpage-save-field-pagename {
	margin-bottom: 0;
	margin-top: 0.2em;
	padding-bottom: 0;
	font-size: 90%;
}

#st-newpage-save-tip {
	margin-bottom: 0;
	margin-top: 1.2em;
	padding-bottom: 0;
	font-size: 75%;
	color: #888;
}

/* Wikitext Styling */

.wiki {
}

.wiki hr {
	margin-top: .4em;
	margin-bottom: .4em;
}

.wiki .short-rule {
	width: 25%;
}

.wiki .medium-rule {
	width: 50%
}

.wiki ul,
.wiki ol,
.wiki blockquote {
	margin-left: 2em;
	padding-left: 0em;
}

.wiki table {
	border-collapse: collapse;
}

.wiki td {
	border: 1px;
	border-style: solid;
	padding: .2em;
	vertical-align: top;
}

.wiki h1,
.wiki h2,
.wiki h3,
.wiki h4,
.wiki h5,
.wiki h6 {
	font-weight: bold;
	font-style: normal;
	margin-top: 0.1em;
	margin-bottom: 8px;
}

.wiki h1 {font-size: 200%;}
.wiki h2 {font-size: 170%;}
.wiki h3 {font-size: 145%;}
.wiki h4 {font-size: 125%;}
.wiki h5 {font-size: 110%;}
.wiki h6 {font-size: 100%;}

.wiki pre {
	background-color: #eee; /* XXX */
	margin-left: 1em;
	margin-right: 1em;
	padding: .2em;
}

.wiki .incipient {
	text-decoration: none;
	border-bottom: 1px dashed;
}

.wiki-include-title {
	background-color: #ccccff;
}

.wiki .wiki {
	position: relative;
	background-color: #ddddff;
	border: 1px solid #ccccff;
	padding: 3px;
}

.wafl_existence_error {
	color: rgb(200,0,0);
	border-bottom: 0.2em dashed rgb(200,0,0);
}

#st-edit-mode-container {
}

#st-edit-mode-view {
}

#st-page-editing-uploadbutton {
	z-index: 1500;
	float: left;
}

/* Comment UI */


body#st-commentui {
	background: #ffffff;
}

#st-commentui-container {
}

#st-commentui-container a:visited,
#st-commentui-container a:active {
	color: #00f;
}

#st-commentui-notetop {
}

#st-commentui-controls {
}

#st-commentui-savelink {
	background-color: #fffebd;
}

#st-commentui-cancellink {
}

#st-commentui-customfield {
}

#st-commentui-customfield .customfield-label {
}

#st-commentui-customfield .customfield-input {
}

#st-commentui-textarea {
	padding: 0;
	border-style: inset;
	border-width: thin;
	background-color: #ffd;
	color: black;
	width: 99%;
	height: 150px;
}

/*

=head2 Send Page by Email

Styles for the 'Send Page by Email' popup, accessed from the 'Email' dropdown
menu on the page bar.

*/

#email-page {
	background: #ffffff;
	font-size: 80%;
}

.email-page-row {
	clear: both;
}

.email-page-row-label {
	font-weight: bold;
	float: left;
	width: 5em;
	margin-left: 1.2em;
	margin-right: 1.2em;
	text-align: right;
}

.email-page-row-content {
	float: left;
	padding-bottom: 1.2em;
}

.email-page-user-select-column {
	float: left;
	padding-right: 1.2em;
	width: 14em;
}

#email-page-user-select-column-center {
	width: 10em;
}

.email-page-user-select-label {
	text-align: center;
}

#email-page-user-select-add-label {
	padding-top: 1em;
}

.email-page-user-select-button-group {
	padding-bottom: 2em;
}

.email-page-input {
	width: 120px;
	clear: both;
	display: block;
}


.email-page-select {
	width: 175px;
	font-size: x-small;
}

#email-page-error-message {
	text-align: center;
}

#email-page-buttons-container {
	clear: both;
}

#email-page-buttons {
	text-align: center;
}

.email-page-input-new {
	width: 175px;
}

/* System Status, Red with icon */

#st-system-status-alert {
	clear: both;
	width: 50%;
	margin-left: 25%;
	margin-top: 10px;
	padding: 5px;
	color: #c00;
	font-weight: bold;
	font-size: 80%;
	background: transparent url('../../images/st/system-message/important-note.gif') no-repeat 5px center;
	padding-left: 60px;
	min-height: 38px;
}
* html #st-system-status-alert {
	height: 38px;
}

/* System Status, Green */

#st-system-status {
	clear: both;
	text-align:center;
	width: 80%;
	margin-left: 10%;
	padding: 8px 0 3px 0;
	color: #0a0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 80%;
}

.socialtextLogo {
	text-align: center;
}
/*}}}*/
/***
|''Name:''|SparklinePlugin|
|''Description:''|Sparklines macro|
***/
//{{{
if(!version.extensions.SparklinePlugin) {
version.extensions.SparklinePlugin = {installed:true};

//--
//-- Sparklines
//--

config.macros.sparkline = {};
config.macros.sparkline.handler = function(place,macroName,params)
{
	var data = [];
	var min = 0;
	var max = 0;
	var v;
	for(var t=0; t<params.length; t++) {
		v = parseInt(params[t]);
		if(v < min)
			min = v;
		if(v > max)
			max = v;
		data.push(v);
	}
	if(data.length < 1)
		return;
	var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160));
	box.title = data.join(",");
	var w = box.offsetWidth;
	var h = box.offsetHeight;
	box.style.paddingRight = (data.length * 2 - w) + "px";
	box.style.position = "relative";
	for(var d=0; d<data.length; d++) {
		var tick = document.createElement("img");
		tick.border = 0;
		tick.className = "sparktick";
		tick.style.position = "absolute";
		tick.src = "data:image/gif,GIF89a%01%00%01%00%91%FF%00%FF%FF%FF%00%00%00%C0%C0%C0%00%00%00!%F9%04%01%00%00%02%00%2C%00%00%00%00%01%00%01%00%40%02%02T%01%00%3B";
		tick.style.left = d*2 + "px";
		tick.style.width = "2px";
		v = Math.floor(((data[d] - min)/(max-min)) * h);
		tick.style.top = (h-v) + "px";
		tick.style.height = v + "px";
		box.appendChild(tick);
	}
};


}
//}}}
/***
|''Name:''|CryptoFunctionsPlugin|
|''Description:''|Support for cryptographic functions|
***/
//{{{
if(!version.extensions.CryptoFunctionsPlugin) {
version.extensions.CryptoFunctionsPlugin = {installed:true};

//--
//-- Crypto functions and associated conversion routines
//--

// Crypto "namespace"
function Crypto() {}

// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
{
	var be = Array();
	var len = Math.floor(str.length/4);
	var i, j;
	for(i=0, j=0; i<len; i++, j+=4) {
		be[i] = ((str.charCodeAt(j)&0xff) << 24)|((str.charCodeAt(j+1)&0xff) << 16)|((str.charCodeAt(j+2)&0xff) << 8)|(str.charCodeAt(j+3)&0xff);
	}
	while (j<str.length) {
		be[j>>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
		j++;
	}
	return be;
};

// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
{
	var str = "";
	for(var i=0;i<be.length*32;i+=8)
		str += String.fromCharCode((be[i>>5]>>>(24-i%32)) & 0xff);
	return str;
};

// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
{
	var hex = "0123456789ABCDEF";
	var str = "";
	for(var i=0;i<be.length*4;i++)
		str += hex.charAt((be[i>>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
	return str;
};

// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
{
	return Crypto.be32sToHex(Crypto.sha1Str(str));
};

// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
{
	return Crypto.sha1(Crypto.strToBe32s(str),str.length);
};

// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
{
	// Add 32-bit integers, wrapping at 32 bits
	add32 = function(a,b)
	{
		var lsw = (a&0xFFFF)+(b&0xFFFF);
		var msw = (a>>16)+(b>>16)+(lsw>>16);
		return (msw<<16)|(lsw&0xFFFF);
	};
	// Add five 32-bit integers, wrapping at 32 bits
	add32x5 = function(a,b,c,d,e)
	{
		var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
		var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
		return (msw<<16)|(lsw&0xFFFF);
	};
	// Bitwise rotate left a 32-bit integer by 1 bit
	rol32 = function(n)
	{
		return (n>>>31)|(n<<1);
	};

	var len = blen*8;
	// Append padding so length in bits is 448 mod 512
	x[len>>5] |= 0x80 << (24-len%32);
	// Append length
	x[((len+64>>9)<<4)+15] = len;
	var w = Array(80);

	var k1 = 0x5A827999;
	var k2 = 0x6ED9EBA1;
	var k3 = 0x8F1BBCDC;
	var k4 = 0xCA62C1D6;

	var h0 = 0x67452301;
	var h1 = 0xEFCDAB89;
	var h2 = 0x98BADCFE;
	var h3 = 0x10325476;
	var h4 = 0xC3D2E1F0;

	for(var i=0;i<x.length;i+=16) {
		var j,t;
		var a = h0;
		var b = h1;
		var c = h2;
		var d = h3;
		var e = h4;
		for(j = 0;j<16;j++) {
			w[j] = x[i+j];
			t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=16;j<20;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=20;j<40;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=40;j<60;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=60;j<80;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}

		h0 = add32(h0,a);
		h1 = add32(h1,b);
		h2 = add32(h2,c);
		h3 = add32(h3,d);
		h4 = add32(h4,e);
	}
	return Array(h0,h1,h2,h3,h4);
};


}
//}}}
/***
|''Name:''|DeprecatedFunctionsPlugin|
|''Description:''|Support for deprecated functions removed from core|
***/
//{{{
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};

//--
//-- Deprecated code
//--

// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
	w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
};

// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = function(w)
{
	var lookaheadRegExp = new RegExp(this.lookahead,"mg");
	lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = lookaheadRegExp.exec(w.source);
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var text = lookaheadMatch[1];
		if(config.browser.isIE)
			text = text.replace(/\n/g,"\r");
		createTiddlyElement(w.output,"pre",null,null,text);
		w.nextMatch = lookaheadRegExp.lastIndex;
	}
};

// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)
{
	createTiddlyElement(place,"br");
};

// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
	var i = this.indexOf(item);
	return i == -1 ? null : i;
};

// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
	return store.getLoader().internalizeTiddler(store,this,title,divRef);
};

// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
	return store.getSaver().externalizeTiddler(store,this);
};

// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
	return store.allTiddlersAsHtml();
}

// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
	refreshPageTemplate(title);
}

// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)
{
	story.displayTiddlers(srcElement,titles,template,animate);
}

// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)
{
	story.displayTiddler(srcElement,title,template,animate);
}

// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;

// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");

}
//}}}
{file: mount-rpi-image.sh}

{toc: }

{tag_list: raspberrypi}

^ Interestring projects

TODO: test them out and write full description on this wiki :-)

* FreeLSS is a laser scanning program for the Raspberry Pi. It allows a Raspberry Pi to function as the core to a complete turn table laser scanning system.
** https://github.com/hairu/freelss
* PWM on the Raspberry pi - done properly (in hardware, stable)
** https://github.com/sarfata/pi-blaster
* https://github.com/ali1234/raspi-teletext
* https://github.com/jgarff/rpi_ws281x

* u-boot on sdcard for nfs boot: http://elinux.org/RPi_U-Boot

* RF transmitter for Raspberry Pi https://github.com/F5OEO/rpitx

^ development

* distcc setup http://openframeworks.cc/setup/raspberrypi/Raspberry-Pi-DISTCC-guide.html
* RPi (Raspbian arm) chroot on x86 Linux http://dev.xff.lt/b/archives/2015/01/11/rpi_raspbian_arm_chroot_on_x86_linux/
** https://wiki.debian.org/QemuUserEmulation https://wiki.debian.org/RaspberryPi/qemu-user-static

^ [OV7670]

* http://www.raspberrypi.org/phpBB3/viewtopic.php?uid=25856&f=44&t=11839&start=0

^ DHT11/DHT22

* http://www.tortosaforum.com/raspberrypi/dht11driver.htm
* http://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/overview

^ [BlinkM] + i2c

* http://www.raspberrypi.org/forums/viewtopic.php?t=11969

^ CEC - control your TV

http://www.raspberrypi.org/forum/viewtopic.php?f=35&t=15749

.pre
root@raspberrypi:/home/pi# git clone https://github.com/Pulse-Eight/libcec.git
root@raspberrypi:/home/pi# cd libcec/
root@raspberrypi:/home/pi/libcec# apt-get install autoconf automake libtool liblockdev1-dev libudev-dev libraspberrypi-dev
root@raspberrypi:/home/pi/libcec# sh -x bootstrap
root@raspberrypi:/home/pi/libcec# ./configure --with-rpi-include-path=/opt/vc/include/ --with-rpi-lib-path=/opt/vc/lib/

##############################################################################

libCEC version 2:1:0 configured

Compilation flags:
  CXXFLAGS :       -g -O2 -fPIC -Wall -Wextra -Wno-missing-field-initializers  -Wno-psabi
  libCEC LDFLAGS : -lbcm_host -llockdev -lrt -ldl -lpthread  -L/opt/vc/lib/ -lvcos -lvchiq_arm -ludev  
  client LDFLAGS : -lrt -ldl -lpthread 

Configured features:
  Pulse-Eight CEC Adapter :             yes
  Pulse-Eight CEC Adapter detection :   yes
  Raspberry Pi support :                yes
  TDA995x support :                     no

You can now build libCEC by running:
  make

##############################################################################

make install
.pre

^^ TV on

.pre
pi@raspberrypi ~ $ echo "on 0" | cec-client -s
.pre

^ Hints from forum

^^ screen saver

http://www.raspberrypi.org/phpBB3/viewtopic.php?p=84831#p84831

.pre
# prevent screensaver from powering down display
setterm -blank 0 -powerdown 0 > /dev/tty0

# clear the display and turn off the flashing cursor
clear > /dev/tty0
setterm -cursor 0 > /dev/tty0

# turn the cursor back on when done with omxplayer
setterm -cursor 1 > /dev/tty0
.pre

^^ YouTube transcoding in VLC

http://www.raspberrypi.org/phpBB3/viewtopic.php?p=163658#p163658

.pre
cvlc 'youtube.com/watch?v=XXXXXXXXXX' :sout='#transcode{vcodec=h264,vb=0,fps=0,scale=0,height=720,acodec=mp4a,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=flv},dst=:8080/youtube}' :sout-keep
.pre

^ Education materials

* http://pi.cs.man.ac.uk/download/Raspberry_Pi_Education_Manual.pdf
* http://www.ocr.org.uk/qualifications/by-subject/computing/raspberry-pi/
* http://www.cl.cam.ac.uk/projects/raspberrypi/

^ Raspberry Pi Accessories Starter Kit

http://www.conrad.com/ce/en/product/409208/Raspberry-Pi-Accessories-Starter-Kit?ref=searchDetail

* 1x Rapberry sticker

* Power supply for the Raspberry
* Sturdy acrylic housing, which includes all possible connections for this Raspberry and perfectly protects
* 4 GB SD card to store your programs
** https://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi
* USB Micro Card Reader
* USB cable (for power supply or the power supply of a PC)
* 3 m Ethernet cable
** https://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh
** https://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc
* TTL USB cable
** https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/test-and-configure
* PI Cobbler (KIT hereby connect the RP with other circuit boards)
* Large breadboard circuit
* Colored board cable connector

* 5x 560 ohm resistors (for LEDS)
* 3x LED's (red, green, blue)
** https://learn.adafruit.com/raspberry-pi-e-mail-notifier-using-leds
** https://learn.adafruit.com/debugging-with-the-raspberry-pi-webide/debug-a-blinking-led
* 5x 10K resistors (for buttons)
* 3x pushbutton
** https://learn.adafruit.com/playing-sounds-and-using-buttons-with-raspberry-pi/bread-board-setup-for-input-buttons
* 1x photocell
** https://learn.adafruit.com/basic-resistor-sensor-reading-on-raspberry-pi/basic-photocell-reading
* 1x 1uf capacitor (for photocell)

^ GPU

* FFT
** http://www.raspberrypi.org/accelerating-fourier-transforms-using-the-gpu/
** https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/hello_pi/hello_fft/qasm
* SHA-256
** http://rpiplayground.wordpress.com/
** https://github.com/elorimer/rpi-playground/tree/master/QPU
* Machine learning - the Deep Belief image recognition SDK
** http://petewarden.com/2014/06/09/deep-learning-on-the-raspberry-pi/
** http://scientistnobee.wordpress.com/2014/06/20/machine-learning-with-raspberry-pi/

^ Arduino

* Connect using I2C http://www.pihomeserver.fr/en/2013/08/13/raspberry-pi-home-server-arduino-lier-les-deux-via-bus-i2c/

^ JTAG

* https://github.com/synthetos/PiOCD/wiki/Using-a-Raspberry-Pi-as-a-JTAG-Dongle

^ Arduino ProMini 3.3V 8MHz

^^ Disable serial port console

edit `/boot/cmdline.txt` and remove all ttyAMA0 leaving:

.pre
pi@raspberrypi ~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait bcm2708.w1_gpio_pin=4
.pre

also, comment out ttyAMA0 in `/etc/inittab`

^^ connect Arduino serial

RX->TX
TX->RX

https://github.com/dpavlin/avrdude-rpi/tree/fix_channel_in_use

pin definitions in GPIO.RPi are physical pins on board *not* BCM or wiring ip!

{image: gpio1.png}

^^ flasing

.pre
dpavlin@blue:~/Arduino/RF433_Sockets$ scp /tmp/build*.tmp/*.hex pi@rpi.tv:/tmp/
RF433_Sockets.cpp.hex                                        100%   19KB  18.6KB/s   00:00

pi@raspberrypi ~ $ cat avrdude.sh 
#!/bin/sh
hex=`ls -t /tmp/*.hex | head -1`
echo "flash hex: $hex"
sudo /home/pi/avrdude-rpi/avrdude-autoreset -C /home/pi/avrdude.conf -v -v -patmega328p -carduino -P/dev/ttyAMA0 -b57600 -D -Uflash:w:$hex:i 

pi@raspberrypi ~ $ ./avrdude.sh
flash hex: /tmp/RF433_Sockets.cpp.hex

avrdude: Version 6.1, compiled on Sep 17 2014 at 05:41:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/pi/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyAMA0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
done with autoreset
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "/tmp/RF433_Sockets.cpp.hex"
avrdude: writing flash (6770 bytes):

Writing | ################################################## | 100% 1.98s

avrdude: 6770 bytes of flash written
avrdude: verifying flash memory against /tmp/RF433_Sockets.cpp.hex:
avrdude: load data flash data from input file /tmp/RF433_Sockets.cpp.hex:
avrdude: input file /tmp/RF433_Sockets.cpp.hex contains 6770 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.49s

avrdude: verifying ...
avrdude: 6770 bytes of flash verified

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe

avrdude done.  Thank you.

strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
.pre

^ DS1307 Tiny RTC

* http://www.instructables.com/id/Set-up-Real-Time-Clock-RTC-on-Raspberry-Pi/
* http://electronics.stackexchange.com/questions/98361/how-to-modify-ds1307-rtc-to-use-3-3v-for-raspberry-pi

Check if module has 5V pull-up I2C resistors! If it does (like Tiny RTC has R2 and R3) you will have to remove them.

{image: tiny-rtc-3.3v-remote-r2-r3.jpg}

.pre
root@raspberrypi:/home/pi# apt-get install i2c-tools

root@raspberrypi:/home/pi# modprobe i2c-dev

root@raspberrypi:/home/pi# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@raspberrypi:/home/pi# modprobe rtc-ds1307

root@raspberrypi:/home/pi# echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device

root@raspberrypi:/home/pi# hwclock --systohc -D --noadjfile --utc
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Assuming hardware clock is kept in UTC time.
Time elapsed since reference time has been 0.722720 seconds.
Delaying further to reach the new time.
Setting Hardware Clock to 11:53:41 = 1429876421 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
.pre

^^ DS18B20

.pre
root@raspberrypi:/home/pi# grep w1 /boot/config.txt 
dtoverlay=w1-gpio

# reboot

root@raspberrypi:/home/pi# cat /sys/bus/w1/devices/28-0000043c5507/w1_slave 
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000
.pre

Hmm, you will also want to remove R1 pullup to make it work?

^ avrdude

Using Raspberry Pi as Arduino ISP programmer

* https://github.com/onandoffables/avrdude-linuxgpio

.pre
root@raspberrypi:/home/pi# avrdude -c linuxgpio -p atmega328p

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f

avrdude: safemode: Fuses OK (E:05, H:DA, L:FF)

avrdude done.  Thank you.
.pre

^ logic analyzer

* bare metal: https://github.com/tuxyme/metal-pi
* Panalyzer - a RaspberryPi based Logic Analyzer https://github.com/richardghirst/Panalyzer

^ rotary encoder

http://www.bobrathbone.com/raspberrypi_rotary.htm

^ SWD

http://www.disk91.com/2015/technology/programming/swd-programming-using-a-raspberrypi/
https://github.com/disk91/PySWD

.pre
pi@raspberrypi ~ $ git clone https://github.com/disk91/PySWD
pi@raspberrypi ~ $ cd PySWD/

.pre

^ PIC

* rpp - PIC Programmer using GPIO http://holdenc.altervista.org/rpp/
* http://mujweb.cz/tlc/rpp/
* https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=14689&start=75
* https://github.com/oh7bf/PiPIC
* https://github.com/WallaceIT/picberry

^ esp8089

* https://hackaday.io/project/8678-rpi-wifi-hat
* https://github.com/al177/esp8089

^ PS/2 GPIO

* http://www.deater.net/weave/vmwprod/hardware/pi-ps2/
** https://github.com/deater/vmw-meter/blob/master/pi-ps2/linux-kernel/pi-ps2gpio.c

^ GPIO header annotations

* https://github.com/splitbrain/rpibplusleaf/tree/master

^ Signal generator

* https://github.com/JamesP6000/WsprryPi

.pre
pi@rpi2 ~/WsprryPi $ sudo ./wspr --test-tone 1000000
A test tone will be generated at frequency 1.000000 MHz

Using local mbox device file with major 249.
Transmitting test tone on frequency 1.000000 MHz
Press CTRL-C to exit!
.pre

* http://github.com/gryrmln/RPi_Wobbulator

^ LCD panels

http://blog.reasonablycorrect.com/raw-dpi-raspberry-pi/

^ Pi Zero USB OTG

libcomposite

* http://isticktoit.net/?p=1383

^ PATA IDE emulation

* https://www.retrotronics.org/home-page/netpi-ide/

^ DPI LCD screen

* http://blog.reasonablycorrect.com/raw-dpi-raspberry-pi/
* https://www.raspberrypi.org/forums/viewtopic.php?p=1023780#p1023780

^ i2c clock stretching

* https://github.com/raspberrypi/linux/issues/254#issuecomment-217047171
 
{toc: }

^ power

* what about power it by USB http://forums.parallella.org/viewtopic.php?f=12&t=1128
* 2A to micro-usb connector next to the rj45 Ethernet http://forums.parallella.org/viewtopic.php?f=50&t=1081
* How to minimize Epiphany standby power? http://forums.parallella.org/viewtopic.php?uid=590&f=10&t=1069&start=0

* Critical issue with non-conforming USB powered hubs. http://forums.parallella.org/viewtopic.php?f=10&t=841
* USB port change http://forums.parallella.org/viewtopic.php?f=10&t=1072
* USB power fix http://forums.parallella.org/viewtopic.php?f=50&t=1510

* Where can I draw 5V for a fan ? http://forums.parallella.org/viewtopic.php?f=23&t=1049&start=10

^ Update boot flash

This is required to get CR10 led working

* http://forums.parallella.org/viewtopic.php?f=49&t=983
* https://github.com/parallella/parallella-hw/tree/master/boards/parallella-I/firmware

enviroment before u-boot update:

.pre
zynq-uboot> env print
baudrate=115200
bitstream_image=parallella.bit.bin
bootcmd=run modeboot
bootdelay=0
devicetree_image=devicetree.dtb
devicetree_size=0x20000
ethact=zynq_gem
ethaddr=04:4f:8b:00:10:13
fdt_high=0x20000000
initrd_high=0x20000000
ipaddr=192.168.0.99
kernel_image=uImage
kernel_size=0x500000
modeboot=run qspiboot
qspiboot=echo Configuring PL and Booting Linux...;mmcinfo;fatload mmc 0 0x4000000 ${bitstream_image};fpga load 0 0x4000000 0x3dbafc;fatload mmc 0 0x3000000 ${kernel_image};fatload mmc 0 0x2A00000 ${devicetree_image};bootm 0x3000000 - 0x2A00000
serverip=192.168.0.101
stderr=serial
stdin=serial
stdout=serial

Environment size: 655/131068 bytes
.pre

flasing output:

.pre
zynq-uboot> mmcinfo
Device: SDHCI
Manufacturer ID: 3
OEM: 5344
Name: SU08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
zynq-uboot> fatload mmc 0 0x4000000 parallella.7020.flash.bin
reading parallella.7020.flash.bin

4351800 bytes read
zynq-uboot> sf probe 0 0 0
SF: Detected N25Q128 with page size 64 KiB, total 16 MiB
zynq-uboot> sf erase 0 0x1000000
SF: Successfully erased 16777216 bytes @ 0x0
zynq-uboot> sf write 0x4000000 0 0x$filesize
SF: program success 4351800 bytes @ 0x0

# I skipped set ethaddr because it was already set correctly

zynq-uboot> set AdaptevaSKU SKUA101040
zynq-uboot> saveenv
Saving Environment to SPI Flash...
SF: Detected N25Q128 with page size 64 KiB, total 16 MiB
Erasing SPI flash...SF: Successfully erased 131072 bytes @ 0x4e0000
Writing to SPI flash...SF: program success 131072 bytes @ 0x4e0000
done


.pre

^ GPIO

.pre
dpavlin@parallella:~/parallella-utils$ make gpiotest
gcc -o gpiotest gpiotest.c para_morse.c para_gpio.c -Wall -lrt

dpavlin@parallella:~/parallella-utils$ sudo ./gpiotest 
[sudo] password for dpavlin: 
GPIOTEST - Basic test of para_gpio

Initializing...
Success, pausing 5 seconds
Setting direction (forces output to 0!)...
Pausing 5 seconds
Reading multiple times
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
Toggling pin 100000 times...
Took 1.432 seconds, 69818 updates/sec
Write / Read test, 100000 times...
Took 2.618 seconds, 76384 ops/sec
Setting output to 0
Verifying level... OK
Disabling output and monitoring input
Gave up waiting for the input to transition
Setting output to 1
Verifying level... OK
Disabling output and monitoring input
Input flipped after 0 cycles
Closing



.pre

^ FPGA

* Zynq documentation http://forums.parallella.org/viewtopic.php?f=51&t=1114

* Command-line programming http://forums.parallella.org/viewtopic.php?uid=590&f=51&t=1161&start=0

.pre
sudo mknod /dev/xdevcfg c 250 0
sudo -s
cat parallella.bit.bin > /dev/xdevcfg
exit

# programming time
cat /sys/devices/amba.1/f8007000.devcfg/prog_done
.pre

* Routing additional Zynq hard block I/O to PEC_FPGA http://forums.parallella.org/viewtopic.php?f=51&t=1154

* Source http://forums.parallella.org/viewtopic.php?uid=590&f=10&t=1069&start=0

* does the board contains thermal sensor(s) ? http://forums.parallella.org/viewtopic.php?f=23&t=930

.pre
/sys/bus/iio/devices/iio:device0/in_temp0_raw
/sys/bus/iio/devices/iio:device0/in_temp0_offset
/sys/bus/iio/devices/iio:device0/in_temp0_scale

T = ((in_temp0_raw + in_temp0_offset) * in_temp0_scale) / 1000)
.pre

script:

.pre
#!/bin/bash
raw=`cat /sys/bus/iio/devices/iio:device0/in_temp0_raw`
offset=`cat /sys/bus/iio/devices/iio:device0/in_temp0_offset`
scale=`cat /sys/bus/iio/devices/iio:device0/in_temp0_scale`

c_temp=`echo "scale=1;(($raw + $offset) * $scale) / 1000" | bc`
f_temp=`echo "scale=1;(($c_temp * 9) / 5) + 32" | bc`

echo
echo "Zynq Temp: $c_temp C / $f_temp F"
echo
.pre

Modified to display temperature in loop: {file: temp.sh}

^^ headless stream

http://forums.parallella.org/viewtopic.php?f=48&t=1213

removed html traces from device tree

^ serial

* serial port http://forums.parallella.org/viewtopic.php?f=10&t=845

^ hardware

* Eagle library available http://forums.parallella.org/viewtopic.php?f=11&t=559
* KiCad daughter card template http://forums.parallella.org/viewtopic.php?f=11&t=1204 https://github.com/TiZed/Parallella_Template
* Parallella Case With 12V Fan http://www.thingiverse.com/thing:273701
* Parallella clip case https://github.com/kyllikki/designs/tree/master/Parallella
* ARM JTAG http://forums.parallella.org/viewtopic.php?f=10&t=167
* uboot network problems http://forums.parallella.org/viewtopic.php?f=48&t=1667&p=10416&hilit=devicetree#p10416

^ software

^^ device tree

.pre
sudo apt-get install device-tree-compiler

# Compiling a device tree blob from source (.dts-->.dtb):
dtc -I dts -O dtb -o devicetree.dtb zynq-parallella1-headless.dts

# To get source from compiled device tree (.dtb-->.dts):
dtc -I dtb -O dts -o devicetree.dts devicetree.dtb

.pre

^^ /dev

see how to modify devicetree at http://elinux.org/Parallella_Speed_Up_Ubuntu

^^ Debian

http://elinux.org/Parallella_Debian

^^ Epiphany

* cgminer https://github.com/LordRafa/cgminer
{toc: }

^ Working configuration

(for me at least :-)

^^ /etc/ppp/peers/huawei-e220

.pre
dpavlin@llin:~$ cat /etc/ppp/peers/huawei-e220
# /etc/ppp/peers/huawei-e220 pppd script
# pppd call huawei-e220

debug
kdebug 3
nodetach
#persist

/dev/ttyUSB0
460800
idle 7200
noipdefault
defaultroute
usepeerdns

connect "/usr/sbin/chat -vf /etc/chatscripts/huawei-e220.chat"  

# avoid compression:
noccp
#nobsdcomp
novj
# t-mobile specific?
#ipcp-restart 8
#ipcp-max-configure 50
#ipcp-accept-local
#ipcp-accept-remote
#ipcp-max-failure 20

lcp-echo-failure 0
lcp-echo-interval 0

modem
crtscts

require-pap
refuse-chap

show-password
user YOUR_USERNAME@DOMAIN
password YOUR_PASSWORD

passive
.pre

^^ /etc/chatscripts/huawei-e220.chat

.pre
dpavlin@llin:~$ cat /etc/chatscripts/huawei-e220.chat
TIMEOUT 3
ABORT BUSY 
ABORT 'NO CARRIER' 
ABORT VOICE 
ABORT 'NO DIALTONE' 
ABORT 'NO DIAL TONE' 
ABORT 'NO ANSWER' 
ABORT DELAYED
"" ATZ
OK ATQ0V1E1S0=0&C1&D2
OK AT+COPS?
OK AT+CGDCONT=1,"ip","carnet.vip.hr"
OK ATDT*99#
CONNECT ""
.pre

^ Links

* http://wwwu.uni-klu.ac.at/agebhard/HuaweiE220/
* another tutorial: http://ske.sourceforge.net/html/projects/huawei/huawei_tre.html
* interesting compilation of configuration files and stat tool: http://oozie.fm.interia.pl/pro/huawei-e220/
* Ubuntu, GUI: http://sistemac-portal.carnet.hr/node/335
* source: http://www.kanoistika.sk/bobovsky/archiv/umts/
* ObWikipedia: http://en.wikipedia.org/wiki/Huawei_E220

^ Turn off pin

.pre
$ cu -l /dev/ttyUSB0
at+clck="sc",0,"PIN!"
OK
.pre

^ libusb driver program

^^ Compilation

Get source from http://www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c

.pre
cc     huaweiAktBbo.c   -o huaweiAktBbo -lusb
.pre

^ hal problem

If you modem is restarting like mad, it's problem with hal.

* http://wiki.archlinux.org/index.php/Huawei_E220

^ CD image update

Since device can emulate USB CDROM, I will try to update image on it to provide bios update image instead of useless (to me) Windows drivers.

^^ dmesg

.pre
dpavlin@t61p:~$ uname -a
Linux t61p 2.6.30-1-686-bigmem #1 SMP Mon Aug 3 17:32:39 UTC 2009 i686 GNU/Linux
dpavlin@t61p:~$ dmesg
[ 3405.568120] usb 4-1: new full speed USB device using uhci_hcd and address 2
[ 3405.726188] usb 4-1: New USB device found, idVendor=12d1, idProduct=1003
[ 3405.726196] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3405.726203] usb 4-1: Product: HUAWEI Mobile
[ 3405.726208] usb 4-1: Manufacturer: HUAWEI Technologies
[ 3405.726384] usb 4-1: configuration #1 chosen from 1 choice
[ 3405.792930] Initializing USB Mass Storage driver...
[ 3405.796244] usb-storage: probe of 4-1:1.0 failed with error -1
[ 3405.796289] usbcore: registered new interface driver usb-storage[ 3405.796296] USB Mass Storage support registered.
[ 3405.952077] usb 4-1: USB disconnect, address 2
[ 3407.432107] usb 4-1: new full speed USB device using uhci_hcd and address 3
[ 3407.590171] usb 4-1: New USB device found, idVendor=12d1, idProduct=1003
[ 3407.590180] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3407.590187] usb 4-1: Product: HUAWEI Mobile
[ 3407.590192] usb 4-1: Manufacturer: HUAWEI Technologies
[ 3407.590373] usb 4-1: configuration #1 chosen from 1 choice
[ 3407.603280] usb-storage: probe of 4-1:1.2 failed with error -1[ 3407.650695] usbcore: registered new interface driver usbserial
[ 3407.650725] USB Serial support registered for generic
[ 3407.650819] usbcore: registered new interface driver usbserial_generic
[ 3407.650824] usbserial: USB Serial Driver core
[ 3407.663176] USB Serial support registered for GSM modem (1-port)
[ 3407.663293] option 4-1:1.0: GSM modem (1-port) converter detected
[ 3407.663458] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 3407.663478] option 4-1:1.1: GSM modem (1-port) converter detected
[ 3407.663576] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 3407.663609] usbcore: registered new interface driver option
[ 3407.663614] option: v0.7.2:USB Driver for GSM modems
.pre

^^ power

.pre
root@t61p:~/t61p/usb_modeswitch/usb_modeswitch-1.0.2# lsusb
Bus 004 Device 003: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

root@t61p:~/t61p/usb_modeswitch/usb_modeswitch-1.0.2# echo suspend >  /sys/bus/usb/devices/4-1/power/level
root@t61p:~/t61p/usb_modeswitch/usb_modeswitch-1.0.2# dmesg
.pre

^^ links

* http://www.draisberghof.de/usb_modeswitch/

{fetchrss: http://feeds.delicious.com/v2/rss/dpavlin/e220?count=15 full}

^ E171

.pre
Found modem         : E171
Model               : Huawei E171
IMEI                : 354807044078459
Serial NR.          : 4BA5TA10B2706637
Firmware            : 11.126.85.01.143
Compile date / time : Jun 21 2010 20:27:27
Dashboard version   : UTPS11.300.05.15.143_MAC11.301.09.01.143
Chipset             : Qualcomm MSM6290
Voice feature       : disabled
SIM Lock status     : unlocked
Wrong codes entered : 0 (unlock attempts left : 10)
.pre

^ E1752

.pre
Found modem         : E1752
Model               : Huawei E1752
IMEI                : 353145034241600
Serial NR.          : O47NAA19A1600110
Firmware            : 11.126.13.00.00
Compile date / time : Jul 05 2010 10:16:42
Dashboard version   : UTPS11.300.05.22.56_MAC11.300.08.19.56
Chipset             : Qualcomm MSM6290
Voice feature       : disabled
SIM Lock status     : unlocked
Wrong codes entered : 0 (unlock attempts left : 10)
.pre

.pre
AT^CVOICE=0 Enable Voice
AT^CVOICE=1 Disable Voice
AT^CVOICE=? Check status
=========
AT^U2DIAG=0 – switch the device in modem mode only
AT^U2DIAG=1 – device in modem mode + CD-ROM
AT^U2DIAG=255 – modem mode + CD-ROM + Card Reader
AT^U2DIAG=256 – modem mode + Card Reader
.pre
SQL snippets for PostgreSQL

{toc: }

^ Size of transaction log

.pre
select sum((pg_stat_file('pg_xlog/' || file)).size)
from pg_ls_dir('pg_xlog') as file
where file ~ '^[0-9A-F]';
.pre

^ Size of tables in current database

.pre
select relname,pg_relation_size(oid) as size
from pg_class
where relkind = 'r' and relname not like 'pg_%' order by size desc;
.pre

^ Number of rows in all tables

http://stackoverflow.com/questions/2596670/how-do-you-find-the-row-count-for-all-your-tables-in-postgres

.pre
SELECT 
  nspname AS schemaname,relname,reltuples::int
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE 
  nspname NOT IN ('pg_catalog', 'information_schema') AND
  relkind='r' 
ORDER BY reltuples DESC;
.pre

^ Script to display database size

Script: {file: pg_size}

^^ all databases

.pre
$ pg_size
.pre

^^ all databases, grouped by user

.pre
$ pg_size -u
.pre

^ Active locks

.pre
select * from pg_locks where pid not in (select procpid from pg_stat_activity);
.pre

^ Graphics

Taken from http://lca2007.linux.org.au/att_data/Miniconfs(2f)PostgreSQL/attachments/advanced.pdf

.pre
# CREATE AGGREGATE array_accum (anyelement)
(
    sfunc = array_append,
    stype = anyarray,
    initcond = '{}'
);

# select d, count(*),
       array_to_string(array_accum('+'::text),'') as graph
       from hits group by 1 order by 1 asc;
     d       | count | graph
------------+-------+----------
 2007-01-13 |      8 | ++++++++
 2007-01-14 |      7 | +++++++
 2007-01-15 |      4 | ++++
(3 rows)
.pre

^ Current query activity

.pre
select datid,datname,procpid,current_query,query_start from pg_stat_activity where current_query not like '<IDLE>' ;
.pre

To actually *see* queries you also have to edit `postgresql.conf` to include:

.pre
stats_command_string = yes
.pre

^ Quickly convert database table to SQLite

.pre
pg_dump --inserts --no-owner --no-privileges --table hr_edu_orgs a3c | grep -v ^SET | sqlite3 var/a3c.sqlite
.pre
{toc: }

There are many on-line resources about RFID. However, most of them are not well suited for beginners. So, if you just got RFID reader (3M in this case) and want high-level overview of what it is and what it can do, you are out of luck.

Until now, that is. This guide should help you decide if RFID is right thing for your library and when you make choice to implement it, how to do it.

This document will describe my experience with 3M 810 reader using RFID 501: RFID Standards for Libraries {file: RFID_501.pdf}

^ RFID tag

Best way to think about RFID tags is like contact-less readable barcode.

Our particular tags come in two form: RFID stickers (to be placed on books) and plastic credit-card like cards (we use them for patrons).

Have in mind that established practice is to have different RFID systems for books and patrons (we are use same one). When we asked about using same system for books and patrons, we got reply: "we don't have experience with it".
In practice, we have problem with 3M selfcheck software in some special conditions where book reader have patron card in range it gets network connection error with SIP server.
Since normal configuration of selfcheck stations is to have two different systems for patrons and books this problem doesn't show up for other users.

Each tag has unique serial number (SID) assigned by manufacturer and used in RFID collision detection protocol. It looks like hexadecimal number starting with letter `E0` like this: `E00401003123AA26`.

It's best to think of SID as unique identifier of physical tag.
Your information system will have it's own ID (barcode?) for some item.
There are cases in which you might want to change physical tag sticker on book because it's damaged. In that case, you will change SID of that item, but not barcode (which is data programmed on tag itself).

Our initial idea was to use data programmed on chip for everything, and just ignore SIDs, but we found out that there is class of RFID devices which can read ONLY SID from chip (in our case it's photocopying system).
3M software does record SIDs to log file when programming chips, but that's all. It essential ignores it for all practical intends and purposes.

Chips have 7 blocks of user data on it, each block with 4 bytes which enables us to store 28 bytes of user specified data on each tag.

^^ blank tag

^^^ 3M Manufacturing Blank

Easiest case is blank tag, in which all data on chip is 0x55

.pre
0	55 55 55 55		blank tag
1	55 55 55 55
2	55 55 55 55
3	55 55 55 55
4	55 55 55 55
5	55 55 55 55
6	00 00 00 00 
.pre

^^^ Generic blank

Generic blank seems to erase only first three blocks with zeros:

.pre
00	00 00 00 00
01	00 00 00 00
02	00 00 00 00
.pre

while rest of tag will be unchanged *including rest of data on tag*

^^ programmed tag

Tags programmed with 3M software have following data layout on them:

.pre
0	04 is 00 tt		i [4 bit] = number of item in set	[1 .. i .. s]
					s [4 bit] = total items in set
					tt [8 bit] = item type

1	dd dd dd dd		dd [16 bytes] = barcode data
2	dd dd dd dd
3	dd dd dd dd
4	dd dd dd dd

5	bb bl ll ll		b [12 bit] = branch [unsigned]
				l [20 bit] = library [unsigned]
6	cc cc cc cc		c [32 bit] = custom signed integer
.pre

This basically means that your barcode or identifier of item or patron can have up to 16 characters (by default numeric, but you can extend that to handle alphanumeric and special character if you need that) and three integer values: branch `0 .. 4095`, library `0 .. 1048575` and custom data `-2147483648 .. 2147483647`.

You might want to use those values to uniquely identify your library and branch so that your RFID tags in books won't collide with other libraries.
If you leave decision just to providers of equipment, you might end up with 300000 tags which have plain and simple 0 in those fields. Guess which value will have tags of next library which that provider will have? My guess would be 0 also.

Writing correct numbers in that fields is not enough. If you want to use 3M software, you will also have to setup it to ignore all other tags which doesn't match your library and branch.

^^ security

There is also single byte called AFI or security which can be changed without accessing content of chip. This byte is also readable by more primitive RFID devices like doors to check if book have been checked out from library.

3M is using `0xD7` (215) value for secured items (door will beep) and `0xDA` (218) as unsecured. It seems that all other values are ignored.
(I would guess that other manufacturers are using different values)

As I mentioned before, since we don't have any special values in branch, library or custom field, we have situations in which patron cards get secured when patron walks by checkout counter and 3M software is left in checkout mode.
This triggers door to ring when patron passes which is not ideal.

^^ disable tag

3M software have option to disable tags. Initial examination showed that it's simply programming of tag with following content:

.pre
00	ff 00 00 00
01	00 00 00 00
02	00 00 00 00
03	00 00 00 00
04	00 00 00 00
05	00 00 00 00
06	00 00 00 00
.pre

and security set to `d7` (this might be value from tag before disabling it, I'll have to re-check this)

While 3M software will ignore tags programmed with this content, there is *not permanent disabling of tag* since it can be programmed using other software.

^ RFID reader device

Reader consists of several part:

* black pad - reader antenna
* reader - small box with micro controller and usb port
* software

Reader is recognized as USB serial device with it's own protocol on serial port. We are mostly interested in it's protocol and our ability to use reader and tags with our custom software.

At first, I assumed that protocol with RFID readers is some kind of standard.
After extensive search on Internet I wasn't able to find any documentation about this particular protocol (I even tried to compare it with existing open source implementations just to be sure).

So, only solution was to do clean-room reverse engineering, and using that technique I developed perl module which can talk with RFID reader which is available at http://svn.rot13.org/index.cgi/RFID

After initial reverse engineering of protocol I rewrote support for 3M and CPR reader which is available at https://github.com/dpavlin/Biblio-RFID

^ Related blog posts

{fetchrss: http://mjesec.ffzg.hr/~dpavlin/blog/mt/mt-search.cgi?tag=RFID&Template=feed&IncludeBlogs=1}

^ More information

If this was too geeky for you here is some additional materials:

* "RFID for libraries FAQ"<http://www.bibliotheca-rfid.com/faq>
* "RFID - overview of protocols, librfid implementation and passive sniffing"<http://events.ccc.de/congress/2005/fahrplan/events/769.en.html>

^ ISO standard

* ISO 15962.2004 - object identifier structure
* ISO 15693 - RFID (layer 2)
* ISO 18000 Part 3 Mode 1 - 13.56MHz
* "ISO/IEC JTC1/SC17/WG8"<http://www.incits.org/tc_home/b105htm/b105Doc2003/N03-140-WG8-Work-Project.htm>

^ ISO/IEC 14443, Proximity cards

The Standard series ISO/IEC 14443 consists of 4 parts, which are:

^^ ISO/IEC 14443-1 Physical characteristics

{file: 17n1363t.doc} {file: 17n1363b.doc}

^^ ISO/IEC 14443-2 Radio frequency power and signal interface

{file: 17n1522t.pdf} {file: 17n1522c.doc}

^^ ISO/IEC 14443-2/AMD2 Amendment 2: Bit rates of fc/64, fc/32 and fc/16

{file: 17n2343T.pdf} {file: 17n2343F.doc}

^^ ISO/IEC 14443-3 Initialization and anticollision

{file: 17n1531t.pdf} {file: 17n1531c.doc}

^^ ISO/IEC 14443-3 Amendment 1: Bit rates of fc/64, fc/32 and fc/16

{file: 17n2342T.pdf} {file: 17n2342F.doc}

^^ ISO/IEC 14443-4 Transmission protocol

{file: 17N1689T.pdf} {file: 17n1689c.doc}

^ ISO/IEC 15693, Vicinity cards

^^ ISO/IEC 15693-1 Physical characteristics

{file: 17n1355t.doc} {file: 17n1355b .doc}

^^ ISO/IEC 15693-2 Air interface and initialisation

{file: 17n1486.pdf} {file: 17n1486c.doc}

^^ ISO/IEC 15693-3 Anticollision and transmission protocol

{file: 17n1692t.pdf} {file: 17n1692c.doc}

^ ISO/IEC 10373-6, 10373-7, Test methods for the contactless integrated circuit(s) cards

^^ ISO/IEC 10373-6 Proximity cards

{file: 17n1695t.pdf} {file: 17n1695c.doc}

^^ ISO/IEC 10373-6/AMD1 Amendment 1: Additional PICC test methods

{file: 17n2258t.pdf} {file: 17n2258t.doc} {file: 17n2258C.doc}

^^ ISO/IEC 10373-6/AMD2 Amendment 2: Improved RF test methods

{file: 17n2225t.pdf} {file: 17n2225F.doc}

^^ ISO/IEC 10373-7 Vicinity cards

{file: 17n1697t.pdf} {file: 17n1697c.doc}

^ ISO/IEC 10536, Close-coupled cards

^^ ISO/IEC 10536-1 Physical characteristics

{file: 17n1480t.PDF} {file: 17n1480c.doc}
Welcome to scratch pad of usefull shell snippets

{toc: }

^ remove all php4 packages with apt-get

.pre
dpkg -l | grep php4 | awk '{ print $2 }' | xargs apt-get remove -y
.pre

^ use socat as simple serial program

.pre
socat - /dev/ttyS0,b9600,echo=0,raw
.pre

^ list first ten files from srchives

.pre
ls *.tar.gz *.tgz | xargs -i sh -c "ls -hs '{}' ; echo ; tar tvfz '{}' | head -10 ; echo"

ls *.tar.bz2 *.tbz | xargs -i sh -c "ls -hs '{}' ; echo ; tar tvfj '{}' | head -10 ; echo"
.pre

> Yes, it sucks that `tar` doesn't know how to handle compression formats automatically...

^ tail recent logs and put output in file

Useful to take a quick view into last lines, reload page (and capture newly created errors/infos) and store that in single file for easy review (in vim :-)

.pre
tail -f /var/log/apache2/*.log | tee ~/log
.pre

^ port forwarder using socat

.pre
socat -d -d TCP4-LISTEN:1280,fork TCP4:192.168.212.5:80
.pre

^ remove all filesystem cache

.pre
echo 3 > /proc/sys/vm/drop_caches
.pre
D-Link DNS-323 network attached storage

{toc: }

^ Overview

{file: dmesg.txt}

.pre
dlink-DFDADE:~# uname -a
Linux dlink-DFDADE 2.6.12.6-arm1 #30 Mon Aug 18 14:19:14 CST 2008 armv5tejl GNU/Linux

dlink-DFDADE:~# free
            total      used      free    shared   buffers    cached
Mem:        61904     54808      7096         0     11824     30592
-/+ buffers/cache:     12392     49512
Swap:     1060208         0   1060208

dlink-DFDADE:~# cat /proc/cpuinfo 
Processor      : ARM926EJ-Sid(wb) rev 0 (v5l)
BogoMIPS       : 331.77
Features       : swp half thumb fastmult edsp java 
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant    : 0x0
CPU part       : 0x926
CPU revision   : 0
Cache type     : write-back
Cache clean    : cp15 c7 ops
Cache lockdown : format C
Cache format   : Harvard
I size         : 32768
I assoc        : 1
I line length  : 32
I sets         : 1024
D size         : 32768
D assoc        : 1
D line length  : 32
D sets         : 1024

Hardware       : MV-88fxx81
Revision       : 0000
Serial         : 0000000000000000
.pre

^ RAID

.pre
Personalities : [linear] [raid0] [raid1] 
md0 : active raid0 sda2[0] sdb2[1]
      2925532672 blocks 64k chunks
      
unused devices: <none>
dlink-DFDADE:~# hdparm -tT /dev/sda /dev/sdb /dev/md0

/dev/sda:
 Timing cached reads:   210 MB in  2.01 seconds = 104.48 MB/sec
 Timing buffered disk reads:   72 MB in  3.00 seconds =  24.00 MB/sec

/dev/sdb:
 Timing cached reads:   212 MB in  2.01 seconds = 105.47 MB/sec
 Timing buffered disk reads:  104 MB in  3.03 seconds =  34.32 MB/sec

/dev/md0:
 Timing cached reads:   208 MB in  2.01 seconds = 103.48 MB/sec
 BLKGETSIZE failed: File too large

dlink-DFDADE:~# dd_rescue /dev/sda /dev/null
dd_rescue: (info): ipos:   1044480.0k, opos:   1044480.0k, xferd:   1044480.0k
                   errs:      0, errxfer:         0.0k, succxfer:   1044480.0k
             +curr.rate:    37169kB/s, avg.rate:    32123kB/s, avg.load: 60.7%

dlink-DFDADE:~# dd_rescue /dev/md0 /dev/null
dd_rescue: (info): ipos:    729536.0k, opos:    729536.0k, xferd:    729536.0k
                   errs:      0, errxfer:         0.0k, succxfer:    729536.0k
             +curr.rate:    37176kB/s, avg.rate:    37502kB/s, avg.load: 76.5%
.pre

^ Debian

* http://www.cyrius.com/debian/orion/d-link/dns-323/install.html

^^ 2.6.26-2-orion5x

^^^ raid0

.pre
Linux dlink-DFDADE 2.6.26-2-orion5x #1 Thu Aug 20 05:04:03 UTC 2009 armv5tel GNU/Linux
Personalities : [raid1] [raid6] [raid5] [raid4] [raid0] 
md1 : active raid0 dm-1[1] dm-0[0]
      2097024 blocks 64k chunks
      
md0 : active raid1 sda4[0] sdb4[1]
      513984 blocks [2/2] [UU]
      
unused devices: <none>

/dev/sda:
 Timing cached reads:   212 MB in  2.01 seconds = 105.39 MB/sec
 Timing buffered disk reads:   72 MB in  3.05 seconds =  23.58 MB/sec

/dev/sdb:
 Timing cached reads:   218 MB in  2.01 seconds = 108.26 MB/sec
 Timing buffered disk reads:   88 MB in  3.00 seconds =  29.33 MB/sec

/dev/md1:
 Timing cached reads:   208 MB in  2.01 seconds = 103.46 MB/sec
 Timing buffered disk reads:   60 MB in  3.07 seconds =  19.57 MB/sec
.pre



.pre
Linux dlink-DFDADE 2.6.26-2-orion5x #1 Thu Aug 20 05:04:03 UTC 2009 armv5tel GNU/Linux
Personalities : [raid1] [raid6] [raid5] [raid4] [raid0]
md1 : active (auto-read-only) raid1 dm-1[1] dm-0[0]
      1048512 blocks [2/2] [UU]
        resync=PENDING

md0 : active raid1 sda4[0] sdb4[1]
      513984 blocks [2/2] [UU]

unused devices: <none>

/dev/sda:
 Timing cached reads:   220 MB in  2.00 seconds = 109.73 MB/sec
 Timing buffered disk reads:   82 MB in  3.01 seconds =  27.22 MB/sec

/dev/sdb:
 Timing cached reads:   216 MB in  2.02 seconds = 107.12 MB/sec
 Timing buffered disk reads:   90 MB in  3.09 seconds =  29.14 MB/sec

/dev/md1:
 Timing cached reads:   208 MB in  2.02 seconds = 103.19 MB/sec
 Timing buffered disk reads:   52 MB in  3.05 seconds =  17.06 MB/sec
.pre

^^ 2.6.30

http://www.cyrius.com/journal/debian/orion/d-link/dns-323/dns-323-fan-control

.pre
dlink-DFDADE:~/mdadm# ./test.sh 
+ ./remove.md1.sh
+ mdadm --manage --stop /dev/md1
mdadm: error opening /dev/md1: No such file or directory
+ mdadm --manage --remove /dev/md1
mdadm: error opening /dev/md1: No such file or directory
+ yes
+ mdadm --create --verbose /dev/md1 --level=0 --raid-devices=2 --force /dev/vga/raid.a /dev/vgb/raid.b
mdadm: chunk size defaults to 64K
mdadm: /dev/vga/raid.a appears to be part of a raid array:
    level=raid1 devices=2 ctime=Sat Sep  5 14:54:52 2009
mdadm: /dev/vgb/raid.b appears to be part of a raid array:
    level=raid1 devices=2 ctime=Sat Sep  5 14:54:52 2009
Continue creating array? mdadm: array /dev/md1 started.
+ ./hdparm-test.sh
+ test -d out
+ uname -a
+ cat /proc/mdstat
+ hdparm -tT /dev/sda /dev/sdb /dev/md1
++ date +%Y%m%d_%H%M%S
+ tee out/20090905_151032
Linux dlink-DFDADE 2.6.30-1-orion5x #1 Tue Aug 18 04:19:30 UTC 2009 armv5tel GNU/Linux
Personalities : [raid1] [raid0] 
md1 : active raid0 dm-0[1] dm-1[0]
      2097024 blocks 64k chunks
      
md0 : active raid1 sda4[0] sdb4[1]
      513984 blocks [2/2] [UU]
      
unused devices: <none>

/dev/sda:
 Timing cached reads:   246 MB in  2.01 seconds = 122.14 MB/sec
 Timing buffered disk reads:  132 MB in  3.00 seconds =  43.93 MB/sec

/dev/sdb:
 Timing cached reads:   242 MB in  2.01 seconds = 120.27 MB/sec
 Timing buffered disk reads:  138 MB in  3.01 seconds =  45.87 MB/sec

/dev/md1:
 Timing cached reads:   234 MB in  2.01 seconds = 116.15 MB/sec
 Timing buffered disk reads:  130 MB in  3.03 seconds =  42.85 MB/sec
.pre

.pre
+ ./remove.md1.sh
+ mdadm --manage --stop /dev/md1
mdadm: stopped /dev/md1
+ mdadm --manage --remove /dev/md1
+ yes
+ mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 --spare-devices=0 --force /dev/vga/raid.a /dev/vgb/raid.b
mdadm: /dev/vga/raid.a appears to be part of a raid array:
    level=raid0 devices=2 ctime=Sat Sep  5 15:10:31 2009
mdadm: /dev/vgb/raid.b appears to be part of a raid array:
    level=raid0 devices=2 ctime=Sat Sep  5 15:10:31 2009
mdadm: size set to 1048512K
Continue creating array? mdadm: array /dev/md1 started.
+ ./hdparm-test.sh
+ test -d out
+ uname -a
++ date +%Y%m%d_%H%M%S
+ cat /proc/mdstat
+ hdparm -tT /dev/sda /dev/sdb /dev/md1
+ tee out/20090905_151114
Linux dlink-DFDADE 2.6.30-1-orion5x #1 Tue Aug 18 04:19:30 UTC 2009 armv5tel GNU/Linux
Personalities : [raid1] [raid0] 
md1 : active (auto-read-only) raid1 dm-0[1] dm-1[0]
      1048512 blocks [2/2] [UU]
        resync=PENDING
      
md0 : active raid1 sda4[0] sdb4[1]
      513984 blocks [2/2] [UU]
      
unused devices: <none>

/dev/sda:
 Timing cached reads:   116 MB in  2.01 seconds =  57.84 MB/sec
 Timing buffered disk reads:  118 MB in  3.00 seconds =  39.32 MB/sec

/dev/sdb:
 Timing cached reads:   114 MB in  2.01 seconds =  56.79 MB/sec
 Timing buffered disk reads:  140 MB in  3.03 seconds =  46.27 MB/sec

/dev/md1:
 Timing cached reads:   234 MB in  2.02 seconds = 116.07 MB/sec
 Timing buffered disk reads:  110 MB in  3.01 seconds =  36.49 MB/sec
.pre


^^ updates

{fetchatom http://www.cyrius.com/journal/index.atom full}
Here are some quick notes about installation on clean Debian etch machine

This page is aimed towards system administrators, if you want information how to customize design of page take a look at [SocialText CSS design] (which is included on bottom of this page).

{toc: }

^ Helper packages

.pre
sudo apt-get install wv xpdf-utils unrtf unzip links
sudo cpan MP3::Tag
.pre

^ Install source

.pre
svn co https://repo.socialtext.net:8999/svn/socialtext/trunk socialtext
cd socialtext/nlw

# checkout lastest Socialtext::Resting client
svn export --force https://repo.socialtext.net:8999/svn/socialtext-clients/trunk/rest/perl/Socialtext-Resting/lib/Socialtext/ lib/Socialtext/

./configure --socialtext-open 1 --apache-proxy 0 --force-ssl-login 1
make
sudo bash
make install
update-rc.d -f apache-perl remove
update-rc.d st-apache defaults
update-rc.d ceqlotron defaults
/etc/init.d/st-apache start
/etc/init.d/ceqlotron start
.pre

^ Update existing checkout

.pre
cd socaialtext
svn update
cd nlw
./configure --socialtext-open 1 --apache-proxy 0 --force-ssl-login 1
make
make test
sudo make install
sudo /etc/init.d/st-apache stop
sudo /etc/init.d/ceqlotron restart
sudo /etc/init.d/st-apache start
.pre

^ Add new admin user

.pre
sudo -u www-data st-admin create-user --email dpavlin@rot13.org --password wikidream \
  --first-name Dobrica --last-name Pavlinusic
sudo -u www-data st-admin add-workspace-admin --email dpavlin@rot13.org
.pre

^ Configuring mailer

^^ postfix

Install and configure postfix for mail delivery

.pre
apt-get install postfix
vi /etc/postfix/main
.pre

Important lines are following:

.pre
alias_maps = hash:/etc/aliases, hash:/etc/aliases.deliver
alias_database = hash:/etc/aliases, hash:/etc/aliases.deliver
.pre

They add `/etc/aliases.deliver` (which SocialText generates with names of wiki workspaces) to configuration.

Next, we need to create `/etc/aliases.deliver.db` which is binary version of database needed for postfix. It's extremly important that `aliases.deliver` file is owned by `www-data` because postfix picks user which will do e-mail delivery based on owner of aliases file. If your owner of `/var/www/socialtext` is some other user than `www-data` you will have to modify following command appropriately:

.pre
# make www-data owner of file
chown www-data:root /etc/aliases.deliver
# allow root group to write in /etc/
chmod g+w /etc/
# create /etc/aliases.deliver.db
sudo postalias /etc/aliases.deliver
.pre

Now restart postfix as `root` user

.pre
/etc/init.d/postfix restart
.pre

^^ crontab

Add following to `/etc/crontab` to refresh aliases database for postfix regularly:

.pre
*/10 *  * * *   root    postalias /etc/aliases.deliver
.pre

^ Handling e-mail errors

.pre
sudo tail /var/log/mail.log | grep st-admin
.pre

> dsn=5.3.0, status=bounced (Command died with status 13: "/usr/local/bin/st-admin deliver-email --workspace bio". Command output: open nlw-stats.log: Permission denied at /usr/local/share/perl/5.8.8/Socialtext/Statistics.pm line 103. END failed--call queue aborted. )

This problem is reported on socialtext-devel list, but no response so far.

.pre
# sudo vi +24 /usr/local/share/perl/5.8.8/Socialtext/Statistics.pm
Readonly my $LOG_NAME => 'nlw-stats.log';
Readonly my $LOG_PATH => $ENV{APACHE_LOG_DIR}
    ? "$ENV{APACHE_LOG_DIR}/$LOG_NAME"       
    : "/tmp/$LOG_NAME";
.pre

^ Customize template

Remove "Did you know?" box from dashboard

.pre
sudo vi /usr/share/nlw/template/view/homepage
.pre

Or from your `socialtext/nlw` checkout (so that `make install` will install correct one):

.pre
vi share/template/view/homepage
.pre

^ Fix RSS feed errors

If you are using `{fetchrss http://blog.rot13.org/index.xml}` and having problems with RSS feeds, try to re-installing two perl modules:

.pre
sudo cpan XML::RSS XML::Atom
.pre

^ Change e-mail address of workspace

This configuration change will feed responses to e-mails generated by wiki back into wiki. You might not want to do that! :-)

.pre
st-admin set-workspace-config --workspace rot13 \
  email_notification_from_address '"random unstructured stuff" <rot13@wiki.rot13.org>'
.pre

^ Access simple version of page

Every SocialText wiki has a lite version available at http://wiki.example.com/lite/page/:workspace/

For this wiki it's http://saturn.ffzg.hr/lite/page/rot13

^ Configure sane resource usage

Since SocialText wiki is designed to run on dedicated box, it's resource requiements are not for faint-hearted users. However, if you are installing it on machine with constraint hardware (or virtual machine) you might want to decrease number of `apache-perl` server which are created on startup and kept running. Each apache child takes about 80Mb of RAM, so lowering number of children will have beneficial effect on your memory usage.

If you open `/etc/apache-perl/st-httpd.conf` you will see comment that describes command used for generating this configuration. So, let's edit command limits, re-create config and restart apache:

.pre
vi +485 dev-bin/gen-config
dev-bin/gen-config --sitewide --apache-proxy=0 --hostname=saturn.ffzg.hr
/etc/init.d/st-apache reload
.pre

^ Convert RSS feed URLs to absolute

If you need to fetch RSS feeds from remote URLs and those providers create only relative URLs in feeds (like svnweb does) that this patch might help you: {file: FetchRSSPlugin.pm.diff}

It does dirty magic to prepend hostname before URL in feeds making them work from Socialtext wiki which is on different host.

^ Problems with 8-bit UTF-8 encoded characters in URLs

It seems that trunk of socialtext

.pre
Repository Root: https://repo.socialtext.net:8999/svn/socialtext
Repository UUID: 593ce9bc-2028-0410-bb98-c566b643a948
Revision: 6127
Node Kind: directory
Schedule: normal
Last Changed Author: jjp
Last Changed Rev: 6028
Last Changed Date: 2007-12-10 19:38:21 +0100 (Mon, 10 Dec 2007)
.pre

has problems with `CGI.pm` 3.31. As a temporary work-around use {file: backpan.sh} to download `CGI.pm` 3.29 which is known to work.

^ Enable html wafl in workspace

This enables `.html` markup which enables embedded html into wiki page

.pre
st-admin set-workspace-config --workspace razmjenavjestina allows_html_wafl 1
.pre

^ Upgrade to 2.2

There are various problems with this upgrade.

^^ Socialtext::Resting

For a start, you will have to install Socialtext::Resting clinet *in the middle* of `make install` because import of help workspace will fail.

You can get it from https://repo.socialtext.net:8999/svn/socialtext-clients/trunk/rest/perl/Socialtext-Resting

^^ Missing directory

.pre
mkdir /etc/apache-perl/socialtext-conf.d
.pre

^^ Missing skins

http://code.google.com/p/socialtext-skins/wiki/SkinningIssues

.pre

.pre

Problem not yet solved.

----

{include: [SocialText CSS design]}
Quick guide based on "stunnel for mysql - server and client"<http://www.edna.narrabilis.com/2006/06/01/stunnel-for-mysql-server-and-client/> to add https to existing http server on demand.

{toc: }

^ Installation

.pre
apt-get install stunnel4
.pre

^ Create certificate

.pre
cd /etc/stunnel
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout https.pem -out https.pem
.pre

^ Configuration file

`/etc/stunnel/httpd.conf`

.pre
cert = /etc/stunnel/https.pem
sslVersion = SSLv3
debug = 7

[https]
accept  = 443
connect = 80
TIMEOUTclose = 0
.pre

^ Start tunnel

.pre
stunnel4 /etc/stunnel/https.conf
.pre
Use "vpnc"<http://svn.unix-ag.uni-kl.de/vpnc/> instead of Cisco VPN client

{toc: }

^ Source

.pre
svn co http://svn.unix-ag.uni-kl.de/vpnc/trunk vpnc
cd vpnc
make
sudo make install
.pre

^ Support template

.pre
pcf2vpnc Support_template.pcf > /etc/vpnc/foobar.conf
.pre

Hash password security, eh?

^ Start connection

.pre
sudo /usr/local/sbin/vpnc --no-detach --debug 2 foobar
.pre

^ Fix routes

I didn't like that all my traffic was going over VPN

.pre
sudo route del default
route add default gw 192.168.1.1
route add -net 192.168.4.0 netmask 255.255.255.0 dev tun0
.pre
Collection of some hints about Debian installation on my D-Link DSM-G600:

{toc: }

^ Resources

* wiki at http://dsmg600.info/
* forum at http://forum.dsmg600.info/

^ firmware (kernel+busybox)

It will fix various problems, including, but not limited to, problems with web interface in firefox.

http://download.dsmg600.info/people/sala/fwimage-04-sala-20070128

I tried to build firmware from source, but had various problems with building gcc. Thet are mostly related to gdb, but after a few random patches it passed compilation (but is broken, because I just commented offending lines).

^^ usbfs

I also want usbfs which generate compilation errors because of missing files in `include/linux/usbdevice_fs.h`
Based on "instructions on wiki"<http://dsmg600.info/howto:chroot_debian> and "post on forum"<http://forum.dsmg600.info/t17-Debian-howto.html>

.pre
cd /mnt/HD_a2
export DEBOOTSTRAP_DIR=`pwd`/usr/lib/debootstrap
export PATH=$PATH:/mnt/HD_a2/bin:/mnt/HD_a2/sbin
./usr/sbin/debootstrap --arch powerpc etch /mnt/HD_a2/debian http://ftp.de.debian.org/debian
cp /etc/resolv.conf /mnt/HD_a2/debian/etc/resolv.conf
# prepare chroot jail
mount -t proc proc /mnt/HD_a2/debian/proc
cd /mnt/HD_a2/
./chroot /mnt/HD_a2/debian /bin/bash
# install additional packages
apt-get update
apt-get install locales
dpkg-reconfigure locales
passwd root
apt-get install dropbear hotplug
.pre

^ USB printer

Kernel module for USB printers for 2.4.21-pre4 kernel: {file: printer.o}

After installation of `cupsys` and `foomatic` all went smoothly, USB printer ("Samsung ML-2510"<http://openprinting.org/show_printer.cgi?recnum=Samsung-ML-2510>) was found and configured automatically. There are a few more details in "this forum thread"<http://forum.dsmg600.info/t105-Printing.html>.

^ Kernel 2.4

As a try to understand this ppc board, I tried to port changes from MontaVista (D-Link used that tree) to current upstream 2.4 kernel and got to the point where SCSI controller times out when reading partition table. This means that board does init, it has serial port which works and has some idea about PCI space (which seems somewhat fishy if you ask me). {file: linux-2.4.34.4-dsmg600.diff.gz}

Few more details are available in "this forum post"<http://forum.dsmg600.info/p3067-Today-182143.html#p3067>.

^ Kernel 2.6

I have a creazy idea: this device *should* run 2.6! So, here is my work in progress...

According to "patches for kurobox"<http://genbako.vodapone.com/> which is quite similar to our hardware, there isn't any changes in current upstream version execept for missing drivers. For DSM G600 that boils town to "IP1000"<http://www.icplus.com.tw/driver-pp-IP1000A.html> network driver, which still isn't in mainland, but seems to be referenced on LKLM as possible inclusion.

* patch against upstream 2.6.21.1 {file: linux-2.6.21.1-dsmg600.diff.gz} (adds IP1000A driver for LAN, wifi missing)

Expirince with 2.4 kernel shows that I have to do more porting to make 2.6 port usable. As a start, code for board initialization is specific for DSM-G600 as well as serial port driver. When we have those two things working we can see if `loader.o` could boot our kernel. I think that shouldn't be problem, because `loader.o` origin shows that it's possible to boot 2.6 kernel from 2.4 kernel using `loader.o` module.

^^ New round based on powerpc kernels

After review of current upstream kernel (2.6.22) and state of "powerpc kernel.org repository"<http://git.kernel.org/?p=linux/kernel/git/galak/powerpc.git;a=summary> I decided to base my efforts on this branch.

For now here are few useful links:

* dtc compiler: git://www.jdl.com/software/dtc.git
* "Kurobox support in stock 2.6 kernels"<http://www.kurobox.com/mwiki/index.php/Kurobox_support_in_stock_2.6_kernels>

^^ Compilation notes

Compile kernel and convert it to binary format for "loader.o"<http://download.dsmg600.info/people/sala/loader.o>:

.pre
. env.sh
make
powerpc-linux-objcopy -O binary vmlinux
scp vmlinux disk:/tmp/
.pre

Then try out your kernel on DSM:

.pre
cd /mnt/HD_a2 && sync && insmod /mnt/HD_a2/loader.o kernel=/mnt/HD_a2/debian/tmp/vmlinux
.pre

Please note that *you must use full path* to kernel binary. Also note that all paths are customized for my particular device (to help with copy/paste :-)

^ Emulation

It's useful to have development environment for DSM on another machine, so I tried to use "QEMU"<http://fabrice.bellard.free.fr/qemu/> to do so.

* patch which adds support for "platforms based on MPC82xx"<http://qemu-forum.ipi.fi/viewtopic.php?t=1528>
* "Installing Debian Sarge for the PowerPC under the QEMU"<http://overselfresearch.com/kb/qemu.html> which I updated to etch to be in sync with DSM

This didn't work quite well as described first in "this blog post"<http://blog.rot13.org/2007/10/powerpc_emulation.html>.

My efforts right now are into making [GXemul] emulate enough of DSM-G600 to boot "original D-Link kernel"<http://git.rot13.org/?p=linux-2.4.21-pre4.git;a=summary>.

^ Source code

All source code is now available "in git repository"<http://git.rot13.org/>

^ Board specification

Here is information that I collected while working on 2.4 port in hope that it will assist me in porting 2.6 kernel

^^ Memory map

Part of information extracted from u-boot loader, part from kernel source

.pre
from		to			size

00000000	02000000	02000000	SDRAM 32Mb

80000000	f0000000	70000000	pci mem space?

fc000000	fcc00000	00c00000	EUMB (PCI I/O space)
fcc00000	fcf00000	00300000	pci cfg regs
fcf00000	fd000000	00100000	pci iack

fe000000	febfffff	00c00000	PCI host bridge

ffc00000	ffffffff	00400000	Flash 4Mb
.pre

Important addresses:

.pre
10000000	CFG_MAX_RAM_SIZE, CFG_BANK0_END (u-boot)
40000000	CFG_INIT_RAM_ADDR (u-boot)

c0000000	start of kernel 2.4.21-pre4 VM

80000000 --- PCI memory space ---
bfffd000	PCI 1033:0035 Non-prefetchable memory
bfffe000	PCI 1814:0201 Non-prefetchable memory
c3029f00	PCI 1033:00e0 00:0e.2 irq 2 ciehci_hcd
c3032000	PCI 1033:0035 00:0e.0 irq 1 usb-ohci
c3034000	PCI 1033:0035 00:0e.1 irq -1 usb-ohci disabled
c30ab000	PCI 1814:0201 irq 0 wirel, /sys/cra0
f0000000 --- PCI memory space ---

fc000000 --- EUMB ---
fc040000	OpenPIC_Addr (mpc1)
fc004500	ttyS0
fc004600	ttyS1
fd000000 --- EUMB ---

febffe00-febffe7f : PCI device 1191:0008
febffe00-febffe0f : atp86x
febffee4-febffee7 : PCI device 1191:0008
febffee8-febffeef : PCI device 1191:0008
febffee8-febffeef : atp86x
febffef4-febffef7 : PCI device 1191:0008
febffef8-febffeff : PCI device 1191:0008
febffef8-febffeff : atp86x IDE, irq 4
febfff00-febfffff : PCI device 13f0:1023
febfff00-febffffe : Sundance Technology IPG Triple-Speed Ethernet

ff000000	ROM_CS1_START (on soc?), FLASH_BASE1_PRELIM (u-boot)
ff800000	ROM_CS0_START
ffc00000	FLASH_BASE0_PRELIM (u-boot)
ffc20000	ramdisk load address
fff00000	TEXT_BASE (u-boot)
fff00100	CFG_RESET_ADDRESS
fff10000	boot image load address
.pre

Important constants:

.pre
CFG_NS16550_CLK		100000000

CONFIG_SYS_CLK_FREQ	100000000
.pre

^^ MTD

Addresses are relative to start of mtd at 0xffc00000

.pre
0x00000000-0x00010000 : "Linux mtd1"
0x00010000-0x00020000 : "Linux mtd2"
0x00020000-0x00300000 : "Linux Ramdisk"
0x00300000-0x00310000 : "U-BOOT BOOT LOADER"
0x00310000-0x00400000 : "Linux Kernel"
.pre

^^ Kernel configuration options

From old 2.4 kernel, just something to keep eye on while configuring 2.6 kernels...

* CONFIG_6xx
* CONFIG_SANDPOINT
* CONFIG_PPC_ISATIMER

* CONFIG_MTD_PARTITIONS
* CONFIG_MTD_CHAR
* CONFIG_MTD_BLOCK

* CONFIG_MTD_CFI
* CONFIG_MTD_GEN_PROBE
* CONFIG_MTD_CFI_AMDSTD

^^ IRQ

.pre
sandpoint_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
	static char pci_irq_table[][4] =
	/*
	 *      PCI IDSEL/INTPIN->INTLINE 
	 *         A   B   C   D
	 */
	{
		{   0,  0,  0,  0 },	/* IDSEL 13 - mini-PCI */
		{   1,  -1,  2,  0 },	/* IDSEL 14 - NEC USB2.0 */
		{   3,  0,  0,  0 },	/* IDSEL 15 - ADM983 */
		{   4,  0,  0,  0 }
	};

	const long min_idsel = 13, max_idsel = 16, irqs_per_slot = 4;
	return PCI_IRQ_TABLE_LOOKUP;
}
.pre

.pre
static u_char sandpoint_openpic_initsenses[] __initdata = {
	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 17, EPIC IRQ 1 - PCI1 - flash*/
	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 18, EPIC IRQ 2 - LAN*/
	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 19, EPIC IRQ 3 - Not used*/
	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 20, EPIC IRQ 4 - Not used*/
	1
}
.pre

.pre
sandpoint_init_IRQ(void)
	/* Map EPIC IRQs 0-3 */
	openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
	/* Skip reserved space and map i2c and DMA Ch[01] */
	openpic_set_sources(113, 3, OpenPIC_Addr + 0x11020);
	/* Skip reserved space and map Message Unit Interrupt (I2O) */
	openpic_set_sources(118, 1, OpenPIC_Addr + 0x110C0);
	//REX: UART
	openpic_set_sources(121, 1, OpenPIC_Addr + 0x11120); //ttyS0

	openpic_set_sources(122, 1, OpenPIC_Addr + 0x11140);    //ttyS1 jackl
.pre

^^ mpc10x

.pre
mpc10x_bridge_init(hose,
	MPC10X_MEM_MAP_B,
	MPC10X_MEM_MAP_B, MPC10X_MAPB_EUMB_BASE)
.pre

should be changed to:

.pre
mpc10x_bridge_init(hose,
		MPC10X_MEM_MAP_B,
		MPC10X_MEM_MAP_B,
		0xfc000000) == 0) 
.pre

^^ IO block

consistent with following:

.pre
-       io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO);
+       io_block_mapping(0xfc000000, 0xfc000000, 0x04000000, _PAGE_IO);
.pre

^^ Serial

.pre
#define UART0_INT       121
#define UART1_INT       122

#define SANDPOINT_SERIAL_0 0xFC004500
#define SANDPOINT_SERIAL_1 0xFC004600
.pre

^^ CPU

.pre
#define CPU_200 1
#define BASE_BAUD (100000000/16)
.pre

^^ Led control strings

Taken from "Beattie's page about DSM-G600"<http://www.beattie-home.net/beattie/DSM-G600/>

.pre
String 	Function
SYN 	Power led flash, HDD, HDD-Full, USB, WLAN leds off
ZWC 	Turn Power Off
ZWO 	Power led solid
ZBO 	Power led flash
WLO 	WLAN led green
WLC 	WLAN led off
WBO 	WLAN led flash green then off
HDE 	HDD led yellow solid
HDC 	HDD-Full led off
HBO 	HDD-Full led flash yellow
HDN 	HDD led off
MMK 	USB led green
MMF 	USB led yellow
MMC 	USB led off
MMI 	USB led blink green
MUI 	USB led blink yellow
MMN 	USB led off
AKO 	Unknown
TSO 	Power, HDD, USB, WLAN leds green, HDD-Full yellow
TSR 	Power, HDD-Full, WLAN leds off, HDD, USB leds yellow
TSC 	Power, HDD, HDD-Full, USB, WLAN leds off
.pre

^^ Chassis Status Strings

.pre
String 	Bit 	Function
RKO 	0x0001 	
UKO 	0x0002 	
CKO 	0x0004 	
EKO 	0x0008 	
PKO 	0x0100 	
1KO 	0x0200 	
TS1 	0x0010 	
TS2 	0x0020 	
RKR 	0x0040 	
UKR 	0x0080 	
IOK 	0x1000 	
LOK 	0x2000 	
NOK 	0x4000 	
AKI 	0x8000
.pre
I guess that I have read (and used) too much XP driven programming and testing, so I started devising tests after each sysadmin change also. So, here are some tips assorted by services:

{toc: }

^ smtp

Test all `MX` records for domain `bobcatsss2008.org` by sending e-mail to `test@bobcatsss2008.org`

.pre
host -t mx bobcatsss2008.org | awk '{ print $4 }' | xargs -i swaks  -t test@bobcatsss2008.org -s {}
.pre

^ dns

Dumps all zones from all name servers.

.pre
host -t ns bobcatsss2008.org | awk '{ print $3 }' | xargs -i host -t soa -va bobcatsss2008.org {}
.pre
This page describe steps needed to compile "open source r500 driver"<http://lwn.net/Articles/237920/>

Installation is done on "IBM T60 laptop"<http://www.thinkwiki.org/wiki/Category:T60"> with 1400x1200 LCD on current Debian unstable.

.pre
# prerequesits from packages
sudo apt-get install xserver-xorg-dev

# libpciexpress
git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
cd libpciaccess/
./autogen.sh
make
sudo make install

# checkout source
git clone git://anongit.freedesktop.org/git/avivo/xf86-video-avivo
cd xf86-video-avivo/
./autogen.sh
./configure --prefix /usr
make
sudo make install
.pre

Then, I needed to add my card PCI ID to driver: {file: avivo-m52-pci-id.diff}

.pre
$ lspci -nn | grep ATI
01:00.0 VGA compatible controller [0300]: ATI Technologies Inc M52 [ATI Mobility Radeon X1300] [1002:7149]
.pre

After that, I changed `/etc/X11/xorg.conf` to include

.pre
Section "Device"
        Identifier  "aticonfig-Device[0]"
        Driver      "avivo"
EndSection
.pre

It does find card, but screen screwed and cursor has strange artifacts.

{image: Image005+scale.jpg}

Here is a log file: {file: Xorg.1.log}
Here are some quick notes about my installation and configuration of munin.

First, I made a "local repository"<http://svn.rot13.org/index.cgi/munin-modules> to track my changes and imported upstream munin plugins into it.
This page will describe my journey while installing "SyncroEdit"<http://www.synchroedit.com> for "DORS/CLUC 2007"<http://www.open.hr/dc2007/> conference.

{toc: }

I have been tracking development of this tool for quite a while, and since we wanted to add some social interaction at conference, SyncroEdit seemed like a right tool for a job.

^ SVN checkout

.pre
svn co http://svn.synchroedit.com/root/trunk syncroedit
cd syncroedit
.pre

^ Building and installing Debian packages

^^ server

First, apply patch to fix `init.d` script: {file: syncroedit-init.d-fix.diff}

.pre
cd server/
sudo ./debian/rules binary
cd ..
sudo dpkg -i synchroedit-server_0.5-1_all.deb 
.pre

^^ client

.pre
cd client/
sudo ./debian/rules binary
cd ..
sudo dpkg -i synchroedit-client_0.5-1_all.deb 
.pre

Now, deploy the client:

.pre
cd /data
mkdir synchroedit-client
synchroedit-deploy synchroedit-client
.pre

Examine created `/data/synchroedit-client/config.cgi` file (I had to manually edit SESERVICE, YMMV)

^^ Apache

Add Apache configuration for new virtual host http://se.m.rot13.org

.pre
<VirtualHost 193.198.212.4>
        ServerName se.m.rot13.org
        DocumentRoot /data/synchroedit-client
        DirectoryIndex index.cgi index.html client.html
        <Directory "/data/synchroedit-client/">
                Options FollowSymLinks ExecCGI
                Order allow,deny
                Allow from all
        </Directory>
        CustomLog /var/log/apache/access-se.m.rot13.org.log full
</VirtualHost>
.pre

^^ test

Test to see if everything is working...

.pre
$ GET http://se.m.rot13.org/handshake.cgi
HAVE SID1 2048 GDAY:ACLR:
.pre

^ Setup ESPI

This is a tricky part. I didn't want to depend on php for this installation so I decided to write simple "ESPI"<http://wiki.synchroedit.com/index.php/ExternalServicePOSTInterface> in perl.

^^ install perl ESPI

.pre
cd /data/synchroedit-client/
svn co svn://svn.rot13.org/synchroedit/
.pre

^^ configure server

Edit `/etc/synchroedit/synchroedit.rc` and change following options:

.pre
ESPI=http://se.m.rot13.org/synchroedit/espi.cgi
ESPIHooks=authenticate-user
sessionAuthentication=1
.pre

Restart server to re-read configuration file

.pre
sudo /etc/init.d/synchroedit-server restart
.pre

^ Changes in my tools

This is subversion commit log of my tools for SynchroEdit

{fetchrss: http://svn.rot13.org/index.cgi/synchroedit/rss full}
Examples of grub usage (as a reminder mostly)

{toc: }

^ install

Sometimes, `grub-install` won't owerwrite MBR. If that happends, first reinstall MBR and then grub:

.pre
install-mbr /dev/sda
grub-install /dev/sda
.pre

If you forget to make `/boot/grub/menu.lst` (as I did), you will have to do a *lot* of typing in grub console, so be sure to also run

.pre
update-grub
.pre

^^ LVM gotchas

There is also corner-case when you have `lvm` compiled into kernel and `/boot` partition on LVM. grub will be confused, and simplest solution that I found so far is to move `/boot` to partition. If you don't have any free space handy, you might try to move swap to LVM and `/boot` onto swap partition.

^ fallback

After you have installed grub, you might want to configure fallback kernels. First configure different kernels, with fail-safe one as last one:

`/boot/grub/menu.lst`

.pre
default         saved

fallback        1 2

title           OpenVZ 2.6.18-028test010
root            (hd0,2)
kernel          /vmlinuz-2.6.18-028test018 root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-028test018
savedefault     fallback
boot

title           Debian GNU/Linux, kernel 2.6.18-028test007.2-ovz-enterprise
root            (hd0,2)
kernel          /vmlinuz-2.6.18-028test007.2-ovz-enterprise root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-028test007.2-ovz-enterprise
savedefault     fallback
boot

title           Debian GNU/Linux, kernel 2.6.18-3-686
root            (hd0,2)
kernel          /vmlinuz-2.6.18-3-686 root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-3-686
savedefault
boot
.pre

Here is simplier alternative:

.pre
default         0

fallback        1

title Debian GNU/Linux
root (hd0,0)
kernel /boot/vmlinuz root=/dev/md0 reboot=warm

title Debian GNU/Linux, with the old kernel
root (hd0,0)
kernel /boot/vmlinuz.old root=/dev/md0 reboot=warm
.pre

Then setup reset to default kernel (0) upon successful boot. On debian, you can just add following line in /etc/rc.local:

.pre
grub-set-default 0
.pre

You might also want to run this once by hand, so that first boot is in first kernel (most recent one presumably).
It seemed easy enough... I want to extract `irc-logger.pl` from my perl repository into it's own, so that I can make some refactoring. Easy enough, right?

.pre
svnadmin create irc-logger
svn mkdir -m "create trunk" file:///home/dpavlin/private/svn/irc-logger/trunk/
svnadmin dump perl | svndumpfilter include --drop-empty-revs trunk/irc-logger.pl | svnadmin load irc-logger/
.pre

Strange things I noticed:

I have to create directories needed to restore filtered dump manually, `svndumpfilter` could be clever about that, but it isn't (at least it *has* non-default option `--drop-empty-revs` which should also be default, but isn't)