Using Samba to acces a windows share

from the linux shell type smbclient \\\\netbiosname\\shareresource it will then ask you for the share password . once your connected you can then upload and download files as you were using a ftp client.

keep in mind that linux does not like spaces within file names and directory names . so the resource name can not have spaces in the name or you will receive a error msg when trying to connec to the resource .

added note. to make sure samba is running type: smbstatus
if is not running use service smbd start to start the service

Apache Redirect/ Rewrite /alias

This invokes a php script that is five directories beneath Apache’s DocumentRoot.
It then passes a variable, within the script, the value “blahblah”. With url redirection, you could configure Apache to redirect
the following url to the one above:

Even with this simple example of redirection, this improves the integrity of the website in the following ways:

* The url is not so complex now and is therefore easier to remember.
* Using redirection in such a way avoids many security risk related to cgi and php scripts, etc… (See *)

* Say someone notices your passing varible values to the script from within the url. This person
may deviously find a way to pass and unexpected value to your script and cause unexpected
behaviour. For example:…/script.php?variable=/path/to/malicious/code.php

Here, for example, someone has tricked your script into running some mailicious code somewhere
causing who-knows-what kind of behaviour and damage!!!

Types of Redirection

There are three main modes of redirection in Apache. These are the Alias, Redirect and Rewrite directives. The first two are defined in mod_alias.c within the Apache source and are compiled into Apache by default. Rewrite is defined in mod_rewrite.c, which is a much more robust module than its counterparts, however it is not compiled into Apache by default.


Alias /something /somewhere/else/in/the/filesystem

The Alias directive allows you to redirect “/something” to somewhere in the filesystem that is underneath the defined DocumentRoot.
For example, we use the following:

Alias /~labstaff /blue/homes/labstaff/www-home/

Therefore, “” is actually redirected to the directory “/blue/homes/labstaff/www-home/”.
We do this with “/~labstaff” and not “/~help” because “help” is a valid user and “labstaff” is not.


Redirect /something

This directive will map “/something” to another url completely. This url can be any valid url of you choosing. For example, the following could be used if we wanted:

Redirect /rt

This would map “” to “”. If you wanted to map a user’s webpage directory to their webpage elsewhere, for example, you could do something similar to:

Redirect /~sammons

This directive can be placed anywhere in the Apache configuration, so long as it is contained within a section.

NOTE: One difference between Alias and Redirect is that the browser is aware of the new location with Redirect, but is not with Alias.
Hence, the new location will be used as the basis for links with Redirect, but not Alias.


The beauty of Rewrite is that it can perform all of the above operations and more.

RewriteEngine on
RewriteRule RegExPattern /url/to/redirect/to/goes/here [Flag(s)]

\_ Pattern _/ \___ Substitution String ___/

One thing that makes mod_rewrite such a valuable tool is its ability to utilize regular expressions in both the Pattern and the refrences
in the Substitution String. Now, take the following rewrite rule for example:

RewriteRule ^/[~]cs530/hw(.*)$ https://%{SERVER_NAME}/~cs530/hw$1 [R]

\___ Pattern ___/ \_____ Substitution String _____/ \_ Flag _/

In this case, we want to match anything referenced on our server from the “/~cs530/hw” directory. Hence, all of the following would match:

The ‘$1’ on the end of the substitution string will be replaced by whatever trails the ‘hw’ in the pattern, as indicated by the ‘(.*)’.
Therefore, the above urls would be substituted with the following urls respectivly:

What’s the difference? We have changed the protocol being used from http:// to https://, thus forcing ssl (an encrypted connecion)!

Notice the use of the Apache variable “SERVER_NAME” in the substitution string. In fact, Rewrite is capable of using many of the other Apache variables in similar ways.


ImageMagick Installation and information

[|Get the Source]
[|More info]

Install from Unix Source

ImageMagick builds on a variety of Unix and Unix-like operating systems including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is required and fortunately almost all modern Unix systems have one. Download ImageMagick.tar.gz from or its mirrors and unpack it with this command:

gunzip -c ImageMagick.tar.gz | tar xvf –

Next configure and compile ImageMagick:

cd ImageMagick-6.?.?

If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type

make install

