#!/bin/sh echo "Don't forget to update this script with the change-log! Press ENTER to start..." read NAME="anyterm" VERSION="1.1.29" SOURCE="http://anyterm.org/download/anyterm-$VERSION.tbz2" CONFIGURE="" DATE=`date '+%Y/%m/%d'` SCRIPT_NAME=$(basename $0) cp $0 /tmp/ export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" echo "Downloading essential packages..." tce-load -wi compiletc squashfs-tools-4.x boost-dev glibc_gconv cd /tmp/ wget $SOURCE sudo rm -rf $NAME-$VERSION 2>/dev/null sudo rm /tmp/$NAME.tcz /tmp/$NAME.tcz.list /tmp/$NAME.tcz.md5.txt /tmp/$NAME.tcz.dep 2>/dev/null sudo rm -rf /tmp/$NAME 2>/dev/null tar xjf $NAME-$VERSION.tbz2 cd $NAME-$VERSION #Insert "include stdio.h" because it's needed to compile anytermd sed -i -e "s/#include \"SmtpClient.hh\"/#include \"SmtpClient.hh\"\n#include /" libpbe/src/SmtpClient.cc #Customize margins sed -i -e "s/body {/body {\n margin: 0;\n padding: 0;/" browser/anyterm.css #Customize frame border color sed -i -e "s/background-color: rgb(63,63,161);/background-color: rgb(92,92,92);/" browser/anyterm.css #Customize cursor color sed -i -e "s/border: 1px solid red/border: 1px solid green/" browser/anyterm.css #Customize blue foreground color sed -i -e "s/.m { color: #0000cd; }/.m { color: #5555ff; }/" browser/anyterm.css sed -i -e "s/.z.m { color: #0000ff !important; }/.z.m { color: #5555ff !important; }/" browser/anyterm.css #Customize character set, terminal size, scrollback sed -i -e "s/window.onload=function() {create_term(\"term\",\"%h (Anyterm%v)\",25,80,\"\",\"\",50);};/window.onload=function() {create_term(\"term\",\"%h (Anyterm%v)\",28,90,\"\",\"UTF-8\",500);};/" browser/anyterm.html #Compile sudo make #There is no make install :( mkdir -p /tmp/$NAME/usr/local/bin cp /tmp/anyterm-$VERSION/build/anytermd /tmp/$NAME/usr/local/bin/anytermd cd /tmp/$NAME sudo find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null sudo find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null sudo mkdir -p /tmp/$NAME/usr/local/etc/init.d sudo echo "#!/bin/sh if [ `whoami` = 'root' ]; then echo \"Don't run this as root.\" exit 0 fi ps=\`ps -ef|grep -v grep|grep -c anytermd\` case \$1 in start) if [ \$ps -ne \"0\" ]; then echo \"\$0: anytermd already running\" else echo \"Starting anytemd...\" anytermd --charset UTF-8 --port 7676 --local-only fi ;; stop) if [ \$ps -ne \"0\" ]; then echo \"Stopping anytermd...\" pkill -TERM anytermd else echo \"\$0: anytermd not running\" fi ;; restart) if [ \$ps -ne \"0\" ]; then echo \"Restarting anytermd...\" pkill -TERM anytermd anytermd --charset UTF-8 --port 7676 --local-only else echo \"\$0: anytermd not running\" fi ;; *) echo \"usage: \$0 {start|stop|restart}\" ;; esac exit 0 " > /tmp/anyterm-init sudo chmod +x /tmp/anyterm-init sudo mv /tmp/anyterm-init /tmp/$NAME/usr/local/etc/init.d/anyterm echo "Creating package..." cd /tmp/ sudo mksquashfs $NAME $NAME.tcz sudo md5sum $NAME.tcz > $NAME.tcz.md5.txt cd $NAME sudo find usr -not -type d > ../$NAME.tcz.list cd /tmp/ SIZE="`du -k $NAME.tcz|cut -f1`k" sudo echo "Title: $NAME.tcz Description: Anyterm + gcc4.4 fix Version: $VERSION Author: Phil Endecott Original-site: http://anyterm.org/ Copying-policy: GPL Size: $SIZE Extension_by: andriscom Comments: Anyterm is a combination of a web page and a process that runs on your web server that provides SSH or telnet access. How it works: Anyterm consists of some Javascript on a web page, an XmlHttpRequest channel on standard ports back to the server, an HTTP proxy such as Apache's mod_proxy and the Anyterm daemon. The daemon uses a pseudo-terminal to communicate with a shell or other application, and includes terminal emulation. Key presses are picked up by the Javscript which sends them to the daemon; changes to the emulated screen are sent from the daemon to the Javascript which updates its display. Performance is quite reasonable and SSL can be used to secure the connection. Built with CFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with CXXFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with LDFLAGS: -Wl,-O1 Source modification (gcc>=4.4 fix): #include added to libpbe/src/SmtpClient.cc Use the init.d script to control anytermd: /usr/local/etc/init.d/anyterm start You can start anytermd manually (for debuging purposes): ex.: anytermd --charset UTF-8 --port 7676 --local-only If bad characters are appearing (ex.: in Midnight Commander) then set your LANG and TERM environment variables: TERM=linux and an UTF-8 supported LANG should be fine Create HTTP proxy: (Don't forget to add Authentication rules to protect the page) Apache example: # When someone visits /anyterm they'll be proxied to Anyterm on port 7676. ProxyPass http://localhost:7676 ttl=60 # There are various parameters that can appear at the end of the ProxyPass directive to control the maximum number of connections and so on. See the Apache documentation. ProxyPassReverse http://localhost:7676 Cherokee example: Reverse Proxy Request: URL Rewriting: RegEx: ^/anyterm/$ Substitution: /anyterm.html RegEx: ^/anyterm/(.*)$ Substitution: /$1 Information Sources: Name: anyterm Connection: localhost:7676 Source: $SOURCE Change-log: 2010/10/16 Version: 1.1.29 $DATE Version: $VERSION, fixed charset support, fixed dependecies, fixed init script Current: $DATE Version: $VERSION, fixed charset support, fixed dependecies, fixed init script " > $NAME.tcz.info sudo echo "bash.tcz glibc_gconv.tcz " > $NAME.tcz.dep cd /tmp/ mkdir packages 2>/dev/null sudo rm packages/$NAME.tar.gz 2>/dev/null tar zcf packages/$NAME.tar.gz $NAME.tcz* $NAME-dev.tcz* $NAME-doc.tcz* $NAME-locale.tcz* $SCRIPT_NAME echo " Run bcrypt on /tmp/packages/*.tar.gz... give password: tinycore" echo "Run the extension_audit.sh and reboot a clean system to try the packages!" echo "Send it to: tcesubmit@gmail.com"