Usage:
rollLog LOGDIRECTORY LOGFILENAME
For instance, if you have a log at c:\log\at.log, you can run:
rollLog c:\logs at.log
Afterwards, you have one file named c:\logs\at.log.0. The next time you run it (and there has been something written to at.log) you get two files, at.log.0 and at.log.1.
]]>
var Combobox={};
Combobox.Local=Class.create(Autocompleter.Local,{
initialize:function($super,element,update,array,options){
$super(element,update,array,options);
this.options.minChars=this.options.minChars||0;
Event.observe(this.element,'click',this.onClick.bindAsEventListener(this));
},
onClick:function($super,event){
if(Event.element(event).id){
if(this.active){
this.hasFocus=false;
this.active=false;
this.hide();
}else{
this.activate();
this.render();
}
return;
}
$super(event);
}
});
.combo {
background-image:url(combo_select2.gif);
background-repeat:no-repeat;
background-position:right top;
margin-right:10px;
}
.combo:hover {
background-image:url(combo_select2.gif);
background-repeat:no-repeat;
background-position:right -18px;
}
div#autocomplete {
margin:0px;
padding:0px;
width:250px;
background:#fff;
border:1px solid #888;
position:absolute;
}
div#autocomplete ul {
margin:0px;
padding:0px;
list-style-type:none;
}
div#autocomplete ul li.selected {
background-color:#ffb;
}
div#autocomplete ul li {
margin:0;
padding:2px;
height:12px;
display:block;
list-style-type:none;
cursor:pointer;
}
new Combobox.Local('textFieldID','outputDivID',array,options);
var cities=new Array('Stockholm','Göteborg','Kiruna');
new Combobox.Local(
'cityField',
'autocomplete',
cities,
{
partialSearch:true,
fullSearch:true,
partialChars:0,
minChars:0
}
);
Thanks Julian, for your excellent guide!
]]>
$ sudo useradd -m domino
$ sudo groupadd domino
$ sudo passwd domino
Domino uses some libraries that is not installed by the standard Ubuntu installation.
$ sudo apt-get install libstdc++5
$ sudo apt-get install libxmu6
$ sudo apt-get install libxp6
$ sudo apt-get install libxp-java
$ sudo apt-get install libxtst6
Unpack the installation file (my is named S7.0.2.tar) and run the linux/domino/install script as root. Use default settings (except user, enter domino), use “Manual setup”.
$ tar -xvf S7.0.2.tar
$ cd S7.0.2/linux/domino
$ sudo install
Since you installed as root, the files is owned by root. I guess if install was run as the domino user, this step would not be required.
$ sudo chown -R domino /local/notesdata
$ sudo chgrp -R domino /local/notesdata
$ sudo chown -R domino /opt/ibm
$ sudo chgrp -R domino /opt/ibm
Stop your local firewall or open 1352 in the local firewall. If you are using shorewall, you can do your own Notes macro. Change the port from 80 to 1352 in the macro.Notes file.
$ sudo cp /usr/share/shorewall/macro.HTTP /usr/share/shorewall/macro.Notes
$ sudo gedit /usr/share/shorewall/macro.Notes
Add the following (depending on setup…) to /etc/shorewall/rules:
Notes/ACCEPT net $FW
Stop any mail, web, ldap services, so that Domino does not conflict on ports. Remember to disable those you don’t need or disable the Domino services that you don’t need.
$ sudo /etc/init.d/postfix stop
$ sudo /etc/init.d/courier-imap stop
$ sudo /etc/init.d/courier-imap-ssl stop
The server script uses /bin/sh, relink sh to bash that normally links to /bin/dash.
$ sudo rm /bin/sh
$ sudo ln -s /bin/bash /bin/sh
I got many “Command not found” errors when starting the server first time. After some research, I found that the script requires gawk in sd.sh:
$ sudo apt-get install gawk
$ su notes
$ DISPLAY=:0.0
$ export DISPLAY
$ cd /local/notesdata
$ /opt/ibm/lotus/bin/server -listen
If you want to add a server with existing IDs, put the certifier ID, the server ID and the admin ID in the notesdata directory on the server. Run the Remote Server Setup utility on a client. Usually in Start\Lotus Applications\Remote Server Setup. Configure as a normal setup.
To be able to start Domino on startup, restart it and shutdown when system restarts, you can download domino init.d-script and put in /etc/init.d. Restart the server to see if it works.
$ cd /etc/init.d
$ sudo wget http://johankanngard.net/wp-content/uploads/2008/07/domino
$ sudo chmod +x domino
$ sudo chown domino domino
$ sudo chgrp domino domino
$ sudo update-rc.d domino defaults
$ sudo shutdown -r now
Use a Notes client and test that the server is up and running. To see if the server is running on the server, you use telnet.
$ ps a | grep server
4505 pts/0 Ss+ 0:00 su - domino -c /opt/ibm/lotus/bin/server
You can also try connecting to the server locally with telnet using:
$ telnet localhost 1352
Trying 127.0.0.1...
Connected to localhost.
Escape character is \\\\\\\\\\\\\\\'^]\\\\\\\\\\\\\\\'.
Updated the startup script since the stop argument wasn’t working.
@echo off
REM Creates a full dump of the repository, should be run weekly
for /f \"tokens=1-4 delims=- \" %%a in (\'date /T\') do set year=%%a
for /f \"tokens=1-4 delims=- \" %%a in (\'date /T\') do set month=%%b
for /f \"tokens=1-4 delims=- \" %%a in (\'date /T\') do set day=%%c
for /f \"tokens=1-2 delims=: \" %%a in (\'time /T\') do set hour=%%a
for /f \"tokens=1-2 delims=: \" %%a in (\'time /T\') do set minute=%%b
set TODAY=%year%%month%%day%
set NOW=%hour%%minute%
for /F \"tokens=1 \" %%i IN (\'svnlook youngest c:\\repository\') do call set YOUNGEST=%%i
echo %YOUNGEST% > c:\\backup\\repository\\latestRev.dat
svnadmin dump c:\\repository > c:\\backup\\repository\\svndump_full_rev%YOUNGEST%.%TODAY%%NOW%
The above example makes a dump to c:\backup\repository of your repository at c:\repository named with the most recent revision and todays date and time.
The example below creates incremental dumps using the latestRev.dat file to store the latest revision that was dumped.
@echo off
REM Creates a partial dump with all revisions since last full dump, should be run daily
for /f \"tokens=1-4 delims=- \" %%a in (\'date /T\') do set year=%%a
for /f \"tokens=1-4 delims=- \" %%a in (\'date /T\') do set month=%%b
for /f \"tokens=1-4 delims=- \" %%a in (\'date /T\') do set day=%%c
for /f \"tokens=1-2 delims=: \" %%a in (\'time /T\') do set hour=%%a
for /f \"tokens=1-2 delims=: \" %%a in (\'time /T\') do set minute=%%b
set TODAY=%year%%month%%day%
set NOW=%hour%%minute%
for /F \"tokens=1 \" %%i in (\'svnlook youngest c:\\repository\') do call set YOUNGEST=%%i
set PREVIOUS=0
if not exist c:\\backup\\repository\\latestRev.dat goto nolatestrev
for /F \"tokens=1 \" %%i in (c:\\backup\\repository\\latestRev.dat) do call set PREVIOUS=%%i
:nolatestrev:
if %YOUNGEST% == %PREVIOUS% goto noupdate
echo %YOUNGEST% > c:\\backup\\repository\\latestRev.dat
svnadmin dump -r %PREVIOUS%:%YOUNGEST% c:\\repository > c:\\backup\\repository\\svndump_incremental_rev%PREVIOUS%to%YOUNGEST%.%TODAY%%NOW%
goto finally
:noupdate
echo No dump needed
:finally
I’m no Windows batch file pro, but I got this working anyway with some help from Google.
if(!Array.indexOf){
Array.prototype.indexOf=function(o){
for(var i=0;i
if(this[i]==o) return i;
return -1;
}
}
var a=new Array(\'aaa\',\'bbb\',\'ccc\');
alert(a.indexOf(\'bbb\')); // Shows 1 as it is the index of \'bbb\' in the a Array.
alert(a.indexOf(\'b\')); // Shows -1 since \'b\' is not a member of the a Array.
]]>
mysql> SHOW PROCEDURE STATUS;
Example output (with cropped dates and times for readable table):
Db | Name | Type | Definer | Modified | Created | Security_type | Comment |
---|---|---|---|---|---|---|---|
mydb | store_user | PROCEDURE | root | 2007-0.. | 2007-0.. | DEFINER | |
mydb | store_cart | PROCEDURE | root | 2007-0.. | 2007-0.. | DEFINER | |
mydb | store_settings | PROCEDURE | root | 2007-0.. | 2007-0.. | DEFINER |
mysql> DELIMITER $$
mysql> CREATE PROCEDURE adduser(IN username VARCHAR(32), IN emailaddress VARCHAR(32))
BEGIN
INSERT INTO users VALUES (username, emailaddress);
END
$$
mysql> SHOW CREATE PROCEDURE `userdb`.`adduser`\\\\G
Example output:
*************************** 1. row ***************************
Procedure: adduser
sql_mode:
Create Procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `adduser`(IN username varchar(32), IN emailaddress(32))
BEGIN
INSERT INTO users VALUES (username, emailaddress);
END
1 row in set (0.00 sec)
Connection con = DriverManager.getConnection(url, user, password);
CallableStatement statement = con.prepareCall(\\\"{call userdb.adduser(?, ?)}\\\");
int i = 0;
statement.setString(i++, \\\"myuser\\\");
statement.setString(i++, \\\"[email protected]\\\");
statement.execute();
For this to work you must give the user SELECT privilege to the proc table in the MySQL database, where the stored procedures are stored. Do it like this:
GRANT SELECT ON `mysql`.`proc` TO \\\'mysqluser\\\'@\\\'myhost\\\';
For a list of more commands, see my MySQL Commands Cheat Sheet.