Freitag, 24. November 2006

Woher kommt das bin-file ? (rpm)

Woher kommt dieses bin-file ?
(aus welchem RPM-File)

rpm -qf /path/file


z.B.


rpm -qf /bin/mount
util-linux-2.12-72.49

Mittwoch, 22. November 2006

TSM: restore via CMD-Line

dsmc

> restore /path_to_file/file

tsm> query backup -inactive -subdir=y /home/save110/   


restore von verz. incl. unterverz. von bestimten datum

dsmc restore '/opt/sapbc47/Server/*' /opt/sapbc47/ -sub=yes -replace=yes -pitdate=12/01/2008



restore von files von bestimmten datum

dsmc restore '/opt/sapbc47/Server/*' /opt/sapbc47/Server/ -sub=yes -replace=yes -fromdate=12/03/2008

Mittwoch, 13. September 2006

nTOP: bestimmtes netz ueberwachen

/etc/protocol.list (Beispiel)

HTTP=http|www|https,SAP=sapdp00|sapdp99|sapgw00|sapgw99|sapmsNP1,IXOS=webcache|ixDS|ixWC|ixRC1|ixMONS|ixMONS1|ixDP|ixADMS|ixADMS-http|ixADMS-https,LPR=printer|mvservice,Mail=pop-2|pop-3|pop3s|kpop|smtp|imap|imap2|imaps|exrpc|iso-tsap|phone,FTP=ftp|ftp-data|squid,PDM=oralisten|pdm|pdm1|pdm2|pdm3|pdm4,TIF=pdmtif,ON=onc|onc2,DNS=name|domain,NBios-IP=netbios-ns|netbios-dgm|netbios-ssn,LDAP=ldap|ldaps,SNMP=snmp|snmp-trap,NEWS=nntp,SSH=ssh|telnet|login,MSP=msp,Tcpapl=tcpapl1|tcpapl2,CSTA=csta|csta1|csta2,VoIP-SIP=sip_stun3478|sip_stun3479|sip_any5060|sip_any5061|sip_any5062|sip_any5070,VoIP-T2T=32512-32767|VoIP-pbx=2556|cmisd=2535|RTP=32000-32255|SIP-Proxy=5060|AudioCodeChannels=4000-4072|tftpd-download=2568|acd=2538-2555|H323-OutCall=21000-21999|H323-MediaChannelOut=25000-25999|H323-MediaChannelOut=25000-25999|H323-MediaChannelIn=31000-31059|MS-MOM=1270|syslog=514






cd /usr/bin

ln -s ntop ntop_netz19216800-24




/etc/ntop_netz19216800-24.conf

--user ntop
--db-file-path /var/ntop_netz19216800-24
--http-server 3001


/etc/init.d/ntop_netz19216800-24

#!/bin/bash
#
# Init file for the NTOP network monitor
#
# chkconfig: - 93 83
#
# description: NTOP Network Monitor
#
# processname: ntop
# config: /etc/ntop.conf
# pidfile: /var/run/ntop

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" == "no" ] && exit 0
[ -x "/usr/bin/ntop21" ] || exit 1
[ -r "/etc/ntop21.conf" ] || exit 1
[ -r "/var/ntop21/ntop_pw.db" ] || exit 1

RETVAL=0
prog="ntop_netz19216800-24"


#Netz 192.168.0.0/24

start () {
echo -n $"Starting $prog: "
daemon $prog -d -L @/etc/ntop21.conf -p /etc/protocol.list -B "'(src net 192.168.0.0/24) or (dst net 192.168.0.0/24)'"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$prog
return $RETVAL
}

stop () {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}

