Send an email in bash

Posted in Tutorials, Linux by Rz on the November 4th, 2005

Quick tutorial for sending an email in bash.

To work, your system must have the following : postfix or sendmail, mailx package (and dependencies).

Define the variables :
#!/bin/bash
# script to send simple email
# email subject
SUBJECT="SET-EMAIL-SUBJECT"
# Email To ?
EMAIL="admin@somewhere.com"
# Email text/message
EMAILMESSAGE="/tmp/emailmessage.txt"

Start the message :
echo "This is an email message test">$EMAILMESSAGE
echo "This is a second line">>$EMAILMESSAGE
echo "This is a third line">>$EMAILMESSAGE

Send the email :
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

In this script, you can add all the variables you want (ie : df, free, uptime, hostname, date…) ;)

Php test

Posted in Tutorials, Css by Rz on the November 1st, 2005

Current date and time: Thursday 25th of April 2024 10:45:02 PM

Php Basis

Posted in Tutorials, Php by Rz on the October 31st, 2005

This tutorial explain the Php basis. The objective is to get you familiar with Php commands.

» So what is the aim of those < ? ?> ?
Php is an “Interpreted” language. This means that Php is NOT compiled, it is parsed at runtime (the time when the script is run. ex : user visits the page).

All Php code is enclosed within “< ?" and "?>“. Functions (text that causes action in the script), are ended by the semicolon (”;”). Comments (or escaped text) are as follows:

#Comments => shell style comment
//Comments => standard comment
/* Comments */ => C-style comment

» What does a Php page look like ?

< ?
$name = "RZ::DESIGN";
echo "<html><head><title>Php Tutorial</title></head>”;
echo “<body>”;
echo “Welcome in $name”;
echo “</body>”;
echo “</html>”;
?>

This code just write the text : Welcome in RZ::DESIGN in a standard html page.

Now lets take a look at this. First, we initialize the Php interpreter. On the second line, we assign the variable “$name” to the value “RZ::DESIGN”. This is done by first giving the variable a name.

All variables (with the exception of constants, which you need not to worry about) start with the dollar sign (”$”). After we give the variable a name, we assign it a value, with the Assignment Operator (”=”). The value can be enclosed in either double or single quotes. Use double when you want to invoke “Variable Interpolation”. This means that if a variable is found in between ” and “, the value will be printed. But, if you use single quotes, the values will not be printed, instead, the variable name will be printed.

Example:

< ?
$variable = "Here's the variable";
//Next line will print : Where is the variable ? Here's the variable;
echo "Where is the variable ? $variable";
//Next line will print : Where is the variable ? $variable;
echo 'Where is the variable ? $variable';
?>

Next, we use the echo function. There are many ways to display text in Php, echo is the most common. We do four lines of the echo statement to demonstrate how PHP can be integrated with Html. The first line prints the head and title information, the second line starts the body tag, the third line prints the text “Welcome in RZ::DESIGN”, and the fourth line closed the Html. Finally, we end the script, closing the Php tag.

» Conclusion
Now you understand what a sample Php page looks like, and how one works. You have learned about variables, the echo statement, and variable interpolation.

If you get confused, refer back to the manual (www.php.net).

Dodged smoke

Posted in Tutorials, Photoshop by Rz on the October 31st, 2005

This tutorial explain how to create realistic dodge blending smoke. It quite easy to create , so be aware of all the details it have. You may create your own thing to come up with something pretty different each time.

» 1st step

First of all, let create a 200×200 pixels window.
Be sure to have monochromatic colors. (F:White/B:Black).
Let select Filter > Render > Clouds.
(You may have the same or aproximative result at what i got here : )
It already make some smoke but we’re ain’t at our satisfaction. Lets call this layer (Basic smoke).

» 2nd step

Make a copy of basic smoke.
Put the mode to color dodge.
Name that layer dodged smoke.
Now you should have more light then the original one.
Hide the new layer.

» 3rd step

Now is the funniest part.
Click on the basic smoke layer to select it.
Let put up some distort on it. Filter > Distort > Waves
Play with the setting until you think it look raw!
Ok, it look cool isnt it ?
we are quite far from the end. Bring the brightness down a bit. Image > Adjust > Brightness/contrast about -30.
Select Dodged smoke layer, (we see him now thrue the background) and change his saturation (CTRL+U).
You can choose the color you want, but let the saturation to about 20-25.
If you are away from what i got here , please restart.

» 4th step

Always on a dodged smoke layer, make a wave distort on him, but make it different from the first layer, the basic smoke one.
Adjust the brightness/contrast again to make it real about B: -24 C: +4.
Well it should look like this , or near.
I hope you got some or more knowledge on blending. ;)

» Extra

You can play with the light with Filter > Render > Lighting effect to come up with a tasty piece.

  Next Page »