February 18th, 2010
admin
Shell script to remove some text from multiple files
Here is a small script that reads all *.txt or all *.html, all *.php files and delete all lines between word1 and word2:
#!/bin/bash
FILES="*.php"
for f in $FILES
do
INF="$f"
OUTF="$f.out.tmp"
# replace
sed '/word1/,/word2>/d' $INF > $OUTF
/bin/cp $OUTF $INF
/bin/rm -f $OUTF
done
Then save this file as “myscript.txt”
run this script with: # bash myscript.txt
September 10th, 2009
admin
I was recently surprised to see that my wordpress install folders have swelled up in size like anything. I have 3 installs of WP and I noticed that in the root of each install there were dump files with a name pattern “core.*” and with sizes to the tune of 12MB each.
core files come from a core dump. A core dump can happen for lots of reasons, but in shared hosting it generally occurs if:
1. Your site software is not compatible with the latest server software versions.
2. The server software itself was/is having issues.