With a little side of applesauce...

Tuesday, January 30, 2007

php loadable extensions on Debian

I originally implemented PHP on Linux from a tarball, and have moved that original php.ini file, (from around 2002), from machine to machine as I have migrated distributions, etc., etc. Therefore, when I switched to running php4 as a Debian package, I have always had issues with loadable modules, and in particular, mysql.so… None of the examples on the internet seemed to work for us… (So, I would recompile the php deb package to use the builtins, (plus, some other third-party modules). Finally, I read:

/usr/share/doc/php4/README.Debian.gz

and found:

* extension_dir and include_path should be commented out, if you don’t need
special settings for them so php will look in compiled-in paths. If you set
them, you should also add appropriate php install directories there.
Doh!! My old php.ini file had:

extension_dir=./

Thanks to the Debian folks for doing such a good job of documenting your things! (Not being facetious. They do a _great_ job.)

Note to self: Save some time and headache by reading the docs…

FPSE recalculate extensions

Here is the line for recalculating hyperlinks on a subweb in fpse:


/usr/local/frontpage/version4.0/bin/fpsrvadm.exe -o recalc -p www.example.com:80 -w subweb

FPSE recalculate hyperlinks hangs

If FPSE hangs when you recalculate hyperlinks, try this:

1. kill the process.

2. cp -R web web.bak

3. rm -Rf web

4. mv web.bak web

5. recalculate hyperlinks again.

Thanks to Charity for this tidbit. :)

SVN must remember…

svn commit - commits your changes to subversion

svn update - rolls back your changes to last commit…

:P

LoadModule in a virtualhost container…

Wow! I have never seen Loadmodule directives in a virtualhost container...


ServerAdmin sean@odonnell.nu
ServerName svn.odonnell.nu
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so

It isn’t even documented:

Description: Links in the object file or library, and adds to the list of active modules
Syntax: LoadModule module filename
Context: server config

Has anyone else seen this?

Apache rewriting a everything but one sub-folder

I had a request to rewrite a web to a new server, and found out after the fact that we needed to leave one subdirectory in place. Enter the power of mod_rewrite:


RewriteCond %{REQUEST_URI} !^/main/subweb1
RewriteRule ^/main/(.*) http://www.example.com/ [R]


What power!

Apache using x-forwarded-for to replace host in log entries

We have moved our servers behind load-balancers that no longer pass the host through to our log files. This has created two problems:

1. The stats show that all requests come from the load-balancers.

2. Access control no longer works when using domain or ip address. (As Apache uses r->connection->remote_addr, which only shows the last host in the hop to the web server… It appears that r->connection->remote_ip would help us out here, but mod_access.c on apache 1.3 and 2 only uses the remote_addr).

I haven’t figured out how to deal with #2 yet, (w/out using mod_perl), but here is a trick that Pat showed me which does the trick for our web stats:
LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”" combined

Simply replace:

%h

with:

%{X-Forwarded-For}i

“%{X-Forwarded-For}i” is conditional, so if there is no value in the x-forwarded-for header, (ie a health check from the load-balancers), then the logs will contain:

- - - [16/Jun/2006:06:34:24 -0500] “GET / HTTP/1.0″ 302 0 “-” “-”

Otherwise, the log will contain:

999.999.999.999 - - [20/Jun/2006:11:08:06 -0500] “GET / HTTP/1.1″ 200 297 “http://www.example.com/myweb/” “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)”

Thanks, Pat!!

Debian/Apache2 mod_proxy “Forbidden”

The Debian Apache2 mod_proxy is setup to proxy the whole server by default. This being the case, they set a very strict set of rules in the /etc/apache2/mods-enabled/proxy.conf:


ProxyRequests Off


Order deny,allow
Deny from all
#Allow from .your_domain.com

# Enable/disable the handling of HTTP/1.1 “Via:” headers.
# (”Full” adds the server version; “Block” removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block

ProxyVia On

# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)

CacheRoot “/var/cache/apache2/proxy”
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
# Again, you probably should change this.
#NoCache a_domain.com another_domain.edu joes.garage_sale.com


Because we run some many virtual hosts, it doesn’t make sense to have this configuration set globally, so I comment these out, and place the appropriate rules per vhost. Here is my /etc/apache2/mods-enabled/proxy.conf:


# ProxyRequests Off

#
# Order deny,allow
# Deny from all
# #Allow from .your_domain.com
#

# Enable/disable the handling of HTTP/1.1 “Via:” headers.
# (”Full” adds the server version; “Block” removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block

# ProxyVia On

# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)

# CacheRoot “/var/cache/apache2/proxy”
# CacheSize 5
# CacheGcInterval 4
# CacheMaxExpire 24
# CacheLastModifiedFactor 0.1
# CacheDefaultExpire 1
# Again, you probably should change this.
#NoCache a_domain.com another_domain.edu joes.garage_sale.com


REMEMBER!! You must set the correct configuration items in your vhosts which support proxying, or else you are opening yourself as an anonymous proxy. Here is an example of how to I have my config setup:


ProxyRequests Off
#

Deny from all

# proxypass rules
ProxyPass / http://localhost:8080/
ProxyPassReverse http://localhost:8080/ /


I just found this little tidbit when double-checking my facts for this entry:

A reverse proxy is activated using the ProxyPass directive or the [P] flag to the RewriteRule directive. It is not necessary to turn ProxyRequests on in order to configure a reverse proxy.”

– http://httpd.apache.org/docs/1.3/mod/mod_proxy.html

And sure enough, the proxypass still works. I don’t know if I still need the LocationMatch with ProxyRequests Off, but it seems to be a safe move, so I will leave it there until I test further.

Win32 DOS Mirror application

I just found one of the coolest applications that I have seen for the Windows command line:

Mirror 1.42

a freeware application by Dominik Jain. Here is a sample usage of the application to move the contents of a network mounted \\remotehost\Inetpub\wwwroot mounted on (z:) to e:\test:
C:\Documents and Settings\speeves\My Documents>Mirror.exe z:\ e:\test

Mirror v1.42 (C) 2001-2006 by Dominik Jain

adding e:\test\aspnet_client\system_web\1_1_4322\SmartNav.htm
adding e:\test\aspnet_client\system_web\1_1_4322\SmartNav.js
adding e:\test\aspnet_client\system_web\1_1_4322\WebUIValidation.js
adding e:\test\index.htm
adding e:\test\na.htm
adding e:\test\new_page_1.htm
adding e:\test\pagerror.gif
adding e:\test\postinfo.html
adding e:\test\_vti_cnf\index.htm
adding e:\test\_vti_cnf\na.htm
adding e:\test\_vti_cnf\new_page_1.htm
adding e:\test\_vti_cnf\pagerror.gif
adding e:\test\_vti_inf.html
adding e:\test\_vti_pvt\access.cnf
adding e:\test\_vti_pvt\botinfs.cnf
adding e:\test\_vti_pvt\bots.cnf
adding e:\test\_vti_pvt\deptodoc.btr
adding e:\test\_vti_pvt\doctodep.btr
adding e:\test\_vti_pvt\frontpg.lck
adding e:\test\_vti_pvt\linkinfo.btr
adding e:\test\_vti_pvt\service.cnf
adding e:\test\_vti_pvt\service.lck
adding e:\test\_vti_pvt\services.cnf
adding e:\test\_vti_pvt\structure.cnf
adding e:\test\_vti_pvt\svcacl.cnf
adding e:\test\_vti_pvt\uniqperm.cnf
adding e:\test\_vti_pvt\writeto.cnf

27 files added, 0 updated
0 files/directories deleted
I then created a test.htm file on \\remotehost and ran Mirror again:

C:\Documents and Settings\speeves\My Documents>Mirror.exe z:\ e:\test

Mirror v1.42 (C) 2001-2006 by Dominik Jain

adding e:\test\test.htm

1 files added, 0 updated
0 files/directories deleted

I then deleted test.htm from \\remotehost

C:\Documents and Settings\speeves\My Documents>Mirror.exe z:\ e:\test

Mirror v1.42 (C) 2001-2006 by Dominik Jain

deleting e:\test\test.htm

0 files added, 0 updated
1 files/directories deleted

This _cool_ application really mirrors the location!! Bye-bye XCOPY!! :)

Win32 Admin Utilities

Since I am on a win32 kick this morning, I need to mention the great utilities (free) that the folks at Sysinternals. These are a must have for any win32 administrator.

My favourite…?

Process Explorer - a graphical process viewer with the ability to kill tasks that seem to elude the Task Manager. (ie Those viral anti-virus applications)

SATA and OS Device names…

I have to remember:

Windows maps the harddrives:

sata-0 -> C: (ie)
sata-1 -> E: (ie)

Debian maps the harddrives:

sata-0 -> /dev/hdg

sata-1 -> /dev/hde

It may just be on this one box, but this will be here to remind me when I have to swap harddrives again… :P

CRONTAB running a job every X …

I always forget the syntax for running a job every X minutes/days/months… etc… I usually have to google it, but I just found that it is actually contained in crontab(5), (on Debian):

Step values can be used in conjunction with ranges. Following a range
with ‘‘/’’ specifies skips of the number’s value through the
range. For example, ‘‘0-23/2’’ can be used in the hours field to spec‐
ify command execution every other hour (the alternative in the V7 stan‐
dard is ‘‘0,2,4,6,8,10,12,14,16,18,20,22’’). Steps are also permitted
after an asterisk, so if you want to say ‘‘every two hours’’, just use
‘‘*/2’’.
– crontab(5)

DREAMWEAVER’s understanding of a testing server

One of our users asked me how to copy files between the “testing server” and “remote view”, and as we poked around a bit, this is what we came up with:

