Friday, June 24, 2011

How to mount ntfs in ubuntu

http://www.arsgeek.com/2006/09/25/ubuntu-tricks-how-to-mount-your-windows-partition-and-make-it-readwritable/

Thursday, June 9, 2011

windows 2008 help

Configure network from command prompt
netsh interface ip show config
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1 
netsh interface ip set dns "Local Area Connection" static 192.168.0.200



Enable icmp through windows 2008 firewall command prompt
netsh firewall set icmpsetting type=ALL mode=enable


Wednesday, June 1, 2011

vnc Real desktop:0 session for Solaris 10

x11vnc real section for solaris 10 x86 and sparc

1. Download the x11vnc
http://www.softpanorama.org/Xwindows/VNC/vnc_on_solaris.shtml

or
From folder x11vnc : google docs
2. gzip -d package.gz
3. pkgadd -d package

After installation start the x11vnc on display 0

 /usr/local/bin/x11vnc -display :0
For more option of x11vnc , please see /usr/local/bin/x11vnc --help
The installed docs can be found at : 
ls /usr/local/doc/x11vnc/
AUTHORS    COPYING    ChangeLog  INSTALL    NEWS       README     TODO


run vnc client  , vncviewer hostname:0




Also more details are here

http://www.softpanorama.org/Xwindows/VNC/vnc_on_solaris.shtml


The below changes may be useful if there is any library issues


# cd /usr/sfw/lib
 # ln -s libcrypto.so.0.9.8 libcrypto.so.0.9.7
 # ln -s libcrypto_extra.so.0.9.8 libcrypto_extra.so.0.9.7
 # ln -s libssl.so.0.9.8 libssl.so.0.9.7

Tuesday, May 17, 2011

Helpful system Administration commands and websites


1 . Installing pkg-get for Solaris , Provided your machine has internet connectivity

 pkgadd -d http://mirror.opencsw.org/opencsw/pkg_get.pkg




2 . Collect coredump on x86/64 Solaris systems

Setup

  1. Take the appropriate steps to ensure the dump device is set up properly, and
    that savecore is enabled. See the dumpadm(1M) manual page for details.

  2. Boot the system with kadb.
    From a command line, type: #eeprom boot-file=kadb and reboot,
    or, at the initial boot prompt, when it says "Select (B)oot or
    (I)nterpreter:" enter "b kadb -d" and press return.

Please Note: if Solaris X86 01/06 (newboot) is used simply add "kadb" to the end of the initrd line.

root (hd0,0,a)
kernel /platform/i86pc/multiboot kadb
module /platform/i86pc/boot_archive

  1. The next time the system hangs, send a break, which if it works, will drop
    to the kadb/kmdb prompt:

Drop to kadb, generate a core file

From a directly attached keyboard or serial port connection, type:

  F1-A - press the "F1" and "A" keys, simultaneously. 

The control-alt-d key sequence also works.

If using a Sun AMD Opteron[TM] based platform.

On X4200/X4100 Servers, once connected to the SP console (start /SP/console from ILOM prompt), and then press Esc followed by shift+b to send break.

On V65x Servers, send a break to the console, and then press the key corresponding to the sysrq-command to send.

On V20z and V40z, once connected via the platform console, press ^Ecl0 to send the break. That is, press CONTROL-E, then the letter 'c', then the letter 'l', then the number '0'.

On Blades (B100x, B200x) to send a break from the SC console, type break s'N'
were 'N' is the slot number followed by 'y' (yes) when prompted.

NOTE: If using the Serial-over-LAN functionality for the Sun AMD Opteron
platform, use the alternate break sequence explained in infodoc 82530.

Once at the kadb prompt,
type $
followed by the "less-than" key
followed by systemdump

This will generate a core file, which can be retrieved from:

 /var/crash/'uname -n' (or wherever the local system stores core files)  

 

3 . Sort commands

sort -t. -nk1,1 -k2,2 -k3,3 -k4,4

 ypcat hosts | grep 10.12.153 |  awk '{ print $1 }'  | sort -t. -nk1,1 -k2,2 -k3,3 -k4,4 | more




4 . Find command examples

  • -mtime -60 means less than 60 days.
  • -mtime 60 If you skip + or - it means exactly 60 days.

So to find text files that were last modified 60 days ago, use
$ find /home/you -iname "*.txt" -mtime -60 -print

Display content of file on screen that were last modified 60 days ago, use
$ find /home/you -iname "*.txt" -mtime -60 -exec cat {} \;

