Two Random Items

It’s exam week which means I’m pretty much useless. Here’s a link to a recent fix (including unified diff patch output) I created for etherpad-lite to allow for multi-user, real-time basic HTTP authentication to work.

and here’s the issue comments I submitted:

https://github.com/Pita/etherpad-lite/issues/628
https://github.com/Pita/etherpad-lite/issues/632

Here’s another script to help us search our wiki (using grep) for common spam patterns and pages.

#!/bin/bash

root='http://zenit.senecac.on.ca'
curl -sL "${root}/wiki/index.php/Special:AllPages" | sed -e 's/<a/\t<a/g' | tr '\t' '\n' | grep -i '^<a.*href=.*from=.*to=.*$' | sed -e 's@^.*href="\([^"]*\)".*$@\1@g' -e 's/\&amp;/\&/g' | sort | uniq > /tmp/pages.txt

while read page
do
	echo "Checking root page [ ${root}${page} ]" 1>&2
	curl -sL "${root}${page}" | sed -e 's/<a/\t<a/g' | tr '\t' '\n' | grep -i '^<a.*href=.*/wiki/index.php/.*$' | sed -e 's@^.*href="\([^"]*\)".*$@\1@g' -e 's/\&amp;/\&/g' | sort | uniq > /tmp/links.txt
	
	while read link
	do
		#echo "    Checking sub page [ ${root}${link} ]" 1>&2
		check=`curl -sL "${root}${link}" | tr -d '\0\t\r\n' | grep -i "$1"`
		
		if [ "${check}" != "" ]
		then
			echo "    Possible spam match [ ${root}${link} ]"
		fi
	done < /tmp/links.txt
done < /tmp/pages.txt

Advertisements
Two Random Items

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s