Monday, May 23, 2011

Linux / Unix tar command

tar command use for Create tape archives and add or extract files.

tar Command Options
-c: Create a tar file
-t: List the contents of a tar file
-x: Extract or restore a tar file
-v: Verbose (display the actions tar is taking)

Create a new tar file:
% tar ctvf outputfile.tar inputfile(s)

-f: filename

Examples for backup FoxBase+:
% tar ctvf foxbase.tar /usr/lib/foxplus /usr/bin/fox*

To extract files:
% tar xvf filename.tar

To extract files to different folder:
% tar -xzvf <filelname> /home/bob

Write tar file on a backup tape:
% tar cvf filename.tar /dev/rct0

Saturday, May 21, 2011

Linux Copy One Hard Disk to Another Using dd Command

Hard Disk Clone

dd command can copy disk in raw format. It will copy partition table and bootloader and all partitions within this disk. For example, you can copy /dev/sda to /dev/sdb (same size) using the following dd command. dd should complete with no errors, but output the number of records read and written.

Login as the root user (use sudo or su command)

dd if=/dev/sda of=/dev/sdb

if=/dev/sda : Input disk (source)
of=/dev/sdb : Output disk (destination)

Making a Hard Disk Image File
dd if=/dev/sda of=~/disk1.img

Partition Clone
dd if=/dev/sda1 of=~/disk2.img

Restoring from an Image File
dd if=disk1.img of=/dev/sda

SCO Commands

----------------------------------------------------------------------------

hwconfig -h  Displays the hardware configuration
swconfig  Displays the system contents database

hw   (5.0.4 and above) Display detailed hardware config.

fixmog -i Checks all system files against file control database

isverify -I Rebuild ISAM database after system restore, need when
  the following message is displayed :-
  "Error: Incorrect SCO Runtime System installed@

/etc/conf/cf.d/configure Tune kernel parameters
/etc/conf/cf.d/link_unix Relinks the kernel

asktime  Used to set the time and date.

/usr/adm/ISL/iqm_file Contains serial number and activation key.

od (filename)  Octal dump of a file
hd (filename)  Hexadecimal dump of a file

custom  Menu for installing software
scoadmin Administration menu (OSR5)
sysadmsh Administration menu (3.2.4.2)

scologin disable Disables graphical SCO login at startup (X)
scologin enables Enables graphical SCO login at startup (X)

--------------------------------------------------------------------------------
    TERMINALS
--------------------------------------------------------------------------------

ttylock (tty)  Locks a named terminal
ttyunlock (tty)  Unlocks a locked terminal

enable (tty)  Turns on terminals
disable (tty)  Turns off terminals

To setup a serial console, add SYSTTY=x into /etc/default/boot.
(Where x is 0 is display adapter and 1 is comm 1 etc)

--------------------------------------------------------------------------------
    NETWORK
--------------------------------------------------------------------------------

hostname  Displays hostname
hostname (hostname) Sets the hostname until next reboot

tcp start Starts TCP services
tcp stop Stops TCP services

nfs start Starts NFS services
nfs stop Stops NFS services

netconfig Menu for setting up network adapters

--------------------------------------------------------------------------------
    BACKUPS
--------------------------------------------------------------------------------

CPIO ARCHIVE
------------

find (filesystem) -print | cpio -ocv > (filename or device)

eg find ./usr/ -print | cpio -ocv > /dev/rStp0

CPIO RESTORE
------------

cpio -ict < (filename or device) | more  Lists archive
cpio -icdv < (filename or device)
cpio -icdv < (filename or device) ("files or directories to restore")

eg cpio -icdv < /dev/rStp0 "tcpip/*"     Restore directory and contents
   cpio -icdv < /dev/rStp0 "*resolve.conf" Restore a named file

TAR ARCHIVE
-----------

tar -cvf (filename or device) ("files or directories to archive")

eg tar -cvf /dev/rStp0 "/usr/*"

