From ef8cdd36436ef1bd1303886a101c8ee60c6f9721 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 18 Sep 2018 10:28:07 +0200 Subject: Initial public commit --- static/shell.min.js | 302 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 static/shell.min.js (limited to 'static/shell.min.js') diff --git a/static/shell.min.js b/static/shell.min.js new file mode 100644 index 0000000..f7f1298 --- /dev/null +++ b/static/shell.min.js @@ -0,0 +1,302 @@ +var Terminal=function(conf){if(typeof conf!="object")conf=new Object;else for(var i in this.Defaults)if(typeof conf[i]=="undefined")conf[i]=this.Defaults[i];this.conf=conf;this.setInitValues()}; +Terminal.prototype={version:"1.43 (original)",Defaults:{cols:80,rows:24,x:100,y:100,termDiv:"termDiv",bgColor:"#181818",frameColor:"#555555",frameWidth:1,rowHeight:15,blinkDelay:500,fontClass:"term",crsrBlinkMode:false,crsrBlockMode:true,DELisBS:false,printTab:true,printEuro:true,catchCtrlH:true,closeOnESC:true,historyUnique:false,id:0,ps:">",greeting:"%+r Terminal ready. %-r",handler:this.defaultHandler,ctrlHandler:null,initHandler:null,exitHandler:null,wrap:false},setInitValues:function(){this.isSafari= +navigator.userAgent.indexOf("Safari")>=0?true:false;this.isOpera=window.opera&&navigator.userAgent.indexOf("Opera")>=0?true:false;this.id=this.conf.id;this.maxLines=this.conf.rows;this.maxCols=this.conf.cols;this.termDiv=this.conf.termDiv;this.crsrBlinkMode=this.conf.crsrBlinkMode;this.crsrBlockMode=this.conf.crsrBlockMode;this.blinkDelay=this.conf.blinkDelay;this.DELisBS=this.conf.DELisBS;this.printTab=this.conf.printTab;this.printEuro=this.conf.printEuro;this.catchCtrlH=this.conf.catchCtrlH;this.closeOnESC= +this.conf.closeOnESC;this.historyUnique=this.conf.historyUnique;this.ps=this.conf.ps;this.closed=false;this.r;this.c;this.charBuf=new Array;this.styleBuf=new Array;this.scrollBuf=null;this.blinkBuffer=0;this.blinkTimer;this.cursoractive=false;this.lock=true;this.insert=false;this.charMode=false;this.rawMode=false;this.lineBuffer="";this.inputChar=0;this.lastLine="";this.guiCounter=0;this.history=new Array;this.histPtr=0;this.env=new Object;this.ns4ParentDoc=null;this.handler=this.conf.handler;this.wrapping= +this.conf.wrapping;this.ctrlHandler=this.conf.ctrlHandler;this.initHandler=this.conf.initHandler;this.exitHandler=this.conf.exitHandler},defaultHandler:function(){this.newLine();if(this.lineBuffer!=""){this.type("You typed: "+this.lineBuffer);this.newLine()}this.prompt()},open:function(){if(this.termDivReady()){if(!this.closed)this._makeTerm();this.init();return true}else return false},close:function(){this.lock=true;this.cursorOff();if(this.exitHandler)this.exitHandler();this.globals.setVisible(this.termDiv, +0);this.closed=true},init:function(){if(this.guiReady()){this.guiCounter=0;if(this.closed)this.setInitValues();this.clear();this.globals.setVisible(this.termDiv,1);this.globals.enableKeyboard(this);if(this.initHandler)this.initHandler();else{this.write(this.conf.greeting);this.newLine();this.prompt()}}else{this.guiCounter++;if(this.guiCounter>18E3)if(confirm("Terminal:\nYour browser hasn't responded for more than 2 minutes.\nRetry?"))this.guiCounter=0;else return;this.globals.termToInitialze=this; +window.setTimeout("Terminal.prototype.globals.termToInitialze.init()",200)}},getRowArray:function(l,v){var a=new Array;for(var i=0;i=0){var ta=text.split("\n");text=ta.join("%n")}}else{if(text.join)text=text.join("%n");else text=""+text;if(text.indexOf("\n")>=0){var ta=text.split("\n");text=ta.join("%n")}}this._sbInit(usemore);var chunks=text.split("%");var esc=text.charAt(0)!="%";var style=0;var styleMarkUp=this.globals.termStyleMarkup;for(var i=0;i0)this._sbType(chunks[i], +style);else if(i>0)this._sbType("%",style);esc=false}else{var func=chunks[i].charAt(0);if(chunks[i].length==0&&i>0){this._sbType("%",style);esc=true}else if(func=="n"){this._sbNewLine(true);if(chunks[i].length>1)this._sbType(chunks[i].substring(1),style)}else if(func=="+"){var opt=chunks[i].charAt(1);opt=opt.toLowerCase();if(opt=="p")style=0;else if(styleMarkUp[opt])style|=styleMarkUp[opt];if(chunks[i].length>2)this._sbType(chunks[i].substring(2),style)}else if(func=="-"){var opt=chunks[i].charAt(1); +opt=opt.toLowerCase();if(opt=="p")style=0;else if(styleMarkUp[opt])style&=~styleMarkUp[opt];if(chunks[i].length>2)this._sbType(chunks[i].substring(2),style)}else if(chunks[i].length>1&&func=="c"){var cinfo=this._parseColor(chunks[i].substring(1));style=style&~16777200|cinfo.style;if(cinfo.rest)this._sbType(cinfo.rest,style)}else if(chunks[i].length>1&&chunks[i].charAt(0)=="C"&&chunks[i].charAt(1)=="S"){this.clear();this._sbInit();if(chunks[i].length>2)this._sbType(chunks[i].substring(2),style)}else if(chunks[i].length> +0)this._sbType(chunks[i],style)}this._sbOut()},_parseColor:function(chunk){var rest="";var style=0;if(chunk.length)if(chunk.charAt(0)=="("){var clabel="";for(var i=1;ii)rest=chunk.substring(i+1);break}clabel+=c}if(clabel)if(clabel.charAt(0)=="@"){var sc=this.globals.nsColors[clabel.substring(1).toLowerCase()];if(sc)style=(16+sc)*256}else if(clabel.charAt(0)=="#"){var cl=clabel.substring(1).toLowerCase();var sc=this.globals.webColors[cl]; +if(sc)style=sc*65536;else{cl=this.globals.webifyColor(cl);if(cl)style=this.globals.webColors[cl]*65536}}else if(clabel.length&&clabel.length<=2){var isHex=false;for(var i=0;i=this.maxCols)this._sbNewLine()}},_sbNewLine:function(forced){var sb=this.scrollBuf;if(this.wrapping&&forced){sb.lines[sb.r][sb.c]=10;sb.lines[sb.r].length=sb.c+1}sb.r++;sb.c=0;sb.lines[sb.r]=this.getRowArray(this.conf.cols,0);sb.styles[sb.r]=this.getRowArray(this.conf.cols,0)},_sbWrap:function(){var wb=new Object;wb.lines=new Array;wb.styles=new Array;wb.lines[0]=this.getRowArray(this.conf.cols,0);wb.styles[0]=this.getRowArray(this.conf.cols, +0);wb.r=0;wb.c=0;var sb=this.scrollBuf;var sbl=sb.lines;var sbs=sb.styles;var ch,st,wrap,lc,ls;var l=this.c;var lastR=0;var lastC=0;wb.cBreak=false;for(var r=0;r=this.maxCols)this._wbIncLine(wb)}if(wrap==3){lastR=r;lastC=c;l=1}else{l=0;lastR=r;lastC=c+1;if(lastC==lc.length){lastR++;lastC=0}if(wrap==4)wb.cBreak=true}}else l++}else continue}}if(l){if(wb.cbreak&&wb.c!=0)wb.c--;this._wbOut(wb,lastR,lastC,l)}sb.lines=wb.lines;sb.styles=wb.styles;sb.r=wb.r;sb.c=wb.c},_wbOut:function(wb,br,bc,l){var sb=this.scrollBuf;var sbl=sb.lines;var sbs=sb.styles;var ofs=0;var lc,ls;if(l+wb.c>this.maxCols)if(l=ml-1)this.clear();if(this.r+buflen-sb.line<=ml){for(var i=sb.line;i=ml){var ofs=buflen-ml;for(var i=0;i0)r=this.conf.rows-offset;else r=this.conf.rows-1;for(var i=0;i=0&&r=this.maxCols){this.c=0;this._incRow()}},_incRow:function(){this.r++;if(this.r>=this.maxLines){this._scrollLines(0,this.maxLines);this.r=this.maxLines-1}},_scrollLines:function(start,end){window.status= +"Scrolling lines ...";start++;for(var ri=start;ri=start;r--)this.redraw(r-1);window.status=""},clear:function(){window.status="Clearing display ...";this.cursorOff();this.insert=false;for(var ri=0;ri0)this.newLine();this.type(this.ps);this._charOut(1);this.lock=false;this.cursorOn()},isPrintable:function(ch,unicodePage1only){if(this.wrapping&& +this.globals.wrapChars[ch]==4)return true;if(unicodePage1only&&ch>255)return ch==this.termKey.EURO&&this.printEuro?true:false;return ch>=32&&ch!=this.termKey.DEL||this.printTab&&ch==this.termKey.TAB},cursorSet:function(r,c){var crsron=this.cursoractive;if(crsron)this.cursorOff();this.r=r%this.maxLines;this.c=c%this.maxCols;this._cursorReset(crsron)},cursorOn:function(){if(this.blinkTimer)clearTimeout(this.blinkTimer);this.blinkBuffer=this.styleBuf[this.r][this.c];this._cursorBlink();this.cursoractive= +true},cursorOff:function(){if(this.blinkTimer)clearTimeout(this.blinkTimer);if(this.cursoractive){this.styleBuf[this.r][this.c]=this.blinkBuffer;this.redraw(this.r);this.cursoractive=false}},cursorLeft:function(){var crsron=this.cursoractive;if(crsron)this.cursorOff();var r=this.r;var c=this.c;if(c>0)c--;else if(r>0){c=this.maxCols-1;r--}if(this.isPrintable(this.charBuf[r][c])){this.r=r;this.c=c}this.insert=true;this._cursorReset(crsron)},cursorRight:function(){var crsron=this.cursoractive;if(crsron)this.cursorOff(); +var r=this.r;var c=this.c;if(c0)c--;else if(r>0){c=this.maxCols-1;r--}if(this.isPrintable(this.charBuf[r][c])){this._scrollLeft(r,c);this.r=r;this.c=c}this._cursorReset(crsron)},fwdDelete:function(){var crsron= +this.cursoractive;if(crsron)this.cursorOff();if(this.isPrintable(this.charBuf[this.r][this.c])){this._scrollLeft(this.r,this.c);if(!this.isPrintable(this.charBuf[this.r][this.c]))this.insert=false}this._cursorReset(crsron)},_cursorReset:function(crsron){if(crsron)this.cursorOn();else this.blinkBuffer=this.styleBuf[this.r][this.c]},_cursorBlink:function(){if(this.blinkTimer)clearTimeout(this.blinkTimer);if(this==this.globals.activeTerm){if(this.crsrBlockMode)this.styleBuf[this.r][this.c]=this.styleBuf[this.r][this.c]& +1?this.styleBuf[this.r][this.c]&254:this.styleBuf[this.r][this.c]|1;else this.styleBuf[this.r][this.c]=this.styleBuf[this.r][this.c]&2?this.styleBuf[this.r][this.c]&253:this.styleBuf[this.r][this.c]|2;this.redraw(this.r)}if(this.crsrBlinkMode)this.blinkTimer=setTimeout("Terminal.prototype.globals.activeTerm._cursorBlink()",this.blinkDelay)},_scrollLeft:function(r,c){var rows=new Array;rows[0]=r;while(this.isPrintable(this.charBuf[r][c])){var ri=r;var ci=c+1;if(ci==this.maxCols)if(ri0){r--;c=this.maxCols-1}else c=0}if(this.isPrintable(this.charBuf[r][c]))while(true){var ri=r;var ci=c+1;if(ci==this.maxCols)if(ri0)c--;else if(r>0){c=this.maxCols-1;r--}else break}line.reverse();return line.join("")},_clearLine:function(){var end=this._getLineEnd(this.r,this.c);var r=end[0];var c=end[1];var line="";while(this.isPrintable(this.charBuf[r][c])){this.charBuf[r][c]=0;if(c>0)c--;else if(r>0){this.redraw(r);c=this.maxCols-1;r--}else break}if(r!=end[0])this.redraw(r); +c++;this.cursorSet(r,c);this.insert=false},focus:function(){this.globals.setFocus(this)},termKey:null,_makeTerm:function(rebuild){window.status="Building terminal ...";this.globals.hasLayers=document.layers?true:false;this.globals.hasSubDivs=navigator.userAgent.indexOf("Gecko")<0;var divPrefix=this.termDiv+"_r";var s="";s+='\n';s+='\n";s+="
\n";s+="
\n';var rstr="";for(var c=0;c'+rstr+"\n"}s+="
\n";var termOffset=48+this.conf.frameWidth;if(this.globals.hasLayers){for(var r= +0;r\n';this.ns4ParentDoc=document.layers[this.termDiv].document;this.globals.termStringStart='
';this.globals.termStringEnd="
"}else if(this.globals.hasSubDivs){for(var r=0;r\n';this.globals.termStringStart='
';this.globals.termStringEnd="
"}this.globals.writeElement(this.termDiv,s);if(!rebuild){this.globals.setElementXY(this.termDiv,this.conf.x,this.conf.y);this.globals.setVisible(this.termDiv, +1)}window.status=""},rebuild:function(){var rl=this.conf.rows;var cl=this.conf.cols;for(var r=0;r=rl){r=rl-1;resetcrsr=true}if(this.c>=cl){c=cl-1;resetcrsr=true}if(resetcrsr&&this.cursoractive)this.cursorOn();this._makeTerm(true);for(var r=0;r";for(var k=tstls.length-1;k>=0;k--){var st=tstls[k];if(curStyle&st)s+=tscls[st]}}curStyle=cs;for(var k=0;k>>8;clr=cc<16?tclrs[cc]:"#"+tnclrs[cc-16]}else if(curStyle&16711680)clr="#"+twclrs[(curStyle&16711680)>>>16];if(clr)if(curStyle&1)s+='';else s+=''}s+=tspcl[c]?tspcl[c]:String.fromCharCode(c)}if(curStyle>0){if(curStyle&16776960)s+="";for(var k=tstls.length-1;k>=0;k--){var st=tstls[k];if(curStyle&st)s+=tscls[st]}}s+=this.globals.termStringEnd;this.globals.writeElement(this.termDiv+ +"_r"+r,s,this.ns4ParentDoc)},guiReady:function(){ready=true;if(this.globals.guiElementsReady(this.termDiv,window.document))for(var r=0;r="0"&&c<="9"||c>="a"&&c<="f"||c>="A"&&c<="F"?true:false},isHexOnlyChar:function(c){return c>="a"&&c<="f"||c>="A"&&c<="F"?true:false},hexToNum:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"a":10,"b":11, +"c":12,"d":13,"e":14,"f":15,"A":10,"B":11,"C":12,"D":13,"E":14,"F":15},webColors:[],webColorCodes:[""],colors:{black:1,red:2,green:3,yellow:4,blue:5,magenta:6,cyan:7,white:8,grey:9,red2:10,green2:11,yellow2:12,blue2:13,magenta2:14,cyan2:15,red1:2,green1:3,yellow1:4,blue1:5,magenta1:6,cyan1:7,gray:9,darkred:10,darkgreen:11,darkyellow:12,darkblue:13,darkmagenta:14,darkcyan:15,"default":0,clear:0},colorCodes:["","#000000","#ff0000","#00ff00","#ffff00","#0066ff","#ff00ff","#00ffff","#ffffff","#808080", +"#990000","#009900","#999900","#003399","#990099","#009999"],nsColors:{"aliceblue":1,"antiquewhite":2,"aqua":3,"aquamarine":4,"azure":5,"beige":6,"black":7,"blue":8,"blueviolet":9,"brown":10,"burlywood":11,"cadetblue":12,"chartreuse":13,"chocolate":14,"coral":15,"cornflowerblue":16,"cornsilk":17,"crimson":18,"darkblue":19,"darkcyan":20,"darkgoldenrod":21,"darkgray":22,"darkgreen":23,"darkkhaki":24,"darkmagenta":25,"darkolivegreen":26,"darkorange":27,"darkorchid":28,"darkred":29,"darksalmon":30,"darkseagreen":31, +"darkslateblue":32,"darkslategray":33,"darkturquoise":34,"darkviolet":35,"deeppink":36,"deepskyblue":37,"dimgray":38,"dodgerblue":39,"firebrick":40,"floralwhite":41,"forestgreen":42,"fuchsia":43,"gainsboro":44,"ghostwhite":45,"gold":46,"goldenrod":47,"gray":48,"green":49,"greenyellow":50,"honeydew":51,"hotpink":52,"indianred":53,"indigo":54,"ivory":55,"khaki":56,"lavender":57,"lavenderblush":58,"lawngreen":59,"lemonchiffon":60,"lightblue":61,"lightcoral":62,"lightcyan":63,"lightgoldenrodyellow":64, +"lightgreen":65,"lightgrey":66,"lightpink":67,"lightsalmon":68,"lightseagreen":69,"lightskyblue":70,"lightslategray":71,"lightsteelblue":72,"lightyellow":73,"lime":74,"limegreen":75,"linen":76,"maroon":77,"mediumaquamarine":78,"mediumblue":79,"mediumorchid":80,"mediumpurple":81,"mediumseagreen":82,"mediumslateblue":83,"mediumspringgreen":84,"mediumturquoise":85,"mediumvioletred":86,"midnightblue":87,"mintcream":88,"mistyrose":89,"moccasin":90,"navajowhite":91,"navy":92,"oldlace":93,"olive":94,"olivedrab":95, +"orange":96,"orangered":97,"orchid":98,"palegoldenrod":99,"palegreen":100,"paleturquoise":101,"palevioletred":102,"papayawhip":103,"peachpuff":104,"peru":105,"pink":106,"plum":107,"powderblue":108,"purple":109,"red":110,"rosybrown":111,"royalblue":112,"saddlebrown":113,"salmon":114,"sandybrown":115,"seagreen":116,"seashell":117,"sienna":118,"silver":119,"skyblue":120,"slateblue":121,"slategray":122,"snow":123,"springgreen":124,"steelblue":125,"tan":126,"teal":127,"thistle":128,"tomato":129,"turquoise":130, +"violet":131,"wheat":132,"white":133,"whitesmoke":134,"yellow":135,"yellowgreen":136},nsColorCodes:["","f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","000000","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00008b","008b8b","b8860b","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff", +"ffd700","daa520","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","90ee90","d3d3d3","ffb6c1","ffa07a","20b2aa","87cefa","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee", +"db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"],_webSwatchChars:["0","3","6","9","c","f"],_initWebColors:function(){var tg=Terminal.prototype.globals;var ws=tg._webColorSwatch;var wn=tg.webColors;var cc=tg.webColorCodes;var n=1;var a, +b,c,al,bl,bs,cl;for(var i=0;i<6;i++){a=tg._webSwatchChars[i];al=a+a;for(var j=0;j<6;j++){b=tg._webSwatchChars[j];bl=al+b+b;bs=a+b;for(var k=0;k<6;k++){c=tg._webSwatchChars[k];cl=bl+c+c;wn[bs+c]=wn[cl]=n;cc[n]=cl;n++}}}},webifyColor:function(s){var tg=Terminal.prototype.globals;if(s.length==6){var c="";for(var i=0;i<6;i+=2){var a=s.charAt(i);var b=s.charAt(i+1);if(tg.isHexChar(a)&&tg.isHexChar(b))c+=tg._webSwatchChars[Math.round(parseInt(a+b,16)/255*5)];else return""}return c}else if(s.length==3){var c= +"";for(var i=0;i<3;i++){var a=s.charAt(i);if(tg.isHexChar(a))c+=tg._webSwatchChars[Math.round(parseInt(a,16)/15*5)];else return""}return c}else return""},setColor:function(label,value){var tg=Terminal.prototype.globals;if(typeof label=="number"&&label>=1&&label<=15)tg.colorCodes[label]=value;else if(typeof label=="string"){label=label.toLowerCase();if(label.length==1&&tg.isHexChar(label)){var n=tg.hexToNum[label];if(n)tg.colorCodes[n]=value}else if(typeof tg.colors[label]!="undefined"){var n=tg.colors[label]; +if(n)tg.colorCodes[n]=value}}},getColorString:function(label){var tg=Terminal.prototype.globals;if(typeof label=="number"&&label>=0&&label<=15)return tg.colorCodes[label];else if(typeof label=="string"){label=label.toLowerCase();if(label.length==1&&tg.isHexChar(label))return tg.colorCodes[tg.hexToNum[label]];else if(typeof tg.colors[label]!="undefined")return tg.colorCodes[tg.colors[label]]}return""},getColorCode:function(label){var tg=Terminal.prototype.globals;if(typeof label=="number"&&label>= +0&&label<=15)return label;else if(typeof label=="string"){label=label.toLowerCase();if(label.length==1&&tg.isHexChar(label))return parseInt(label,16);else if(typeof tg.colors[label]!="undefined")return tg.colors[label]}return 0},insertText:function(text){var tg=Terminal.prototype.globals;var termRef=tg.activeTerm;if(!termRef||termRef.closed||tg.keylock||termRef.lock||termRef.charMode)return false;for(var i=0;i=0){t=t.substring(0,ofs)+s2+t.substring(ofs+l1);ofs=t.indexOf(s1,ofs+l2)}return t},wrapChars:{9:1,10:1,12:4,13:1,32:1,40:3,45:2,61:2,91:3,94:3,123:3},setFocus:function(termref){Terminal.prototype.globals.activeTerm=termref;Terminal.prototype.globals.clearRepeatTimer()},termKey:{"NUL":0, +"SOH":1,"STX":2,"ETX":3,"EOT":4,"ENQ":5,"ACK":6,"BEL":7,"BS":8,"BACKSPACE":8,"HT":9,"TAB":9,"LF":10,"VT":11,"FF":12,"CR":13,"SO":14,"SI":15,"DLE":16,"DC1":17,"DC2":18,"DC3":19,"DC4":20,"NAK":21,"SYN":22,"ETB":23,"CAN":24,"EM":25,"SUB":26,"ESC":27,"IS4":28,"IS3":29,"IS2":30,"IS1":31,"DEL":127,"EURO":8364,"LEFT":28,"RIGHT":29,"UP":30,"DOWN":31},termDomKeyRef:{},_domKeyMappingData:{"LEFT":"LEFT","RIGHT":"RIGHT","UP":"UP","DOWN":"DOWN","BACK_SPACE":"BS","RETURN":"CR","ENTER":"CR","ESCAPE":"ESC","DELETE":"DEL", +"TAB":"TAB"},_initDomKeyRef:function(){var tg=Terminal.prototype.globals;var m=tg._domKeyMappingData;var r=tg.termDomKeyRef;var k=tg.termKey;for(var i in m)r["DOM_VK_"+i]=k[m[i]]},registerEvent:function(obj,eventType,handler,capture){if(obj.addEventListener)obj.addEventListener(eventType.toLowerCase(),handler,capture);else{var et=eventType.toUpperCase();if(window.Event&&window.Event[et]&&obj.captureEvents)obj.captureEvents(Event[et]);obj["on"+eventType.toLowerCase()]=handler}},releaseEvent:function(obj, +eventType,handler,capture){if(obj.removeEventListener)obj.removeEventListener(eventType.toLowerCase(),handler,capture);else{var et=eventType.toUpperCase();if(window.Event&&window.Event[et]&&obj.releaseEvents)obj.releaseEvents(Event[et]);et="on"+eventType.toLowerCase();if(obj[et]&&obj[et]==handler)obj.et=null}},enableKeyboard:function(term){var tg=Terminal.prototype.globals;if(!tg.kbdEnabled){tg.registerEvent(document,"keypress",tg.keyHandler,true);tg.registerEvent(document,"keydown",tg.keyFix,true); +tg.registerEvent(document,"keyup",tg.clearRepeatTimer,true);tg.kbdEnabled=true}tg.activeTerm=term},disableKeyboard:function(term){var tg=Terminal.prototype.globals;if(tg.kbdEnabled){tg.releaseEvent(document,"keypress",tg.keyHandler,true);tg.releaseEvent(document,"keydown",tg.keyFix,true);tg.releaseEvent(document,"keyup",tg.clearRepeatTimer,true);tg.kbdEnabled=false}tg.activeTerm=null},keyFix:function(e){var tg=Terminal.prototype.globals;var term=tg.activeTerm;if(tg.keylock||term.lock)return true; +if(window.event){var ch=window.event.keyCode;if(!e)e=window.event;if(e.DOM_VK_UP){for(var i in tg.termDomKeyRef)if(e[i]&&ch==e[i]){tg.keyHandler({which:tg.termDomKeyRef[i],_remapped:true,_repeat:ch==27?true:false});if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();e.cancleBubble=true;return false}e.cancleBubble=false;return true}else{var termKey=term.termKey;var keyHandler=tg.keyHandler;if(ch==8&&!term.isSafari&&!term.isOpera)keyHandler({which:termKey.BS,_remapped:true, +_repeat:true});else if(ch==9)keyHandler({which:termKey.TAB,_remapped:true,_repeat:term.printTab?false:true});else if(ch==37)keyHandler({which:termKey.LEFT,_remapped:true,_repeat:true});else if(ch==39)keyHandler({which:termKey.RIGHT,_remapped:true,_repeat:true});else if(ch==38)keyHandler({which:termKey.UP,_remapped:true,_repeat:true});else if(ch==40)keyHandler({which:termKey.DOWN,_remapped:true,_repeat:true});else if(ch==127)keyHandler({which:termKey.DEL,_remapped:true,_repeat:true});else if(ch>=57373&& +ch<=57376)if(ch==57373)keyHandler({which:termKey.UP,_remapped:true,_repeat:true});else if(ch==57374)keyHandler({which:termKey.DOWN,_remapped:true,_repeat:true});else if(ch==57375)keyHandler({which:termKey.LEFT,_remapped:true,_repeat:true});else{if(ch==57376)keyHandler({which:termKey.RIGHT,_remapped:true,_repeat:true})}else{e.cancleBubble=false;return true}if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();e.cancleBubble=true;return false}}},clearRepeatTimer:function(e){var tg= +Terminal.prototype.globals;if(tg.keyRepeatTimer){clearTimeout(tg.keyRepeatTimer);tg.keyRepeatTimer=null}},doKeyRepeat:function(ch){Terminal.prototype.globals.keyHandler({which:ch,_remapped:true,_repeated:true})},keyHandler:function(e){var tg=Terminal.prototype.globals;var term=tg.activeTerm;if(tg.keylock||term.lock)return true;if(window.event&&window.event.preventDefault)window.event.preventDefault();else if(e&&e.preventDefault)e.preventDefault();if(window.event&&window.event.stopPropagation)window.event.stopPropagation(); +else if(e&&e.stopPropagation)e.stopPropagation();var ch;var ctrl=false;var shft=false;var remapped=false;var termKey=term.termKey;var keyRepeat=0;if(e){ch=e.which;ctrl=e.ctrlKey&&e.altKey||e.modifiers==2;shft=e.shiftKey||e.modifiers==4;if(e._remapped){remapped=true;if(window.event){ctrl=ctrl||window.event.ctrlKey&&!window.event.altKey;shft=shft||window.event.shiftKey}}if(e._repeated)keyRepeat=2;else if(e._repeat)keyRepeat=1}else if(window.event){ch=window.event.keyCode;ctrl=window.event.ctrlKey&& +!window.event.altKey;shft=window.event.shiftKey;if(window.event._repeated)keyRepeat=2;else if(window.event._repeat)keyRepeat=1}else return true;if(ch==""&&remapped==false){if(e==null)e=window.event;if(e.charCode==0&&e.keyCode)if(e.DOM_VK_UP){var dkr=tg.termDomKeyRef;for(var i in dkr)if(e[i]&&e.keyCode==e[i]){ch=dkr[i];break}}else if(e.keyCode==28)ch=termKey.LEFT;else if(e.keyCode==29)ch=termKey.RIGHT;else if(e.keyCode==30)ch=termKey.UP;else if(e.keyCode==31)ch=termKey.DOWN;else if(e.keyCode==37)ch= +termKey.LEFT;else if(e.keyCode==39)ch=termKey.RIGHT;else if(e.keyCode==38)ch=termKey.UP;else if(e.keyCode==40)ch=termKey.DOWN;else if(e.keyCode==9)ch=termKey.TAB}if(ch>=57344&&ch<=63743)return;if(keyRepeat){tg.clearRepeatTimer();tg.keyRepeatTimer=window.setTimeout("Terminal.prototype.globals.doKeyRepeat("+ch+")",keyRepeat==1?tg.keyRepeatDelay1:tg.keyRepeatDelay2)}if(term.charMode){term.insert=false;term.inputChar=ch;term.lineBuffer="";term.handler();if(ch<=32&&window.event)window.event.cancleBubble= +true;return false}if(!ctrl){if(ch==termKey.CR){term.lock=true;term.cursorOff();term.insert=false;if(term.rawMode)term.lineBuffer=term.lastLine;else{term.lineBuffer=term._getLine();if(term.lineBuffer!=""&&(!term.historyUnique||term.history.length==0||term.lineBuffer!=term.history[term.history.length-1]))term.history[term.history.length]=term.lineBuffer;term.histPtr=term.history.length}term.lastLine="";term.inputChar=0;term.handler();if(window.event)window.event.cancleBubble=true;return false}else if(ch== +termKey.ESC&&term.conf.closeOnESC){term.close();if(window.event)window.event.cancleBubble=true;return false}if(ch<32&&term.rawMode){if(window.event)window.event.cancleBubble=true;return false}else if(ch==termKey.LEFT){term.cursorLeft();if(window.event)window.event.cancleBubble=true;return false}else if(ch==termKey.RIGHT){term.cursorRight();if(window.event)window.event.cancleBubble=true;return false}else if(ch==termKey.UP){term.cursorOff();if(term.histPtr==term.history.length)term.lastLine=term._getLine(); +term._clearLine();if(term.history.length&&term.histPtr>=0){if(term.histPtr>0)term.histPtr--;term.type(term.history[term.histPtr])}else if(term.lastLine)term.type(term.lastLine);term.cursorOn();if(window.event)window.event.cancleBubble=true;return false}else if(ch==termKey.DOWN){term.cursorOff();if(term.histPtr==term.history.length)term.lastLine=term._getLine();term._clearLine();if(term.history.length&&term.histPtr<=term.history.length){if(term.histPtr=65&&ch<=96||ch==63)if(ch==63)ch=31;else ch-=64;term.inputChar=ch;term.ctrlHandler();if(window.event)window.event.cancleBubble=true; +return false}else if(ctrl||!term.isPrintable(ch,true)){if(window.event)window.event.cancleBubble=true;return false}else if(term.isPrintable(ch,true)){if(term.blinkTimer)clearTimeout(term.blinkTimer);if(term.insert){term.cursorOff();term._scrollRight(term.r,term.c)}term._charOut(ch);term.cursorOn();if(ch==32&&window.event)window.event.cancleBubble=true;else if(window.opera&&window.event)window.event.cancleBubble=true;return false}return true},hasSubDivs:false,hasLayers:false,termStringStart:"",termStringEnd:"", +termSpecials:{0:" ",1:" ",9:" ",32:" ",34:""",38:"&",60:"<",62:">",127:"◊",8364:"€"},termStyles:[1,2,4,8],termStyleMarkup:{"r":1,"u":2,"i":4,"s":8},termStyleOpen:{1:'',2:"",4:"",8:""},termStyleClose:{1:"",2:"",4:"",8:""},assignStyle:function(styleCode,markup,htmlOpen,htmlClose){var tg=Terminal.prototype.globals;if(!styleCode||isNaN(styleCode))if(styleCode>=256){alert("termlib.js:\nCould not assign style.\n"+ +s+" is not a valid power of 2 between 0 and 256.");return}var s=styleCode&255;var matched=false;for(var i=0;i<8;i++)if(s>>>i&1){if(matched){alert("termlib.js:\nCould not assign style code.\n"+s+" is not a power of 2!");return}matched=true}if(!matched){alert("termlib.js:\nCould not assign style code.\n"+s+" is not a valid power of 2 between 0 and 256.");return}markup=String(markup).toLowerCase();if(markup=="c"||markup=="p"){alert('termlib.js:\nCould not assign mark up.\n"'+markup+'" is a reserved code.'); +return}if(markup.length>1){alert('termlib.js:\nCould not assign mark up.\n"'+markup+'" is not a single letter code.');return}var exists=false;for(var i=0;i=32){var cs=unescape("%"+high+low);termString_keyref[cc]=cs;termString_keycoderef[cs]=cc}}}},_extendMissingStringMethods:function(){if(!String.fromCharCode||!String.prototype.charCodeAt)Terminal.prototype.globals._termString_makeKeyref();if(!String.fromCharCode)String.fromCharCode=function(cc){return cc!=null?Terminal.prototype.globals.termString_keyref[cc]: +""};if(!String.prototype.charCodeAt)String.prototype.charCodeAt=function(n){cs=this.charAt(n);return Terminal.prototype.globals.termString_keycoderef[cs]?Terminal.prototype.globals.termString_keycoderef[cs]:0}}}};Terminal.prototype.globals._initGlobals();var TerminalDefaults=Terminal.prototype.Defaults;var termDefaultHandler=Terminal.prototype.defaultHandler;var TermGlobals=Terminal.prototype.globals;var termKey=Terminal.prototype.globals.termKey;var termDomKeyRef=Terminal.prototype.globals.termDomKeyRef; +var parserWhiteSpace={" ":true,"\t":true};var parserQuoteChars={'"':true,"'":true,"`":true};var parserSingleEscapes={"\\":true};var parserOptionChars={"-":true};var parserEscapeExpressions={"%":parserHexExpression}; +function parserHexExpression(termref,pointer,echar,quotelevel){if(termref.lineBuffer.length>pointer+2){var hi=termref.lineBuffer.charAt(pointer+1);var lo=termref.lineBuffer.charAt(pointer+2);lo=lo.toUpperCase();hi=hi.toUpperCase();if((hi>="0"&&hi<="9"||hi>="A"&&hi<="F")&&(lo>="0"&&lo<="9"||lo>="A"&&lo<="F")){parserEscExprStrip(termref,pointer+1,pointer+3);return String.fromCharCode(parseInt(hi+lo,16))}}return echar} +function parserEscExprStrip(termref,from,to){termref.lineBuffer=termref.lineBuffer.substring(0,from)+termref.lineBuffer.substring(to)} +function parserGetopt(termref,optsstring){var opts={"illegals":[]};while(termref.argc0&&parserOptionChars[a.charAt(0)]){var i=1;while(i="0"&&nc<="9"){v+=nc;i++}else break}if(optsstring.indexOf(c)>=0)opts[c]=v==""?{value:-1}:isNaN(v)?{value:0}:{value:parseFloat(v)};else opts.illegals[opts.illegals.length]=c; +i++}termref.argc++}else break}return opts} +function parseLine(termref){var argv=[""];var argQL=[""];var argc=0;var escape=false;for(var i=0;i", +"%c(@lightgrey) Features2=0x1","%c(@lightgrey) AMD Features=0xe2500800","%c(@lightgrey) AMD Features2=0x3","%c(@lightgrey) Cores per package: 2","%c(@lightgrey)usable memory = 2139738112 (2040 MB)","%c(@lightgrey)avail memory = 2065133568 (1969 MB)","","%c(@lightgrey)Detecting IDE drives ... IDE Flash Disk","","%c(@lightgrey)acpi0: on motherboard","%c(@lightgrey)acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0", +"%c(@lightgrey)ata0: on atapci0","%c(@lightgrey)ata1: on atapci0","%c(@lightgrey)usb0: on ohci0","%c(@lightgrey)usb0: USB revision 2.0","%c(@lightgrey)uhub0: SiS OHCI root hub, class 9/0, rev 1.00/1.00, addr 1","%c(@lightgrey)cpu0: on acpi0","%c(@lightgrey)cpu1: on acpi0","%c(@lightgrey)bge0: mem 0xfe9e0000-0xfe9effff irq 18 at device 6.0 on pci1","%c(@lightgrey)Looks convincing, doesn't it?", +"%c(@lightgrey)atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177at device 2.5 on pci0%n","%c(@lightgrey)Timecounters tick every 1.000 msec","","%c(@lightgrey)ipfw2 (+ipv6) initialized, divert enabled, rule-based forwarding disabled, default to deny, logging enabled","%c(@lightgrey)Trying to mount root from ufs:/dev/ad0a","","%c(@lightgrey)/bin/sh: accessing tty1","%c(@lightgrey)Starting external programs: ssh apache2 mxvpn sendmail","","ready"," "]; +filesContent["/etc/passwd"]=["%c(@lightgrey)# $FreeBSD: src/etc/master.passwd,v 1.40 2005/06/06 20:19:56 brooks Exp $","#","root:*:0:0:Charlie &:/root:/bin/csh","toor:*:0:0:Bourne-again Superuser:/root:","mailnull:*:26:26:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin","www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin","sysa:*:1001:0:System Administrator:/home/sysadmin:/bin/tcsh"]; +filesContent["/etc/group"]=["%c(@lightgrey)# $FreeBSD: src/etc/group,v 1.32.2.1 2006/03/06 22:23:10 rwatson Exp $","#","wheel:*:0:root,sysa","mailnull:*:26:milter","www:*:80:","sysa:*:1001:"]; +filesContent["/etc/rc.conf"]=['%c(@lightgrey)hostname="localhost"','firewall_enable="YES" # Set to YES to enable firewall functionality','firewall_type="web" # Firewall type (see /etc/rc.firewall)','ifconfig_rl0="inet 78.31.70.238 netmask 255.255.255.0"','defaultrouter="78.31.70.1"','sshd_enable="YES" # Enable sshd','sendmail_enable="YES" # Run the sendmail inbound daemon (YES/NO).','sendmail_flags="-L sm-mta -bd -q30m"','apache22_enable="YES" # start Apache httpd', +'apache22ssl_enable="YES"','apache22_http_accept_enable="YES" # Use kernel accf_data and accf_http modules'];filesContent["/etc/hosts"]=["%c(@lightgrey)# In the presence of the domain name service or NIS, this file may","# not be consulted at all; see /etc/nsswitch.conf for the resolution order.","#","::1 localhost localhost.localhost","127.0.0.1 localhost localhost.localhost"]; +filesContent["/etc/crontab"]=["%c(@lightgrey)# $FreeBSD: src/etc/crontab,v 1.32 2002/11/22 16:13:39 tom Exp $","#minute hour mday month wday who command","# Save some entropy so that /dev/random can re-seed on boot.","*/11 * * * * operator /usr/libexec/save-entropy","# Rotate log files every hour, if necessary.","0 * * * * root newsyslog","# Perform daily/weekly/monthly maintenance.","1 3 */2 * * root periodic daily", +"15 4 */2 * 6 root periodic weekly","30 5 1 */2 * root periodic monthly"]; +filesContent["/usr/share/man/vi"]=["%c(@lightcyan)VI localhost General Commands Manual VI","","NAME"," Vi -- a screen oriented text editor.","","DESCRIPTION"," Vi is a modal editor and is either in insert mode or err... Who doesn't "," know vi? This implementation is very thin and does not support paging. That"," is only the visible page can be edited. The following commands should work:",""," to enter command mode"," :q to exit", +" :w to save",' :w filename to save to "filename"',' :e filename to open "filename"'," :q! to exit without saving"," D to delete rest of line"," dd to delete current line"," x to delete current char"," i to enter edit mode "," UP RIGHT DOWN LEFT to move the cursor"," or h left j down k up l right",""," %c(@chartreuse)On Safari browsers use instead of !!%c(@lightcyan)"]; +filesContent["/usr/share/man/ssh"]=["%c(@lightcyan)SSH localhost General Commands Manual SSH","","NAME"," ssh -- Mindterm SSH client (remote login program)","","SYNOPSIS"," ssh [-L port:host:hostport] [-p port] [user@]hostname","","DESCRIPTION",' The ssh command will start the Appgate java applet "mindterm".'," The applet is self-signed and can thus be used to connect to any server"," (as you don't have an account on localhost...)"," and also allows to build tunnels. This is the compiled version from", +" www.appgate.com with the logo removed."," %c(@chartreuse)There is no connection between this client and the localhost server.","",' Use the top right "X" to close the ssh client%c(@lightcyan)',"","EXAMPLES"," ssh hostname"," ssh -p 123 user@hostname"," ssh -L 3128:127.0.0.1:80 -p 1234 user@hostname"]; +filesContent["/usr/share/man/echo"]=["%c(@lightcyan)ECHO localhost General Commands Manual ECHO","","NAME"," echo -- write arguments to the standard output","","DESCRIPTION"," The echo utility writes any specified operands, separated by single blank"," (' ') characters and followed by a newline (\\n) character, to the stan-"," dard output."," the > redirect can be used to create a file. For example the command"," %c(@chartreuse)echo Hello world! > hello.txt%c(@lightcyan)", +" will create the file hello.txt"]; +filesContent["/usr/share/man/hostname"]=["%c(@lightcyan)HOSTNAME localhost General Commands Manual HOSTNAME","","NAME"," hostname -- print name of current host system","","SYNOPSIS"," hostname [-fsi]","","DESCRIPTION"," The hostname utility prints the name of the current host."," This script uses the hostname variable in /etc/rc.conf.",""," Options:",""," -f Include domain information in the printed name. This is the"," default behavior.", +""," -s Trim off any domain information from the printed name.",""," -i Show the corresponding host IP address."]; +filesContent["/usr/share/man/reload"]=["%c(@lightcyan)RELOAD localhost General Commands Manual RELOAD","","NAME"," reload -- reload the terminal as a new http request","","DESCRIPTION"," This command will reload the terminal with a new http GET request from the"," browser. This will reinitialize the shell and all variables and has the same "," effect as the browser reload button. A reload will also recalculate the shell"," size.","","SEE ALSO", +" reset, redim"];filesContent["/usr/share/man/reset"]=["%c(@lightcyan)RESET localhost General Commands Manual RESET","","NAME"," reset -- reset the terminal to the initial state","","DESCRIPTION"," This command will reset the terminal to its initial state but will not reload"," the variables. The created file are not deleted either. Delete them all with"," rm * in the home directory.","","SEE ALSO"," reload"]; +filesContent["/usr/share/man/redim"]=["%c(@lightcyan)REDIM localhost General Commands Manual REDIM","","NAME"," redim -- calculates and resizes the shell to it's maximal size.","","DESCRIPTION"," This command resizes the shell to fit the visible browser area, it can be used"," when the browser size has changed. The argument <-s> will only display the sizes"," but will not change anything.",""," The following options are available:",""," -s only display the window and shell sizes without changing anything", +"","SEE ALSO"," reload"]; +filesContent["/usr/share/man/snake"]=["%c(@lightcyan)SNAKE localhost General Commands Manual SNAKE","","NAME"," snake -- a variation of the classical snake game.","","DESCRIPTION"," The snake must be steered to get food (the numbers randomly displayed)"," and avoid crashing on rocks or wall or itself. There is also an autopilot,"," but it is not to be trusted.",""," The following options are available:",""," -s1 for speed: -s1 = slow; -s3 = fast"," -f1 for food: -f1 = less; -f3 = more", +" -o1 for obstacles: -o1 = less; -o3 = more rocks"," -a toggle the autopilot on or off. Status is displayed on the status line"," -r toggle auto-restart on or off. Status is displayed on the status line","","EXAMPLES",""," snake -f3 -o3 -a -r max food and rocks with autopilot and auto-restart","","SEE ALSO"," invaders"]; +filesContent["/usr/share/man/invaders"]=["%c(@lightcyan)INVADERS localhost General Commands Manual INVADERS","","NAME"," invaders -- the classical invaders game, courtesy of Norbert Landsteiner.","","DESCRIPTION"," The invaders must be shot down before they reach earth. The ship must also"," avoid the enemy fire.",""," On a large screen the game might be too stretched and thus too easy to"," win... Use option -s to reduce the available game area to the classical", +" 80x25 characters.",""," -s start the game with a smaller area of 80x25 characters","","SEE ALSO"," snake"]; +filesContent["/usr/share/man/ls"]=["%c(@lightcyan)LS localhost General Commands Manual LS","","NAME"," ls -- list directory contents","","SYNOPSIS"," ls [-la] [directory]","","DESCRIPTION"," For each operand that names a directory, ls displays the names of files"," contained within that directory, as well as any requested, associated"," information."," If no operands are given, the contents of the current directory are dis-"," played.", +""," The following options are available:",""," -l List files in the long format with date and permission information",""," -a Display also hidden files and folders"]; +filesContent["/usr/share/man/matrix"]=["%c(@lightcyan)MATRIX localhost General Commands Manual MATRIX","","NAME"," matrix -- a matrix like screen saver animation","","SYNOPSIS"," matrix [-s]","","DESCRIPTION"," This animation displays falling random letters in a gree gradient. This is"," quite heavy on the browser rendering engine and thus uses a lot of CPU.",""," The following options are available:",""," -s Start with an empty page and fill it with time. Default starts with a newly", +" generated screen.",""," key or to quit the animation",""," key to pause or play the animation",""," any other key will add an iteration"]; +filesContent["/usr/share/man/cal"]=["%c(@lightcyan)CAL localhost General Commands Manual CAL","","NAME"," cal -- a simple month calender","","SYNOPSIS"," cal [n] (n = 1-12)","","DESCRIPTION"," Display a calender of the current month or an other month given as option.",""," The following options are available:",""," n Selects an other month of the year. For example:"," Jan = 1, Jan next year = 13, Dec last year = 0"]; +filesContent["/usr/share/man/clock"]=["%c(@lightcyan)CLOCK localhost General Commands Manual CLOCK","","NAME"," clock -- display a large clock or stopwatch","","SYNOPSIS"," clock [-t -s]","","DESCRIPTION"," With no option the command clock displays a large clock in full screen"," mode and international format, like 21:45:04. It is also possible to display"," a stopwatch. Use any key besides and to quit",""," The following options are available:", +""," -t start in stopwatch mode",""," -s use smaller numbers. This is automatic if the terminal is too small",""," pause the display, the time is still ticking...",""," reset the stopwatch and start again."]; +filesContent["/usr/share/man/ed"]=["%c(@lightgrey)This text is straight from http://www.gnu.org/fun/jokes/ed.msg.html","%c(@lightcyan)When I log into my Xenix system with my 110 baud teletype, both vi","*and* Emacs are just too damn slow. They print useless messages like,","'C-h for help' and '\"foo\" File is read only'. So I use the editor","that doesn't waste my VALUABLE time.","","Ed, man! !man ed","","ED(1) Unix Programmer's Manual ED(1)","","NAME"," ed - text editor", +"","SYNOPSIS"," ed [ - ] [ -x ] [ name ]","DESCRIPTION"," Ed is the standard text editor.","---","","Computer Scientists love ed, not just because it comes first","alphabetically, but because it's the standard. Everyone else loves ed","because it's ED!","",'"Ed is the standard text editor."',"","And ed doesn't waste space on my Timex Sinclair. Just look:","","-rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed","-rwxr-xr-t 4 root 1310720 Jan 1 1970 /usr/ucb/vi","-rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs", +"","Of course, on the system *I* administrate, vi is symlinked to ed.","Emacs has been replaced by a shell script which 1) Generates a syslog","message at level LOG_EMERG; 2) reduces the user's disk quota by 100K;","and 3) RUNS ED!!!!!!","",'"Ed is the standard text editor."',"","Let's look at a typical novice's session with the mighty ed:","","golem$ ed","","?","help","?","?","?","quit","?","exit","?","bye","?","hello?","?","eat flaming death","?","^C","?","^C","?","^D","?","","---","Note the consistent user interface and error reportage. Ed is", +"generous enough to flag errors, yet prudent enough not to overwhelm","the novice with verbosity.","",'"Ed is the standard text editor."',"","Ed, the greatest WYGIWYG editor of all.","","ED IS THE TRUE PATH TO NIRVANA! ED HAS BEEN THE CHOICE OF EDUCATED","AND IGNORANT ALIKE FOR CENTURIES! ED WILL NOT CORRUPT YOUR PRECIOUS","BODILY FLUIDS!! ED IS THE STANDARD TEXT EDITOR! ED MAKES THE SUN","SHINE AND THE BIRDS SING AND THE GRASS GREEN!!","","When I use an editor, I don't want eight extra KILOBYTES of worthless", +"help screens and cursor positioning code! I just want an EDitor!!",'Not a "viitor". Not a "emacsitor". Those aren\'t even WORDS!!!! ED!',"ED! ED IS THE STANDARD!!!","","TEXT EDITOR.","","When IBM, in its ever-present omnipotence, needed to base their",'"edlin" on a Unix standard, did they mimic vi? No. Emacs? Surely',"you jest. They chose the most karmic editor of all. The standard.","","Ed is for those who can *remember* what they are working on. If you","are an idiot, you should use Emacs. If you are an Emacs, you should", +"not be vi. If you use ED, you are on THE PATH TO REDEMPTION. THE",'SO-CALLED "VISUAL" EDITORS HAVE BEEN PLACED HERE BY ED TO TEMPT THE',"FAITHLESS. DO NOT GIVE IN!!! THE MIGHTY ED HAS SPOKEN!!!","","?"];var pslong=["%c(@lightgrey)USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND"];var globalterm;var fetcherror="";var vgeoip_country_code;var vgeoip_country_name;var vgeoip_city;var vgeoip_region;var vgeoip_latitude;var vgeoip_longitude; +function incrementLoaded(t){var loaded=readCookie("loaded");loaded++;if(loaded>4){t.newLine();carriageReturn();loaded=2}createCookie("loaded",loaded,0,5)}function carriageReturn(){Terminal.prototype.globals.keyHandler({which:globalterm.termKey.CR,_remapped:true})}function pressKey(ch){Terminal.prototype.globals.keyHandler({which:ch,_remapped:true})} +function createCookie(name,value,days,min){var expires;var date=new Date;if(days){date.setTime(date.getTime()+days*24*60*60*1E3);expires="; expires="+date.toGMTString()}else expires="";if(min){date.setTime(date.getTime()+min*60*1E3);expires="; expires="+date.toGMTString()}document.cookie=name+"="+value+expires+"; path=/"} +function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;imax)return-1;if(min==max)return min;var r=parseInt(Math.random()*(max+1),10);return r+min<=max?r+min:r} +function browserWidth(){if(window.innerWidth)return window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)return document.documentElement.clientWidth;else if(document.body&&document.body.offsetWidth)return document.body.offsetWidth;else return 0} +function browserHeight(){if(window.innerHeight)return window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;else if(document.body&&document.body.offsetHeight)return document.body.offsetHeight;else return 0}Date.prototype.getMonthName=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"][this.getMonth()]}; +Date.prototype.milTime=function(){var t=this.getHours()+":"+this.getMinutes()+":"+this.getSeconds();return t};Date.prototype.daysInMonth=function(){return(new Date(this.getFullYear(),this.getMonth()+1,0)).getDate()}; +Date.prototype.calendar=function(){var calArray=[];var buildStr="";var numDays=this.daysInMonth();var startDay=(new Date(this.getFullYear(),this.getMonth(),1)).getDay();calArray.push("%c(@lightgrey) "+this.getMonthName()+" "+this.getFullYear());calArray.push("Sun Mon Tue Wed Thu Fri Sat");for(var i=0;i0)globalterm.write("%c(@lightgrey) deleted "+deleted+" files%n")} +function addFile(fname,fcontent,iseditor,fdate){if(typeof iseditor=="undefined")iseditor=false;var error="";var fpath=getPath(fname);fname=fpath[1];if(fname=="unixtoolbox.xhtml"){error=fname+": Permission denied";if(iseditor)return"Save "+error;else{globalterm.write("%c(@lightgrey)"+error);return error}}var size=fcontent.length+1;var sizestr;var datestr;if(size<10)sizestr=" "+size;else if(size<100)sizestr=" "+size;else if(size<1E3)sizestr=" "+size;else if(size<1E4)sizestr=" "+size;if(typeof fdate== +"undefined"){var d=new Date;var h=d.getHours();if(h<10)h="0"+h;var m=d.getMinutes();if(m<10)m="0"+m;var day=d.getDate();if(day<10)day=" "+day;var mo=shortm[d.getMonth()];datestr=mo+" "+day+" "+h+":"+m}else datestr=fdate;var findex=files_www_n.indexOf(fname);if(fpath[0]!="/home/www"){error=fname+": Permission denied";if(iseditor)return"Save "+error;else{globalterm.write("%c(@lightgrey)"+error);return error}}else if(findex!=-1){if(!readCookie(fname)){error=fname+": system file permission denied";if(iseditor)return"Save "+ +error;else{globalterm.write("%c(@lightgrey)"+error);return error}}files_www_n[findex]=fname;files_www_s[findex]=sizestr;files_www_t[findex]=datestr}else{files_www_n.push(fname);files_www_s.push(sizestr);files_www_t.push(datestr)}fcontent=fcontent.replace(/;/g,"~~");fcontent=fcontent+datestr;createCookie(fname,fcontent,365);return error} +function addAFile(fname){var fcontent=readCookie(fname);if(fcontent!==""){var cnt=fcontent.slice(0,fcontent.length-12);cnt=cnt.replace(/~~/g,";");var date=fcontent.slice(fcontent.length-12);if(date.length==12)addFile(fname,cnt,false,date)}} +function getPath(fname){var fullpath="";var filename="";var fullname="";var rpath=path;while(fname.charAt(fname.length-1)=="/"&&fname.length>1)fname=fname.slice(0,fname.length-1);var slashindex=fname.lastIndexOf("/");if(slashindex==-1&&fname.charAt(0)!="."){filename=fname;fullpath=rpath}else{filename=fname.slice(slashindex+1);if(fname.charAt(0)=="/"){fullpath=fname.slice(0,slashindex);if(fullpath==="")fullpath="/"}else if(fname.indexOf("..")===0){var relarray=fname.split("..");var relpath=rpath.split("/"); +if(relpath.length>=relarray.length){for(var i=0;i0)fullpath=rpath+"/"+pathtoadd;else fullpath=rpath}else fullpath=rpath;if(filename==".."){filename="";fullname=fullpath}else fullname=fullpath+"/"+filename}}else if(rpath=="/")fullpath=rpath+fname.slice(0,slashindex);else fullpath=rpath+"/"+fname.slice(0,slashindex)}if(fullpath== +"/")fullname=fullpath+filename;else if(fullname.length===0)fullname=fullpath+"/"+filename;return[fullpath,filename,fullname]} +function longlisting(t,files,opt){if(typeof files=="undefined"){t.write("%c(@lightgrey)Error path does not exist%n");return}var showmore=false;var lines=[];if(typeof opt!="undefined"&&opt.indexOf("a")!=-1)t.write(["%c(@lightgrey)drwxrwxr-x 6 sysa wheel 1024 Feb 12 03:03 ./","drwxr-xr-x 21 root wheel 512 Jan 25 00:26 ../%n"]);for(var i=0;it.conf.rows-2)showmore=true;t.write(lines,showmore)} +function listing(t,f){if(typeof f=="undefined"){t.write("%c(@lightgrey)Error path does not exist%n");return}var files=f;var name_length=0;var space_divider=5;var fileslist=[];for(var i=0;iname_length)name_length=files[i].length;name_length=name_length+space_divider;var dividers=Math.round((t.conf.cols-2)/name_length);var j=1;var thisline="%c(@lightgrey)";for(var k=0;k0){space=space+" ";space_missing--}thisline+=space;j++;if(j>=dividers){fileslist.push(thisline);t.write(thisline+"%n");thisline="%c(@lightgrey)";j=1}}if(j!==0)t.write(thisline+"%n")}var uptimed=randomRange(10,380);var uptime=" up "+uptimed+" days, 04:32, "+randomRange(0,10)+" users, load averages: 0."+randomRange(10,99)+", 0."+randomRange(10,89)+", 0."+randomRange(10,69);var clockvisible=false; +stopwatch=false;var numh=asciin.length;var numw=asciin[0].length/10;var asciistr=[];var r;var c;var started;var now;var firstline="";var sp="ABCDEFGHIJKLMNOPQRSTUVWXYZabscdefghijklmnopqrstuvwxyz23456789#$\u00a3@";var s=" ";var dim=null;var allRows=[];var interval=0;var xperIter=0;var mcolors=["030","033","063","093","393","0c3","3c0","6c3","0f0","6f3","3f0","9f3","ff3","fff"];var regex=[]; +function connectionLost(){globalterm.charMode=true;globalterm.lock=true;globalterm.cursorOff();globalterm.newLine();globalterm.write("%n%c(@orange)Error: connection reset by peer%n");createCookie("broken","true",0,1)}function cmdLogin(t){if(t.argc==t.argv.length||t.argv[t.argc]==="")t.write("%c(@lightgrey)usage: login ");else{t.env.getPassword=true;t.env.username=t.argv[t.argc];t.write("%c(@lightgrey)Password: ");t.rawMode=true;t.lock=false;return}} +function cmdSu(t){t.env.getPassword=true;t.env.username="root";t.write("%c(@lightgrey)Password: ");t.rawMode=true;t.lock=false;return}var uid=randomRange(500,1E3);function cmdId(t){var uidnow=uid;if(t.user=="www")uidnow=80;else if(t.user=="root")uidnow=0;t.write("%c(@lightgrey)uid="+uidnow+"("+t.user+") gid="+uidnow+"("+t.user+") groups="+uidnow+"("+t.user+")")}function cmdUptime(t){d=new Date;t.write("%c(@lightgrey)"+d.milTime()+uptime)} +function isnumeric(str){for(var i=0;i47&&a<58)&&!(a==45))return false;if(a==45&&i!==0)return false}return true} +function cmdCal(t){if(t.argv.length==1)d=new Date;else if(t.argv[1]=="-h"||t.argv[1]=="--help"){t.write("%c(@lightgrey)display this months calender.%n");t.write("%c(@lightgrey)usage: cal [month]%n");return}else if(!isnumeric(t.argv[1])){t.write("%c(@lightgrey)usage: cal [month] where [month] is numeric%n");return}else{now=new Date;var year=now.getFullYear();var day=now.getUTCDate();var month=t.argv[1]-1;d=new Date(year,month,day)}t.write(d.calendar())} +function cmdLs(t){var findex=0;var fpath=null;var longlist=false;if(t.argv.length==1){listing(t,tree_files[tree.indexOf(path)][0]);return}else if(t.argv[1]=="-l"||t.argv[1]=="-la"||t.argv[1]=="-al")if(t.argv.length==2){longlisting(t,tree_files[tree.indexOf(path)],t.argv[1]);return}else{longlist=true;fpath=getPath(t.argv[2])}else fpath=getPath(t.argv[1]);findex=tree.indexOf(fpath[2]);if(findex!=-1)if(longlist)longlisting(t,tree_files[findex],t.argv[1]);else listing(t,tree_files[findex][0]);else t.write("%c(@lightgrey)"+ +t.argv[1]+": No such file or directory.")}function cmdLl(t){if(t.argv.length==1)longlisting(t,tree_files[tree.indexOf(path)]);else{fpath=getPath(t.argv[1]);findex=tree.indexOf(fpath[2]);if(findex!=-1)longlisting(t,tree_files[findex]);else t.write("%c(@lightgrey)"+t.argv[1]+": No such file or directory.")}}function cmdPwd(t){t.write("%c(@lightgrey)"+path)} +function cmdCd(t){if(t.argv.length==1||t.argv[1]=="~"){path="/home/www";t.ps="["+t.user+"@localhost]~>";return}else{splitpath=getPath(t.argv[1]);var findex=tree.indexOf(splitpath[2]);if(findex!=-1)path=splitpath[2];else t.write("%c(@lightgrey)"+splitpath[2]+": No such file or directory.")}if(path=="/home/www")t.ps="["+t.user+"@localhost]~>";else t.ps="["+t.user+"@localhost]"+path+">"} +function cmdEcho(t){if(t.argv.length!=1&&t.argv[t.argv.length-2]==">"){var file=t.argv[t.argv.length-1];if(path!="/home/www"){t.write("%c(@lightgrey)Permission denied");return}var fs="";for(var i=1;i0)rmdirr(dirpath+"/"+files[files.length-1])}rmdir(dirpath)} +function cmdRm(t){t.wrap=false;if(t.argv.length==1){t.write("%c(@lightgrey)usage: rm ");return}var rf=false;var rootindex=0;var dirindex=0;var fileindex=0;var filearg=t.argv[t.argv.length-1];if(t.argv.indexOf("-rf")!=-1)rf=true;if(t.user=="root"){if(filearg=="/"&&rf){setTimeout("connectionLost()",15E3);filearg="/bin"}var fpath=getPath(filearg);var fname=fpath[1];var lpath=fpath[0];var fullname=fpath[2];rootindex=tree.indexOf(lpath);if(rootindex!=-1){dirindex=tree.indexOf(fullname);fileindex= +tree_files[rootindex][0].indexOf(fname);if(isdir(fullname))if(rf)rmdirr(fullname);else t.write("rm: cannot remove "+filearg+": Is a directory%n");else if(fileindex!=-1)for(var i=0;i<3;i++)tree_files[rootindex][i].splice(fileindex,1);else t.write("rm: cannot remove "+fname+": No such file or directory%n")}else t.write("rm: cannot remove "+lpath+": No such file or directory%n")}else if(filearg=="/")t.write("%c(@lightgrey)I'm sorry Dave, I'm afraid I can't do that.");else if(t.argv[1]=="*")delAllFiles(); +else delAFile(filearg)} +function cmdUname(t){if(t.argv.length==1||t.argv[1]=="-s")t.write("%c(@lightgrey)FreeBSD");else if(t.argv[1]=="-i")t.write("%c(@lightgrey)CB");else if(t.argv[1]=="-m"||t.argv[1]=="-p")t.write("%c(@lightgrey)i386");else if(t.argv[1]=="-n")t.write("%c(@lightgrey)localhost");else if(t.argv[1]=="-a")t.write("%c(@lightgrey)FreeBSD localhost 7.1-STABLE FreeBSD 7.1-STABLE #2: Wed Jan 30 16:21:05 CET 2009 c@localhost:/usr/obj/usr/src/sys/CB i386");else if(t.argv[1]=="-v")t.write("%c(@lightgrey)FreeBSD 7.1-STABLE #2: Wed Jan 30 16:21:05 CET 2009 c@localhost:/usr/obj/usr/src/sys/CB");else if(t.argv[1]== +"-r")t.write("%c(@lightgrey)7.1-STABLE");else t.write(["%c(@lightgrey)uname: illegal option -"+t.argv[1],"usage: uname [-aimnprsv]"])}function cmdHostname(t){if(t.argv.length==1||t.argv[1]=="-f")t.write("%c(@lightgrey)localhost");else if(t.argv[1]=="-s")t.write("%c(@lightgrey)cb");else if(t.argv[1]=="-i")t.write("%c(@lightgrey)78.31.70.238");else t.write(["%c(@lightgrey)uname: illegal option -"+t.argv[1],"usage: hostname [-fsi]"])} +function cmdReset(t){t.write(" ");t.clear();t.rawMode=true;t.open();return} +function cmdCat(t,iseditor,filename){var error="ok";if(t.argv.length==1&&!iseditor){t.write("%c(@lightgrey)usage: cat file");return error}if(typeof filename=="undefined")filename=t.argv[1];var fpath=getPath(filename);var fname=fpath[1];var lpath=fpath[0];var fullname=fpath[2];var cnt;var tindex=tree.indexOf(lpath);if(tindex==-1){error="Error: "+lpath+" wrong path";return error}var findex=tree_files[tindex][0].indexOf(fname);if(findex!=-1||fname=="unixtoolbox.xhtml"){var fcontent=readCookie(fname); +if(fcontent){cnt=fcontent.slice(0,fcontent.length-12);cnt=cnt.replace(/~~/g,";");t.write("%c(@lightgrey)"+cnt+"%n");return error}cnt=filesContent[fullname];if(typeof cnt!="undefined"&&cnt!="undefined")t.write(cnt);else if(remote_files.indexOf(fname)!=-1){cnt=filesContent[fullname];t.write("%c(@lightgrey)"+cnt+"%n")}else if(binary_files.indexOf(fname)!=-1)if(iseditor)error=" binary file";else window.location="/"+fname;else{error=fname+": Permission denied";if(iseditor)return"Open "+error;else t.write("%c(@lightgrey)cat : "+ +error+"%n")}}else if(!iseditor)t.write("%c(@lightgrey)cat : "+fname+" : File not found%n");else error="";return error} +function cmdMan(t){if(t.argv.length==1){t.write("%c(@lightgrey)usage: man %n");t.write("%c(@lightgrey)The following man pages are available, or use apropos on any command.%n");listing(t,files_man[0]);return}var cmd=t.argv[1];if(files_man_n.indexOf(cmd)!=-1){var dim=t.getDimensions();var file=filesContent["/usr/share/man/"+cmd];if(file.length>t.conf.rows-1)t.write(file,true);else t.write(file)}else t.write("%c(@lightgrey)No manual entry for "+cmd)} +function cmdMore(t){if(t.argv.length==1){t.write("%c(@lightgrey)usage: more ");return}var fpath=getPath(t.argv[1]);var fname=fpath[1];var lpath=fpath[0];var fullname=fpath[2];var cnt;var findex;var tindex=tree.indexOf(lpath);if(tindex==-1)return;if(lpath=="/home/www"){findex=tree_files[tindex][0].indexOf(fname);if(findex!=-1){t.clear();var fcontent=readCookie(fname);if(fcontent){cnt=fcontent.slice(0,fcontent.length-12);cnt=cnt.replace(/~~/g,";");t.write("%c(@lightgrey)"+cnt+"%n");return}else if(fname== +"sitemap.xml"){t.write(file_sitemap,true);return}else if(fname=="cb.txt"){t.write(file_cb,true);return}else if(fname=="about.txt"){t.write(file_about,true);return}else if(fname=="bugs.txt"){t.write(file_bugs,true);return}}if(remote_files.indexOf(fname)!=-1){t.rawMode=true;t.write("%c(@lightgrey)Patience...%n");fetchHttp("/"+fname,displaymore)}else if(binary_files.indexOf(fname)!=-1)t.write("%c(@lightgrey)Binary file. Use pr instead");else t.write("%c(@lightgrey)File not found.")}else if(lpath=="/etc"){findex= +tree_files[tindex][0].indexOf(fname);if(findex!=-1){cnt=filesContent[fullname];if(typeof cnt!="undefined"){t.clear();t.write(cnt)}else t.write("%c(@lightgrey)"+fname+" : Permission denied%n")}else t.write("%c(@lightgrey)"+fname+" : File not found%n")}}function cmdPr(t){if(t.argv.length==1)t.write("%c(@lightgrey)usage: pr file");else window.location=t.argv[1]} +function cmdRedim(t,manual){var oldie=false;if(typeof document.documentElement.style.maxHeight=="undefined")oldie=true;if(navigator.appVersion.indexOf("Safari")!=-1)safari=true;var dim=t.getDimensions();var neww=Math.round(t.conf.cols/dim.width*browserWidth())-2;var newh=Math.round(t.conf.rows/dim.height*browserHeight())-1;if(oldie){t.write("Using IE6 hack%n");neww=neww-2}if(t.argv&&t.argv.length>1||manual){t.write("Terminal dimentions in px: "+dim.width+" x "+dim.height+" px%n");t.write("Browser window dimentions in px: "+ +browserWidth()+" x "+browserHeight()+" px%n");t.write("Terminal columns x rows: "+t.conf.cols+" x "+t.conf.rows+" char%n");t.write("Maximal columns x rows: "+neww+" x "+newh+" char%n")}else if(!t.argv||t.argv.length==1)if(neww!==0){t.resizeTo(neww,newh);t.maxCols=neww;t.maxLines=newh;if(neww<6*asciinumber[0].length/10+2*asciiddot[0].length){asciin=asciinumber_s;asciid=asciiddot_s}else{asciin=asciinumber;asciid=asciiddot}numh=asciin.length;numw=asciin[0].length/10}} +function redim(){cmdRedim(globalterm)}function cmdTime(t){var d=new Date;t.write("%c(@lightgrey)"+d.milTime())} +function displayNum(str,center){var n=0;for(var i=0;i=2)findex=t.argv.indexOf("-t");if(findex!=-1){stopwatch=true;t.argv.splice(findex,1);findex=-1}if(t.argv.length>=2)findex=t.argv.indexOf("-s");if(findex!=-1){asciin=asciinumber_s;asciid=asciiddot_s;t.argv.splice(findex,1);findex=-1}else if(t.conf.cols>6*asciinumber[0].length/10+2*asciiddot[0].length){asciin=asciinumber;asciid=asciiddot}t.charMode=true;t.cursorOff();t.clear();clockHandler(t);interval=setInterval("carriageReturn()", +1E3);t.handler=clockHandler;t.lock=false;return}function setNormal(){term.conf.bgColor="#181818";term.rebuild()}function setColor(color){term.conf.bgColor=color;term.rebuild();globalterm.write(" ")}var bootline=0;var booting=false;var sdnotifed=false;var rebootask1=false;var rebootask2=false;var rebootask3=false;var beenhere=false; +function rebootHandler(initterm){if(initterm){initterm.env.handler=initterm.handler;if(beenhere)initterm.write("%c(@orange)You again?? %c(@lightgrey)Alright you want to reboot, but are you sure?");else initterm.write("%c(@lightgrey)So you want to reboot. Are you sure?");return}this.newLine();this.charMode=false;this.lock=true;if(this.isPrintable(key)){var ch=String.fromCharCode(key);this.type(ch)}if(!rebootask1){beenhere=true;this.cursorOn();if(this.lineBuffer=="yes"){rebootask1=true;this.write("%c(@lightgrey)Are you really sure you know which machine is actually going to reboot?"); +this.newLine()}else if(this.lineBuffer=="no"){this.write("%c(@lightgrey)Good choice! Go play with the other commands.");this.charMode=false;this.handler=this.env.handler;this.prompt();return}else if(this.lineBuffer){this.write("%c(@lightgrey)answer yes or no");this.newLine()}this.lock=false;this.lineBuffer="";return}else if(!rebootask2){this.cursorOn();if(this.lineBuffer=="yes"){rebootask2=true;this.write('%c(@lightgrey)So will that be yours or mine? Answer "yours" or "mine" or "quit"');this.newLine()}else if(this.lineBuffer== +"no"){this.write("%c(@lightgrey)I don't know either :o)");rebootask1=false;this.charMode=false;this.handler=this.env.handler;this.prompt();return}else if(this.lineBuffer){this.write("%c(@lightgrey)answer with yes or no");this.newLine()}this.lock=false;this.lineBuffer="";return}else if(!rebootask3){this.cursorOn();if(this.lineBuffer=="yours"||this.lineBuffer=="mine"){this.cursorOff();rebootask3=true;this.write("%c(@lightgrey)So you mean yours....OK you asked for it.");setTimeout("carriageReturn()", +2E3)}else if(this.lineBuffer=="quit"){rebootask1=false;rebootask2=false;rebootask3=false;this.write("%c(@lightgrey)whimp :o).");this.charMode=false;this.handler=this.env.handler;this.prompt();return}else if(this.lineBuffer){this.write('Answer "yours" or "mine" or "quit"');this.newLine()}this.lock=false;this.lineBuffer="";return}this.lock=true;var key=this.inputChar;this.cursorOff();if(key==32)if(interval===0)interval=setInterval("carriageReturn()",300);else{clearInterval(interval);interval=0}else if(!sdnotifed&& +!booting){this.newLine();this.write(["%n%n%n%c(@orange)Shutdown at "+Date(),"%c(@chartreuse)shutdown: [pid "+randomRange(189,21E3)+"]","root:{"+randomRange(70,150)+"}"+path,"%n%n*** System shutdown message from "+clientip+" ***","Sytem going down in 4 seconds%c()%n%n%n"]);this.write("Send SIGTERM to all processes%n");this.write(pslong);this.newLine();this.write("%n%n");sdnotifed=true;setTimeout("interval = setInterval ('carriageReturn()', 300 )",4E3)}else if(!booting&&sdnotifed)if(bootline==filesContent["/boot/shutdown"].length- +1){bootline=0;clearInterval(interval);interval=0;this.clear();term.conf.bgColor="blue";term.rebuild();this.write(" ");booting=true;setTimeout("setColor('#ffffff')",1200);setTimeout("setNormal()",1600);setTimeout("interval = setInterval ('carriageReturn()', 300 )",2500)}else{this.write(filesContent["/boot/shutdown"][bootline]);bootline++;if(bootline==filesContent["/boot/shutdown"].length-1){clearInterval(interval);interval=setInterval("carriageReturn()",4E3)}}else if(bootline==filesContent["/boot/kernel"].length- +1){clearInterval(interval);interval=0;bootline=0;booting=false;rebootask1=false;rebootask2=false;this.newLine();cmdRedim(this,true);this.charMode=false;this.handler=this.env.handler;this.cursorOn();setTimeout("globalterm.clear()",3E3);setTimeout("location.reload()",3500)}else{this.write(filesContent["/boot/kernel"][bootline]);bootline++}this.lock=false} +function cmdReboot(t){if(t.user!="root"){t.write("%c(@lightgrey)You must be root to do this");return}t.charMode=true;rebootHandler(t);t.handler=rebootHandler;setTimeout("carriageReturn()",100);t.lock=false;return}function cmdNum(t){if(t.argv.length==1)t.write("%c(@lightgrey)usage: num number");asciistr=[];displayNum(t.argv[1],true)} +function randomScreen(isgame){globalterm.wrap=true;var maxr=0;allRows=[];globalterm.clear();if(typeof isgame=="undefined")isgame=false;if(isgame)maxr=globalterm.conf.rows-2;else maxr=globalterm.conf.rows;firstline="";for(var j=0;j<=maxr;j++){for(var i=0;i0&&kr<3)rockchar="#####";else if(kr===0)rockchar=",###,";else if(kr==3)rockchar="'###'";allRows[rockr+kr]=allRows[rockr+ +kr].slice(0,rockc)+rockchar+allRows[rockr+kr].slice(rockc+5)}}for(var l=0;l0)while(matrixrounds>0){iterateArray(false);matrixrounds--}iterateArray(false);this.write(allRows)}this.lock=false} +function cmdMatrix(t){t.cursorOff();t.charMode=true;t.write("%c(@lightgrey)Use q or ESC to quit. Space to pause%n");t.write("%c(@lightgrey) -s for empty start%n");t.write("%c(@lightgrey) See also man matrix%n");matrixHandler(t);interval=setInterval("carriageReturn()",1200);t.handler=matrixHandler;t.lock=false;return} +function init(t){var numproc=randomRange(9,12);var h=randomRange(0,9);var m=randomRange(10,59);for(var i=0;i");else if(t.argv[1]=="help")t.write("%c(@lightgrey)display the help message");else if(t.argv[1]=="info")t.write("%c(@lightgrey)display the info message with credentials");else if(t.argv[1]=="clear")t.write("%c(@lightgrey)clear the terminal");else if(t.argv[1]=="echo")t.write("%c(@lightgrey)echo the arguments or create a file with >");else if(t.argv[1]=="ls"||t.argv[1]=="ll")t.write("%c(@lightgrey)list directory contents"); +else if(t.argv[1]=="cd")t.write("%c(@lightgrey)change working directory");else if(t.argv[1]=="rm")t.write("%c(@lightgrey)delete a file mostly for root only");else if(t.argv[1]=="uname")t.write("%c(@lightgrey)display system identification");else if(t.argv[1]=="whoami")t.write("%c(@lightgrey)display effective user id");else if(t.argv[1]=="whereami")t.write("%c(@lightgrey)display you probable position with country and city");else if(t.argv[1]=="weather")t.write("%c(@lightgrey)display weather information based on your location"); +else if(t.argv[1]=="who")t.write("%c(@lightgrey)display who is on the system");else if(t.argv[1]=="id")t.write("%c(@lightgrey)return user identity");else if(t.argv[1]=="matrix")t.write("%c(@lightgrey)show a matrix like screen saver (it is CPU hungry)");else if(t.argv[1]=="more")t.write("%c(@lightgrey)display a file with paging function");else if(t.argv[1]=="pwd")t.write("%c(@lightgrey)return working directory name");else if(t.argv[1]=="cat")t.write("%c(@lightgrey)concatenate and print files");else if(t.argv[1]== +"chat")t.write("%c(@lightgrey)chat with the terminal chatbot");else if(t.argv[1]=="hostname")t.write("%c(@lightgrey)set or print name of current host system");else if(t.argv[1]=="ps")t.write("%c(@lightgrey)process status");else if(t.argv[1]=="pr")t.write("%c(@lightgrey)print files on the browser");else if(t.argv[1]=="browse")t.write("%c(@lightgrey)display the file on the browser");else if(t.argv[1]=="browser")t.write("%c(@lightgrey)display your IP address and browser information");else if(t.argv[1]== +"cal")t.write("%c(@lightgrey)displays a calendar");else if(t.argv[1]=="uptime")t.write("%c(@lightgrey)show how long system has been running");else if(t.argv[1]=="date")t.write("%c(@lightgrey)display date and time");else if(t.argv[1]=="time")t.write("%c(@lightgrey)time command execution");else if(t.argv[1]=="clock")t.write("%c(@lightgrey)display a full screen clock or stopwatch with the option -t");else if(t.argv[1]=="top")t.write("%c(@lightgrey)display information about the top cpu processes");else if(t.argv[1]== +"df")t.write("%c(@lightgrey)display free disk space");else if(t.argv[1]=="history")t.write("%c(@lightgrey)display the last used commands");else if(t.argv[1]=="fortune")t.write("%c(@lightgrey)print a random, hopefully interesting, adage");else if(t.argv[1]=="su")t.write("%c(@lightgrey)substitute user identity");else if(t.argv[1]=="ssh")t.write("%c(@lightgrey)ssh connection using the mindterm java terminal");else if(t.argv[1]=="vi")t.write("%c(@lightgrey)vi the editor!");else if(t.argv[1]=="snake")t.write("%c(@lightgrey)A variation of the classical snake game"); +else if(t.argv[1]=="invaders")t.write("%c(@lightgrey)The invaders game provided by Norbert Landsteiner");else if(t.argv[1]=="logout"||t.argv[1]=="exit")t.write("%c(@lightgrey)Exit and logout from the terminal");else if(t.argv[1]=="reset")t.write("%c(@lightgrey)reset the terminal as it's initial state");else if(t.argv[1]=="reload")t.write("%c(@lightgrey)reload the web page");else if(t.argv[1]=="ping")t.write("%c(@lightgrey)ping a host, or yourself when no argument is given");else t.write("%c(@lightgrey)"+ +t.argv[1]+": nothing appropriate")}var viquit=false;var visave=false;var viforce=false;var viopen=false;var viedit=false;var visaved=true;var visplvis=false;var vicmd="";var vifile="";function readOneLine(t,row){var c=0;var line="";while(t.isPrintable(t.charBuf[row][c])&&c to enter command mode"," :q to exit"," :w to save",' :w filename to save to "filename"',' :e filename to open "filename"'," :q! to exit without saving"," D to delete rest of line"," dd to delete current line"," x to delete current char"," i to enter edit mode "," UP RIGHT DOWN LEFT to move the cursor", +" or h left j down k up l right","","Paging is not possible, sorry. Only one","window (or page) can be edited at a time.","","both vi *and* Emacs are just too damn slow","Use ED! See man ed"];if(safari)splash.push("On Safari browsers use instead of ");visplvis=true;centerSplash(t,splash)} +function centerSplash(t,splash){var sh=splash.length;var sw=0;for(var i=0;isw)sw=splash[i].length;var r=Math.round(t.conf.rows/2)-Math.round(sh/2)-3;var c=Math.round(t.conf.cols/2)-Math.round(sw/2);if(r<0)r=0;for(var m=0;m instead of ")}}else{initterm.statusLine(" [New File]"); +viSplash(initterm)}if(!visplvis)for(var r=initterm.r;r0)c--;this.cursorSet(ru,c)}else if(key==termKey.DOWN){var cd=this.c;var rd=this.r+1;if(this.charBuf[rd][0]!=126){while(!this.isPrintable(this.charBuf[rd][cd])&& +cd>0)cd--;this.cursorSet(rd,cd)}}if(visplvis){for(var ro=this.r;ro0)cd2--;this.cursorSet(rd2,cd2)}}else if(key==107&&vicmd.charAt(0)!=":"){var c2=this.c;var ru2=this.r-1;if(ru2<0)ru2=0;while(!this.isPrintable(this.charBuf[ru2][c2])&& +c2>0)c2--;this.cursorSet(ru2,c2)}else if(key==108&&vicmd.charAt(0)!=":")this.cursorRight();if(key==termKey.CR){if(vicmd.charAt(0)!=":"){viquit=viopen=visave=viforce=viedit=false;vicmd="";this.statusLine("Error: no command given. Use :q to quit.")}if(visave){viopen=visave=viedit=false;var name=vicmd.split(" ");if(name.length>2)this.statusLine("Error: no space in file name. Use :w filename.");else if(name.length==2||vifile!==""){if(name.length==2)vifile=name[1];if(saveFile(this,vifile))visaved= +true;else viquit=false}else this.statusLine("Error: no file name. Use :w filename to save.")}else if(viopen){viquit=viopen=visave=viedit=false;var fname=vicmd.split(" ");if(fname.length>2)this.statusLine("Error: no space in file name. Use :e filename.");else if(fname.length==2||vifile!=="")if(fname.length==2)vifile=fname[1];this.clear();error=cmdCat(this,true,vifile);if(error==="")this.statusLine('"'+vifile+'" [New File]');else if(error!="ok"&&typeof error!="undefined")this.statusLine("Error: "+ +error,1)}if(viquit)if(visaved||viforce){viquit=viopen=visave=viforce=viedit=false;vicmd="";vifile="";this.charMode=false;this.handler=this.env.handler;this.maxLines=globalterm.conf.rows;this.clear();this.prompt();return}else this.statusLine("Error: file modified since last write; save or use ! to override.");vicmd="";viquit=viopen=visave=viforce=viedit=false}else if(key==33&&vicmd.charAt(0)==":"){viforce=true;vicmd+="!";this.statusLine(vicmd)}else if(key==58&&vicmd.charAt(0)!=":"){vicmd+=":";viquit= +false;visave=false;viforce=false;this.statusLine(vicmd)}else if(key==113&&vicmd.charAt(0)==":"&&!viedit){viquit=true;vicmd+="q";this.statusLine(vicmd)}else if(key==119&&vicmd.charAt(0)==":"&&!viedit){visave=true;vicmd+="w";this.statusLine(vicmd)}else if(key==101&&vicmd.charAt(0)==":"){viopen=true;vicmd+="e";this.statusLine(vicmd)}else if(key==120&&vicmd.charAt(0)==":"&&!viedit){viquit=visave=true;vicmd+="x";this.statusLine(vicmd)}else if(key==120&&!viedit){visaved=false;this.fwdDelete()}else if(key== +68&&!viedit){visaved=false;while(this.isPrintable(this.charBuf[this.r][this.c]))this.fwdDelete()}else if(key==100&&!viedit){vicmd+="d";if(vicmd=="dd"){visaved=false;this.cursorSet(this.r,0);while(this.isPrintable(this.charBuf[this.r][this.c]))this.fwdDelete();removeLine(this,this.r);vicmd=""}}else if(key==105&&!viedit){this.statusLine("-- INSERT --",0);this.env.mode=""}else if(key==termKey.ESC||key==9){this.statusLine("",0);viquit=false;visave=false;viforce=false;vicmd=""}else if(visave||viopen){if(key== +32)viedit=true;var ch=String.fromCharCode(key);vicmd+=ch;this.statusLine(vicmd)}}else if(key==termKey.ESC||key==9){vicmd="";this.statusLine("",1);this.env.mode="ctrl"}else if(key==termKey.CR){visaved=false;if(!this.isPrintable(this.charBuf[this.r][0])||this.charBuf[this.r][0]==126)this.write(" ");if(this.rinitterm.conf.rows)vartoptmp=vartoptmp.slice(0,initterm.conf.rows);initterm.write(vartoptmp);interval=setInterval("carriageReturn()",2E3);return}this.lock=true;var now=new Date;var h=now.getHours();var hup=(h+8)%24;var m=now.getMinutes();var mup=(m+13)%60;var s=now.getSeconds();var sup=(s+45)%60;if(h<10)h="0"+h;if(m<10)m="0"+m;if(s<10)s="0"+s; +if(hup<10)hup="0"+hup;if(mup<10)mup="0"+mup;if(sup<10)sup="0"+sup;var timestr="%c(@lightgrey)"+uptimed+"+"+hup+":"+mup+":"+sup+" "+h+":"+m+":"+s;var key=this.inputChar;if(key==termKey.CR){var procarray=vartoptmp.slice(8,vartop.length-1);procarray.shuffle();this.cursorSet(0,57);this.write(timestr);this.cursorSet(8,0);this.write(procarray)}else{clearInterval(interval);interval=0;this.charMode=false;this.handler=this.env.handler;this.clear();this.prompt();this.wrapping=true;return}this.lock=false} +function cmdTop(t){t.wrapping=false;topHandler(t);t.handler=topHandler;t.charMode=true;t.lock=false;return}function bsHandler(initterm){if(initterm){initterm.clear();initterm.env.handler=initterm.handler;initterm.cursorOff();setColor("blue");initterm.write(bs);return}this.lock=true;this.charMode=false;this.handler=this.env.handler;this.clear();this.prompt();setNormal();return}function cmdBlueScreen(t){t.wrapping=false;bsHandler(t);t.handler=bsHandler;t.charMode=true;t.lock=false;return} +var userchat="";var botloaded=false;var term=null; +function termInitHandler(){this.user="www";globalterm=this;cmdRedim(this);var cookiebroken=readCookie("broken");if(cookiebroken.length>0){this.write("You broke it!");this.charMode=true;this.lock=true;this.cursorOff();return}var thislog="%c(@lightgrey)Last login: "+Date()+" from "+clientip;var cookielastlog=readCookie("clilastlog");var oldlog=cookielastlog?cookielastlog:thislog;createCookie("clilastlog",thislog,365);this.write([oldlog,"FreeBSD 7.1-STABLE (localhost) #3: "+Date("2017-06-17T15:34:42"), +"%c()"]);this.newLine();this.newLine();this.prompt();var allcookies=readAllCookies();for(var i=0;i1){tabresult=tolist[0].slice(arg.length);var j=0;var nextchar=" ";if(tolist[0].lengtharg.length+ +j&&nextchar.length>0){nextchar=tolist[0].charAt(arg.length+j);for(var k=1;ktolist[k].length||tolist[k].charAt(arg.length+j)!=nextchar){nextchar="";break}tabresult+=nextchar;t.type(nextchar);j++}}}if(tolist.length>1){t.charMode=true;typed=t._getLine();t.lock=true;t.cursorOff();t.newLine();listing(t,tolist);t.cursorOn();t.lock=false;t.charMode=false;t.prompt();t.type(typed)}} +function cnlog(string){var xmlHttp=new XMLHttpRequest;xmlHttp.open("GET","/rest-api/cmd/?"+string,true);xmlHttp.send(null)} +function commandHandler(){cnlog("s="+this.lineBuffer);this.newLine();if(this.rawMode){if(this.env.getPassword){if(this.lineBuffer==this.env.username){this.user=this.env.username;this.ps="["+this.user+"@localhost]~>"}else this.write("%c(@lightgrey)Sorry.");this.env.username="";this.env.getPassword=false}this.rawMode=false;this.prompt();return}parseLine(this);if(this.argv.length===0);else if(this.argQL[0])this.write("%c(@lightgrey)Syntax error: first argument quoted.");else{var cmd=this.argv[this.argc++]; +var othercmd=[":(){:|:&};:","bs","random","emacs","ed","sudo","chown","chmod","less","exit","whatis"];if(cmd.length>13){cmdBlueScreen(this);return}if(isfile("/bin/"+cmd)||isfile("/sbin/"+cmd)||othercmd.indexOf(cmd)!=-1)if(cmd=="help")this.write(helpPage);else if(cmd=="info")this.write(infoPage);else if(cmd=="clear"||cmd=="bash")this.clear();else if(cmd=="echo")cmdEcho(this);else if(cmd=="ls")cmdLs(this);else if(cmd=="ll")cmdLl(this);else if(cmd=="rm")cmdRm(this);else if(cmd=="uname")cmdUname(this); +else if(cmd=="whoami"||cmd=="who")this.write("%c(@lightgrey)"+this.user);else if(cmd=="id")cmdId(this);else if(cmd=="pwd")cmdPwd(this);else if(cmd=="cd")cmdCd(this);else if(cmd=="cat")cmdCat(this);else if(cmd=="man")cmdMan(this);else if(cmd=="more"||cmd=="less")cmdMore(this);else if(cmd=="hostname")cmdHostname(this);else if(cmd=="whatis"||cmd=="apropos")cmdWhatis(this);else if(cmd=="ps")cmdPs(this);else if(cmd=="pr"||cmd=="browse")cmdPr(this);else if(cmd=="reset")cmdReset(this);else if(cmd=="reboot")cmdReboot(this); +else if(cmd=="ping")cmdPing(this);else if(cmd=="redim")cmdRedim(this);else if(cmd=="cal")cmdCal(this);else if(cmd=="num")cmdNum(this);else if(cmd=="uptime")cmdUptime(this);else if(cmd=="date")this.write("%c(@lightgrey)"+Date());else if(cmd=="reload")location.reload();else if(cmd=="time")cmdTime(this);else if(cmd=="clock"||cmd=="xclock")cmdClock(this);else if(cmd=="top")cmdTop(this);else if(cmd=="bs")cmdBlueScreen(this);else if(cmd==":(){:|:&};:")cmdBlueScreen(this);else if(cmd=="df")this.write(vardf); +else if(cmd=="history")this.write(this.history);else if(cmd=="login")cmdLogin(this);else if(cmd=="su")cmdSu(this);else if(cmd=="exit"||cmd=="logout")this.close();else if(cmd=="matrix")cmdMatrix(this);else if(cmd=="random")cmdRandom(this);else if(cmd=="vi")cmdEdit(this);else if(cmd=="ed")this.write("%c(@lightgrey)Ed is the standard text editor. (I still have to port it though) %c(@lightcyan)See man ed");else if(cmd=="sudo")this.write("%c(@lightgrey)sudo is for wimps");else if(cmd=="chown"||cmd=="chmod")this.write("%c(@lightgrey)All Your Files Are Belong To Us"); +else{if(files_sbin_n.indexOf(cmd)!=-1)this.write("%c(@lightgrey)"+this.argv[0]+": Permission denied.")}else this.write("%c(@lightgrey)"+this.argv[0]+": Command not found.")}if(!this.rawMode&&!this.charMode)this.prompt()} +function termOpen(){user_login=localStorage.getItem("user");var hostname=location.hostname;if(!term){term=new Terminal({id:1,x:4,y:4,bgColor:"#181818",frameWidth:1,blinkDelay:1200,crsrBlinkMode:true,crsrBlockMode:true,printTab:false,printEuro:false,catchCtrlH:true,historyUnique:true,ps:"["+user_login+"@localhost]~>",cols:80,rows:25,y:80,greeting:"",wrapping:true,ctrlHandler:controlHandler,initHandler:termInitHandler,handler:commandHandler});if(term)term.open()}else if(term.closed)term.open();else term.focus(); +incrementLoaded(term)}function controlHandler(){if(this.inputChar==termKey.ETX){this.newLine();this.prompt()}else if(this.inputChar==termKey.EOT)this.close();else if(this.inputChar==9)tabCompletion(this)}var clientip="%c(@lightgrey)127.0.0.1"; +var vartop=["%c(@lightgrey)last pid: 17396; load averages: 0.12, 0.15, 0.16 up 1187+13:45:54 13:45:40","%c(@lightgrey)132 processes: 1 running, 131 sleeping","%c(@lightgrey)","%c(@lightgrey)Mem: 1041M Active, 328M Inact, 452M Wired, 80M Cache, 209M Buf, 5604K Free","%c(@lightgrey)Swap: 2000M Total, 1676M Used, 324M Free, 83% Inuse","%c(@lightgrey)","%c(@lightgrey)","%c(@lightgrey) PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND","%c(@lightgrey)14496 www 1 50 0 344M 83808K lockf 0 1:29 2.98% httpd", +"%c(@lightgrey) 6786 asterisk 37 44 0 303M 9004K ucond 1 448.8H 0.00% asteris","%c(@lightgrey)71038 mysql 10 44 0 108M 22404K sigwai 0 693:36 0.00% mysqld","%c(@lightgrey)70914 pgsql 1 44 0 49748K 30440K select 0 108:59 0.00% postgre","%c(@lightgrey) 1413 clamav 1 45 0 28136K 2332K pause 0 57:32 0.00% freshcl","%c(@lightgrey) 1111 root 1 44 0 6008K 704K select 0 28:43 0.00% syslogd","%c(@lightgrey) 1234 root 1 44 0 661M 236M lockf 1 23:06 0.00% saslaut", +"%c(@lightgrey) 1232 root 1 44 0 661M 61372K lockf 0 23:05 0.00% saslaut","%c(@lightgrey) 1233 root 1 44 0 661M 236M accept 0 23:04 0.00% saslaut","%c(@lightgrey)92882 root 1 44 0 29232K 1440K select 0 17:27 0.00% sendmai","%c(@lightgrey)93011 root 1 44 0 341M 58724K select 0 14:30 0.00% httpd","%c(@lightgrey)70915 pgsql 1 44 0 17380K 112K select 0 8:55 0.00% postgre","%c(@lightgrey) 1361 root 1 46 0 8120K 712K select 0 8:45 0.00% inetd", +"%c(@lightgrey) 1406 clamav 3 76 0 41248K 708K sigwai 1 8:09 0.00% clamav-","%c(@lightgrey)94445 mailnull 4 76 0 52804K 7628K sigwai 1 7:15 0.00% dkim-fi","%c(@lightgrey) 1289 root 3 76 0 43520K 4896K sigwai 0 5:50 0.00% sid-fil","%c(@lightgrey)79764 root 2 76 0 48560K 5660K sigwai 0 5:27 0.00% spamass","%c(@lightgrey)70912 pgsql 1 44 0 49748K 780K select 1 4:23 0.00% postgre","%c(@lightgrey)32014 root 1 54 10 113M 77668K select 0 3:51 0.00% perl5.8", +"%c(@lightgrey)93104 root 1 44 0 25196K 520K select 1 3:45 0.00% sshd","%c(@lightgrey) 1462 root 1 44 0 6936K 380K nanslp 0 2:50 0.00% cron","%c(@lightgrey)14506 www 1 44 0 345M 84272K lockf 0 1:43 0.00% httpd","%c(@lightgrey)14464 www 1 44 0 345M 86764K select 0 1:38 0.00% httpd","%c(@lightgrey)14465 www 1 44 0 344M 81920K kqread 1 1:38 0.00% httpd","%c(@lightgrey)14469 www 1 50 0 346M 82600K lockf 0 1:38 0.00% httpd", +"%c(@lightgrey)14498 www 1 45 0 344M 83520K select 0 1:36 0.00% httpd","%c(@lightgrey)"]; +var vardf=["%c(@lightgrey)Filesystem 1K-blocks Used Avail Capacity Mounted on","%c(@lightgrey)/dev/ad6s1d 99173510 51628630 39611000 57% /","%c(@lightgrey)/usr/src 9914318 4470852 4650322 49% /usr/src","%c(@lightgrey)/usr/obj 9914318 4470852 4650322 49% /usr/obj","%c(@lightgrey)/usr/ports 9914318 4470852 4650322 49% /usr/ports","%c(@lightgrey)/data/jail/sleepyowl8/data/home 99173510 51628630 39611000 57% /var/chroot/data/home", +"%c(@lightgrey)/data/jail/sleepyowl8/data/www 99173510 51628630 39611000 57% /var/chroot/data/www","%c(@lightgrey)devfs 1 1 0 100% /dev","%c(@lightgrey)fdescfs 1 1 0 100% /dev/fd","%c(@lightgrey)procfs 4 4 0 100% /proc",""]; +var file_index=["%c(@lightgrey)","a, a:link, a:visited {"," text-decoration: none;"," color: #5E83E0;","}","a:hover {"," text-decoration: underline;","}","a:active {"," text-decoration: underline;"," color: orange;","}","#applet { position: absolute; top: 4px; left: 4px; z-index: 2; }","#link { position: absolute; top: 4px; right: 4px; z-index: 3; }"," ","","","",'

',"Welcome to localhost.
","","",""]; +var file_toolbox=["%c(@lightgrey)","","",'

Online Help

','

Documentation

',"",' ',' ',' ',' ', +' ',' ',' ',' ',"
Linux Documentation en.tldp.org
Linux Man Pages www.linuxmanpages.com
Linux commands directory www.oreillynet.com/linux/cmd
Linux doc man howtos linux.die.net
FreeBSD Handbook www.freebsd.org/handbook
FreeBSD Man Pages www.freebsd.org/cgi/man.cgi
FreeBSD user wiki www.freebsdwiki.net
Solaris Man Pages docs.sun.com/app/docs/coll/40.10
", +'

Other Unix/Linux references

',"",' ',' ',' ',' ', +' ',"
Rosetta Stone for Unix bhami.com/rosetta.html (a Unix command translator)
Unix guide cross reference unixguide.net/unixguide.shtml
Linux commands line list www.linuxcmd.org
Short Linux reference www.pixelbeat.org/cmdline.html
Little command line goodies www.shell-fu.org
","
","",'

That\'s all folks!

',"","\x3c!-- page break --\x3e",'\x3c!--
--\x3e',"",'
','This document: "Unix Toolbox revision 14.4" is licensed under a Creative Commons Licence [Attribution - Share Alike]. © Colin Barschel 2007-2012. Some rights reserved.', +"
","","","",""];var file_toolbox_txt=["%c(@lightgrey)","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]; +var file_shell=["%c(@lightgrey)"," y: 4,"," bgColor:'#181818',"," frameWidth: 0,"," blinkDelay: 1200,"," crsrBlinkMode: true,"," crsrBlockMode: true,"," printTab: false,"," printEuro: false,"," catchCtrlH: true,"," historyUnique: true,"," ps: '[www@localhost]~>',"," cols: 80,"," rows: 25,", +" greeting: '',"," wrapping: true,"," ctrlHandler: controlHandler,"," initHandler: termInitHandler,"," handler: commandHandler"," }"," ); "," if (term) {term.open();}"," } else if (term.closed) { term.open();"," } else { term.focus();"," }"," incrementLoaded(term);"," } ","}","function controlHandler() {"," if (this.inputChar == termKey.ETX) {", +" this.newLine();"," this.prompt();"," } else if (this.inputChar == termKey.EOT) {this.close();}"," else if (this.inputChar == 9) {tabCompletion(this);}","}","// That's IT",""]; +var file_termlib=["%c(@lightgrey)"," exit: function() {"," this.clear();"," var inv=this.env.invaders;"," // reset the terminal"," this.handler=inv.termHandler;"," if (inv.charBuf) {"," for (var r=0; r=0) this.maxCols=inv.termMaxCols;"," this.keyRepeatDelay1=inv.keyRepeatDelay1;"," this.keyRepeatDelay2=inv.keyRepeatDelay2;"," delete inv.termref;"," this.lock=false;"," this.charMode=inv.charMode;"," // delete instance and leave with a prompt"," delete this.env.invaders;"," this.prompt();"," },"," getStyleColorFromHexString: function(clr) {"," // returns a stylevector for the given color-string"," var cc=Terminal.prototype.globals.webifyColor(clr.replace(/^#/,''));", +" if (cc) {"," return Terminal.prototype.globals.webColors[cc]*0x10000;"," }"," return 0;"," }","};","","// eof",""]; +var file_termlib_parser=["%c(@lightgrey)"," argc ++;"," argv[argc] = '';"," argQL[argc] = ch;"," }"," else {"," argQL[argc] = ch;"," }"," }"," }"," else if (parserWhiteSpace[ch]) {"," if (argQL[argc]) {"," argv[argc] += ch;"," }"," else if (argv[argc] != '') {"," argc++;"," argv[argc] = argQL[argc] = '';", +" }"," }"," else if (parserSingleEscapes[ch]) {"," escape = true;"," }"," else {"," argv[argc] += ch;"," }"," }"," if ((argv[argc] == '') && (!argQL[argc])) {"," argv.length--;"," argQL.length--;"," }"," termref.argv = argv;"," termref.argQL = argQL;"," termref.argc = 0;","}","","// eof",""];var file_about=["%c(@lightgrey)","Welcome to my website localhost!",""]; +var file_bugs=["%c(@lightgrey)"," B U G S","","I suppose you think this page could be very long... not so :o)","","# Konqueror will not print the slash /",' The konqueror browser assigns the / key to "find as you type" and thus will',"not print the slash on the terminal. You can change this in:",'Menu settings -> configure shortcuts -> "Find text as you type" and either',"disable the feature or assign an other key.","Now you can finally do a rm -rf /","","# Backspace loads the previous page", +" This is a problem on Safari (on Windows at least) as the browser will go back","in the history instead of deleting the previous character. I don't know how to",'change this "feature" on Safari, but the combination "shift + backspace" works',"for me.","",' To disable the "feature" on firefox change the value browser.backspace_action',"from 0 to 2 (do nothing) in about:config.","","Tell me about a disappointingly missing command/feature or bug. This could","motivate me to do it...","","Have fun.", +""]; +var file_sitemap=["%c(@lightgrey)",'',"',"",""," http://localhost"," 0.0"," daily","",""," http://localhost/unixtoolbox.xhtml"," 1", +" daily","",""," http://localhost/unixtoolbox.pdf"," 0.8"," daily","",""," http://localhost/unixtoolbox.book.pdf"," 0.0"," daily","","",""];filesContent["/home/www/about.txt"]=file_about;filesContent["/home/www/bugs.txt"]=file_bugs;filesContent["/home/www/unixtoolbox.xhtml"]=file_toolbox; +filesContent["/home/www/unixtoolbox.txt"]=file_toolbox_txt;filesContent["/home/www/index.html"]=file_index;filesContent["/home/www/sitemap.xml"]=file_sitemap;filesContent["/home/www/shell.js"]=file_shell;filesContent["/home/www/termlib.js"]=file_termlib;filesContent["/home/www/termlib_parser.js"]=file_termlib_parser; \ No newline at end of file -- cgit v1.2.3