#	tl_b64s = `ls b*.txt`
#	ko.sh	20221030_0500	pb
progid="ko"
dttm=`date +"%Y%m%d_%H%M%S"`

#	ht/jk.sh 20190203_1500 publish kogrids

	if [ "$1" = "vi" ] || [ "$1" == "vi" ]; then vi $progid.sh; exit; fi

	if [ "$1" = "go" ] || [ "$1" == "annotate" ]; then
		lim=10
# fonts=`identify -list font | grep "Font" | awk -F" " '{ print $2 }' | head -$lim`
fonts=`identify -list font | grep "Font" | awk -F" " '{ print $2 }'`

		j=0;
		img="zc/imgs/peddlers/ko_colorado_white"
		img="zc/imgs/peddlers/ko_colorado_mocha.jpg"
		txt="ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdefghijklmnopqrstuvwxyz"
		tpath="fonts"
		if [ ! -d $topath ]; then
			echo "$progid $dttm ERR_100 NOTFOUND DIR tpath=$tpath"
			exit
			fi

		for font in $fonts; do
			if [ "$font" == "" ]; then continue; fi
			echo "$progid $dttm j=$j img_font=$img_font pqpqpqpqpqpqpqpqpqpqpqpq";

			if [ ! -f $img ]; then
				echo "$progid $dttm $j=$j ERR_100 NOTFOUND img=$img"
				exit;
				fi
			img_font="fonts/ko_colorado_mocha_$font.jpg"
			echo "$progid $dttm j=$j font=$font img_font=$img_font"

echo "convert $img -gravity NorthWest -font $font -pointsize 70 -annotate +200+300 $txt $img_font"
			if [ "$2" == "go" ]; then
convert $img -gravity NorthWest -font $font -pointsize 70 -annotate +200+300 $txt $img_font 
				fi
			let j=j+1
			echo "$progid $dttm j=$j img_font=$img_font bdbdbdbdbdbdbdbdbdbdbdbd";
			done
		echo "$progid $dttm $j $img_font ls -lat fonts"
		ls -lat fonts
		exit;
		fi

	if [ "$1" = "go" ] || [ "$1" == "go" ]; then

		btns="
ko.png ok.png kb.png kw.png ki.png
kob.png kow.png kib.png kiw.png
koeye.png koeyew.png koeyeb.png kop1.png
kop2.png kop3.png kop4.png kop12.png kop23.png kop34.png kop14.png
btn.png btn_n.png btn_s.png btn_e.png btn_w.png
dragon.png koeye_handhither.gif koeye_handhi.gif
"
		echo "$progid $dttm go: btns=$btns"
		echo "" > b64btn.txt
		for btn in $btns;do
			echo "btn=$btn"
			echo "// "$btn 					>> b64btn.txt
			echo $btn' = url("data:/img/png;base64,'	>> b64btn.txt
			base64 imgs/btn/$btn 				>> b64btn.txt
			echo '");' 					>> b64btn.txt
			done




		exit;
		kovlist="kov_new kov_work kov_focus kov_old"
		echo "$progid $dttm go: kovlist=$kovlist"
		for kov in $kovlist;do
			echo "kov=$kov"
			done
		exit;
		fi

	if [ "$1" = "pb" ] || [ "$1" == "pub" ]; then
files="index.htm* ko_coffee.*"

		for file in $files;do 

			echo "scp index.htm kozerus@ko0.us:~/public_html/"
#			scp index.htm* kozerus@ko0.us:~/public_html/

			echo "scp index.htm kotwous@ko2.us:~/public_html/"
#			scp index.htm* kotwous@ko2.us:~/public_html

			echo "scp index.htm kotwous@ko2.us:~/public_html/ko1/"
#			scp index.htm* kotwous@ko2.us:~/public_html/ko1/

			echo "scp index.htm kotwous@ko2.us:~/public_html/konet/"
#			scp index.htm* kotwous@ko2.us:~/public_html/konet/

			echo "scp index.htm kotwous@ko2.us:~/public_html/iperms/"