TAR RESTORE
-----------

tar -tvf (filename or device)    Lists archive

tar -xvf (filename or device)   Restore all
tar -xvf (filename or device) ("files or directories to restore")
use -p option for restoring with orginal permissions

eg tar -xvf /dev/rStp0 "tcpip"   Restore directory and contents
   tar -xvf /dev/rStp0 "tcpip/resolve.conf" Restore a named file


--------------------------------------------------------------------------------
    TAPE DRIVES
--------------------------------------------------------------------------------

/dev/xct0 Cartridge tape controller
/dev/erct0 Error correcting cartridge tape
/dev/nrct0 No rewind cartridge tape
/dev/rct0 Cartridge tape
/dev/rStp0 SCSI tape
/dev/rctmini Mini catridge tape
/dev/rft0 QIC40 floppy tape

Cartridge   rct0 nrct0 xct0
SCSI cartridge or DAT rStp0 nrStp0 xStp0
Mini cartridge  rctmini nrctmini xctmini

/dev/r  Rewinds on closing
/dev/nr  No rewind on closing
/dev/x  Control file used by the tape command, cannot be used for data

tape reten (device) Retension the tape
tape rewind (device) Rewind the tape
tape erase (device) Erase the tape
tape status (device) Is there a tape in the drive ?
tape unload (device) Eject a tape
tape getblk (device) Reads and reports the block size of the tape

tape -a (new block size) setblk (device) Sets the block size

If no device used the will use default in tape  /etc/defaults/tape

dtype (device) Reports what type of data is on the devices (cpio, tar etc)

--------------------------------------------------------------------------------
    PRINT QUEUES
--------------------------------------------------------------------------------

lpstat -t
lpstat -a  Will display "text message" 

reject (pqueue)  Stops requests being placed in the queue
accept (pqueue)  Enables requests to be placed in the queue

reject -r "text message" (pqueue)

disable (pqueue) Halts the queue, request will still be accepted
enable (pqueue)  Enables the queue afte being halted

disable -r "text message" (pqueue)

/usr/lib/lpshut  Stop the print sheduler
/usr/lib/lpsched Start the print sceduler

cancel (job id)  Cancel a job that is queuing

lp -i (job id) -H hold  Hold a job
lp -i (job id) -H resume Cancel the hold on a job
lp -i (job id) -H immediate Promote a job within a queue
lp -i (job id) -d(pqueue) Move a job between queues

$LPDEST  Default queue variable

/etc/printcap  Config file for print queues
/usr/spool/lp  Contains local printers
/usr/spool/lpd  Contains remote printers

--------------------------------------------------------------------------------
    HARD DRIVES
--------------------------------------------------------------------------------

dkinit   Displays non scsi disk details

scsibadblk Scans for bad tracks on disk
badtrk  As as scsibadblk

fdisk   Divides a hard disk into partitions
fdisk -p  Displays partion information
fdisk -p -f (device) Displays partion information for named device
fdisk -p -f /dev/rhd00

--------------------------------------------------------------------------------
    FILE SYSTEMS
--------------------------------------------------------------------------------

HTFS High Throughput filesystem
 2 gig max file size
 1 tera max file system size
 1k block size
 Not bootable

DTFS Desktop filesystem
 2 gig max file size
 1 tera max file system size
 512 byte to 4k block size
 Not bootable

EAFS Extended Acerfile file system
 2 gig max file size
 2 gig max file system size
 1k block size
 Bootable and default

AFS, S51K, XENIX <- Other bootable filesystems

divvy   Divides disk partions into divisions for filesystems
divvy -N -P  Displays division information
divvy -N -P (device) Displays division information for 2nd disk drive
divvy -N -P /dev/hd1a

fstyp (device eg /dev/root) Displays filesystem type

/dev/root Boot filesystem (/stand)
/dev/recover
/dev/root Root filesystem (/)
/dev/swap Swap space

