Tuesday, March 30, 2010

UFS : Out of inodes on metadevice(Solaris)

UFS : Out of inodes on metadevice(Solaris)

dmesg says "out of inodes"
root@server# dmesg
..
uid 0 on /: out of inodes
uid 0 on /: out of inodes
uid 0 on /: out of inodes
uid 0 on /: out of inodes
uid 0 on /: out of inodes
uid 0 on /: out of inodes
uid 0 on /: out of inodes
uid 0 on /: out of inodes


    inodes are used for file entries.  Each file/directory uses an inode.
When you run out of inodes, you can't create any more files, no matter
how much space you have left.


"df -i" will show inode usage.

root@server# fstyp /dev/dsk/c0t0s0
ufs
root@server# df -o i /
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t0s0 1258550 0 100% /



The only way to free up inodes is to delete some files/directories.
You must have a lot of files or directories somewhere to be using up
all your inodes when you have 50% of the disk left. Once you find
out where all the files are, you can delete some, or possible tar
them up so they only take up a single inode.

For more information: http://www.porcupine.org/forensics/forensic-discovery/chapter3.html

Thursday, March 25, 2010

Plink - PuTTY Link: command-line connection utility

PuTTY Link: command-line connection utility
Release 0.60
Usage: plink [options] [user@]host [command]
("host" can also be a PuTTY saved session name)
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw
force use of a particular protocol
-P port connect to specified port
-l user connect with specified username
-batch disable all interactive prompts
The following options only apply to SSH connections:
-pw passw login with specified password
-D [listen-IP:]listen-port
Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
Forward local port to remote address
-R [listen-IP:]listen-port:host:port
Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-m file read remote command(s) from file
-s remote command is an SSH subsystem (SSH-2 only)
-N don't start a shell/command (SSH-2 only)
-nc host:port
open tunnel in place of session (SSH-2 only)

Download: http://tartarus.org/~simon/putty-snapshots/x86/plink.exe
โค๊ด: http://tartarus.org/~simon/putty-sna


For example:
C:> plink.exe -ssh 102.34.112.17 -P 22 -l admin -pw password "/tmp/scriptfile.ksh"


Wednesday, March 24, 2010

Launching remote desktop from the command line in Windows XP Pro

The Windows XP remote desktop connection dialog box provides you with everything that you need to configure and connect to another computer running Windows XP Pro. You can use the Save As button on the Connection Settings panel to save all your connection settings as an RDP file. Then, you can launch and connect to a remote computer simply by double-clicking the RDP file.

You can also script a remote desktop connection, as Windows XP's remote desktop connection has an executable file that can accept command line parameters and be run from a batch file. The remote desktop connection executable file is MSTSC.EXE, and the following are some of the most common parameters:

  • /v:--specifies the name of the computer to connect to.
  • /f--starts the connection in a full screen.
  • /w:--specifies the width of the remote desktop screen.
  • /h:--specifies the height of the remote desktop screen.

For example, to remotely connect to a computer named Kaltec in a 640 x 480 remote desktop screen, you would use the following command:

mstsc /v: 10.4.45.99 /w:640 /h:480

You can type this command line in the Run dialog box, as well as use it in a batch file.

Note: This tip applies only to Windows XP Professional.