#			scp index.htm* kotwous@ko2.us:~/public_html/iperms/
			done
	

		exit;


# kogrids publish bugs bugs bus
#       $hosts = "kozerus@ko0.us kotwous@ko2.us ka10 ka11 ka12 ka20 ka21 ka22"
	        hosts_bh="kozerus@ko0.us kotwous@ko2.us"
	        hosts_ka="konet@ka10 konet@ka20"
	        hosts=$hosts_bh
	
	        hostrts="kozerus@ko0.us:~/public_html/ kotwous@ko2.us:~/public_html/"
	        hostrts_ka1="konet@ka10/Volumes/ka1tbr1/ht konet@ka10/Volumes/ka1tbr2/ht konet@ka10/ht"
	        hostrts_ka2="konet@ka20/Volumes/ka1tbr1/ht konet@ka20/Volumes/ka1tbr2/ht konet@ka20/ht"
	
	        locrts_ka1="/ht/ /Volumes/ka1tbr1/ /Volumes/ka1tbr2/"
	        locrts_ka2="/ht/ /Volumes/ka2tbr1/ /Volumes/ka2tbr2/"
	        locrts="/ht/ /Volumes/ka1tbr1/"

	        for host in $hosts; do
	                echo "ssh $host 'mkdir $hostrt/imgs/kogrids/'"
	                ssh $host 'mkdir $hostrt/imgs/kogrids/'
	                echo "ssh $host 'mkdir $hostrt/imgs/kogrids/tn/'"
	                ssh $host 'mkdir $hostrt/imgs/kogrids/tn/'
	                done
	
	
	
	
	        for hostrt in $hostrts; do
	                echo "scp /imgs/kogrids/*.png $host$hostrt/imgs/kogrids/"
	                scp /imgs/kogrids/*.png $host$hostrt/imgs/kogrids/
	                echo "scp /imgs/kogrids/*.gif $host$hostrt/imgs/kogrids/"
	                scp /imgs/kogrids/*.gif $host$hostrt/imgs/kogrids/
	                echo "scp /imgs/kogrids/tn/tn_*.png $host$hostrt/imgs/kogrids/tn/"
	                scp /imgs/kogrids/tn/tn_*.png $host$hostrt/imgs/kogrids/tn/
	                echo "scp /imgs/kogrids/tn/tn_*.gif $host$hostrt/imgs/kogrids/tn/"
	                scp /imgs/kogrids/tn/tn_*.gif $host$hostrt/imgs/kogrids/tn/
	                done
	
	        for locrt in $locrts; do
	                echo "mkdir $locrt/imgs/kogrids/"
	                mkdir $locrt/imgs/kogrids/
	                echo "mkdir $locrt/imgs/kogrids/tn/"
	                mkdir $locrt/imgs/kogrids/tn/
	
	                echo "cp /imgs/kogrids/*.png $locrt""imgs/kogrids/"
	                cp /imgs/kogrids/*.png $locrt"imgs/kogrids/"
	                echo "cp /imgs/kogrids/*.gif $locrt""imgs/kogrids/"
	                cp /imgs/kogrids/*.gif $locrt"imgs/kogrids/"
	                echo "cp /imgs/kogrids/tn/tn_*.png $locrt""imgs/kogrids/tn/"
	                cp /imgs/kogrids/tn/tn_*.png $locrt"imgs/kogrids/tn/"
	                echo "cp /imgs/kogrids/tn/tn_*.gif $locrt""imgs/kogrids/tn/"
	                cp /imgs/kogrids/tn/tn_*.gif $locrt"imgs/kogrids/tn/"
	                done
	



		exit
		echo "scp index.html kozerus@ko0.us:~/public_html/index.html"
		scp index.html kozerus@ko0.us:~/public_html/index.html

		echo "scp index.html kotwous@ko2.us:~/public_html/index.html"
		scp index.html kotwous@ko2.us:~/public_html/index.html
		exit;



		scp imgs/links/links_gigapan.png kozerus@ko0.us:~/public_html/imgs/links/links_gigapan.png	
		scp imgs/links/links_gigapan_mars.png kozerus@ko0.us:~/public_html/imgs/links/links_gigapan_mars.png	
		scp imgs/links/tn/tn_links_gigapan.png kozerus@ko0.us:~/public_html/imgs/links/tn/tn_links_gigapan.png	
		scp imgs/links/tn/tn_links_gigapan_mars.png kozerus@ko0.us:~/public_html/imgs/links/tn/tn_links_gigapan_mars.png	
		scp imgs/links/links_gigapan.png kotwous@ko2.us:~/public_html/imgs/links/links_gigapan.png	
		scp imgs/links/links_gigapan_mars.png kotwous@ko2.us:~/public_html/imgs/links/links_gigapan_mars.png	
		scp imgs/links/tn/tn_links_gigapan.png kotwous@ko2.us:~/public_html/imgs/links/tn/tn_links_gigapan.png	
		scp imgs/links/tn/tn_links_gigapan_mars.png kotwous@ko2.us:~/public_html/imgs/links/tn/tn_links_gigapan_mars.png	




		exit
		echo "$progid $dttm nothing here todo "

		thosts="kozerus@ko0.us kotwous@ko2.us"
                for thost in $thosts; do
			thost_ht=$thost":~/public_html/"
#			echo "ssh $thost 'mkdir ~/public_html/kb/pdf/pdf_20190126'"
			echo "scp kb/pdf/pdf_20190126/*.pdf $thost""kb/pdf/pdf_20190126/"
			echo 'scp index.html $thost_ht""us/konabus/er/index.html"
			echo 'scp index.html $thost_ht""us/konabus/gw/index.html'
			echo 'scp index.html $thost_ht""us/konabus/er/index.html"
			echo 'scp index.html $thost_ht""us/konabus/er/index.html"
			done






		exit;
		scp ./imgs/links/index_konabus.png kozerus@ko0.us:~/public_html/imgs/links/
		scp ./imgs/links/graduation_outofreach.png kozerus@ko0.us:~/public_html/imgs/links/
		scp ./imgs/links/tn/tn_index_konabus.png kozerus@ko0.us:~/public_html/imgs/links//tn/
		scp ./imgs/links/tn/tn_graduation_outofreach.png kozerus@ko0.us:~/public_html/imgs/links/tn/



		exit;
		fi

	if [ "$1" = "go_upload" ] || [ "$1" == "gup" ]; then
		echo "$progid $dttm upload ./kb/jtfdc/vid/tn "

		exit;
#		scp ./kb/jtfdc/vid/jtfdc_20190122_2200_stalkaround_jtf28in_drivewaytraffic.mp4 kozerus@ko0.us:~/public_html/kb/jtfdc/vid/
#		scp ./kb/jtfdc/vid/jtfdc_20190124_1350_stalkaround_lwhitesuv_jtf30in_jkwii.mp4 kozerus@ko0.us:~/public_html/kb/jtfdc/vid/
#		scp ./kb/jtfdc/vid/jtfdc_20190122_2200_stalkaround_jtf28in_drivewaytraffic.mp4 kotwous@ko2.us:~/public_html/kb/jtfdc/vid/
#		scp ./kb/jtfdc/vid/jtfdc_20190124_1350_stalkaround_lwhitesuv_jtf30in_jkwii.mp4 kotwous@ko2.us:~/public_html/kb/jtfdc/vid/
 

scp ./kb/jtfdc/vid/tn/tn_jtfdc_20190122_2200_stalkaround_jtf28in_drivewaytraffic.gif kozerus@ko0.us:~/public_html/kb/jtfdc/vid/tn/
scp ./kb/jtfdc/vid/tn/tn_jtfdc_20190124_1350_stalkaround_lwhitesuv_jtf30in_jkwii.gif kozerus@ko0.us:~/public_html/kb/jtfdc/vid/tn/

scp ./kb/jtfdc/vid/img/jtfdc_20190122_2200_stalkaround_jtf28in_drivewaytraffic.png kozerus@ko0.us:~/public_html/kb/jtfdc/vid/img/
scp ./kb/jtfdc/vid/img/jtfdc_20190124_1350_stalkaround_lwhitesuv_jtf30in_jkwii.png kozerus@ko0.us:~/public_html/kb/jtfdc/vid/img/

scp ./kb/jtfdc/vid/tn/tn_jtfdc_20190122_2200_stalkaround_jtf28in_drivewaytraffic.gif kotwous@ko2.us:~/public_html/kb/jtfdc/vid/tn/
scp ./kb/jtfdc/vid/tn/tn_jtfdc_20190124_1350_stalkaround_lwhitesuv_jtf30in_jkwii.gif kotwous@ko2.us:~/public_html/kb/jtfdc/vid/tn/

scp ./kb/jtfdc/vid/img/jtfdc_20190122_2200_stalkaround_jtf28in_drivewaytraffic.png kotwous@ko2.us:~/public_html/kb/jtfdc/vid/img/
scp ./kb/jtfdc/vid/img/jtfdc_20190124_1350_stalkaround_lwhitesuv_jtf30in_jkwii.png kotwous@ko2.us:~/public_html/kb/jtfdc/vid/img/






		exit;
		fi

	if [ "$1" = "go_tl_b64" ] || [ "$1" == "go_tl_b64" ]; then
		tl_b64s=`ls b*.txt`
		j=0
		echo "$progid $dttm $tl_b64 "  > tl_b64s.js
		echo "$progid $dttm $tl_b64 "  > tl_b64sn.js
		echo "$progid $dttm $tl_b64 "  > tl_json.js
		
                for tl_b64 in $tl_b64s; do
			let j=j+1
                        dttm=`date +"%Y%m%d_%H%M%S"`
			echo "$progid $dttm $j tl_b64=$tl_b64"
#			nofile=""
#                       if [ -f $nofile  ]; then
                        if [ -f $tl_b64  ]; then
				b64=`cat $tl_b64`


				echo "// $tl_b64" >> tl_b64sn.js
				echo "	tl_b64sn[ $tl_b64 ] = data:/text/plain;base64," >> tl_b64sn.js
				cat $tl_b64 >> tl_b64sn.js
				echo "\""  >> tl_b64sn.js


				echo "// $tl_b64" >> tl_b64s.js
				echo "	tl_b64s[ $j ] = \"data:/text/plain;base64," >> tl_b64s.js
				cat $tl_b64 >> tl_b64s.js
				echo "\""  >> tl_b64s.js
				fi
			done
		exit;
		fi
	
	echo "jk.sh go";
	echo "ERR unsupported option"
	exit




	exit
base64 tl.json > b64_tl_json.txt
base64 tl0.json > b64_tl0_json.txt
base64 tl1.json > b64_tl1_json.txt
base64 tl2.json > b64_tl2_json.txt
base64 tl_bugs.json > b64_tl_bugs_json.txt
base64 tl_good.json > b64_tl_good_json.txt
base64 tl_iperms.json > b64_tl_iperms_json.txt
base64 tl_jk.json > b64_tl_jk_json.txt
base64 tl_jk1.json > b64_tl_jk1_json.txt
base64 tl_jtf29.json > b64_tl_jtf29_json.txt
base64 tl_jtfdc.json > b64_tl_jtfdc_json.txt
base64 tl_jtfinc.json > b64_tl_jtfinc_json.txt
base64 tl_ka.json > b64_tl_ka_json.txt
base64 tl_ko.json > b64_tl_ko_json.txt
base64 tl_konet.json > b64_tl_konet_json.txt
base64 tl_saic.json > b64_tl_saic_json.txt
base64 tl_saic_contract1.json > b64_tl_saic_contract1_json.txt
base64 tl_test0.json > b64_tl_test0_json.txt
base64 tl_test01.json > b64_tl_test01_json.txt
base64 tl_test1.json > b64_tl_test1_json.txt
base64 tl_test2.json > b64_tl_test2_json.txt
base64 tl_test9.json > b64_tl_test9_json.txt