fsck (device) Verify a file system, the file system must be unmounted,
  except the /dev/root filesystem, you must be in single user
  mode (init 1) or have booted from boot/root.

fsck -o full (device) Forces a full fsck.
fsck -y (device) Pre-answer questions either yes or no !
fsck -bs (device) Will recreate superblock

mkdev fs  Screen for Creating and deleting filesystems

mount               Lists all the mounted filesystems
mount (fs or device)    Mounts a named filesystem
mountall   Mounts all filesystems

fuser -u (/mount point) Lists who is using the filesystem

--------------------------------------------------------------------------------
    SWAP SPACE
--------------------------------------------------------------------------------

swap -l  Lists swap space and useage.

--------------------------------------------------------------------------------
    BOOTING
--------------------------------------------------------------------------------

kernel  Will display path and name of the kernel used to boot system

mount /dev/hd0root /mnt  Mounts root filesystem over /mnt when you 
    have booting from boot/root floppies.

mount /dev/boot /mnt/stand Mounts boot filesystem.

Boot: hd(40)unix Boot floppy, load kernel from hard drive.
   Used when /boot not found error

Boot: fd(64)unix root=hd(40) swap=hd(41) Unix from floppy, mount root
      filesystems on hard disk.

Boot: unix.old  Load the previous version of the kernel
   (Must be in /stand {/dev/boot} directory)

Boot: dir  Displays whats in /stand (/dev/boot)

Boot: bootos ?  Lists partitions
Boot: bootos 4  Boot from a non-active partition

Boot: defbootstr btld=fd(61) link=alad325 Sdsk=alad(0,0,0,0)

 btld Boot time loadable driver can be found at fd(61) b: drive,
      defaults to fd(60) a: if not present.
 link Uses driver alad325 from device specified in btld, driver
      disks are unix filesystem disks.
 Sdsk Device to use the boot time loadable driver with :-
  alad is for the controller, 
     0 is host adapter
     0 is bus on the adapter
     0 is drive scsi id
     0 is LUN

--------------------------------------------------------------------------------
    SCHEDULING
--------------------------------------------------------------------------------

crontab -l   List out crontab entrys
crontab -e   Edit crontab entrys
crontab -l > (filename)  Output crontab entrys to a file
crontab (filename)  Enter a crontab from a file
crontab -r   Removes all crontab entrys
crontab -v   Displays crontab submission time.

/usr/lib/cron/cron.allow        File containing users allowed crontab use.
/usr/lib/cron/cron.deny         File containing users denied crontab use.
/usr/spool/cron/crontabs Directory containing users crontabs

at (now + 2 minutes, 13:05, etc) {return} Schedule a job using at
Command or schell script {return}
{CTRL D}

at -l    

at -r (at job No)

/usr/lib/cron/at.allow  File containing users allowed at use.
/usr/lib/cron/at.deny  File containing users denied at use.
/usr/spool/cron/atjobs  Directory contains users at jobs

--------------------------------------------------------------------------------
    SECURITY
--------------------------------------------------------------------------------

chmod abcd (filename) Changes files/directory permissions

Where a is  (4 SUID) + (2 SGID)  + (1 SVTX)
      b is  (4 read) + (2 write) + (1 execute)  permissions for owner
      c is  (4 read) + (2 write) + (1 execute)  permissions for group
      d is  (4 read) + (2 write) + (1 execute)  permissions for others


 -rwxrwxrwx   -rwxrwxrwx   -rwxrwxrwx
  |||             |||             |||
   -               -               -
   |               |               |
 Owner           Group           Others

 -rwSrwxrwx = SUID   -rwxrwSrwx = SGID   drwxrwxrwt = SVTX


chown (new owner) (filename) Changes file/directory owners
chgrp (new group) (filename) Changes file/directory groups

umask    Displays umask settings
umask abc   Changes users umask settings

