2x Random Scripts

Koji Build Que’r

qu.sh
#!/bin/bash
export l=`find ~/Desktop/f15v5.0 -type f | grep -i '\.src\.rpm' | wc -l`
export x=1
while true
do
	ak list-tagged dist-f15 > /tmp/t
	while true
	do
		ak list-tasks --mine --quiet | grep '^[0-9]' | grep -Ei ' (open|free) .* build' > /tmp/n
		#echo "got tasks..." ; cat /tmp/n | wc -l ; echo
		if [ `cat /tmp/n | wc -l` -ge 10 ]
		then
			break
		fi
		p=`find ~/Desktop/f15v5.0 -type f | grep -i '\.src\.rpm' | head -n "$x" | tail -n 1`
		q=`basename "$p" | sed -e 's/[^0-9A-Za-z]/./g' -e 's/\.src\.rpm//g'`
		#echo "checking pkg [$p] [$q]..." ; echo
		c=`cat /tmp/n /tmp/t | grep -i "$q"`
		let x="($x % $l) + 1"
		if [ "$c" != "" ]
		then
			continue
		fi
		echo "queing [$p] skipped [$x]"
		ak build dist-f15 "$p" --nowait
		let n="$n + 1"
	done
	sleep 60
done

and a javascript host highlighter

hosts.js
// ==UserScript==
// @name           hosts
// @namespace      builds
// @include        http://arm.koji.fedoraproject.org/koji/hosts?order=last_update&state=enabled
// ==/UserScript==

var dateob = new Date();
var yerstr = (dateob.getFullYear() + "");
var monstr = ((dateob.getMonth() + 1) + "");
var daystr = (dateob.getDate() + "");
var srcobj = document.getElementById("loginInfo");
var scdate = (parseInt(yerstr + monstr + daystr + srcobj.innerHTML.replace(/[^0-9]/g, "").substring(6)) / 100);
var dsttab = document.getElementsByClassName("data-list");
var dstrow = dsttab[0].getElementsByTagName("tr");

for (var x = 0; x < dstrow.length; ++x)
{
	var dstcol = dstrow[x].getElementsByTagName("td");
	
	if (dstcol.length > 5)
	{
		var chdate = (parseInt(dstcol[5].innerHTML.replace(/[^0-9]/g, "")) / 100);
		
		if ((scdate - 5) >= chdate)
		{
			var lnklst = dstcol[1].getElementsByTagName("a");
			
			for (var y = 0; y < lnklst.length; ++y)
			{
				lnklst[y].innerHTML = ("<font color='red'>" + lnklst[y].innerHTML + "</font>");
			}
		}
	}
}

Advertisements
2x Random Scripts

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