From KiSS DP 558 STAGE2 WiKi
Jump to: navigation, search

Stage2 Extensions

dajomas has created a tarfile which contains a collection of BusyBox compiles. Each compile contains a single tool. The reason for this is to minimize the memory used when creating a webpage using shell commands. You get:

" [ -> test, awk, basename, bunzip2, cal, cat, chmod, clear, cmp, cp, cut, date, dc, df, dirname, dmesg, dos2unix, du, echo, env, expr, false, fold, free, ftpget, ftpput, getopt, grep, gunzip, gzip, head, hostname, hush, ifconfig, kill, killall -> kill, last, length, ln, ls, mkdir, more, mount, mv, netstat, od, ping, printenv, printf, ps, pwd, rdate, rm, rmdir, sed, seq, sleep, sort, stat, strings, stty, sum, tail, tar, tee, test, time, top, touch, tr, true, umount, uname, uniq, unix2dos, uptime, usleep, vi, watch, wc, wget, which, xargs, yes "

To install:

cd /hdd/stage2
wget http://johan.godfried.net/kiss/bbbin.tar
tar xvf bbbin.tar

Now if you want to use these commands in your CGI scripts, start your script like this:

export PATH=/hdd/stage2/bbbin

echo HTTP/1.0 200 OK
echo Content-type: text/plain

And for those wondering, yes, vi works, but only on existing files! So if you want to edit a new file, first create the file (for instance using touch) before editing. The only thing not working in vi (AFAIK) is "." (repeat command)

All the commands included accept the --help argument to display a list of options. If you want more information regarding any of the commands, please don't hesitate to ask.