Count total number of files using wc command
$ find /home/you -iname "*.txt" -mtime -60 | wc -l

You can also use access time to find out pdf files. Following command will print the list of all pdf file that were accessed in last 60 days:
$ find /home/you -iname "*.pdf" -atime -60 -type -f

List all mp3s that were accessed exactly 10 days ago:
$ find /home/you -iname "*.mp3" -atime 10 -type -f

There is also an option called -daystart. It measure times from the beginning of today rather than from 24 hours ago. So, to list the all mp3s in your home directory that were accessed yesterday, type the command
$ find /home/you -iname "*.mp3" -daystart -type f -mtime 1

Where,

  • -type f - Only search for files and not directories



5 . Cloning vmware virtual systems

http://www.dedoimedo.com/computers/vmware-esxi-clone-machine.html



6 . Disk usage commands

 df -lh | grep -v net | awk '{ print $6,$5 }'



7 . Setting timezone - HP-UX

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1233303304989+28353475&threadId=1008029


8 . Windows rsh and shutdown

 rsh sunone142 tsshutdn.exe 60 /reboot -v

TO work this ..

1. install and start terminal services . on all windows systems
2. Install rsh from  http://sourceforge.net/projects/rshd/

WINDOWS RSHD INSTALL     --------------------           1) In DOS, Run:                   rshd1.8-Setup.exe              ..and follow the onscreen gui instructions, using all defaults.           2) To enable rshd:                   cd "\program files\rshd\bin"                  rshd -install -r                  net start rshd

To check the version of windows : rsh sunone142 ver

An Example :

 rsh sunone142 tsshutdn.exe 5 /reboot -v
Sending message to Session Console.
Notifying Users, Type ^C to Cancel Shutdown.
System shutdown in progress ... Logging off all users ...
Sending message to Session Console.
Notifying Users, Type ^C to Cancel Shutdown.

Shutdown is complete.
The system will now reboot.


Configuring NIS client - IBM AIX
http://www.unix.com/aix/32194-aix-nis-client.html



Increasing root file system
 http://unix.ittoolbox.com/groups/technical-functional/ibm-aix-l/increasing-file-system-in-aix-1492756


uptime for windows
http://support.microsoft.com/kb/q232243/


How to find network interface in Solaris 10

kstat -c net | grep net

Just in case, ifconfig -a did not give the interface I want.



Mounting pen drive on Solaris sunray

Just plug the usb to the Sunray to access the device .
You will be able to see the disks under :  
cd /tmp/SUNWut/mnt  
     Unmounting/disconnecting USB devices:      To remove the device, first run the following command to prepare the  device for removal:
% /opt/SUNWut/bin/utdiskadm -r disk1 disk1 is ready for unplugging  

     Enable Administrator account : Windows Vista