where ( 7 - a = new file read permissions)
      ( 7 - b = new file write permissions) 
      ( 7 - c = new file execute permissions)

eg umask 022 = new file permissions of 755 = read write and execute for owner   
                                             read ----- and execute for group
                                             read ----- and execute for other

passwd   Change current user password
passwd -l (user) Lock a users account
passwd -u (user) Unlock a users account

goodpw  Test to see if a passwd is acceptable.

pwck  Checks /etc/passwd file for inconsistencies
grpck  Checks /etc/group file for inconsistencies

--------------------------------------------------------------------------------
    USERS
--------------------------------------------------------------------------------

env  Displays values of environment variables

id   Displays current user's uid and gid details
id (user) Displays user uid and gid details

who  Displays details of all users currently logged in.
w

quot (filesystem) Displays disk useage by user

useradd

userdel   (Note does not remove home dir)
rmuser

userls -l (username)

usermod

groupls   Lists what groups you are in.
groupls (username)
groupls -a  Lists all groups

groupmod

groupadd

groupdel
rmgroup

passwd (username)
rmpasswd

unretire (username) To reactivate a retired user

--------------------------------------------------------------------------------
   INIT RUN LEVELS
--------------------------------------------------------------------------------

init (run level)   Switches run levels

0 Shutdown
1 Single user
2,3,4 Multiuser
6 Reboot


haltsys  
reboot

shutdown -g(number) grace period before starting shutdown
         -y  answer y to all further questions
         -i(number) shutdown to run level

shutdown -y -g0 -i1 To shutdown to single user mode
shutdown -y -g0 -i6 To shutdown and reboot system.

who -b  Displays when the machine was last booted
who -r  Displays what the current run level is


--------------------------------------------------------------------------------
                             SERIAL PORTS
--------------------------------------------------------------------------------

com1 = /dev/tty1a (terminal/getty) or /dev/tty1A (dial out modem)
com2 = /dev/tty2a (terminal/getty) or /dev/tty2A (dial out modem)

enable /dev/tty1a Enables the getty on /dev/tty1a
disable /dev/tty1a Disables the getty on /dev/tty1a
(above edits both /etc/inittab and /etc/conf/init.d/sio files)

/etc/inittab
/etc/gettydefs

/etc/conf/init.d/sio Contains the defaults for the serial part of inittab.
   Will recreate inittab from this when the environment
   is rebuilt using link_unix.

--------------------------------------------------------------------------------
                             ERROR LOGGING
--------------------------------------------------------------------------------

/usr/adm/messages


--------------------------------------------------------------------------------
                        PERFORMANCE
--------------------------------------------------------------------------------

sar (delay) (repeats)

options :-

-r Displays amount of free memory and free swap
-d Displays disk and tape activity
-b Displays buffer activity
-u Displays cpu useage

swap -l  Displays swap details and useage

/etc/conf/cf.d/configure -x Displays kernel parameters
sysdef

--------------------------------------------------------------------------------
                        FLOPPY DRIVES
--------------------------------------------------------------------------------

 48ds9  360Kb  5.25 inch
 96ds15  1.2Mb  5.25 inch
135ds9  720Kb  3.5 inch
135ds18  1.44Mb  3.5 inch
135ds36  2.88Mb  3.5 inch
 | | |
 | | +------ sectors per track
 | +-------- ds = double sided
 +---------- tracks per inch

/dev/rfd0135ds18 = floppy disk 0 3.5" 1.44Mb

format  Formats disk for use.

mkdev fs Screen for creating root/boot disks or floppy filesystems

diskcp  Disk to disk copy
diskcp -f Disk to disk copy with format first.

--------------------------------------------------------------------------------
                        DOS DISKETTES
--------------------------------------------------------------------------------

doscp
dosrm

dosdir  List dos directories in dos dir style
dosdir /dev/fd0 or dosdir a:

dosls  List dos directories in unix ls style

dosformat Format a dos floppy