1. Dreamweaver is assuming that the “local view” is the master, and that all synching should be done between the “local view”, and either the “testing server” or “remote view”, (it doesn’t appear to be possible to synch between “testing server” and “remote view”).
Now for the confusing part… How do you specify to which server you want to upload files?

Dreamweaver remembers the last view that you changed from, and will upload the files to that location. For example, if you just changed from “remote view” to “local view”, the files will be uploaded to the “remote view”. If you just changed from “testing server” to “local view”, your files will be uploaded to the “testing server”. Unfortunately, Dreamweaver doesn’t give any indication of the destination in the default view. At this point, (I am a novice Dreamweaver user), it appears that the only way that you can be sure of the destination location for uploaded files is to click on the little blue and white square icon, (the mouseover pops up the message, “expand to show local and remote sites”), on the right-hand “files” menu, (under the “local view”, “remote view” drop-down menu), which expands to a split-screen representation of destination, (on the left), and “local view”, (on the right).

Hmmm…

VMWARE with Debian Sid and linux-headers-2.6.16-2-686

I have just upgraded my Debian Sarge guest OS to Debian Sid, and had a problem with vmware-config-tool.pl finding the kernel headers at:

/usr/src/linux-headers-2.6.16-2-686/include

It appears to be a problem with the regular expression that vmware-config-tool uses to check for the installed headers (on newer kernels):

http://www.redhat.com/archives/fedora-test-list/2006-February/msg00380.html

Here is the patch that was found at that link:



--- vmware-config.pl.old        2005-12-15 21:55:24.000000000 -0800
+++ vmware-config.pl 2006-02-04 16:53:06.000000000 -0800
@@ -1969,8 +1969,8 @@
. ' -E - | ' . shell_string($gHelper{'grep'}) . ' '
. shell_string($pattern));
chomp($header_page_offset);
- $header_page_offset =~ s/^$pattern \(?0x([0-9a-fA-F]{8,}).*$/$1/;
- if ($header_page_offset =~ /[0-9a-fA-F]{8,}/) {
+ if ($header_page_offset =~ /^$pattern \(?0x([0-9a-fA-F]{8,})/) {
+ $header_page_offset = $1;
# We found a valid page offset
if (defined($gSystem{'page_offset'}) and
not (lc($header_page_offset) eq lc($gSystem{'page_offset'}))) {


Here is a link to more information about the problem:

http://www.vmware.com/community/thread.jspa?threadID=31877&tstart=0

VMWARE/DEBIAN Sarge slow backspace deletion when depressed

Though the title is humourous, the problem was not… (At the time ;) ).

I am running Debian Sarge as a guest on VMWare 5.5 (Ubuntu Dapper host). I was very happy with the installation, (which was going to be my Debian bug reporting/patch platform), except that it appears that you had to depress the backspace key multiple times to delete multiple characters. (The same was seen with the arrow keys). I found many recommendations to change the value for “repeat keys”, but it wasn’t until today that I actually found where that configuration setting was:

Applications->Desktop Preferences->Accessibility->Keyboard

This opens the “Keyboard Accessibility Preferences” dialogue box. You then click the checkbox to “Enable keyboard accessibility features”, and click the checkbox “Enable Repeat Keys”, then modify the Delay and Speed to taste…

Ouch!! Hope this is fixed in Etch…

mod_perl replacing r->connection->remote_ip with with “original client ip”

We have just moved our machines behind load-balancers which only send the “original client ip” in the x-forwarded-for header. This has caused us a lot of problems with our ip-based access control, (ie Allow from 192.168). We already use mod_perl for authentication on our machines, so went the next step and used mod_perl to replace the load-balancer’s address in:

r->connection->remote_ip

with the “original client ip”. Here is the code verbatim Stas Bekman’s Practical mod_perl:

package Book::ProxyRemoteAddr;

use Apache::Constants qw(OK);
use strict;

sub handler {
my $r = shift;

# we'll only look at the X-Forwarded-For header if the request
# comes from our proxy at localhost
return OK unless ($r->connection->remote_ip eq "127.0.0.1") &&
$r->header_in('X-Forwarded-For');

# Select last value in the chain -- original client's IP
if (my ($ip) = $r->headers_in->{'X-Forwarded-For'} =~ /([^,s]+)$/) {
$r->connection->remote_ip($ip);
}

return OK;
}
1;


We found it easiest to download the

sourcecode.tgz

from the book, and then move the ~/source/ch12-perf_strategy/Book directory into:

/usr/local/share/perl/5.8.4/Book

on the web server machine. The existing ProxyRemoteAddr.pm just contains a template, so you will need to replace the contents of the file with this:

handler code

And, replace 127.0.0.1 with the ip address of your load-balancer(s), (use the logical || for multiple load-balancers):

# we'll only look at the X-Forwarded-For header if the request
# comes from our proxy at localhost
return OK unless ($r->connection->remote_ip eq "127.0.0.1") &&
$r->header_in('X-Forwarded-For');

Then, you simply add this to your httpd.conf file:

PerlPostReadRequestHandler Book::ProxyRemoteAddr
Restart apache, and begin to tail your logs to make sure that you see outside ip addresses being logged.

DON’T FORGET! If you have modified your LogFormat directive to replace “%h” (client ip address) with “%{X-Forwarded-For}i”, (contents of x-forwarded-for header), change them back, or your log files will not accurately reflect the changes created by ProxyRemoteAddr.pm.

Debian Apache2 libapache2-mod-rpaf

On a similar note to my last posting, I have found mod-rpaf, reverse proxy add forward module for Apache (mod_rpaf), written by Thomas Eibner. This module works with both apache 1.3 and apache2, but is most interesting to me as an Apache2 module. Since we are running a Debian apache2 package, you can imagine my great pleasure in finding libapache2-mod-rpaf packaged as a Debian package. I simply installed the package:

apt-get install libapache2-mod-rpaf

modified /etc/apache2/mods-enabled/rpaf.conf to reflect the ip addresses of our proxy servers:

RPAFenable On
RPAFsethostname On
RPAFproxy_ips 192.168.1.2 192.168.1.3 192.168.1.4

And, voila! Apache2 could now use the “original client ip” for access control again…

DON’T FORGET! If you have modified your LogFormat directive to replace “%h” (client ip address) with “%{X-Forwarded-For}i”, (contents of x-forwarded-for header), change them back, or your log files will not accurately reflect the changes created by mod-rpaf.

Debian package for Python Imaging Library

I had to google to find the Debian package for the Python Imaging Library… ;( It is:

apt-get install python2.3-imaging

Apache, Frontpage 2003, and webDAV (301 Moved Permanently)

Frontpage 2003 has a problem when trying to copy a COLLECTION (folder) from an Apache web server using webDAV. Here is a sample packet capture on the web server machine:


34.644550 192.168.1.2 -> 192.168.1.101 HTTP PROPFIND /aboutdbc HTTP/1.1
34.644677 192.168.1.101 -> 192.168.1.2 TCP webcache > 1753 [ACK] Seq=70073 Ack=5546 Win=16779 Len=0
34.647210 192.168.1.101 -> 192.168.1.2 HTTP HTTP/1.1 301 Moved Permanently (text/html)
34.795153 192.168.1.2 -> 192.168.1.101 TCP 1753 > webcache [ACK] Seq=5546 Ack=70648 Win=17065 Len=0
36.026395 192.168.1.2 -> 192.168.1.101 HTTP PROPFIND /aboutdbc HTTP/1.1
36.028916 192.168.1.101 -> 192.168.1.2 HTTP HTTP/1.1 301 Moved Permanently (text/html)
36.196829 192.168.1.2 -> 192.168.1.101 TCP 1753 > webcache [ACK] Seq=6192 Ack=71223 Win=16490 Len=0


Apparently, Frontpage should be including a forward slash at the end of the COLLECTION name:

PROPFIND /aboutdbc HTTP/1.1


Should be:

PROPFIND /aboutdbc/ HTTP/1.1


This missing forward slash causes Apache to return a 301 Moved Permanently. The fix is to add:


BrowserMatch “FrontPage” redirect-carefully


To you httpd.conf and restart Apache.

Thanks to Steve’s Rants and Raves! for this fix:
http://spaces.msn.com/steve95131/blog/cns!B3A49FDA1BAB8D43!154.entry?_c11_blogpart_blogpart=blogview&_c=blogpart#permalink

Using Fabien Coelho’s Mod_Macro to help scale web farms.

Introduction:

We are currently setting up a load-balanced server farm and have greatly simplified configuration by using Fabien Coelho’s mod-macro. Fortunately, the module has recently been ported to work with Apache2, and Debian has a deb package to simplify setup.

$ apt-get install apache2 apache2-utils libapache2-mod-macro

One of the great things about using the apache2 Debian package to install Apache, is that it makes heavy use of include files to allow for finer control over enabling sites and modules.
Here is an example of using an Include directive to “pull in” an external file, (ports.conf), into the apache2.conf, (the main conf file that replaces the standard httpd.conf in the apache2 Debian package).

me@mylap:~$ less /etc/apache2/ports.conf


# Include ports listing
Include /etc/apache2/ports.conf


This single line will pull in the contents of the following file:

me@mylap:~$ cat /etc/apache2/ports.conf
Listen 80

It is that simple. You can see the ease with which one can Include many different files to create a very complex apache2.conf file. (It is possible to use regular expressions to load any number of files into the configuration file as well).

The Problem:

When running a server farm, it becomes apparent that you do not want to handle configuration of the Apache server on each individual machine. Therefore, we searched for a way to use a single set of configuration files for any number of machines. After searching for some time, we settled on mod-macro, a great module written by Fabien Coelho, which “allows the definition and use of macros within apache runtime configuration files.” We found that this module would allow us to set the ip address of the Apache web server based on a variable that was passed to it from the startup script. Here is how we did it:

1. We need to define the macro using the tags. This is the section that you want to perform the variable expansion upon. Here is an example:

webadmin:/export/web# cat /etc/apache2/apache2.conf


### start of the Macro

Listen $ip:80

### end of the Macro



2. Next, we need to include the variable definition based upon the parameter that is passed by the host’s /usr/sbin/apache2ctl file. Find the start stanza in /usr/sbin/apache2ctl and add the following parameter:

startssl|sslstart|start-SSL)
$HTTPD -k start -DSSL -D`hostname`
ERROR=$?
;;

This will pass the hostname of the web server machine as a parameter to Apache. We have chosen the hostname as a simple unique identifier for defining the ip address used in our Apache config. The command above will look like this after the hostname is expanded:

/usr/sbin/apache2 -k start -DSSL -Dmylap

3. Create a file in a central location with the ip address of our web server host. We created this location on an NFS mount located at /export/web/hosts/mylap/ip.txt.

webadmin:/home/speeves# cat /export/web/hosts/mylap/ip.txt
##
## Set the IP Address of the Host
##

Use WebFarmConf “192.168.2.29″

The Use directive tells mod-macro to execute the WebFarmConf Macro, (defined above), with the parameter “192.168.2.29″, (the ip address of the web server machine).

4. We add the following IfDefine section to the end of /etc/apache2/apache2.conf:


Include /export/web/hosts/mylap/ip.txt

The IfDefine section takes the hostname parameter that is passed to the Apache binary, and Includes the appropriate ip.txt file for the web server host. Voila! We can now scale our server farm very quickly, thanks to Fabien Coelho and Mod_Macro.

Important Note on Included files and Mod_Macro:

After finding a note in the source code of mod-macro and then discussing this with Fabien Coelho, we have discovered that you _cannot_ use Include directives within a section. This means that all configuration Directives must be in the section, and can’t be included from another file. We was planning on using this web farm for virtual hosting, and, hence, lost one of the truly interesting aspects of the Debian Apache2 package… including virtual host configuration files.

Here is a simple example using the Listen directive mentioned above:

The Apache2 Debian package has the default configuration:

me@mylap:~$ less /etc/apache2/ports.conf


# Include ports listing
Include /etc/apache2/ports.conf

me@mylap:~$ cat /etc/apache2/ports.conf
Listen 80

I would like to set the section like this:

me@mylap:~$ less /etc/apache2/ports.conf


# Include ports listing
Include /etc/apache2/ports.conf


With the included ports.conf looking like:

me@mylap:~$ cat /etc/apache2/ports.conf
Listen $ip:80

Unfortunately, mod-macro doesn’t know how to deal with these Included files yet. Therefore, we need to alter the default apache2.conf by removing the Include directive like this:

### start of the Macro

Listen $ip:80

### end of the Macro

This means that all virtual host sections will need to be included in a single monolithic apache2.conf, which makes it more difficult to administer large number of virtual hosts.

Conclusion:

Is there a better solution…? We do not have a large number of virtual hosts right now, so the simplicity of mod-macro makes it the best solution for us right now. In the future, as we grow, it might be a good idea to either spend some time modifying mod-macro to work with Include directives, or simply find an alternative, such as using mod_perl to generate large numbers of virtual hosts. We’ll keep you posted as we find out more.

References:
Apache 2.0 module mod_macro

Fixing Quicktime to allow you to save MP3s

Many people have installed Quicktime/iTunes to listen to various types of media files. Among these files are MP3s. Many people have found that they can no longer save MP3 files after installing Quicktime/iTunes on Windows XP. This document outlines a work-around to allow you to save the MP3 files once again.

Fix:

1. Click on Start->Set Program Access and Default
2. Highlight the Custom option and click on the double-arrow to expand the Custom menu.
3. Find the Choose a default media player menu.
4. Click the radio button next to Windows Media Player.
5. Next, restart your internet browser and attempt to download the MP3 file again.

Once the MP3 is playing in Windows Media Player:

1. Click File->Save Media As…
2. Save the MP3 file to your preferred location.

ldapsearch, TLS, and a self-signed certificate

I am using the ldap-utils package on Ubuntu to access our ldap server over TLS, but was having issues with the self-signed certificate causing ldapsearch to return:

mylap~$ ldapsearch -x -h ldap.example.com -p 389 -ZZ -W -D “cn=binduser,dc=example,dc=com” -v -n sn=smith -d -1



TLS trace: SSL3 alert write:fatal:unknown CA
TLS trace: SSL_connect:error in SSLv3 read server certificate B
TLS trace: SSL_connect:error in SSLv3 read server certificate B
TLS: can’t connect.
ldap_perror
ldap_start_tls: Connect error (-11)
additional info: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

After googling a bit, I found that I needed to insert the following line into the /etc/ldap/ldap.conf:

LS_CACERT /location/to/my-ca.crt

References:

Serenge - Setup a secure TLS-LDAP server on Debian Sarge
http://72.14.209.104/search?q=cache:Vl7cnIM_57IJ:www.serenge.nl/index.php%3Foption%3Dcom_content%26task%3Dview%26id%3D33%26Itemid%3D32+debian+ldapsearch+ssl&hl=en&gl=us&ct=clnk&cd=6&client=firefox

Windows XP - Mount ISO image as virtual drive

This cool tool allows you to mount ISO images without having to burn them CD:

Microsoft Virtual CD-ROM Control Panel
Instructions on how to use it are found here:

http://support.microsoft.com/?kbid=916902


It doesn’t work on Windows 2003, but I was able to use it on Windows XP, and then share the local disks over to the Windows 2003 server. Very nice!!

Windows 2003 64-bit: 32-bit emulation?

I have just started to admin a 64-bit windows 2003 server, and found the following processes in the Windows Task Manager:

IEXPLORE.EXE*32

msiexec.exe*32

Apparently, Windows launches 32-bit versions of its applications when it thinks it needs them, which is further supported by this thread:

http://groups.google.com/group/microsoft.public.windows.64bit.general/browse_thread/thread/929109d74c8151e0/55d5473c769880f0%2355d5473c769880f0

The most interesting thing about this for me, is that we, (64-bit Linux users), have been fighting with the need to use 32-bit versions of our browsers, because of a lack of 64-bit versions of Flash and the w32codecs… Apparently, Windows suffers from the same issues…

CFMX 7 cfform validation not working (w/ multiple virtual hosts)

When using the tag, and form validation using , etc., the validation is not working. If you create the as follows:


<body>
<cfform action="valid.cfm" method="post" >
<cfinput name="name" type="text" required="yes" message="please enter name" />name

<cfinput name="submit" type="submit" value="submit" />
</cfform>
</body>
</html>


And, then view the rendered HTML:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" xsrc="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" xsrc="/CFIDE/scripts/masks.js"></script>
<script type="text/javascript">
<!--
function _CF_checkCFForm_1(_CF_this)
{
//reset on submit
_CF_error_exists = false;
_CF_error_messages = new Array();
_CF_error_fields = new Object();
_CF_FirstErrorField = null;



you will see that the tag uses “/CFIDE/scripts/cfform.js” as the location from which to include the javascript needed to validate the forms.
In a virtual host, or multi-homed, environment, this path is not correct, therefore, form validation is bypassed.

WORKAROUND: Thankfully, the tag has a “scriptSrc” attribute that can be used to set the correct location of the javascript files:



<body>
<cfform action="valid.cfm" method="post" scriptSrc="http://www.location.cfide.com/cfide/scripts/cfform.js" >
<cfinput name="name" type="text" required="yes" message="please enter name" />name

<cfinput name="submit" type="submit" value="submit" />
</cfform>
</body>
</html>


This sets the correct location for the javascript files, and validation works:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" xsrc="http://www.location.cfide.com/cfide/scripts/cfform.js"></script>
<script type="text/javascript" xsrc="/cfide/scripts/masks.js"></script>
<script type="text/javascript">
<!--
function _CF_checkCFForm_1(_CF_this)
{
//reset on submit
_CF_error_exists = false;
_CF_error_messages = new Array();


Check this link out for more information:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18653

Ubuntu Dapper - files list file for package `libss2′ is missing final newline

I got the following error when I did my apt-get upgrade today:
The following packages will be upgraded:
xserver-xorg-core
1 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
Need to get 0B/3529kB of archives.
After unpacking 0B of additional disk space will be used.
(Reading database … dpkg: error processing /var/cache/apt/archives/xserver-xo rg-core_1%3a1.0.2-0ubuntu10.1_i386.deb (–unpack):
files list file for package `libss2′ is missing final newline
Errors were encountered while processing:
/var/cache/apt/archives/xserver-xorg-core_1%3a1.0.2-0ubuntu10.1_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

According to this posting:

http://www.linuxquestions.org/questions/showthread.php?t=271118

the problem was related to the libss2.list file in:

/var/lib/dpkg/info/

The contents of the file were:

speeves@mylap:/var/lib/dpkg/info$ cat libss2.list
/.
/lib
/lib/libss.so.2.0
/usr
/usr/share
I then opened the file in vi and put an empty line after /usr/share, and ran apt-get upgrade again, which errored out with the following error:

The following packages will be upgraded:
xserver-xorg-core
1 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
Need to get 0B/3529kB of archives.
After unpacking 0B of additional disk space will be used.
(Reading database … dpkg: error processing /var/cache/apt/archives/xserver-xo rg-core_1%3a1.0.2-0ubuntu10.1_i386.deb (–unpack):
files list file for package `libss2′ contains empty filename
Errors were encountered while processing:
/var/cache/apt/archives/xserver-xorg-core_1%3a1.0.2-0ubuntu10.1_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Finally, I opened the libss2.list file one more time, and deleted the empty line that I had put into the file previously, and ran apt-get upgrade once again… Success!!! xserver-xorg-core was able to install.

phpwiki - issues with %%%

I just tried adding some code which uses a “%%%” prefix for one of the lines and phpWiki kept removing the lines with this prefix, (even while using pre tags). Apparently, they have two ways of enclosing code, pre tags, and:

<verbatim></verbatim>

If you are enclosing code with a prefix of %%%, then you need to use the verbatim tags.

Zope/Plone Tips and Tricks

(Plone) Files that start with a dot (ie .config, .htaccess)

These files are ignored by directory listings in Plone, but they can be downloaded, if the end-user knows the exact address of the file.

Turn off webDAV access for authenticated

A Zope default installation has webDAV access allowed for all authenticated users, irrespective of their security level. To turn this off, move to the root folder and click on Security. Scroll to the bottom of the page, and uncheck “WebDAV Access” under the “Authenticated” role.

(Plone) Title requirement work-around

If you don’t want to place a “Title” in an object that requires one, (ie documents in Plone), you can place a space in the “Title” form field, and Plone will no longer complain about the missing “Title”.

Tail for Windows

Another must have for windows administrators:

Tail for Windows

“Tail for Win32 is used to monitor changes to files; displaying the changed lines in realtime. This makes Tail ideal for watching log files.”

Windows x64 IIS 6 running 32-bit App Pools

Internet Information Services in Windows x64 is 64-bit. This means, if you want to run 32-bit ISAPI DLLs with IIS6 on Windows x64, you’ll need to apply a small tweak. Open up a Command Prompt window, and type this command to enable 32-bit Application Pools:

cscript %SystemDrive?%\inetpub\AdminScripts?\adsutil.vbs set w3svc/AppPools?/Enable32bitAppOnWin64 1

Down the road, if you’ve made the required steps to update your stuff to 64-bit, type the following to re-enable 64-bit Application Pools:

cscript %SystemDrive?%\inetpub\AdminScripts?\adsutil.vbs set w3svc/AppPools?/Enable32bitAppOnWin64 0

http://blog.danbartels.com/archive/2005/05/18/661.aspx

PHP email forms

Here is an excerpt from an email showing how to create PHP email forms:



<pre class="tightenable top bottom">The examples that would be most interesting to you, would be the html form:

<form action="mail.php" method="post">
Your Name: <input type="text" name="name">

E-mail: <input type="text" name = "email">


Comments

<textarea name="comments"></textarea>


<input type="submit" value="Submit">
</form>


And, the php script "mail.php" in the same directory:


// This function helps to keep spammers from using your forms
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}

// set the posted variables to local variables
// This makes it easier for accessing the form data later in the script.
// NOTE: Change the value of foo in $_POST['foo'] to the name of your form
// on the previous page. Also, you can add as many of these initializations
// as are forms on the previous page.
$name=$_POST['name'];
checkOK($name);

$email=$_POST['email'];
checkOK($email);

$comments=$_POST['comments'];
checkOK($comments);

// We are setting the recipients email address here
$to="myemail@myweb.com";

// We are creating the message content here. Notice that the variables that we set above are used
// throughout the message to insert the form information.
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";

// Now, we try to send the mail. If it is successful, we return a "Thanks for your comments",
// If it is not successful, we return "There was a problem sending the mail...."
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>

The code is from:

http://www.freewebmasterhelp.com/tutorials/php/6

and I just added comments.

Novell Groupwise 7 client on Ubuntu Dapper

Thanks these instructions:

I got GroupWise 7 working by doing the following:
  • Use alien to convert the RPM to a DEB file (alien groupwise-blah-blah-blah.rpm)
  • Install JAVA (download it from http://java.sun.com)
  • Install GroupWise (dpkg -i groupwise-blah-blah-blah.deb)
  • Delete the /opt/novell/groupwise/client/jre directory
  • Copy the jre directory from the Java installation you just performed to /opt/novell/groupwise/client/
  • Run groupwise by typing /opt/novell/groupwise/client/bin/groupwise.sh
Don’t use /opt/novell/groupwise/client/bin/groupwise. That won’t work. You have to use the groupwise.sh file.

Hope this helps.

by daimaou at the following thread:

http://ubuntuforums.org/showthread.php?p=1002121

NOTES: I modified the instructions in the following way:

1. I symlinked my sun java directory into the /opt/novell dir:


s@mycomp:/opt/novell/groupwise/client$ sudo mv jre/ old_jre
s@mycomp:/opt/novell/groupwise/client$ sudo ln -s /usr/lib/j2sdk1 .4-sun/jre/ jre

I now have Groupwise 7 running on Ubuntu Dapper.

Microsoft Virtual PC 2004 Service Pack 1… FREE!!

Crazy!!! I just found out the Microsoft is giving away Virtual PC 2004 here:

http://www.microsoft.com/windows/virtualpc/downloads/sp1.mspx

And, is planning on giving away Virtual PC 2007 next year… I think we are seeing a new Microsoft…

Virtual PC 2004 Release Mouse from virtual machine console

I have installed Ubuntu Dapper on Virtual PC 2004, and am pretty happy. It is much faster than running a Windows XP guest on VMWare with Ubuntu Dapper as a host :P (Comparing apples to oranges, I imagine). One thing that I don’t like about Virtual PC is that you have to hit the right “alt” key to release the mouse from the virtual machine console… Yikes! I am right-handed, so I am holding the mouse with my right hand and have to reach over with my left hand to hit the right “alt” key. I am hoping there is a way to create an alternative key combination, ala ctrl-alt in VMWare…

Install stubborn Firefox extensions

I wanted to install LiveHTTPHeaders into firefox this morning, and was only able to download the file. My extensions manager didn’t show “install” as an option, (as I am used to in thunderbird). I found that if I double-clicked on the extension, (livehttpheaders-0.12.xpi), windows asked with which service I would like to open the xpi file. When I chose firefox, it ran the extensions install dialog as usual, and I was able to install the extension.

Virtual Machine Additions for Linux

Just a heads-up: virtualpc doesn’t ship with virtual machine additions for linux, so you need to join their beta testing program at:

https://connect.microsoft.com/

(which gives you access to a lot of cool beta software that they are working on :) (Including the new “Powershell”)).

Once you are “connected”, you can then participate in any of the programs that are listed at Available Connections. For this blog entry, we are interested in participating in the Microsoft Virtual Machine Additions for Linux program… I will let you know if I can install them on Ubuntu, which is unsupported :)

Here is more information about supported GNU/Linux distributions:
Third-party guest operating systems that are supported for use with Virtual Server 2005 R2

Cannot load /opt/apache/libexec/libdav.so into server: /opt/apache/libexec/libdav.so: undefined symbol: XML_SetElementHandler

This always gets me… :P For some reason, mod_dav doesn’t find expat on Debian. The fix is:

./configure –with-apxs=/opt/apache/bin/apxs –with-expat=/usr

make

make install

Virtual PC 2004 - mobile networking

I am running virtualpc on my laptop, and switch between my ethernet and wireless network cards for networking. virtualpc complains that the previously connected network interface is not available, but actually deals with the issue transparently, EXCEPT that you need to run:

sudo /etc/init.d/networking restart

to grab a new ip address and get connected.

Kill that pesky apache2 process

Here is the quick kill command, when the /etc/init.d/apache2 script doesn’t kill apache2 processes:

for process in $(ps -ef | grep apache2 | awk '{print $2}'); do kill $process ; done

Bash script to kill processes, kills itself

Here is an interesting problem:


#!/bin/sh

# create the usage message to help new users
usage="
Usage: ${0} [OPTION] [process]

Options:
-h This message
"

while getopts ":ft" OPT
do
case $OPT in
h )
echo "$usage"
exit 1
;;
\?)
echo "$usage"
exit 1;;
esac
done
# remove the flags from $@
shift $((${OPTIND} - 1))

# test to see if there is a list of process names given to killprocess
[ $# -lt 1 ] && echo "$usage" && exit 1

# set PROCNAME to the array of process names that were passed to the killprocess script
PROCNAME="$@"
echo $PROCNAME

# for every process name in PROCNAME, grab all of the processes, and
# kill them... One at a time... ;)
for name in $PROCNAME
do
echo $name
# here, we grep on the process name passed to the script, which
# secretly passes the pid of the script because of the arguments
# that we passed to the script. This kills the script before it
# can move on to the second argument :))
for process in $(ps -ef | grep $name | awk '{print $2}')
do
echo $process
kill $process
done
done

The script above works great for killing processes for a single argument which is passed to the killprocess script. BUT, you get a “terminated” message every time the script has been run, AND, the script is killed before it can process a second argument :P
Here is a version of the script that removes the PID of the killprocess shell script, so that we can kill processes for more than one argument:

#!/bin/sh

# create the usage message to help new users
usage="
Usage: ${0} [OPTION] [process]

Options:
-h This message
"

while getopts ":ft" OPT
do
case $OPT in
h )
echo "$usage"
exit 1
;;
\?)
echo "$usage"
exit 1;;
esac
done
# remove the flags from $@
shift $((${OPTIND} - 1))

# test to see if there is a list of process names given to killprocess
[ $# -lt 1 ] && echo "$usage" && exit 1

# set PROCNAME to the array of process names that were passed to the killprocess script
PROCNAME="$@"
echo $PROCNAME

# for every process name in PROCNAME, grab all of the processes, and
# kill them... One at a time... ;)
for name in $PROCNAME
do
echo $name
# here, we grep on the process name passed to the script, which
# secretly passes the pid of the script because of the arguments
# that we passed to the script. This kills the script before it
# can move on to the second argument :))
#
# for process in $(ps -ef | grep $name | awk '{print $2}')
for process in $(ps -ef | grep $name | grep -v $$ | awk '{print $2}')
do
echo $process
kill $process
done
done

Debian Sarge - Can’t stop those apache2 processes?

If you are having problems killing apache2 processes with the /etc/init.d/apache2 script, run it with the -x switch:

/bin/bash -x /etc/init.d/apache2 stop

My output looked like this:


mymachine:/etc/apache2# /bin/bash -x /etc/init.d/apache2 stop
+ ENV=env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin
+ NO_START=0
+ set -e
+ '[' -x /usr/sbin/apache2 ']'
+ HAVE_APACHE2=1
+ test -f /etc/default/rcS
+ . /etc/default/rcS
++ TMPTIME=0
++ SULOGIN=no
++ DELAYLOGIN=yes
++ UTC=no
++ VERBOSE=yes
++ EDITMOTD=yes
++ FSCKFIX=no
+ test -f /etc/default/apache2
+ . /etc/default/apache2
++ NO_START=0
+ '[' 0 '!=' 0 -a stop '!=' stop ']'
+ APACHE2=env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin /usr/sbin/apache2
+ APACHE2CTL=env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin /usr/sbin/apache2ctl
+ echo -n 'Stopping web server: Apache2'
Stopping web server: Apache2+ apache_stop
+ PID=
+ PIDFILE=
++ grep '^PidFile' /etc/apache2/access /etc/apache2/apache2.conf /etc/apache2/apache2.conf~ /etc/apache2/conf.d /etc/apache2/envvars /etc/apache2/httpd.conf /etc/apache2/magic /etc/apache2/mods-available /etc/apache2/mods-enabled /etc/apache2/old /etc/apache2/ports.conf /etc/apache2/README /etc/apache2/sites-available /etc/apache2/sites-enabled /etc/apache2/ssl /etc/apache2/ssl.crt /etc/apache2/ssl.key -r
++ awk '{print $2}'
+ PIDFILE=/var/run/apache2.pid
+ '[' -e /var/run/apache2.pid ']'
++ cat /var/run/apache2.pid
+ PID=21370
+ PIDFILE=/var/run/apache2.pid
+ '[' -e /var/run/apache2.pid ']'
++ cat /var/run/apache2.pid
+ PID=21370
+ PIDFILE=/opt/apache/logs/httpd.pid
+ '[' -e /opt/apache/logs/httpd.pid ']'
+ PIDFILE=/opt/apache/logs/httpd.pid
+ '[' -e /opt/apache/logs/httpd.pid ']'
++ apache2 -t
+ '[' -e /opt/apache/logs/httpd.pid ']'
+ echo -n ' ... no pidfile found! not running?'
... no pidfile found! not running?+ echo .

Do you notice that it searches for the PID in both:

/var/run/apache2.pid

and:

/opt/apache/logs/httpd.pid

The reason this is happening is that /etc/init.d/apache2 searches recursively through the /etc/apache2/ directory for the PidFile directive, and I had created a backup of the conf file in a subdirectory of /etc/apache2. Here is the offending code:

# apache2 allows more than PidFile entry in the config but only
# the last found in the config is used
for PFILE in `grep ^PidFile /etc/apache2/* -r | awk '{print $2}'`; do
PIDFILE="$PFILE"
if [ -e "$PIDFILE" ]; then
PID=`cat $PIDFILE`

Here is the Debian Bug Report <#303076>

AND, it is fixed in apache2-common 2.0.55-4, which is available in etch:

dpkg-source: extracting apache2 in apache2-2.0.55
dpkg-source: unpacking apache2_2.0.55.orig.tar.gz
dpkg-source: applying ./apache2_2.0.55-4.diff.gz

(It is fixed in sid as well).

Virtual PC 2004 - Installing Virtual Machine Additions for Linux on Ubuntu Dapper guest

Here is a rough guide for installing the Virtual Machine Additions for Linux on a Ubuntu Dapper guest.

1. Download the VMAdditions for Linux as instructed here

2. Run the MSI, which will place the iso image in:

C:\Program Files\Microsoft Virtual Server\Virtual Machine Additions

3. With the guest image off, set the CD to point to the VMAdditionsForLinux.iso image.

4. Boot the guest image and login to GNOME.

5. Start gnome-terminal

6. mkdir ~/vmadditionsforlinux

7. cd ~/vmadditionsforlinux

8. cp /cdrom/* .

9. sudo apt-get install alien

10. for rpm in $(ls *.rpm) ; do sudo alien $rpm ; done

11. sudo ./vmadd-install.run all

12. for i in $(ls *.deb); do sudo dpkg - i –force-overwrite $i ; done

13. sudo reboot

I’m not sure that we really gain anything from the vmadditions for linux on Ubuntu Dapper… For instance, I can do full-screen now, but the desktop remains the default size. I haven’t explored any of the other benefits yet…

Also, it has introduced a new bug. Previously, I was able to simply suspend my laptop, then come back and access the virtual machine in the same state as when I suspended. Now, I need to reset my virtual machine to fix whatever foo causes it to freeze when windows is recovering from the suspended state. (Possibly fixed by vpc2004qfe889677_msdn.msp, (which comes bundled in the virtualpc2004 download)? (Hot Fix for Microsoft Knowledge Base article number(s) 889677))

NOTES:

It appears that there is a lot of overlap in the rpm packages that MS has created for vmadditionsforlinux. I needed to add the –force-overwrite option to dpkg, so that it would install all of the vmadd*.deb packages:


speeves@vpcubuntu:~/vmadditionsforlinux$ for i in $(ls *.deb); do sudo dpkg - i $i ; done
Password:
Selecting previously deselected package vmadd-full.
(Reading database ... 73612 files and directories currently installed.)
Unpacking vmadd-full (from vmadd-full_0.0.1-2_i386.deb) ...
Setting up vmadd-full (0.0.1-2) ...
Selecting previously deselected package vmadd-heartbeat.
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-heartbeat (from vmadd-heartbeat_0.0.1-2_i386.deb) ...
dpkg: error processing vmadd-heartbeat_0.0.1-2_i386.deb (--install):
trying to overwrite `/usr/sbin/vmadd-heartbeatd', which is also in package vmad d-full
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
vmadd-heartbeat_0.0.1-2_i386.deb
Selecting previously deselected package vmadd-kernel-module.
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-kernel-module (from vmadd-kernel-module_0.0.1-2_i386.deb) ...
dpkg: error processing vmadd-kernel-module_0.0.1-2_i386.deb (--install):
trying to overwrite `/lib/modules/vmadd/module/Makefile', which is also in pack age vmadd-full
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
vmadd-kernel-module_0.0.1-2_i386.deb
Selecting previously deselected package vmadd-scsi.
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-scsi (from vmadd-scsi_0.0.1-2_i386.deb) ...
dpkg: error processing vmadd-scsi_0.0.1-2_i386.deb (--install):
trying to overwrite `/lib/modules/vmadd/scsi/VPCSCSIMiniportDriver.o_shipped', which is also in package vmadd-full
Errors were encountered while processing:
vmadd-scsi_0.0.1-2_i386.deb
Selecting previously deselected package vmadd-shutdown.
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-shutdown (from vmadd-shutdown_0.0.1-2_i386.deb) ...
dpkg: error processing vmadd-shutdown_0.0.1-2_i386.deb (--install):
trying to overwrite `/usr/sbin/vmadd-shutdownd', which is also in package vmadd -full
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
vmadd-shutdown_0.0.1-2_i386.deb
Selecting previously deselected package vmadd-timesync.
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-timesync (from vmadd-timesync_0.0.1-2_i386.deb) ...
dpkg: error processing vmadd-timesync_0.0.1-2_i386.deb (--install):
trying to overwrite `/usr/sbin/vmadd-timesyncd', which is also in package vmadd -full
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
vmadd-timesync_0.0.1-2_i386.deb
Selecting previously deselected package vmadd-x11.
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-x11 (from vmadd-x11_0.0.1-2_i386.deb) ...
dpkg: error processing vmadd-x11_0.0.1-2_i386.deb (--install):
trying to overwrite `/usr/X11R6/lib/modules/input/mouse_drv.o', which is also i n package vmadd-full
Errors were encountered while processing:
vmadd-x11_0.0.1-2_i386.deb
speeves@vpcubuntu:~/vmadditionsforlinux$ for i in $(ls *.deb); do sudo dpkg - i --force-overwrite $i ; done
(Reading database ... 73651 files and directories currently installed.)
Preparing to replace vmadd-full 0.0.1-2 (using vmadd-full_0.0.1-2_i386.deb) ...
Unpacking replacement vmadd-full ...
Setting up vmadd-full (0.0.1-2) ...
(Reading database ... 73651 files and directories currently installed.)
Unpacking vmadd-heartbeat (from vmadd-heartbeat_0.0.1-2_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/sbin/vmadd-heartbeatd', which is also in package vmad d-full
Setting up vmadd-heartbeat (0.0.1-2) ...
(Reading database ... 73654 files and directories currently installed.)
Unpacking vmadd-kernel-module (from vmadd-kernel-module_0.0.1-2_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/Makefile', which is also in pack age vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/vpc-utils.c', which is also in p ackage vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/vpc-utils.h', which is also in p ackage vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/vpc-user.h', which is also in pa ckage vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/vpc-dll.h', which is also in pac kage vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/vpc-mod.c', which is also in pac kage vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/module/vpc-mod.h', which is also in pac kage vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/sbin/vmadd-prepare-module', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/sbin/vmadd.dll', which is also in package vmadd-full
Setting up vmadd-kernel-module (0.0.1-2) ...
(Reading database ... 73657 files and directories currently installed.)
Unpacking vmadd-scsi (from vmadd-scsi_0.0.1-2_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/VPCSCSIMiniportDriver.o_shipped', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/miniport.h', which is also in pack age vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/Makefile', which is also in packag e vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/VPCSCSIMiniportDriverUtilities.o_s hipped', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/vpc-scsi.c', which is also in pack age vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/vpc-scsi.h', which is also in pack age vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/vpc-scsi-wrap.c', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/vpc-scsi-wrap.h', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/intf_template.h', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/VPCProducerConsumerArray.o_shipped ', which is also in package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/lib/modules/vmadd/scsi/WindowsTypes.h', which is also in package vmadd-full
Setting up vmadd-scsi (0.0.1-2) ...
(Reading database ... 73660 files and directories currently installed.)
Unpacking vmadd-shutdown (from vmadd-shutdown_0.0.1-2_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/sbin/vmadd-shutdownd', which is also in package vmadd -full
Setting up vmadd-shutdown (0.0.1-2) ...
(Reading database ... 73663 files and directories currently installed.)
Unpacking vmadd-timesync (from vmadd-timesync_0.0.1-2_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/sbin/vmadd-timesyncd', which is also in package vmadd -full
Setting up vmadd-timesync (0.0.1-2) ...
(Reading database ... 73666 files and directories currently installed.)
Unpacking vmadd-x11 (from vmadd-x11_0.0.1-2_i386.deb) ...
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/X11R6/lib/modules/input/mouse_drv.o', which is also i n package vmadd-full
dpkg - warning, overriding problem because --force enabled:
trying to overwrite `/usr/X11R6/lib/modules/drivers/s3_drv.o', which is also in package vmadd-full
Setting up vmadd-x11 (0.0.1-2) ...
speeves@spdellubuntu:~/vmadditionsforlinux$ ls

RedirectMatch with a trailing slash

This always gets me:

RedirectMatch ^/catalogs/$ http://my.web.com/catalog

never matches because Apache appends the DirectoryIndex which is found in the directory, (ie index.html). Therefore, we need to include the DirectoryIndex to the regular expression:

RedirectMatch ^/catalogs/index.html$ http://my.web.com/catalog

emacs power-macros.el

http://www.blackie.dk/emacs/power-macros.el

It is discussed here:

http://linuxgazette.net/issue47/pedersen.html

And was written by Jesper Kjaer Pedersen:

http://www.blackie.dk/emacs/

Since I don’t have power-macros.el on every machine, I like to test for the file before requiring it:

;; load local elisp libraries
(setq load-path (cons “~/elisp” load-path))

;; load power-macros if available

(let ((library-to-load “~/elisp/power-macros.el”))
(if (file-exists-p library-to-load)
(load-file library-to-load)
)

(if (file-exists-p library-to-load)
(require ‘power-macros)
)

)

emacs save tmp files in a specific directory

This will save your tmp, (~), files in a single directory, instead of strewing them throughout the file system:

;; Put autosave files (ie #foo#) in one place, *not* scattered all over the
;; file system! (The make-autosave-file-name function is invoked to determine
;; the filename of an autosave file.)
(defvar autosave-dir (concat "/tmp/emacs_autosaves/" (user-login-name) "/"))
(make-directory autosave-dir t)

(defun auto-save-file-name-p (filename) (string-match "^#.*#$" (file-name-nondirectory filename)))

(defun make-auto-save-file-name () (concat autosave-dir (if buffer-file-name (concat "#" (file-name-nondirectory buffer-file-name) "#") (expand-file-name (c\oncat "#%" (buffer-name) "#")))))

;; Put backup files (ie foo~) in one place too. (The backup-directory-alist
;; list contains regexp=>directory mappings; filenames matching a regexp are
;; backed up in the corresponding directory. Emacs will mkdir it if necessary.)
(defvar backup-dir (concat "/tmp/emacs_backups/" (user-login-name) "/")) (setq backup-directory-alist (list (cons "." backup-dir)))

emacs apache-mode on Debian

On Debian, apache-mode is a part of the emacs-goodies-el package. I do a lot of work with apache conf files, so load it by default for any file that ends with .conf:


;; apache mode to edit config files.
(autoload 'apache-mode "apache-mode" "Apache Major Mode" t)
(setq auto-mode-alist
(cons '("\.conf$" . apache-mode) auto-mode-alist))

emacs set default major mode based on file extension

Placing this in your ~/.emacs file will load a specific major mode based on the file extension:

;; apache mode to edit  config files.
(autoload 'apache-mode "apache-mode" "Apache Major Mode" t)
(setq auto-mode-alist
(cons '("\.conf$" . apache-mode) auto-mode-alist))

emacs define a macros

Precede the macros with:

ctrl-x (

Close macros with:

ctrl-x )

For example:

ctrl-x ( ;; start macro
M-> ;; select region from point to end of buffer
ctrl-w ;; kill region (cut)
ctrl-x ) ;; close macro

To recall the last macros:

ctrl-x e

Or, you can bind a keyboard shortcut to the last macros by placing the following in your .emacs:

;; repeat last keyboard macro
(global-set-key [(shift f1)] ‘call-last-kbd-macro)

Taken from:

http://linuxgazette.net/issue47/pedersen.html

firefox extension live ip address

This is a great extension which shows your external ip address in the lower right-hand status of your firefox window:

This is a great extension which shows your external ip address in the lower right-hand status of your firefox window:

https://addons.mozilla.org/firefox/1731/

https://addons.mozilla.org/firefox/1731/

firefox extension showip

Here is a great extension which shows the remote ip address of the web page that you are viewing:

https://addons.mozilla.org/firefox/590/

(Great for monitoring DNS changes).

Monday, January 29, 2007

Windows 2003 - Remote Assistance - Web Page Dialog… ooops

I’m not sure that some end-users would find this dialog funny:

“Remote assistance cannot connect because the novice is not logged on.”

I would think “remote user”, or something other than “novice” could have been used here…. I know of power users, (and administrators), that could use help from time to time…

Windows 2003 raise domain functional level

To change the functional level on a domain in Active Directory:

1. Open Active Directory Domains and Trusts (MMC)

2. Highlight the domain that needs to have the functional level changed

3. Click on Actions->Raise Domain Functional Level…

Running Python scripts with cscript

You can use Python to work with COM objects by:

1. Using the .pys extension

2. Calling the script with cscript.exe

c:\scripts> cscript listfiles.pys

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

#.newsrc-dribble#
104.wav
124.txt
AUTOEXEC.BAT
boot.ini
cert.csr
COMLOG.txt
CONFIG.SYS

Here is the code for listfiles.pys:

fso = WScript.CreateObject(”Scripting.FileSystemObject”)
files = fso.GetFolder(”c:\\”).Files

for file in files:
print file.name

Borrowed from Windows Scripting and Objects by Brian Knittel.

Tabbed Console for Windows

Finally, I have found a tabbed console application for windows:

http://sourceforge.net/projects/console

You can view all downloadable files at:

http://prdownloads.sourceforge.net/console/

There doesn’t seem to be much information about this tool, but I just unzipped the newest beta, and clicked on the Console.exe file, and it worked fine. Great features are:

1. hotkeys - I can have my gnome-terminal keyboard shortcuts for creating a new tab and moving between them.

2. transparency

All configuration information is held in:

my\installdir\Console2\console.xml

Here is an example of adding an option for starting up a Cygwin in a new tab:

<tabs>
<tab title="Console">
<console shell="" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="cmd">
<console shell="cmd.exe" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="2" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="65" r="0" g="0" b="0"/>
</image>
</background>
</tab>
<tab title="cygwin">
<console shell="e:\cygwin\cygwin.bat" init_dir=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="2" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="65" r="0" g="0" b="0"/>
</image>
</background>
</tab>
</tabs>

Though I just found that you can add them through the Edit->Settings…->tabs menu :P

The help files are only found in the src.zip files, (interestingly enough):

my\installdir\Console2\help\console.chm



Microsoft Powershell RC1 coolness

Though I have my reservations about the overall acceptance of the Powershell as shell replacement, (mostly because of the shift to treating everything as objects), I have found two very cool things so far:

1. I can create aliases for commands, (I’m not sure how yet, but the built-ins make it easy when coming from BASH).

2. I can browse the registry from the command line… (How cool is that!? This is the actual finding that led to this blog entry).

PS HKLM:\SYSTEM> cd HKLM:\SOFTWARE
PS HKLM:\SOFTWARE> ls
Hive: Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE
SKC VC Name Property
— — —- ——–
4 0 ActiveState {}
6 0 Adaptec {}
3 0 Adobe {}
1 0 Alps {}
1 0 Apple Computer, Inc. {}
4 0 ATI Technologies {}
1 0 Blunck Software {}
1 0 Bogosoft {}
1 0 BreakPoint {}
5 0 Broadcom {}
1 0 BVRP Software {}
1 0 BVRP Software, Inc {}
1 1 C07ft5Y {(default)}

Now, if I can just figure out how to make “cd” take me back to %HOME%… :P

Debian on a Dell 1950

I wanted to document this somewhere before going over to the server room…

To get Debian to install on a Dell 1950 you need to use the Debian Installer for Testing (Etch). Also, before installing grub (at the end of the installation), you need to perform the following tasks:


Alt+F2
chroot /target
echo "megaraid_sas" >> /etc/mkinitramfs/modules
mkinitramfs -o /boot/initrd.img-2.6.15-1-486 2.6.15-1-486
exit
Alt+F1

This will include the megaraid_sas module in your initrd.img, (allowing the kernel to find your PERC/5 RAID array).

http://www.ubuntuforums.org/showthread.php?t=226114

Using sed to delete the first match and then quit

I found this gem when I was trying to delete the first instance of a duplicate line in a group of files:


for conf in $(ls *publish*) ; do sed '0,/AllowOverride All/{//d;}' $conf ; done

I’ll extract the sed command for easier perusal:

sed ‘0,/AllowOverride All/{//d;}’ $conf

http://www.linuxtopia.org/online_books/linux_tool_guides/the_sed_faq/sedfaq4_004.html

Debian on a Dell 1950

Here are some great ISO images for install Debian Sarge on Dell 1950s:

http://kmuto.jp/debian/d-i/

I found this link through this blog by kmuto:
http://kmuto.jp/b.cgi/debian/d-i-2616.htm

Ubuntu Dapper Acer 5102 Turion 64 X2

The install on this machine was very straight-forward. I didn’t need any special parameters to boot the Live CD for installation, and it configured the wireless card (atheros ar5005g), and the video card (ATI Radeon Xpress 1100) correctly.

At this point, I am only having the following issues:

1. Synaptics Touchpad doesn’t always allow you to highlight text, or drag windows, etc.

2. hibernate does not bring the machine back into a usable state. (GNOME acts like it is coming up, but… I haven’t fully explored this).

3. the hard drive light comes on constantly. (This worries me, as my last Acer exhibited this same behavior, and only lasted 10-11 months with some suspicious (hardware?) problems… ). Or, is it a HAL, Kernel, two IDE drives on same cable behavior…? ).

Here are some links that were helpful in setting up my Acer 5102:

1. disable ipv6

https://help.ubuntu.com/community/WebBrowsingSlowIPv6IPv4?highlight=%28ipv6%29

2. install 32-bit firefox, flash, and java:

https://help.ubuntu.com/community/FirefoxAMD64FlashJava?highlight=%28amd%29

Zope - Error Value: [Errno 28] No space left on device

I was trying to import a zexp file that was about 1.5GB, and kept getting:

Error Value: [Errno 28] No space left on device

After finding a reference to the /tmp dir here:

http://mail.zope.org/pipermail/zope/2002-May/114219.html

and checking to see where my /tmp lived, I found:

Filesystem Size Used Avail Use% Mounted on
/dev/hde3 1.8G 826M 866M 49% /
tmpfs 443M 0 443M 0% /dev/shm
/dev/md2 74G 7.1G 63G 11% /Inetpub
/dev/hde1 45M 9.4M 33M 23% /boot
/dev/md0 5.5G 770M 4.5G 15% /usr
/dev/md1 9.2G 393M 8.4G 5% /var

To work around this, I:

1. created a temporary /tmp directory in /Inetpub/tmp, and set the sticky bit on it:

chmod 1777 /Inetpub/tmp

2. moved the old /tmp:

mv /tmp /tmpOLD

3. created a symlink from the new tmp to the old location:

ln -s /Inetpub/tmp /tmp

Debian - Problem reconfiguring xserver-xorg

pitea:/home/speeves# dpkg-reconfigure xserver-xorg
xserver-xorg postinst warning: not updating /etc/X11/X; file has been
customized

Here is the fix:
pitea:/home/speeves# dexconf; rm /etc/X11/X; dpkg-reconfigure xserver-xorg

nspluginwrapper

32-bit plugins (flash, etc) for firefox on amd64 machines :)

http://marius.scurtescu.com/?p=139

http://applications.linux.com/applications/06/06/28/1635229.shtml?tid=13

Debian amd64 - i386 chroot

I was able to setup my i386 chroot with the help of the following two pages:

Ubuntu - Unofficial Transgaming Wiki:

http://cedegawiki.sweetleafstudios.com/wiki/Ubuntu#Building_a_clean_32bit_chroot_with_debbootstrap_on_AMD64

Debian AMD64 How-To:

https://alioth.debian.org/docman/view.php/30192/21/debian-amd64-howto.html#id271998

I used the Transgaming Wiki for most of the steps, and used the example in the Debian AMD64 How-To to translate some steps that I needed to understand for Debian.

NOTE: on Debian sid, I found that I needed to put my dchroot configurations in /etc/schroot/schroot.conf, (as opposed to /etc/dchroot.conf), or I would see the following error:
W: No chroots are defined in ‘/etc/schroot/schroot.conf’

Debian AMD64 How-To (includes schroot)

I found a link to the most current (as of Sep. 1, 2006)
debian-amd64-howto in the wiki:

Debian AMD64 How-To :

http://haydn.debian.org/~intero-guest/debian-amd64-howto.html

The wiki page was:

http://wiki.debian.org/DebianAMD64Faq

Create madwifi-tools for amd64 architecture

As you may know, we are missing the madwifi-tools binary for the amd64 architecture, but _do_ have one for i386. This is a how-to on creating an amd64 package from the i386 binary.


1. download the i386 binary from:

http://packages.debian.org/unstable/net/madwifi-tools

2. extract the contents of the package:

dpkg-deb -x madwifi-tools_0.svnr1697.0.9.2-1_i386.deb madwifi-tools_0.svnr1697.0.9.2-1_amd64

3. extract the control files:

dpkg-deb -e madwifi-tools_0.svnr1697.0.9.2-1_i386.deb madwifi-tools_0.svnr1697.0.9.2-1_amd64/DEBIAN

4. modify the architecture in the DEBIAN/control file:

emacs madwifi-tools_0.svnr1697.0.9.2-1_amd64/DEBIAN/control

-- change:

Architecture: i386 to Architecture: amd64

5. rebuild the binary package:

dpkg-deb --build madwifi-tools_0.svnr1697.0.9.2-1_amd64
6 . install the new madwifi-tools:

sudo dpkg -i madwifi-tools_0.svnr1697.0.9.2-1_amd64.deb

7. install the binary that you created from madwifi-source:

sudo dpkg -i /usr/src/madwifi-modules-2.6.17-2-amd64_0.svnr1697.0.9.2-1+2.6.17-7_amd64.deb

8. load the kernel modules:

sudo modprobe ath_pci

9. run iwconfig to see if ath0 now appears in your list of network interfaces:

sudo iwconfig

Enjoy!

Debian glxgears application for testing 3D Acceleration

glxgears is found in the “mesa-utils” package.

Using Exim4 as an SMTP-AUTH client

Simply add the host:username:password to the /etc/exim4/passwd.client file. For example:

pitea:/home/speeves# cat /etc/exim4/passwd.client
# password file used when the local exim is authenticating to a remote
# host as a client.
#
# see passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:login:password
#
my.smart.host:speeves:mypassword

Make sure that the file has a mode of “640″.

Debian amd64 and VMWare 5.5.2

VMWare workstation 5.5.2 installed without any patching, etc. on Debian Sid (amd64). (no vmware-any-any-update needed :) ).

Using tar to move file trees across the network

I got this great tip from:

http://www.cs.hmc.edu/qref/targzip.html

You can also use a tar pipe to copy across the network:

% (cd /src; tar -cvf - foo) | (ssh other.machine ‘cd /dst; tar -xf -’)

I used it to move all files that were newer than 07 Jul 2006:

(tar -cvf - -N “07 Jul 2006″ myweb/*) | (ssh remoteserver ‘cd /webroot/; tar xf -’)
Cool!

NULL and empty strings in MySQL/Access

Here is an interesting email which details a problem between MySQL and Access 2000:

http://listserv.muohio.edu/scripts/wa.exe?A2=ind0302b&L=archives&D=1&P=8035

This caused many headaches for our folks who used Access frontends to manipulate MySQL backends. I’m not sure if any of the newer versions of Access continue to exhibit this issue or not…

Here is the text:
>Hi. I’m currently running Access for our database which is for pretty
>much a single user. Recently we got a new computer with XP and the latest
>Access. There is a conversion process that can be done with our Access 95
>db’s, but the product is then not readable from the other computers which
>still have Access 95 on them (and we are not upgrading them).
>
>I installed MySQL for Windows on one of the Win 98 computers and can throw
>the database from Access 2002 to MySQL. This can be accessed with Access
>95 or Access 2002 and that’s nice.
>
The only problem you might run into when using Access as a front-end is
caused by the ancient sql standards to which the jet db engine adheres.
Here is an explanation:

/We have identified a problem with using Access as a front-end with the
MySQL server. Thanks to Michael Zedeler ([log in to unmask])
for this article that explains the problem quite thoroughly. :)

———————————————————————————

If you get the following message: “Write Conflict - This record has been
changed by
another user since you started editing it. […]” from Access 2000, its
likely to be a
problem that arises from differing standards between Access and MySQL.

>From old times, according to some SQL standard, an empty space is by
definition
equal to NULL. This disposition has caused many grievances over the
years, so
MySQL rectifies this by deviating from the standard. In MySQL, NULL is
NULL and the empty string is the empty string.

So when Access retrieves a row from MySQL with fields containing the
empty
string, it automatically translates them into NULL values. When you try
updating this
row, the query sent from Access 2000 to MySQL will fail to update the
row.
An example:

You have inserted the following row into table a:

id | name—-+————————- 1 | >- contains the empty
string. Not
NULL.

And then you retrieve the row using Access 2000, subsequently inserting
the value
“Smartypants” in the “name” field.

You would expect Access 2000 to send the following query to MySQL:

UPDATE a SET name = ‘Smartypants’ WHERE id = 1 AND name = ‘’

(The extra “AND name = ‘’” is included to avoid updates in case that
some other
user has already updated the given row.)

But what Access 2000 actually sends is:

UPDATE a SET name = ‘Smartypants’ WHERE id = 1 AND name IS NULL

That query fails because NULL is not being treated as the empty string
by
MySQL.

How to fix the problem

I haven’t found any way around it, but to stop using empty strings in
character fields.

The problem only arises when other systems inserts data into MySQL
tables, so
you’ll have to make those systems start using NULL in stead of the empty
string,
where necessary. When Access 2000 inserts data, it will always translate
the empty
string into NULL, thus maintaining data that are consistent with the
(old?) SQL
standard.
————————————————————————————-

As many of you insert data into the database with empty strings, and not
NULL, this means that you will have to write some code to check to see
if the value in the form is actually an empty string or NULL. Then
write the query accordingly. For examples of inserting NULL values into
a MySQL database, check out:

http://www.mysql.com/doc/P/r/Problems_with_NULL.html/

This not only effects using access with mysql, but also with any “modern” database server, including Microsoft SQL Server. :( (Go figure, they can’t even get on the ball with their own products. ;-( )

>
>I have read that php is the way to go to access the MySQL database.
>
This is one possibility. You have mentioned another, with MS Access.
You can also write applications in Perl, Python, (I’d imagine C++), and
probably almost any other language, as long as you use the ODBC drivers
to access the data. (The only thing about PHP is the incredibly
powerful and mature library that allows you to interface with the
database. I’m sure that Perl DBI mods are pretty mature as is
Pythons… Pick your poison.)

>What
>I’ve read seems to indicate to me that I need a web server to do this.
>
This is true. PHP is a language that is primarily used in conjunction
with a web server. (Apache is the way to go here. It is the most
stable, and configurable, web server on the market. (It’s also free :)
It has mod_php, which might come with apache2, the best version for a
windows installation. It is fairly simple to setup, and you can
probably enable mod_php during the install… (My installation handles
1.5 mil hits on Apache2, coldfusion/php enabled server, on linux, no
problem.) The site is www.apache.org. The documentation is pretty
thorough, and groups.google.com is a great place to find out other
information about running the server. (If you are running NT/2000/XP,
it will install as a service, so that it will start automatically at
bootup.)

>Can you give me a little clarity on this. I don’t want to get a book on
>php and try to learn that if I’m going to have to install a web server to
>use it. I would like to find another way for the average user to query
>the MySQL database other than Access. I would also like to be able to
>input data into it some other way that is similar to the way I can input
>with Access - using a form or datasheet view. Can php do this for me? Is
>the learning curve high on this? It was pretty steep for learning to use

>MySQL and learning SQL to do these tasks is not something I really want to
>do. I don’t mind spending the time creating the forms etc, but I’d like
>it to be fairly easy to use them after they are made. Making the forms in
>Access took me some time to learn and to create, but now they are easy to
>use.
>
>
If you have any previous programming experience with C++ or Perl, PHP
should come fairly naturally. Otherwise, it can be a bit difficult at
first. (As anything new is…) A great place to steal code from, would
be www.phpmyadmin.net. There gui admin is written in PHP, and it is the
most amazing web interface :) They have a lot of great code in their
product. You might also want to search the web for some PHP interfaces
on the net. Try www.hotscripts.com, or search on google.com. You would
be surprised at the applications that are Open-Source and available for
you to modify, instead of starting from scratch.

If you decide to use another language, such as Visual Basic, you will
not need to use a web server. _But_, you will need to install the
program on an application server, or on each individual machine.

HTH, :)

speeves
cws

Mailman Config FAQ

I am beginning to compile some tips for configuring Mailman lists:

www.gnu.org/software/mailman/index.html

1. How do I suppress welcome emails when I am adding a user to a list?

- Change the radio button for “Send welcome messages to new subscribees”, from Yes to No, (on the Mass Subscriptions page).

2. How do I change everyone’s moderation bit to yes?

- When the moderation bit is set to “On”, the user’s emails will be captured by mailman and placed into the queue for a moderator. To set the moderation bit to “On” for everybody, visit the “Membership List” page, and scroll to the bottom. Change “Set everyone’s moderation bit, including those members not currently visible” from “Off” to “On”, then hit the “Set” button on the right.

3. How do I make a mailing list archive private?

- Visit the “Archiving Options” page, and change “Is archive file source for public or private archival?” from “public” to “private” and hit “Submit your Changes”.

4. What if I don’t want to archive mail list messages at all?

- On the same “Archiving Options” page, change “Archive messages?” from “Yes” to “No” and click the “Submit Your Changes” button.

5. How do I add multiple administrator emails to a mailing list?

- Under General Options, you may add as many emails as necessary to the “The list administrator email addresses. Multiple administrator addresses, each on separate line is okay.” text box, then click “Submit your Changes”.

6. What if I, (the administrator), would like help moderating a busy list, but don’t want another user to have the ability to make administrative changes to the mailing list?

- You can designate “moderators” to help you moderate a busy mailing list. A moderator will receive emails notifying them of messages in the queue which need a moderator to double-check before it is allowed on the list. To add a moderator, visit “General Options”, and add email addresses to the “The list moderator email addresses. Multiple moderator addresses, each on separate line is okay.”, then click “Submit your Changes”.

7. I have added a moderator, but how do they access the queue to moderate messages?

- Mailman will send an email to the moderator as soon as a moderated message is added to the queue. This message will have a link which will take them to moderator’s login page, where they will need to enter the moderator’s password to login.

8. But, what is the moderator’s password?

- Mailman gives you the ability to set a different password for moderators. To do so, click on “Passwords”, and enter the moderator password in the “Enter new moderator password:” field, confirm it, then click the “Submit Your Changes” button.

9. How do I hide the sender’s email address?

- Under “General Options”, you can change “Hide the sender of a message, replacing it with the list address (Removes From, Sender and Reply-To fields)” from “No” to “Yes”, then click the “Submit Your Changes” button.

10. What if I don’t want Mailman to send out a message when the user is unsubscribed?

- Under “General Options”, you can change “Send goodbye message to members when they are unsubscribed?” from “Yes” to “No”, then click the “Submit Your Changes” button.

11. I have lost control of my list, and I need to stop ALL traffic to my “announce-only” list?

- Under “General Options”, you can change “Emergency moderation of all list traffic.” from “No” to “Yes”, then click the “Submit Your Changes” button.

12. I am trying to send PDF files to the list, but they are always placed in the moderation queue… Help!

- Under “General Options”, you can change the value of the “Maximum length in kilobytes (KB) of a message body. Use 0 for no limit.” field to a more appropriate size. (The default is 40 Kilobytes), then click the “Submit Your Changes” button. BE AWARE, dial-up users may not appreciate receiving a lot of large email messages…

13. How do I make sure that new member’s email addresses will be hidden when they post to the mailing list?

- Under “General Options”, click the checkbox next to “Conceal the member’s address”, in the “Default options for new members joining this list.” menu item, then click the “Submit Your Changes” button.

Zope 2.9 and Debian

I thought I had posted this, but I had a hard time finding information about managing the new zope package for zope2.9. I am pasting it here, because I always forget that there is a zope-common package, and that the only Debian specific documentation seems to be in that package…. :( (I have submitted a bug report to the zope-common package). In the meantime, I would like to place a copy of portions of the file here:

zope-common for Ubuntu/Debian



The document describes how to handle zope installations, managing zope instances and packaging of zope versions and products on Debian systems.

zope versions in Debian



The packaging of zope versions and products allows parallel installations and running of different zope versions.

Hints for a Zope user



Installing a Zope package doesn’t start you a Zope process, it just sits on your disk. To actually do something you have to create a Zope instance and start this instance. You can do this by hand, but the packaging provides you with some support to setup preconfiugred Zope instances like a sandbox instances (play around, test), or preconfigured instances like plone-site or cps-site.

Each Zope version is installed in

/usr/lib/zope

Instances are created in

/var/lib/zope/

If you want to add them somewhere else, add a symlink in the above directory to the instance home, so the packaging tools can find them.

Zope products and extensions are installed in

/usr/{lib,share}/zope/{Extensions,Products}

These won’t show up in Zope instances by default. Make them visible to the instances by the packaging tools (the dzhandle binary) or use your own tools and scripts.

You don’t have to use the packaging tools. Just create the instances manually and the packaging won’t touch them (If it’s touched anyway, please report a bug).

Handling of Zope Instances


You (or a package) can create a zope instance using
dzhandle -z 2.7 make-instance –addon-mode all?

The script uses the `mkzopeinstance.py’ script to create the instance and creates a file /etc/zope2.7//debian_policy, which has information about how the instance should be handled.

Addon-Mode describes, if all addons should be installed in the Products directory of the instance, or if you want to handle these yourself either copying products to the location by hand or using the dzhandle tool.

Addon-Technique describes how products and extensions, which are installed as .deb packages, are shown to the instance.

  • ‘linked’ makes everything visible to the instance, by using a symlink to the packaged addon. Doesn’t handle different python versions well.
  • ‘tree-linked’ copies the directory tree of the addon and symlinks every file. Works better when you do have different zope versions requiring different python versions (that’s what the zope2.7-sandbox package uses).
  • ‘copied’ copies the product to the instance, but doesn’t update the copy on package upgrades.

Restart-Policy describes how instances are restarted during configuration.

An instance, which should be restarted on system start, has to be mentioned in /etc/default/zope.

Handling of Zope Products



Products are typically packaged as zope-

(where is all lowercase). Installing a product makes the product available on your system, but not in an Zope instance, except the instance is configured to have all products installed by default.

To add the MyProduct? product to the Zope 2.8 instance `myinstance’,

you have to run the following command
  1. dzhandle -z 2.8 add-product myinstance MyProduct?

Product Installation in Instances



A product is automatically installed in an instance, if the Addon-Mode of the instance is set to ‘all’, and the instance doesn’t have the addon exclude in it’s instance policy file (Excluded-Addons).

The installation will fail, if there’s already a product in an instance in Addon-Mode ‘all’ and the product isn’t in the list of excluded addons.

Product Upgrades in Instances



The installation of a packaged product in an instance is upgraded, if the Addon-Technique for the instance is ‘linked’ or ‘tree-linked’. Manually installed products and ‘copied’ products are not updated.

Product Removals in Instances



When a packaged product is removed, it is tried to remove all product installations in instances, if the Addon-Technique of the instance is ‘linked’ or ‘tree-linked’. The removal will fail, if the instance is in Addon-Mode ‘manual’.

Manually installed products and ‘copied’ products are not removed from the instances.

This is taken from:

/usr/share/doc/zope-common/README.Debian.gz written by Matthias Klose.