Follow following steps to Enable Administrator Account in Vista home machines.
1. Turn off /Un-check  UAC(User Account Control from Control Panel > User accounts > Turn User Account Control On or Off.
2. Reboot the System
3. Go to Command Prompt and execute following
   - Activate administrator:
   C:\> net user Administrator / Active:Yes
   - Give New Password for Administrator
   C:\> net  user Administrator  < "new  password">
4. Logoff and logon as administrator


Change windows IP address from command line
netsh interface ip set address "Local Area Connection" static ipaddr subnetmask gateway metric

NOTE: Replace ipaddr with the static IP address, subnetmask with the subnet mask, gateway with the default gateway and, if necessary, metric with the appropriate metric. The following example changes the interface "Local Area Connection" to a static address of 192.168.0.10 with a subnet mask of 255.255.255.0, and the interface has a default gateway of 192.168.0.1 with a metric of 1:


Example : netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1


Wiki : Solaris zones
http://www.solarisinternals.com/wiki/index.php/Zones

Raid disk space calculator
http://www.ibeast.com/content/tools/RaidCalc/RaidCalc.asp

Mounting usb devices under Solaris
http://www.softpanorama.org/Solaris/Disks_and_filesystems/mounting_cdrom_on_solaris.shtml

IPV6 on Linux
http://tldp.org/HOWTO/Linux+IPv6-HOWTO/systemcheck-kernel.html

HP-UX help
http://users.cis.fiu.edu/~tho01/psg/hpux.html


How To Enable Samba And SWAT In Solaris 10

1. Solaris 10 comes with built-in versions of Samba and SWAT. This short guide will show you how to enable them.

2. Create a file called smb.conf in /etc/sfw/. Add these lines to the file:

    # Global parameters
    [global]
    workgroup = WORKGROUP
    server string =

3. Open /etc/services in a text editor. Below the line that says "ldaps     636/udp", add this line:

    swat           901/tcp                      # Samba swat

4. Open /etc/inetd.conf in a text editor. At the very bottom, add these lines:

    netbios-ssn stream tcp nowait root /usr/sfw/sbin/smbd smbd
    netbios-ns dgram udp wait root /usr/sfw/sbin/nmbd nmbd
    swat stream tcp nowait root /usr/sfw/sbin/swat swat

5. Open a terminal and run "inetconv". (This command "activates" the lines that we added to inetd.conf.)

6. Restart the computer.

7. Samba and SWAT are now ready to go! Open your web browser and connect to http://yourhostname:901. Input "root" for the user name and the root password as the password.

8. You should now be connected to SWAT. From here, you can create file shares, set Samba passwords, and change any of your Samba settings. Note that a Solaris user account must exist before you can assign a Samba password to it. For example, if I wanted to create a Samba password for "jdoe," jdoe must exist as a valid user on the Solaris system before jdoe can be assigned a Samba password.



Linux ks = "options"
boot: linux ks=floppy

The linux ks=floppy command also works if the ks.cfg file is located on a vfat filesystem on a floppy diskette and you boot from the Red Hat Linux CD-ROM.

An alternate boot command for booting off the Red Hat Linux CD-ROM and having the kickstart file on a vfat filesystem on a floppy diskette is:

boot: linux ks=hd:fd0/ks.cfg

If you need to use a driver disk with kickstart, you can still have the kickstart file on a floppy disk:

boot: linux ks=floppy dd

The Red Hat Linux installation program looks for a kickstart file if the ks command line argument is passed to the kernel. The command line argument can take a number of forms:

ks=nfs:<server>:/<path>

The installation program will look for the kickstart file on the NFS server <server>, as file <path>. The installation program will use DHCP to configure the Ethernet card. For example, if your NFS server is server.example.com and the kickstart file is in the NFS share /mydir/ks.cfg, the correct boot command would be ks=nfs:server.example.com:/mydir/ks.cfg.

ks=http://<server>/<path>

The installation program will look for the kickstart file on the HTTP server <server>, as file <path>. The installation program will use DHCP to configure the Ethernet card. For example, if your HTTP server is server.example.com and the kickstart file is in the HTTP directory /mydir/ks.cfg, the correct boot command would be ks=http://server.example.com/mydir/ks.cfg.

ks=floppy

The installation program looks for the file ks.cfg on a vfat filesystem on the floppy in drive /dev/fd0.

ks=hd:<device>/<file>

The installation program will mount the filesystem on <device> (which must be vfat or ext2), and look for the kickstart configuration file as <file> in that filesystem (for example, ks=hd:sda3/mydir/ks.cfg).

ks=file:/<file>

The installation program will try to read the file <file> from the filesystem; no mounts will be done. This is normally used if the kickstart file is already on the initrd image.

ks=cdrom:/<path>


DNS Tools
http://www.dnsstuff.com/

Configuring NIS clients on HP-UX systems !!!

Make sure in the /etc/nsswitch.conf file :    for hosts:        files nis [NOTFOUND=return] files
  1. Log in as root to the NIS client.

  2. Add the -ypset option to the YPBIND_OPTIONS variable in the /etc/rc.config.d/namesvrs file, as follows:         

     YPBIND_OPTIONS="-ypset"   

   3.  In the /etc/rc.config.d/namesvrs file, set the YPSET_ADDR variable to the IP address of an NIS server, as in the following example:

     YPSET_ADDR="15.13.115.168"      Issue the following commands to restart the NIS client 
     /sbin/init.d/nis.client stop      /sbin/init.d/nis.client start  
After this for a better result please reboot the server to start all applications to work properly .

 HP-UX patch bundle http://www2.itrc.hp.com/service/patch/releaseIndexPage.do 
DHCP Faq
http://www.dhcp-handbook.com/dhcp_faq.html

redhat.com | End of Life Products | Linux Links
https://www.redhat.com/security/updates/eol/

The search engine for Unix Commands

coolcommands.com is a search engine for UNIX system administrators. Our database provides access to useful commands for all flavours of UNIX including:

http://www.coolcommands.com/


A useful website
http://everythingsolaris.org/


AIX Installation and customiztion
http://bio.gsi.de/DOCS/aix41install.html

check the memory modules inside a server without opening the box
http://www.4schmidts.com/memconf.html
http://www.4schmidts.com/unix.html



Setting Display to DVI port on SB 2500  Follow these steps to get the Display on the DVI port.  # This is the Script to change Display to DVI on SB 2500 servers # /etc/init.d/dtlogin stop fbconfig -doublewide disable fbconfig -doublehigh disable fbconfig -dev /dev/fbs/pfb0b -res SUNW_STD_1280x1024x60 now /etc/init.d/dtlogin start # echo " reboot now "  NOTE: You will not gte the OK prompt, nor will be able to see the boot messages. You will just see the login screen once the server is booted up.   Thanks  


Temporary snapshot of file systems ( Solaris )
To take a snap shot of the /space filesystem and delete the same, very useful when you need to backup from a stable system or you can use snapshot it self as a backup in case of emergencies
fssnap -o bs=/test /space
mount -o ro /dev/fssnap/0 /mnt
cd /mnt
touch /space/foo
ls /mnt/foo
file not found
fssnap -d /space (delete the snap shot)



Solaris running 32 or 64 bit mode
To find out if the OS has been configured to run in 32 bit or 64 bit Mode

On a 32 bit machine
-------------------
# isainfo -v
32-bit sparc applications

On a 64 bit machine
-------------------
# isainfo -v
64-bit sparcv9 applications
32-bit sparc applications


TO uncompress cpio formats  cpio -idvI combinedsol10_b66.something  Run this command in the current folder.   

All about cdrw



_________________________________________________________________
The new MSN toolbar! Your shortcut to the internet! http://toolbar.msn.co.in/ Access a world of convenience!

cdrw.html

ISO, CDR, and CDRW in Linux
Updated September 25, 2002
Created December 29, 2000


Autogenerated Site Map
Search this Site!:
Search this site powered by FreeFind


CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Creating an ISO Image

Here are a couple of different commands for creating an ISO image:

[root@server /root]# mkisofs -RJ -o image.iso /burndirectory/  [root@server /root]# mkisofs -J -o image.iso /burndirectory  mkisofs -o image.iso -b images/boot.img -c boot.cat -R -J -T /my/file/tree 

The options (-RJ) will preserve long filenames, casing and Rock Ridge extensions (long mixed-case filenames and symbolic links for *nix).
-J  Generate Joliet directory records  in  addition  to        regular iso9660 file names.  This is primarily use-        ful when the discs are to be used on Windows-NT  or        Windows-95  machines.    The  Joliet  filenames are        specified in Unicode and each path component can be        up to 64 Unicode characters long.     -R  Generate  SUSP  and RR records using the Rock Ridge        protocol to  further  describe  the  files  on  the        iso9660 filesystem. 

CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Copying a CD to a File on your Filesystem

Here are a couple of mentods for copying a CD to a file:

[root@server /root]# dd if=/dev/cdrom of=image.iso [root@server /root]# cat /dev/cdrom >image.iso 

More info can be found here: cdimage.html
CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Buring an ISO Image to CDR or CDRW

[root@server /root]# cdrecord -v dev=3,0,0 image.iso 


CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Blanking CDRW Media

Here are a few methods to blank CDRW media:

[root@server /root]# cdrecord blank=fast dev=3,0,0 [root@server /root]# cdrecord blank=all dev=3,0,0 [root@server /root]# cdrecord blank=all -force dev=3,0,0 


CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Copying Directly from One CD to Another

[root@server /root]# cdrecord -v dev=3,0,0 -isosize /dev/cdrom 

Where the dev designation is the cd burner and /dev/cdrom is your regular cdrom drive.
CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Verifying an ISO Image or CDR/CDRW

[root@server /root]# md5sum - or - [root@server /root]# diff /dev/cdrom image.iso - or - [root@server /root]# mount /mnt/cdrom; [root@server /root]# mount -t iso9660 iso.image /mnt/isotest -o loop; [root@server /root]# diff -r /mnt/cdrom /mnt/isotest - or - [root@server /root]# md5sum /dev/cdrom >md5sum-cdrom.txt [root@server /root]# md5sum image.iso >md5sum-file.txt  #Script to verify the md5sum results: echo "Verifying MD5SUMS:" MD5SUM1=md5sum-file.txt MD5SUM2=md5sum-cdrom.txt cat $MD5SUM1 | while read CODE NAME; do      if [ -n "`cat $MD5SUM2 | grep $CODE`" ]; then           echo "Success: $NAME"      else           echo "Failure: $NAME"      fi done  


CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Using an ISO Image without Burning it to CD Media

Mount it via the loop device:

[root@server /root]# mkdir /mnt/isotest [root@server /root]# mount -t iso9660 /dev/cdrom /mnt/isotest -o loop [root@server /root]# ls /mnt/isotest 

More Info:
loop.html
cdimage.html
CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Setting up your system to work with cdrecord

Before performing the entries mentioned for /etc/modules.conf, try just adding the following line to the global section of /etc/lilo.conf:

append="hda=ide-scsi"

Then run /sbin/lilo, reboot, then run cdrecord -scanbus to see if your CDRW is detected:

[root@server /root]# /sbin/lilo [root@server /root]# shutdown -r now ... [root@server /root]# cdrecord -scanbus 

If the above doesn't work, then you may need to complete the following steps:

Red Hat 7.1 (and probably 6.2 and 7.0) should already have a kernel that is ready to work with cdrecord. You probably need to add some or all of the following entries into /etc/modules.conf (or /etc/conf.modules):
options ide-cd ignore=hda            # tell the ide-cd module to ignore hdb #alias scd0 sr_mod                    # load sr_mod upon access of scd0 alias scd0 ide-scsi                    # load sr_mod upon access of scd0 #pre-install ide-scsi modprobe imm    # uncomment for some ZIP drives only pre-install sg     modprobe ide-scsi # load ide-scsi before sg pre-install sr_mod modprobe ide-scsi # load ide-scsi before sr_mod pre-install ide-scsi modprobe ide-cd # load ide-cd   before ide-scsi 
Script for checking out your system: cdre_sh.txt
CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Finding your CDR or CDRW drive

[root@server /root]# cdrecord -scanbus 


CREATE CD2FILE BURN BLANK CD2CD VERIFY LOOP SETUP DETECT RESOURCES


Resources

http://lhd.zdnet.com/LDP/HOWTO/CD-Writing-HOWTO.html#toc3 - CD-Writing HOWTO
Search this Site!:
Search this site powered by FreeFind

Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/sitemap.html







Wednesday, May 11, 2011

ssh without password

Kindle, Wi-Fi, Graphite, 6" Display with New E Ink Pearl Technology - includes Special Offers & Sponsored Screensavers allowing one or more users to log in without a password from different computers.

Step # 1: Generate first ssh key

Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location.
workstation#1 $ ssh-keygen -t rsa
Finally, copy your public key to your remote server using scp
workstation#1 $ scp ~/.ssh/id_rsa.pub user@remote.server.com:.ssh/authorized_keys

Step # 2: Generate next/multiple ssh key

a) Login to 2nd workstation
b) Download original the authorized_keys file from remote server using scp:
workstation#2 $ scp user@remote.server.com:.ssh/authorized_keys ~/.ssh
c) Now create the new pub/private key:
workstation#2 $ ssh-keygen -t rsa
d) Now you have new public key. APPEND this key to the downloaded authorized_keys file using cat command:
workstation#2 $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
e) Finally upload authorized_keys to remote server again:
workstation#2 $ scp ~/.ssh/id_rsa.pub user@remote.server.com:.ssh/authorized_keys
You can repeat step #2 for each user or workstations for remote server.

