Another memory-dump. The manual contains more information (that’s a surprise :-).
For a complete list, see Bash Reference Manual – Bash Environment Variables. This is just my own memory-dump. To get the value of a variable, you can use:
echo $OLDPWD
Just a memory dump for important files and directories.
Also see Filesystem Hierarchy Standard.
There are a lot of these on the net. Why not one more? :-) I will try to keep this updated. Some commands are shell-specific (I use bash), and some are application specific, like the Apache commands.
Also see the good man-page-like command list at Oreillynet.
If you want to stream your own radio station, Shoutcast is an easy solution. This little HOWTO focus only on the server part, and not on the actual audio/feeding client part. I recommend reading ShoutCast Streaming for beginners and Streaming radio with ShoutCast and WinAmp to get the hang of the audio part.
Download the tarball from shoutcast.com.
$ tar -xvf sc_serv_1.9.8_Linux.tar.gz
$ sudo cp sc_serv_1.9.8_Linux/sc_serv /usr/sbin
$ sudo mkdir /etc/shoutcast
$ sudo cp sc_serv.conf /etc/shoutcast
This will make shoutcast start when the server starts. Download the initscript (which I have modified to work in Ubuntu 8.04, source script here).
$ sudo cp shoutcast /etc/init.d/shoutcast
$ sudo update-rc.d /etc/init.d/shoutcast defaults
The default sc_serv.conf says logging should go to the current directory. I changed the lines:
LogFile=sc_serv.log
...
W3CLog=sc_w3c.log
into:
LogFile=/var/log/sc_serv.log
...
W3CLog=/var/log/sc_w3c.log
Also, make sure you set a password on the line saying:
Password=changeme
If you have a locally installed firewall, you have to open up two ports. First the port mentioned in sc_serv.conf on the line saying:
PortBase=8000
The second is the PortBase + 1, i.e. in the default example above it is 8001. The 8001 port is used to receive data from Winamp or other audio streaming feeder and the 8000 port is used to send streaming audio to listening clients. Make sure both ports are open for TCP and UDP. And don’t forget any hardware firewalls, they have to be opened too.
Restart the server or do:
$ sudo /etc/init.d/shoutcast start
and try opening localhost:8000 in your browser and you should see the (in-)famous Shoutcast page.
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.