A simple log file roller, that rolls/rotates a file from FILENAME.0, to FILENAME.1, onwards to FILENAME.9. If FILENAME.9 exists, it is deleted. Can be used to keep log files small and managable, and delete old ones. The code is not pretty, I could not get it work with loops. If anyone has a better way of doing this, please let me know! :-)
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.
The Autocompleter.Local in the Script.aculo.us Prototype-addon is quite nice. It can be used to get type-ahead into a field if you have a local JavaScript Array. I wanted to extend the functionality to have it behave as a Combobox, which is like a Select with a text input field. Here is how I did it, be advised it has some bugs, let me know if you have a better solution!
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);
}
});
The CSS I use is a modified variant of the Autocompleter.Local wiki page:
.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;
}
Usage:
new Combobox.Local('textFieldID','outputDivID',array,options);
Example JavaScript:
var cities=new Array('Stockholm','Göteborg','Kiruna');
new Combobox.Local(
'cityField',
'autocomplete',
cities,
{
partialSearch:true,
fullSearch:true,
partialChars:0,
minChars:0
}
);
Example HTML:
The Windows XP style combobox image referenced in the CSS can be found here:

IBM has removed the old redirect for the Lotus Developer Domain, I only get to Lotus Software using that old URL. Now is time to remember this: http://www.ibm.com/developerworks/lotus
I just followed Julian’s excellent guide and it worked! Even though the guide was for previous versions of both Notes, Ubuntu and Wine, I did not have to make any additional steps to get it working. All programs works, I haven’t found anything that is broken (yet), and it’s great having the Designer “directly” in Ubuntu instead of firing up VirtualBox.
Thanks Julian, for your excellent guide!
Another memory-dump. The manual contains more information (that’s a surprise :-).
This minimalistic guide shows how to install Domino 7.0.2 on Ubuntu 8.0.4 server or workstation. I did this on Ubuntu 7, but did not write everything down, which meant learning/searching for the information once more. Please let me know if you have better ways of doing this!
$ 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.
The first is something you should do weekly on your Subversion repository – a full dump. Put the following in a BAT or CMD file on a Windows box, and run it scheduled.
@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.
I’ve added 8.0 to the list.
Internet Explorer does not have an indexOf method in the Array object. Here is how you can add your own:
if(!Array.indexOf){
Array.prototype.indexOf=function(o){
for(var i=0;i
return -1;
}
}
Use it like this:
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.
I will add more when I stumble upon commands I can’t remember the syntax of.
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 |