Commit c0bcbdca authored by Peter Kovary's avatar Peter Kovary Committed by Turing Lab Account
Browse files

Polish web_cgi, make `ssh` not check keys

parent ff348750
...@@ -6,21 +6,17 @@ echo '<HTML><HEAD><title>Lab Stalker Online v0.2</title><style> ...@@ -6,21 +6,17 @@ echo '<HTML><HEAD><title>Lab Stalker Online v0.2</title><style>
td { padding-right:24px } td { padding-right:24px }
a:visited { color:blue } a:visited { color:blue }
.split { height: 100%; position: fixed; top: 0; overflox-x: hidden; padding: 20px; } .split { height: 100%; position: fixed; top: 0; overflox-x: hidden; padding: 20px; }
.left { width: 33%; left: 0; } .left { width: 33%; left: 0; overflow: scroll;}
.right { width: 66%; right: 0; } .right { width: 66%; right: 0; }
img { max-width: 100%; max-height: 100%; object-fit: contain; } img { max-width: 100%; max-height: 100%; object-fit: contain; }
</style></HEAD><BODY> </style></HEAD><BODY>
<div class="split left"><table border="0" cellspacing="0">' <div class="split left"><table border="0" cellspacing="0">'
premium=$(grep -o ${REMOTE_USER} /homes/pk3115/Public/LabStalker/premium || true) echo "Hello $(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no shell1 "finger ${REMOTE_USER} | grep -oPm1 'Name: \K.+'")!<br>"
donate='\1<a href="\2\3/5.00?d=LabStalker%20is%20worth%20a%20pint%20('${REMOTE_USER}')">\3</a><br>' ~/LabStalker/whosinlabs | perl -pe 's!(.+?) +(.+?) +(\((.+(1[0-9]))\))!<tr><td>\1</td><td><a href="https://teachdb.doc.ic.ac.uk/photo/student/pics\5/\4.jpg" target="_blank">\2</a></td><td>\3</td></tr>!'
[ "${premium}" ] && donate="" #~/LabStalker/whosinlabs | grep -v turinglab46 | grep -v fullness | perl -pe 's!(.+?) +(.+?) +(\((.+(1[0-9]))\))!<tr><td>\1</td><td><a href="https://teachdb.doc.ic.ac.uk/photo/student/pics\5/\4.jpg" target="_blank">\2</a></td><td>\3</td></tr>!'
#~/LabStalker/whosinlabs | grep -v turinglab46 | grep -v fullness | perl -pe 's!(.+?) +(.+?) +(\((.+(1[0-9]))\))!<tr><td>\1</td><td><a href="#" onclick="return false;" target="_blank">\2</a></td><td>\3</td></tr>!''
echo "Hello $(ssh shell1 "finger ${REMOTE_USER} | grep -oPm1 'Name: \K.+'")!<br>"
~/LabStalker/whosinlabs | perl -pe 's!(.+?) +(.+?) +(\((.+(1[0-9]))\))!<tr><td>\1</td><td><a href="https://teachdb.doc.ic.ac.uk/photo/student/pics\5/\4.jpg" target="_blank">\2</a></td><td>\3</td></tr>!' | sed -E 's!(.+)(https://)(monzo.me/peterkovary)!'"${donate}"'!'
#~/LabStalker/whosinlabs | grep -v turinglab46 | grep -v fullness | perl -pe 's!(.+?) +(.+?) +(\((.+(1[0-9]))\))!<tr><td>\1</td><td><a href="https://teachdb.doc.ic.ac.uk/photo/student/pics\5/\4.jpg" target="_blank">\2</a></td><td>\3</td></tr>!' | sed -E 's!(.+)(https://)(monzo.me/peterkovary)!'"${donate}"'!'
#~/LabStalker/whosinlabs | grep -v turinglab46 | grep -v fullness | perl -pe 's!(.+?) +(.+?) +(\((.+(1[0-9]))\))!<tr><td>\1</td><td><a href="#" onclick="return false;" target="_blank">\2</a></td><td>\3</td></tr>!' | sed -E 's!(.+)(https://)(monzo.me/peterkovary)!'"${donate}"'!'
echo '</table><br></div><div class="split right"><img src="./map.png"></div> echo '</table><br></div><div class="split right"><img src="./map.png"></div>
</BODY></HTML>' </BODY></HTML>'
echo "$(date --iso-8601=seconds) ${REMOTE_USER}" >> /homes/pk3115/Public/log echo "$(date --iso-8601=seconds) ${REMOTE_USER}" >> /homes/turinglab46/Public/log
...@@ -135,7 +135,7 @@ for host in ${hostlist[*]} ...@@ -135,7 +135,7 @@ for host in ${hostlist[*]}
do do
if ! [[ $exclusions =~ $host ]] if ! [[ $exclusions =~ $host ]]
then then
echo $(timeout -k 0.1 $timeout ssh -q -o StrictHostKeyChecking=no -o ConnectTimeout=$timeout $host "finger 2>/dev/null | tr -s ' ' | grep -E '$curr' | sed -n -E 's/(.*$curr).*/\1/p' | sort | uniq" 2>/dev/null) $host >> $outputFile & echo $(timeout -k 0.1 $timeout ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=$timeout $host "finger 2>/dev/null | tr -s ' ' | grep -E '$curr' | sed -n -E 's/(.*$curr).*/\1/p' | sort | uniq" 2>/dev/null) $host >> $outputFile &
children="$children $!" children="$children $!"
fi fi
done done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment