Archive for Unix

Mounting Windows volumes in Linux (In this case Centos 5)

Assuming that samba is running
Assuming that Windows has no firewall blocking
Assuming that the folder on the Windows machine is already shared for all
Assuming the hostname of the windows server is served by a DNS or in /etc/hosts then the name can be used. (If not then use the ip)

So, where dante is the Windows host and styx is a Linux server.

[root@styx /]# mkdir /mnt/everyone
[root@styx /]# chmod -R 777 /mnt/everyone
[root@styx /]# mount //dante/everyone /mnt/everyone

To automatically mount the volume then it would be a good idea to add a line to /etc/fstab
At the end of the file (which I first made a temporary copy of)

//dante/everyone /mnt/dante/everyone cifs password=

Once saved then at the prompt, mount -a to reload the table and be able to access the mount.

Leave a Comment

shared memory semaphores and amount of memory

Often pre installation checklist items for installing packages include semaphores and shared memory. Documentum requires semaphores to be enabled and at least 2GB RAM.

1. Check semaphores are enabled. This is a preinstall requirement.
In AIX: $ipcs -s

will return rows, if enabled.

2. Check base amount of RAM is available

In AIX: lsattr -El sys0 | grep realmem

Will provide the amount of memory in KB. I believe a min of 2 GB is required for Documentum on Unix (at least true for 5.3).

Leave a Comment

cpio

Unpack a cpio file

cpio -idmv < file.cpio

Leave a Comment

Unix Shell – History, searching files, so on.

Be able to hunt through the history using up/down keys (or J,K)

in the shell:

set -o vi

Search files for a given word:

find ./ -type f | xargs grep -l “ac.jpg”

where ac.jpg is the string being searched for.

or

find ./ -type f | xargs grep -l “\.co\.uk”
to find .co.uk in all pl files:

find ./*.pl -type f| xargs grep -l “\.co\.uk”

VI – line numbers and deletion:

:set nu

delete lines

:17,40d

Will delete lines 17 thru 40 in vi

Search and replace, for example, lines with ^M at the end -

:%s/<ctrl+v><ctrl+m>//

Move to the end of a line

$

Setting up the shell to handle the backspace key:

stty erase <bksp>

Better to configure putty to do this for you. While in putty, configure X11 forwarding as it makes life easier working with Exceed and other X-Windowing products!

Uncompressing a bz2 file
If it is a tar then use the tar command as in the following:
tar -xvjf blender-2.45-linux-glibc236-py24-i386.tar.bz2

Leave a Comment

Sun Enterprise Server – IN THE EEPROM

Boot from CD Rom

At Boot ‘Stop + A’ from the Sun Keyboard

Default =

boot-device: disk net

Change to cdrom

setenv boot-device cdrom disk

then type

boot

(‘prtenv’ to list the command, settings and normal defaults)

In Solaris printenv is the solaris unix command for printenv

Leave a Comment

Process hogging a port

List of open sockets

lsof -i :80

Will give you the process id, you can then kill the process.

Useful for getting rid of Tomcat and other things that gave up the ghost while in the middle of something.

Leave a Comment

« Newer Posts