Step #3: Test your setup

Now try to login from Workstation #1, #2 and so on to remote server. You should not be asked for a password:
workstation#1 $ ssh user@remote.server.com
workstation#2 $ ssh user@remote.server.com

-- 

Thursday, April 14, 2011

How to mount iso image on solaris:

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

You can mount an ISO image directly using the lofiadm and mount commands.
Given an ISO image in /export/home/user/program.iso, a loopback file
device (/dev/lofi/1) is created with the following command:
lofiadm -a /export/home/user/program.iso /dev/lofi/1
The lofi device creates a block device version of a file. This block
device can be mounted to /mnt with the following command:
mount -F hsfs -o ro /dev/lofi/1 /mnt
These commands can be combined into a single command:
mount -F hsfs -o ro `lofiadm -a /export/home/user/program.iso` /mnt
You can mount multiple iso images by incrementing /dev/lofi/[x] and
using differing mount points.



If you want to know any word that associate to a Solaris command you can use , man -k keyword
create the windex database (so that you can use whatis or man -k for a keyword search through the man pages or man -f for man pages related to certain files) do "catman -w"

Check the status, mode and speed of the network device : Solaris

#ndd -get /dev/hme link_status
0 -- link up
1 -- link down

# ndd -get /dev/hme link_mode
0 -- half-duplex
1 -- full-duplex

# ndd -get /dev/hme link_speed
0 -- 10 Mbit
1 -- 100 Mbit
1000 -- 1 Gbit