├── LICENSE ├── README.md ├── engridden ├── gridstart └── hubchat /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Sean Hinchee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grid Unix Scripts 2 | 3 | Adapted from mycroftiv's grid scripts in ANTS: https://bitbucket.org/mycroftiv/antshill 4 | 5 | For connecting to the public grid run by mycroftiv: http://9gridchan.org/ 6 | 7 | ## Contributing 8 | 9 | These exist more as a PoC and updates/contributions are very welcome. 10 | 11 | ## Things you need 12 | 13 | - [plan9port](https://github.com/9fans/plan9port) 14 | - `sudo` (for now) 15 | - the `sensible-browser` symlink 16 | 17 | ## Things you run 18 | 19 | - gridstart, from the current working directory 20 | 21 | Note: You can also run engridden on its own if you just want the services mounted 22 | 23 | ## Things that are bugged 24 | 25 | - ☺ 26 | 27 | -------------------------------------------------------------------------------- /engridden: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rc 2 | # Connect to all the grid services 3 | 4 | FUSEDIR = '' 5 | 6 | switch($#*){ 7 | case 1; 8 | FUSEDIR = $1 9 | case *; 10 | echo 'usage:' $0 'n-directory' 11 | exit 'usage' 12 | } 13 | 14 | NAMESPACE = `{namespace} 15 | srvfiles = (chat sirjofripub registry 9gridchan_registry) 16 | 17 | # Delete any stale files, TODO — should prompt 18 | for(f in $srvfiles){ 19 | nf = $NAMESPACE/$f 20 | ff = $FUSEDIR/$f 21 | 22 | # Delete stale srv files 23 | if(test -e $nf) 24 | rm $nf 25 | 26 | # Unmount fuse mounts 27 | if(test -e $ff) 28 | fusermount -zu $ff 29 | } 30 | 31 | # Plumber hack 32 | plumber 33 | rm $NAMESPACE/plumb 34 | 35 | # Connect all the services 36 | srv 'tcp!chat.9p.zone!9990' chat 37 | srv 'tcp!oat.nine.sirjofri.de!564' 'sirjofripub' 38 | srv 'tcp!registry.9gridchan.org!6675' '9gridchan_registry' 39 | srv 'tcp!registry.9p.zone!6675' 'registry' 40 | # srv tcp!registry.demo.metacoma.io!30099 '9minegrid_registry' 41 | 42 | # Fuse mount all the successful connections 43 | for(f in $srvfiles){ 44 | if(test -e $NAMESPACE/$f){ 45 | if(! test -e $FUSEDIR/$f){ 46 | mkdir $FUSEDIR/$f 47 | } 48 | 9pfuse $NAMESPACE/$f $FUSEDIR/$f 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /gridstart: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rc 2 | # Initialize a grid connection and all its windows 3 | 4 | # This is the directory where all your connections will be mounted 5 | N = $HOME/n 6 | 7 | ## Set up environment 8 | 9 | # Necessary evil unless you regex plumb messages — TODO 10 | echo Submit a patch to fix the /n hack, pls 11 | sudo ln -s $N /n 12 | 13 | 14 | # Connect all services, nuke stale files 15 | ./engridden $N 16 | 17 | ## Start opening windows 18 | 19 | # Chat 20 | 9term -s 'hubchat' & 21 | 22 | # Acme 23 | acme /n/griddisk & 24 | 25 | # Browser 26 | sensible-browser http://wiki.9gridchan.org/message_board 27 | 28 | # Page 29 | page $N/gridroot/lib/musicant.png & 30 | 31 | -------------------------------------------------------------------------------- /hubchat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # You'll need to install plan9port https://github.com/9fans/plan9port 3 | 4 | echo "++JOIN" $USER "from UNIX™!++" | 9p -a 'tcp!chat.only9fans.com!9990' write chat 5 | 9p -a 'tcp!chat.only9fans.com!9990' read chat & 6 | while read l; do 7 | echo $LOGNAME : "$l" 8 | done | 9p -a 'tcp!chat.only9fans.com!9990' write chat 9 | 10 | --------------------------------------------------------------------------------