2007-07-03

SET cron job

Examples how to set cron:

If you have installed a cgi script in your cgi-bin directory called members.cgi and wanted to run this program each night as 11.30 PM as in above example.

You would setup the following crontab line:

30 23 * * * /home/username/www/cgi-bin/members.cgi

30--represents the minute of cron work
23--represents the hour of the day
The * represent every day, month, and weekday.

If you want to set the cron job every sunday at midnight 11.30 PM then it would be like:

30 23 * * 0 /home/username/www/cgi-bin/members.cgi
0--represents the Sunday.

If you want the cron job to run at 1:00 and 2:00 A.M then you can set it like:

* 1,2 * * * /home/username/www/cgi-bin/members.cgi

This runs your cron at 1 and 2 A.M every day, every month and every week.

If you want to run the above task only from Monday to Friday then set it like:

* 1,2 * * 1-5 /home/username/www/cgi-bin/members.cgi

Ubuntu : Set permission PROFTPD

Example :

$ sudo pico /etc/proftpd/proftpd.conf

<Limit LOGIN>
AllowUser userftp
AllowUser hacker
DenyAll
</Limit LOGIN>

<Directory /var/www>
Umask 022 022
AllowOverwrite on
<Limit DELE>
DenyAll
</Limit>
<Limit MKD>
AllowAll
</Limit>
</Directory>





Example : /etc/proftpd/proftpd.conf
# To really apply changes reload proftpd after modifications.
AllowOverwrite on
AuthAliasOnly on

# Choose here the user alias you want !!!!
UserAlias sauron userftp

ServerName "ChezFrodon"
ServerType standalone
DeferWelcome on

MultilineRFC2228 on
DefaultServer on
ShowSymlinks off

TimeoutNoTransfer 600
TimeoutStalled 100
TimeoutIdle 2200

DisplayFirstChdir .message
ListOptions "-l"

RequireValidShell off

TimeoutLogin 20

RootLogin off

# It's better for debug to create log files ;-)
ExtendedLog /var/log/ftp.log
TransferLog /var/log/xferlog
SystemLog /var/log/syslog.log

#DenyFilter \*.*/

# I don't choose to use /etc/ftpusers file (set inside the users you want to ban, not useful for me)
UseFtpUsers off

# Allow to restart a download
AllowStoreRestart on

# Port 21 is the standard FTP port, so you may prefer to use another port for security reasons (choose here the port you want)
Port 1980

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 8

# Set the user and group that the server normally runs at.
User nobody
Group nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022

PersistentPasswd off

MaxClients 8
MaxClientsPerHost 8
MaxClientsPerUser 8
MaxHostsPerUser 8

# Display a message after a successful login
AccessGrantMsg "welcome !!!"
# This message is displayed for each access good or not
ServerIdent on "you're at home"

# Set /home/FTP-shared directory as home directory
DefaultRoot /home/FTP-shared

# Lock all the users in home directory, ***** really important *****
DefaultRoot ~

MaxLoginAttempts 5

#VALID LOGINS
<Limit LOGIN>
AllowUser userftp
DenyALL
</Limit>

<Directory /home/FTP-shared>
Umask 022 022
AllowOverwrite off
<Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
DenyAll
</Limit>
</Directory>

<Directory /home/FTP-shared/download/*>
Umask 022 022
AllowOverwrite off
<Limit MKD STOR DELE XMKD RNEF RNTO RMD XRMD>
DenyAll
</Limit>
</Directory>

<Directory> /home/FTP-shared/upload/>
Umask 022 022
AllowOverwrite on
<Limit READ RMD DELE>
DenyAll
</Limit>

<Limit STOR CWD MKD>
AllowAll
</Limit>
</Directory>


Why CakePHP

Why CakePHP?

CakePHP has several features that make it a great choice as a framework for developing applications swiftly and with the least amount of hassle. Here are a few in no particular order:

  1. Active, friendly community

  2. Flexible Licensing

  3. Compatibility with PHP4 and PHP5

  4. Integrated CRUD for database interaction and simplified queries

  5. Application Scaffolding

  6. Model View Controller (MVC) Architecture

  7. Request dispatcher with good looking, custom URLs

  8. Built-in Validation

  9. Fast and flexible templating (PHP syntax, with helpers)

  10. View Helpers for AJAX, Javascript, HTML Forms and more

  11. Security, Session, and Request Handling Components

  12. Flexible access control lists

  13. Data Sanitization

  14. Flexible View Caching

  15. Works from any web site subdirectory, with little to no Apache configuration involved

SQL Insert Table to Table

Example:

INSERT INTO database_a.table_a VALUES SELECT * FROM database_b.table_a

MovieClip._width property

_width (MovieClip._width property)

public _width : Number

The width of the movie clip, in pixels.

Availability: ActionScript 1.0; Flash Lite 2.0 - as a read-only property.

Example
The following code example displays the height and width of a movie clip in the Output panel:

this.createEmptyMovieClip("triangle", this.getNextHighestDepth());

triangle.beginFill(0x0000FF, 100);
triangle.moveTo(100, 100);
triangle.lineTo(100, 150);
triangle.lineTo(150, 100);
triangle.lineTo(100, 100);

trace(triangle._name + " = " + triangle._width + " X " + triangle._height + " pixels");

MovieClip.onRollOver

MovieClip.onRollOver

Availability

Flash Player 6.

Usage

my_mc.onRollOver = function() {
// your statements here
}

Parameters
None.

Returns
Nothing.

Description
Event handler; invoked when the pointer moves over a movie clip area.

You must define a function that executes when the event handler is invoked. You can define the function on the Timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.

Example
The following example defines a function for the onRollOver method that sends a trace() to the Output panel:

my_mc.onRollOver = function () {
trace ("onRollOver called");
};