dosmkdir Create a dos directory
dosrmdir Remove a dos directory

doscat

dtox (in file) > (out file) Dos to unix ascii file conversion
xtod (in file) > (out file) Unix to dos ascii file conversion

Thursday, May 5, 2011

Delete Archived Logs - Oracle

If you have not enough space in your disk and make sure you have recent backup of your database and archive log is not needed then you can use.


Delete more than 2 days old log files:

RMAN TARGET /
DELETE ARCHIVELOG UNTIL TIME 'SYSDATE-2';
Delete all log files:

RMAN TARGET /
STARTUP MOUNT;
DELETE ARCHIVELOG ALL;
ALTER DATABASE OPEN;

Wednesday, May 4, 2011

RMAN-06059: expected archived log not found

This can happen for a variety of reasons; the file has been manually moved or deleted, the archive log destination has recently been changed, the file has been compressed, etc.

Starting backup
current log archived
released channel: DISK01
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 14:24:55
RMAN-06059: expected archived log not found, lost of archived log
compromises recoverability
ORA-19625: error identifying file /u01/app/oracle/flash_recovery_area/TESTDB/2011_05_03/o1_mf_1_26vz057td.arc
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3 


Your options are either to restore the missing file(s), or to perform a crosscheck. To perform a crosscheck, run the following command from within RMAN:
change archivelog all crosscheck;
It is advisable to perform a full backup of the database at this point.

When an archive log crosscheck is performed, RMAN checks each archive log in turn to make sure that it exists on disk (or tape). Those that are missing are marked as unavailable. If you have got missing logs, this won't bring them back. It will allow you to get past this error and back-up the database though.

Monday, May 2, 2011

Mount NTFS file system on Oracle Linux 5

1. Install following yum repository 

# Linux 5 / i386:
rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm

# Linux 5 / x86_64:
rpm -Uvh http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

2. Update yum repository
yum update

3. Install fuse

# Linux 5 / i386:
yum install fuse-2.7.4-8.cl5.i386.rpm

# Linux 5 / x86_64:
 yum install fuse-2.7.4-8.cl5.x86_64.rpm

4. Install ntfs-3g
yum install ntfs-3g

5. Mount your disk
mount -t ntfs-3g /dev/hdb1 /mnt/disk1

Thursday, April 28, 2011

Delete no of day's old file in your backup folder - Windows

This is simple vb script to delete no of day's old files on your windows computer.You can automate this script with windows Task Manager. 

Open notepad and paste following script.

Dim Fso
Dim Directory
Dim Modified
Dim Files
Set Fso = CreateObject(”Scripting.FileSystemObject”)
Set Directory = Fso.GetFolder(”D:\test”)
Set Files = Directory.Files
For Each Modified in Files
If DateDiff(”D”, Modified.DateLastModified, Now) > 7 Then Modified.Delete
Next

D:\test is my test directory. You can change it as your need. 7 is days which you want to delete how many days old files. Save this file as <filename>.vbs.

Get Network Status on Windows

You can use the windows in-built command to check which all computers are connected to your computer through their domain names or ip addresses.

The command is NetStat Stands for Network Status.

Syntax & Available options :

Code:

netstat [-a] [-e] [-n] [-s] [-p protocol] [-r] [interval]

Meaning of each option :

-a Displays all connections and listening ports. Server connections are normally not shown.

-e Displays Ethernet statistics. This may be combined with the -s option.

-n Displays addresses and port numbers in numerical form (rather than attempting name look-ups).

-s Displays per-protocol statistics. By default, statistics are shown for TCP, UDP, ICMP, and IP. The -p option can be used to specify a subset of the default.

-p protocol Shows connections for the protocol specified by protocol; protocol can be tcp or udp. If used with the -s option to display per-protocol statistics, protocol can be tcp, udp, icmp, or ip.

-r Displays the contents of the routing table.

interval Redisplays selected statistics, pausing interval seconds between each display.

