Tuesday, November 27, 2007

UNIX - uname : print name of current system

`uname` - Print certain system information. With no OPTION, same as -s.


Usage
uname [OPTION]


DESCRIPTION
The uname utility prints information about the current system on the standard output. When options are specified, symbols representing one or more system characteristics will be written to the standard output. If no options are specified, uname prints the current operating system's name. The options print selected information returned by uname(2), sysinfo(2), or both.

OPTION
-a, --all print all information, in the following order:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type
-i, --hardware-platform print the hardware platform
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit


EXAMPLE

[root@server root]# uname -a
Linux admincmd.blogspot.com 2.4.21-4.ELsmp #1 SMP Fri Nov 14 12:52:56 EDT 2002 i686 i686 i386 GNU/Linux


.

Friday, November 23, 2007

PHP The $_POST variable

`PHP $_POST`

The $_POST variable is used to collect values from a form with method="post".

The $_POST variable is used to collect values from a form with method="post". Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.

Example

HTML: test.html









When the user clicks the "Submit" button, the URL will not contain
any form data, and will look something like this:
 http://admincmd.blogspot.com/login.php

The "login.php" file can now use the $_POST variable to catch the form data (notice that the names of the form fields will automatically be the ID keys in the $_POST array):

PHP: login.php

< ?php
echo "Your name is ".$_POST["name"]
;

echo "Your password is ".$_POST["pass"];

?>

Why use $_POST?

  • Variables sent with HTTP POST are not shown in the URL
  • Variables have no length limit

However, because the variables are not displayed in the URL, it is not possible to bookmark the page.

Thursday, November 22, 2007

UNIX - df [disk space]

`df` - report filesystem disk space usage

USAGE
df [OPTION]... [FILE]...

The df command displays the amount of disk space occupied by mounted or unmounted file systems, the amount of used and available space, and how much of the file system's total
capacity has been used. The file system is specified by dev ice, or by referring to a file or directory on the specified file system.

Used without operands or options, df reports on all mounted file systems.

df may not be supported for all FSTypes.

If df is run on a networked mount point that the automounter has not yet mounted, the file system size will be reported as zero. As soon as the automounter mounts the file system,
the sizes will be reported correctly.

OPTIONS
Show information about the filesystem on which each FILE resides, or all filesystems by default.
Mandatory arguments to long options are mandatory for short options too.

-a, --all
include filesystems having 0 blocks

-B, --block-size=SIZE use SIZE-byte blocks

-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)

-H, --si
likewise, but use powers of 1000 not 1024

-i, --inodes
list inode information instead of block usage

-k like --block-size=1K

-l, --local
limit listing to local filesystems

--no-sync
do not invoke sync before getting usage info (default)

-P, --portability
use the POSIX output format

--sync invoke sync before getting usage info

-t, --type=TYPE
limit listing to filesystems of type TYPE

-T, --print-type
print filesystem type

-x, --exclude-type=TYPE
limit listing to filesystems not of type TYPE

-v (ignored)

--help display this help and exit

--version
output version information and exit

EXAMPLE

banner

`banner` - make posters

DESCRIPTION
banner prints its arguments (each up to 10 characters long) in large letters on the standard output.

EXAMPLE
root@server # banner test








root@server #