Posts Tagged ‘bash’

Hani böylesine zorla yapmak istemeyizde mecbur kalınca, niye olmasın :)
stop
komutuyla durmuyorsa.
#!/bin/

for ind in `ps -aef | grep | grep -v grep | cut -f4 -d ' '`
do
kill -9 $ind
echo "process $ind"
done
if [ $? -eq 0 ]; then
lsnrctl start
fi
exit

Bookmark and Share
Tags: , , , , ,

Tags: , , , , ,

#!/bin/
#dupfind.sh
#author: myownshadow
#TODO:
#needs find redirecting without for loop (find invokes subshells)
#need a faster , md5sum can be very slow with big files

for ind in `find $1 -type f -print0 | xargs -0 md5sum |sed s/\ /-/g`
do
echo $ind >> .md5list &2>/dev/null
done
cat .md5list|cut -c1-32| sort| uniq -d >> .duplist
for line in `cat .duplist`
do
cat .md5list | grep $line | cut -c35-
done
rm .md5list
rm .duplist
exit

Kullanım:
$dupfind.sh /media/iPOD

Bookmark and Share
Tags: , , , ,

Tags: , , , ,

18
Feb

Apache için basit bir log viewer

   Posted by: myownshadow    in Yazılım

#!/bin/
if [ ! -f /tmp/logcopy ]
then
echo "first run, copying log file"
cp /var/log/2/access.log /tmp/logcopy
fi
oldfilehash=`md5sum /tmp/logcopy | cut -d " " -f1`
newfilehash=`md5sum /var/log//access.log | cut -d " " -f1`
if [ "$oldfilehash" != "$newfilehash" ]; then
diff /var/log/apache2/access.log /tmp/logcopy > /tmp/logdiff
if [ ! $? -eq 0 ]; then
cat /tmp/logdiff | --title "Apache " --text-info --width 1024 --height 800
fi
cp -u /var/log/apache2/access.log /tmp/logcopy
fi
exit

/usr/local/bin altına kaydedip kullanabilirsiniz.

Bookmark and Share
Tags: , , , , , ,

Tags: , , , , , ,

Switch to our mobile site