restart () {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=1
esac

exit $RETVAL



/var/ntop_netz19216800-24

chown ntop.nobody /var/ntop_netz19216800-24


Admin Kennwort vergeben

ntop_netz19216800-24 -L @/etc/ntop_netz19216800-24.conf -p /etc/protocol.list

STRG+C

chkconfig --add ntop_netz19216800-24

chkconfig ntop_netz19216800-24 on


dann via browser auf die IP des NTOP-Severver z.B. 192.168.1.222

http://192.168.1.222:3001

Montag, 11. September 2006

file mit bestimmer groesse anlegen

dd if=/dev/zero of=300m bs=1024 count=300000

hier wird ein file mit 300 MB angelegt

Montag, 21. August 2006

kopieren von filesystemen ohne Links zu verfolgen

Kopieren von NFS-gemeounteten Filesystemen.



in das gemountete Verz. stellen

z.B.

/mnt/nfs/oracle


find . -print | cpio -pdvum


z.B.


find . -print | cpio -pdvum /oracle

Donnerstag, 9. Februar 2006

Aus eMail Anhang extrahieren

mail(s) aus einem Postfach per IMAP abholen.
Attachments auspacken, *.pdf kopieren

hier am beispiel eines speiseplans fuer das Intranet




file: get_mail

#!/bin/bash
#
# abholen von speiseplan.pdf aus Postfach speiseplan@domain.tld
#

/usr/bin/fetchmail -a -u speiseplan
/usr/local/bin/uudeview /var/spool/mail/speiseplan -i -c


/usr/bin/fetchmail -a -u speiseplan
/usr/local/bin/uudeview /var/spool/mail/speiseplan -i -c

mv *.pdf speiseplan.pdf
mv *.PDF speiseplan.pdf

/bin/cp -f speiseplan.pdf /var/www/webdata/speiseplan/speiseplan.pdf

/bin/rm -f *.pdf
touch /var/spool/mail/speiseplan
chown speiseplan /var/spool/mail/speiseplan
chgrp speiseplan /var/spool/mail/speiseplan
#
#
# needed: uudeview, fetchmail, .fetchmail, cp, rm
#
#




file: .fetchmailrc

poll "MAILSERVER"
protocol imap
localdomains domain.tld
username "speiseplan"
password "password"
to speiseplan





wenn mehrere Postfacher abgefragt werden sollen,
muessen mehrere .fetchmailrc files angelegt werden z.B. so:


file: get_mail2

#!/bin/bash
#
# abholen von aktion.pdf aus Postfach aktion@domain.tld
#

/usr/bin/fetchmail -f /root/.fetchmailrc2 -a -u aktion
/usr/local/bin/uudeview /var/spool/mail/aktion -i -c


#/usr/bin/fetchmail -a -u aktion
#/usr/local/bin/uudeview /var/spool/mail/aktion -i -c

/bin/mv *.pdf aktion.pdf
/bin/mv *.PDF aktion.pdf

/bin/cp -f sbaraktion.pdf /var/www/webdata/speiseplan/aktion.pdf

/bin/rm -f *.pdf
/bin/touch /var/spool/mail/aktion
/bin/chown sbaraktion /var/spool/mail/aktion
/bin/chgrp sbaraktion /var/spool/mail/aktion
#
#
# needed: uudeview, fetchmail, .fetchmail, cp, rm
#


file: .fetchmailrc2


poll "MAILSERVER"
protocol imap
localdomains domain.tld
username "aktion"
password "password"
to aktion

DNS-Server: bind

bind
----




NameServer finden:

dig redhat.com ns

dig heise.de ns

dig suse.de ns






Reverse aufloesen:

host -l -v -t any 50.232.187.66.in-addr.arpa. ns2.redhat.com.


host -l -v -t any 76.98.193.in-addr.arpa. dns.pemic.net.


host -l -v -t any 3.220.135.195.in-addr.arpa. ns.suse.de







Abfragen von bind Version des Nameservers


dig @NAMESERVER txt chaos version.bind

z.B:


dig @ns2.vkn.de txt chaos version.bind




Verhindern des Versionausgabe mit:


in der named.conf


version "Go away!!!";




Wem gehoert eine DOMAIN:


whois -h whois.networksolutions.com heller-machines.com