Finally, verify the ImageMagick install worked properly, type

/usr/local/bin/convert logo: logo.gif

Congratulations, you have a working ImageMagick distribution and you are ready to use ImageMagick to convert, compose, or edit your images or perhaps you’ll want to use one of the Application Program Interfaces for C, C++, Perl, and others.

The above instructions will satisfy a great number of ImageMagick users, but we suspect a few will have additional questions or problems to consider. For example, what does one do if ImageMagick fails to configure or compile? Or what if you don’t have administrator privileges and what if you don’t want to install ImageMagick in the default /../usr/local folder? You will find the answer to these questions, and more, in Advanced Unix Source Installation.


use mogrify  to convert or use convert

SoX – Sound eXchange

Sox is a general purpose sound converter/player/recorder that supports the following formats:

* RAW sound data in various data styles
* RAW textual sound data
* Amiga 8svx files
* Apple/SGI AIFF files
* SUN .au files
o PCM, U-law, A-law, G7xx ADPCM files
o mutant DEC .au files
o NeXT .snd files body [|More information on SOX]

wget ( this may change , check with the SOx website for correct address)


The preferred method for compiling SoX is to use the “configure” scripts
compatible with most UNIX systems that contain “/bin/sh” or equivalent
(even the Window’s Cygwin setup will work with this).

To compile and install SoX on these platforms run the following commands:

make install

There are several optional parameters that you may pass to the configure
script to customize SoX for your applications. Run “./configure –help”
for a complete list of options.

If your system works with the “configure” script then you may skip
to the Optional Compiling section.

If your system does not work with the configure scripts then there are
several canned “Makefile”‘s that you can use inside the src directory.
The following systems have a canned Makefile:

DOS Makefile.dos (Borland or Turbo C)
WIN95/NT Makefile.dos (Needs modifying for Visual C++)
OS/2 Makefile.gcc (using EMX GCC compiler)

To use a canned Makefile, a few steps need to be completed. First up,
you need to make a copy of and call it stconfig.h. Modify
this file to reflect your environment.

FIXME: A file called ststdint.h needs to be created as well. This
is the same as stdint.h if your system has it.

After that, copy either Makefile.dos or Makefile.gcc to a file
called Makefile. This needs to be done in both the src directory
and the src/gsm directory. This file also needs to be modified to reflect
your environment.

Optional Compile Features

A GSM library is included with SoX. More information on this library
can be obtained from
If this library fails to compile on your system, you can specify
–disable-gsm to prevent it from being compiled in.

SoX can make use of Ogg Vorbis libraries to read and write Ogg
Vorbis files. Normally, the configure script will auto detect
this library and enable support for Ogg Vorbis. Ogg Vorbis library
can be obtained from

SoX can make use of MP3 libraries to read and write MP3 files.
Normally, the configure script will auto detect these libraries and
enable support for MP3. SoX requires libmad for reading MP3 files
and lame for writing MP3 files. Libmad can be obtained from and lame can be obtained from

If any libraries are installed in a non-standard locations in your
system then you can use the CPPFLAGS and LDFLAGS variables to allow
configure to find
them. For example:

./configure CPPFLAGS=”-I/home/sox/include -I/usr/local/multimedia/include” LDFLAGS=”-L/home/sox/lib -L/usr/local/multimedia/lib”

If you’re not processing lots of u-law or A-law files and would
like to save around 64K of memory when SoX is executed then you
can use runtime routines to perform u-law/A-law conversions.
This is slower then the default lookup tables but results in the
same answers. To save this memory, specify –disable-fast-ulaw and


After successfully compiling SoX, try translating a sound file.
If you can play one of the supported sound file formats,
translate ‘monkey.wav’ to your format (we’ll use ‘xxx’):

cd src
./sox monkey.wav

You may have to give the word size and rate for the file.
For example, this command will make a sound file with a data rate of
12,500 samples per second and the data formatted as signed shorts:

./sox monkey.voc -r 12500 -s -w

If plays properly (it’s a very short monkey screech),
congratulations! SoX works.

After that, running “” and “” (“tests.bat” and
“testall.bat” for DOS) tests most of the implemented file handlers to
make sure that some portability issue haven’t popped up.

Computer , server issues and solutions