Samba - Netbeui communication ********************************* Make sure host computer you want is entered in /etc/lmhosts (or perhaps /etc/hos ts) /usr/local/samba/bin/smbclient smbclient -L hosts !checks on available services smbclient \\\\dls-office\\c passwd ! to connect to c: drive or ! note that extra \ for escaping smbclient "\\dls-office\c" passwd ################################################# # misc ############################################### *** f77 compiler use switch -static in resolving problems under IRIX 6.x that did not occur with IRIX 5.x *** cc compiler gcc -O -Wuninitialized a.c gcc -Wunused a.c to check for uninitialized or unused variables cvd code view debugger - very fancy debugger ############################################### # mail ############################################### *** to decode BINHEX file kunarc -or- winzip on PC can decode *** to send binary file (e.g. MSWORD document) attach using "pine" (T gets file listing to attach) "zmail" seems to uuencode file first # display *** to recover from chain crash with monitor in stereo mode /usr/Local/bin/nostereo ################################################################## c shell procedures ################################################################## *** to delete selected files along directory path rm `find . -name "f*.img" ` rehash # update files along path *** to copy entire directory structure: tar -cf - . | (cd newdirectory ; tar -xf -) across network (putative) tar -cf - . | rsh cryoem.med (cd newdirectory ; tar -xf -) *** to make global change in filenames (in this case, ; to .) foreach F (*.*\;*) #for filenames *.*;* mv $F 'echo $F | sed -e "s/;/./g"' end *** to strip off file extensions foreach F (*.*) mv $F $F:r end *** to use VAX-like wildcard - e.g. mv file.ext file.newext mv file.ext !#:1:r.newext *** to remove ^Z from file (maybe doesn't work) sed -e s/\O032//g file > file.fixed *** to replace a line in a file with another line (see pick.iterate) first step is to find line number to replace (unless you already know) next step is to replace this line with desired text set lineno=`grep -n "TEXT TO SEARCH FOR" infile | cut -d: -f0` sed -e "$lineno c\\ TEXT TO PUT ON LINE" infile > outfile *** to use file as input to a command (like ar or rm) ar d lib.a `cat file.list` ######################################## # System stuff *** cadmin database rebuild (to set up ports etc) /etc/init.d/cadmin stop /etc/init.d/cadmin clean /etc/init.d/cadmin start *** su - root !will read configuration files from root hinv !hardware inventory versions !lists all installed software ls -l /etc/config !lists files corresponding to various daemons and servers, if file size =4 -> turned off, size=3 -> turned on du -k !disk usage by directory df -k !free and used space on mounted disks # Saturn directories with good stuff /opt /ftp/pub/pc for binhex.* # Remote access .rhosts file in root directory lists trusted users/machines # Printing a2ps -1 -p -F5 twofoldedt1.log | lp !instead of enscript (small font 5) lp !to print locally on klug lpr ! to print on BSD Unix systems (e.g. cryoem) lpstat ! to check on status of lp server cancel ! to cancel jobs on lp server enscript -d printer !PostScript on local printer (not necessary) enscript -p - tst | lpr -Plpc !PostScript on BSD system (e.g. cryopc) /etc/printcap !applies to lpr system only # Backup # DAT tape on laue find . -cpio /dev/rmt/tps0d2nrs -print # DAT tape in computer room on x-ray model building machines tar clvf guest@mcbi-14:/dev/tape . # at NYU on crimson (mercury) mt -f /dev/rmt/tps1d6nr fsf n move to file n mt -f /dev/rmt/tps1d6nr status to check status # on mcbi-25 mt -f mcbi-25:/dev/rmt/tps1d4nrnsv status mt -f mcbi-25:/dev/tape status tape has symbolic link to rmt/tps1d4nrnsv mt -f guest@mcbi-25:/dev/tape status *** backups with cpio find . -newer backup.log/lastbackup -print | cpio -oBO \ cryoem:/dev/nrst1 > backup.log/currentbackup & for full backup: find . -cpio /dev/nrst1 -print > date.backup for incremental backup (e.g. since date of last logfile find . -newer prev-date.backup -cpio /dev/nrst1 -print > date.backup to get table of contents from tape cpio -itB < /dev/nrst1 *** backups with tar tar does not allow individual files to be restored - only whole group cd topdirectory mt -f /dev/nrst1 eom # position at end of tape if necessary to create archive on tape tar cvf /dev/nrst0 *** dump of entire partition dump 0cstf 620 18 /dev/nrst0 /dev/sd0a 0 => full dump 620 18 => QIC 150 /dev/nrst0 => target for dump /dev/sd0a => partition being backed up dump c0sdf 6000 54000 cryoem:/dev/nrst1 /usr !dump entire file system c: treat as cassette tape s: 6000 6000 feet of tape d: 54000 density of tape size and density are fake - to get around bug, see man page f: cryoem:/dev/nrst1 /usr: file system to backup *** *** reading VAX tapes *** on mcbi-25 where Exabyte is mounted backup tapes with vmsbackup vmsbackup -tf /dev/tape # table of contents for whole tape vmsbackup -ts 1 -f /dev/tape # table of contents for file 1 first file is number 1 vmsbackup -xs 1 -f /dev/tape # extract is possible to specify file to extract but have only had luck specifying wildcard names vmsbackup -x -d -s 1 -f /dev/tape # extract preserving VMS directory structure starting with current directory as [] note - get errors with directories of certain backup files, but is possible to read subsequent backup files by using s option also note - get "snark" errors on restoring files, but data seems OK # customize workspace xsetroot -solid 'color' !to set background color on console