Press CTRL+B to stop redisplaying statistics. If this parameter is omitted, netstat prints the current configuration information only once.

Mount ISO Image under Linux

Create the directory where your ISO is going to be mounted:
mkdir /media/ISO

Mount your ISO file:
mount -t iso9660 -o loop image.iso /media/ISO

Mount a Windows share on Linux with Samba

This article describes how to set up a share from a Linux to a Windows. Samba has to be installed.
 
To test if your Linux machine sees the shares on the Windows : 
smbclient -L <windows-box> -U <username> 
 
Make a directoy for the mountpoint: 
mkdir /mnt/<name-of-mount-point> 
 
Mount the share: 
mount -t smbfs -o username=<username>,password=<password> //<win-box>/<share> /mnt/<name-of-mountpoint> Note: The syntax -username=<username>,password=<password> saves the password. 
  
Create a symbolic link to the mounted drive: ln -s /mnt/<name-of-mount-point> /<path-of-symlink>

Samba With Recycle Bin

I'm working under Linux and Windows network long time. Usually we are sharing document with each others with Samba or Windows File Sharing. But the problem is, after delete file on shared document, that file will be deleted permanently. There is no way to restore accidentally deleted files. We have to use recover tools to recover deleted files. But problem is, recover option is not familiar with normal computer users.  If you are using Windows, there are many 3rd party tools that can help you recover your files easily. But if you are using Linux, then it can be quite a huge problem. Following configuration will useful under Linux.
First you need to create the /etc/samba/recycle.conf file.  Login as root.vi /etc/samba/recycle.conf
 
Then edit  recycle.conf file as follow.
##Recycle Bin Configuration File##
name = Recycle Bin
mode = KEEP_DIRECTORIES|VERSIONS|TOUCH
maxsize = 0
exclude = *.tmp|*.temp|*.o|*.obj|~$*|*.~??|*.log|*.trace
excludedir = /tmp|/temp|/cache
noversions = *.doc|*.ppt|*.dat|*.ini

and then edit your /etc/samba/samb.conf file...
sudo vi /etc/samba/smb.conf
 
add the following lines to the each share folder which you'd like the recycle bin to live.
 
vfs object = recycle
config-file = /etc/samba/recycle.conf
recycle:repository = Recycle Bin
recycle:keeptree = Yes
recycle:versions = Yes
 
then restart your samba daemons and the recycle bin should show up after a few momnents (but most likely after you delete your first file).
/etc/init.d/samba restart

Recover Deleted File in Debian

Package : Foremost
Latest Version : foremost-1.5.7
Home Page : http://foremost.sourceforge.net/

Foremost is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving. Foremost can work on image files, such as those generated by dd, Safeback, Encase, etc, or directly on a drive. The headers and footers can be specified by a configuration file or you can use command line switches to specify built-in file types. These built-in types look at the data structures of a given file format allowing for a more reliable and faster recovery. .

Installation:
Download deb package from http://ftp.us.debian.org/debian/pool/main/f/foremost/foremost_1.5.7-1_i386.deb

wget http://ftp.us.debian.org/debian/pool/main/f/foremost/foremost_1.5.7-1_i386.deb

If there is not wget installed on your Debian computer, first install it.
apt-get install wget

Install debian package
dpkg -i foremost_1.5.7-1_i386.deb

Currently foremost can recover the following file types:
  • jpg – Support for the JFIF and Exif formats including implementations used in modern digital cameras.
  • gif
  • png
  • bmp – Support for windows bmp format.
  • avi
  • exe – Support for Windows PE binaries, will extract DLL and EXE files along with their compile times.
  • mpg – Support for most MPEG files (must begin with 0x000001BA)
  • wav
  • riff – This will extract AVI and RIFF since they use the same file format (RIFF). note faster than running each separately.
  • wmv – Note may also extract -wma files as they have similar format.
  • mov
  • pdf
  • ole – This will grab any file using the OLE file structure. This includes PowerPoint, Word, Excel, Access, and StarWriter
  • doc – Note it is more efficient to run OLE as you get more bang for your buck. If you wish to ignore all other ole files then use this.
  • zip – Note is will extract .jar files as well because they use a similar format. Open Office docs are just zipâd XML files so they are extracted
    as well. These include SXW, SXC, SXI, and SX? for undetermined OpenOffice files.
  • rar
  • htm
  • cpp – C source code detection, note this is primitive and may generate documents other than C code.
