* [9fans] u-root srvfiles command works fine on Plan 9
@ 2025-02-05 23:50 ron minnich
2025-02-06 7:55 ` sirjofri
0 siblings, 1 reply; 4+ messages in thread
From: ron minnich @ 2025-02-05 23:50 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]
As a test I built and ran the u-root srvfiles command on 9front.
srvfiles is a dead-simple http server I used at google when I needed an
easy way to get files from here to there and did not have a lot of time to
fool around with keys and such.
I tried it again today, and it works fine, and made it easy for me to get
kernels from my 9front laptop to my mac to run qemu.
on 9front I run the command
srvfiles -d / -h 192.168.0.20
and I can then grab them from safari or whatever on osx.
Core code:
https://github.com/u-root/u-root/blob/main/cmds/exp/srvfiles/srvfiles.go
...
func maxAgeHandler(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r
*http.Request) {
for _, v := range cacheHeaders {
if r.Header.Get(v) != "" {
r.Header.Del(v)
}
}
h.ServeHTTP(w, r)
})
}
func main() {
flag.Parse()
http.Handle("/", maxAgeHandler(http.FileServer(http.Dir(*dir))))
log.Fatal(http.ListenAndServe(net.JoinHostPort(*host, *port), nil))
}
I like using Go on Plan 9. It's the environment I like with the language I
like. I know there's been mention of Rust, but (1) I don't see it being
native, now or ever, and (2) I don't like it as much as Go. If you want a
"starter pack" for Go on Plan 9, I think u-root is not a bad place to look.
If you want to contribute more Plan 9 support to u-root, we would welcome
it.
Thanks
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tb13f273be9a2d368-M20ccfedae2cbd87a789820f0
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
[-- Attachment #2: Type: text/html, Size: 3078 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] u-root srvfiles command works fine on Plan 9
2025-02-05 23:50 [9fans] u-root srvfiles command works fine on Plan 9 ron minnich
@ 2025-02-06 7:55 ` sirjofri
2025-02-06 16:58 ` ron minnich
0 siblings, 1 reply; 4+ messages in thread
From: sirjofri @ 2025-02-06 7:55 UTC (permalink / raw)
To: 9fans
06.02.2025 01:07:06 ron minnich <rminnich@gmail.com>:
> As a test I built and ran the u-root srvfiles command on 9front.
>
> srvfiles is a dead-simple http server I used at google when I needed an easy way to get files from here to there and did not have a lot of time to fool around with keys and such.
That's why I built webbox: https://shithub.us/sirjofri/webbox/HEAD/info.html
It's a pure rc+tcp80 solution, which uses a tcp80 with a few extensions (see the readme). It also has a snarf solution (fill the snarf buffer with text or "data" from a web form), and it's very small. The core part (displaying/downloading files) is done by tcp80 as that already has a solution for that.
I also have an even simpler webshare script that's a bit buggy, but that only exposes a single file and directly opens a qr code for the url. I wasn't satisfied with that solution, and I wanted something two-way, so I built webbox.
sirjofri
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tb13f273be9a2d368-M41273b29c9f5c52a96457a73
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] u-root srvfiles command works fine on Plan 9
2025-02-06 7:55 ` sirjofri
@ 2025-02-06 16:58 ` ron minnich
2025-02-09 22:53 ` rjkroege
0 siblings, 1 reply; 4+ messages in thread
From: ron minnich @ 2025-02-06 16:58 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]
webbox looks quite nice, thanks for the tip!
On Thu, Feb 6, 2025 at 5:51 AM sirjofri <sirjofri+ml-9fans@sirjofri.de>
wrote:
> 06.02.2025 01:07:06 ron minnich <rminnich@gmail.com>:
>
> > As a test I built and ran the u-root srvfiles command on 9front.
> >
> > srvfiles is a dead-simple http server I used at google when I needed an
> easy way to get files from here to there and did not have a lot of time to
> fool around with keys and such.
>
> That's why I built webbox:
> https://shithub.us/sirjofri/webbox/HEAD/info.html
>
> It's a pure rc+tcp80 solution, which uses a tcp80 with a few extensions
> (see the readme). It also has a snarf solution (fill the snarf buffer with
> text or "data" from a web form), and it's very small. The core part
> (displaying/downloading files) is done by tcp80 as that already has a
> solution for that.
>
> I also have an even simpler webshare script that's a bit buggy, but that
> only exposes a single file and directly opens a qr code for the url. I
> wasn't satisfied with that solution, and I wanted something two-way, so I
> built webbox.
>
> sirjofri
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tb13f273be9a2d368-M9dd3fb57a68de7dfc6921f33
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
[-- Attachment #2: Type: text/html, Size: 2864 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] u-root srvfiles command works fine on Plan 9
2025-02-06 16:58 ` ron minnich
@ 2025-02-09 22:53 ` rjkroege
0 siblings, 0 replies; 4+ messages in thread
From: rjkroege @ 2025-02-09 22:53 UTC (permalink / raw)
To: 9fans; +Cc: ron minnich
(Possibly pointless me-too.) I also wrote something similar:
https://github.com/rjkroege/oneserve -- it has upload, download and
directory listings.
Rob.
On Fri, 7 Feb 2025 01:58:29 +0900, ron minnich <rminnich@gmail.com> said:
> webbox looks quite nice, thanks for the tip!
>
> On Thu, Feb 6, 2025 at 5:51 AM sirjofri <sirjofri+ml-9fans@sirjofri.de>
> wrote:
>
>> 06.02.2025 01:07:06 ron minnich <rminnich@gmail.com>:
>>
>> > As a test I built and ran the u-root srvfiles command on 9front.
>> >
>> > srvfiles is a dead-simple http server I used at google when I needed an
>> easy way to get files from here to there and did not have a lot of time to
>> fool around with keys and such.
>>
>> That's why I built webbox:
>> https://shithub.us/sirjofri/webbox/HEAD/info.html
>>
>> It's a pure rc+tcp80 solution, which uses a tcp80 with a few extensions
>> (see the readme). It also has a snarf solution (fill the snarf buffer with
>> text or "data" from a web form), and it's very small. The core part
>> (displaying/downloading files) is done by tcp80 as that already has a
>> solution for that.
>>
>> I also have an even simpler webshare script that's a bit buggy, but that
>> only exposes a single file and directly opens a qr code for the url. I
>> wasn't satisfied with that solution, and I wanted something two-way, so I
>> built webbox.
>>
>> sirjofri
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tb13f273be9a2d368-Mc74345e2f849ac5ba9582925
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-09 22:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-05 23:50 [9fans] u-root srvfiles command works fine on Plan 9 ron minnich
2025-02-06 7:55 ` sirjofri
2025-02-06 16:58 ` ron minnich
2025-02-09 22:53 ` rjkroege
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).