.
For add or remove more file types, you can edit /etc/foremost.conf

Foremost Syntax
foremost  [-h][-V][-d][-vqwQT][-b][-o] [-t][-s][-i]
Available Options
-h Show a help screen and exit.
-V Show copyright information and exit.
-d Turn on indirect block detection, this works well for Unix file systems.
-T Time stamp the output directory so you don’t have to delete the output dir when running multiple times.
-v Enables verbose mode. This causes more information regarding the current state of the program to be dis-played on the screen, and is highly recommended.
-q Enables quick mode. In quick mode, only the start of each sector is searched for matching headers. That is,the header is searched only up to the length of the longest header. The rest of the sector, usually about 500 bytes, is ignored. This mode makes foremost run con- siderably faster, but it may cause you to miss files that are embedded in other files. For example, using quick mode you will not be able to find JPEG images embedded in Microsoft Word documents.
Quick mode should not be used when examining NTFS file systems. Because NTFS will store small files inside the Master File Table, these files will be missed during quick mode.
-Q Enables Quiet mode. Most error messages will be sup-pressed.
-w Enables write audit only mode. No files will be extracted.
-a Enables write all headers, perform no error detection in terms of corrupted files.
-b number Allows you to specify the block size used in foremost. This is relevant for file naming and quick searches. The default is 512.
foremost -b 1024 /dev/hda1
-k number Allows you to specify the chunk size used in foremost.This can improve speed if you have enough RAM to fit the image in. It reduces the checking that occurs between chunks of the buffer. For example if you had > 500MB of RAM.
foremost -k 500 /dev/hda1
-i file The file is used as the input file. If no input file is specified or the input file cannot be read then stdin is used.
-o directory Recovered files are written to the directory directory.
-c file Sets the configuration file to use. If none is speci-fied, the file “foremost.conf” from the current directory is used, if that doesn’t exist then “/etc/fore-most.conf” is used. The format for the configuration file is described in the default configuration file included with this program.
-s number Skips number blocks in the input file before beginning the search for headers.
foremost -s 512 -t jpeg -i /dev/hda1

Examples:
Search for jpeg format skipping the first 100 blocks
foremost -s 100 -t jpg -i /dev/hda1
  
Only generate an audit file, and print to the screen (verbose mode)
foremost -av /dev/hda1 
 
Search all defined types
foremost -t all -i /dev/hda1 
 
Search for gif and pdf
foremost -t gif,pdf -i /dev/hda1 
Search for office documents and jpeg files in a Unix file sys-tem in verbose mode.
foremost -v -t ole,jpeg -i /dev/hda1 
Run the default case
foremost /dev/hda1
 
* /dev/hda1 is your hard disk mount point 
** I'm no guarantee that foremost will succeed in recovering your files, but at least there’s a chance. 

Wednesday, April 27, 2011

SQL Developer -3.0.04.34 Timezone Error connecting to Oracle 10g Database

Open the sqldeveloper.conf file in your oracle home sql developer directory:
<Drive>:\<ORACLE_HOME>\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf

and add the line

Add VMOption -Duser.timezone=<TIME ZONE>


Ex: AddVMOption -Duser.timezone=EST

Save file, close Sql Developre and reopen.

If you got this message on Oracle JDeveloper

Find jdev.conf file on jdeveloper\jdev\bin\
Add above line to end of file and save.

Restart your JDeveloper application.