Merge branch 'master' of woozle.org:projects/homepage

This commit is contained in:
Neale Pickett 2015-02-02 21:27:57 -07:00
commit aaba43634e
4 changed files with 124 additions and 29 deletions

View File

@ -4,12 +4,13 @@ import (
"net"
"fmt"
"time"
"sync"
)
const MAGIC = "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78"
func isAlive() bool {
conn, err := net.Dial("udp", "h.woozle.org:30919")
func isAlive(host string) bool {
conn, err := net.Dial("udp", host)
if err != nil {
return false
}
@ -28,24 +29,59 @@ func isAlive() bool {
return true
}
var wg sync.WaitGroup
func waitClose(c chan<- string) {
wg.Wait()
close(c)
}
type HostEntry struct {
host string
owner string
}
var hosts = []HostEntry{
{"h.woozle.org:30919", "Ginnie"},
{"h.woozle.org:44321", "Neale"},
{"h.woozle.org:58000", "Amy"},
}
func ping(results chan<- string, e HostEntry) {
defer wg.Done()
if isAlive(e.host) {
results <- fmt.Sprintf("%s is playing at %s", e.owner, e.host)
}
}
func main() {
results := make(chan string, 5)
for _, host := range hosts {
wg.Add(1)
go ping(results, host)
}
go waitClose(results)
fmt.Println("Content-type: text/html")
fmt.Println("")
fmt.Println("<!DOCTYPE html>")
fmt.Println("<html>")
fmt.Println("<head>")
fmt.Println("<meta name=\"viewport\" content=\"width=device-width\">")
fmt.Println("<style type=\"text/css\">#a{font-size: 500%; text-align: center; background: silver;}</style>")
fmt.Println("<title>Is Ginnie playing Minecraft PE?</title></head>")
fmt.Println("<style type=\"text/css\">#a{font-size: 120%; background: silver;}</style>")
fmt.Println("<title>Minecraft PE ping</title></head>")
fmt.Println("<body>")
fmt.Println("<h1>Is Ginnie playing Minecraft PE?</h1>")
fmt.Println("<p id=\"a\">")
if isAlive() {
fmt.Println("yes")
} else {
fmt.Println("no")
fmt.Println("<h1>Are The Picketts playing Minecraft PE?</h1>")
fmt.Println("<ul id=\"a\">")
count := 0
for msg := range results {
fmt.Printf("<li>%s</li>\n", msg)
count += 1
}
fmt.Println("</ul>")
if count == 0 {
fmt.Println("<p>Sorry, looks like nobody's playing right now.</p>")
}
fmt.Println("</p>")
fmt.Println("<p>Use the external server address <code>h.woozle.org</code>, port <code>30919</code> to join in.</p>")
fmt.Println("</body></html>")
}

View File

@ -4,7 +4,62 @@ All bets are for $1.
Neale's prediction is the one stated.
Los Angeles Population (Blake)
------------------------------
==============================
On Feb 24, 2029, the metropolitan area commonly known as "Los Angeles"
will have, at most recent measure, double-digit population decrease.
Neale's Rationale
-----------------
LA uses a ton of fresh water, brought in from all over the place.
As droughts worsen, there will be increasingly large fights over water.
Regardless of the political outcome,
places closer to fresh water will tend to keep that water.
LA is not close to fresh water.
Las Vegas is going to have the same problem,
but predicting the collapse of Las Vegas didn't seem as challenging.
------
This Page (Nemo Thorx)
======================
By 7 December, 2028, Neale will have updated this web page
within the last 12 months.
Neale's Rationale
-----------------
I actually think Nemo's right,
but this was such an amusing bet,
I couldn't turn it down.
------
DC Power (Nobody yet!)
======================
By 2030, over ⅓ of US residences currently being built will be wired with a DC power bus.
Neale's Rationale
-----------------
When I counted in 2014, we had only 5 electrical devices
that used Alternating Current.
Everything else ran off a "wall wart":
an AC to DC transformer.
In addition to DC being tremendously safer
(it won't stop Junior's heart when he sticks a fork in a USB port),
it's also potentially more efficient to have a single transformer for the entire house.
As more houses move to solar power with battery storage,
the conversion from DC batteries to AC wall power,
just to be converted again to DC,
will be a tantalizing inefficiency to conquer.
And with the introduction in 2015 of USB delivering up to 100W,
there will even be a standard to use.

View File

@ -42,14 +42,15 @@ At work, I use an Intel NUC.
Software
--------
I recently switched to Xubuntu from Arch Linux.
I'm not sure I'll stay here, but I got tired of maintaining my one-off
/sbin/init that uses runit.
Linux distributions are all heading toward systemd,
which I strongly dislike. But I figure it's time to catch up
and abandon understanding how the computer boots.
I run Arch Linux, with a shell script PID 1 that I maintain because I enjoy tinkering with early userspace.
It uses runit from busybox to manage starting and stopping daemons.
Runit is a lot like systemd or upstart at core: daemons don't do the double-fork trick, and log to stdout.
On the desktop, I run Google Chrome, xterm, and acme from plan9port.
My window manager varies a lot.
Most times it's Openbox plus tint2, but sometimes I go back to 9wm (which I maintain).
I'm starting to make overtures at Wayland.
Occasionally I kick up inkscape or gimp, and mixxx for my DJ work.
Most of my non-work computer use is through Chrome, which ties me strongly
to Linux, for better or worse.
@ -65,14 +66,17 @@ All my home printing is through Google Cloud Print.
What would be your dream setup?
-------------------------------
A Chromebook that had Acme and my development tools.
I really like how my wife's Chromebook updates itself,
and how it doesn't need dozens of mystifying apps in the default menu.
I'm actually not too far away right now.
I like working in the cloud, and for my development stuff,
acme is pretty great.
Some day I may figure out how to get Chrome to expose its window manager,
and then I'll probably abandon all of XFCE4,
since I don't really use it for anything other than kicking up Chrome
and acme.
I spend a lot of time fretting about window managers.
Hopefully I can move to Wayland soon, and port 9wm to it.
Or maybe I can get Chrome to expose its window manager.
I kind of wish I didn't need a gazillion packages in order to run my 3 main programs
(chrome, acme, and xterm).
But I don't know how I can fix that, and I'm not sure I really even want to.
I would also like to do away with the FitPC print server.
I'd love to be able to buy a little box that will hop on our wireless network

View File

@ -1,7 +1,7 @@
Title: xss: X Screensaver Construction Kit
Author: Neale Pickett <neale@woozle.org>
[xss](http://woozle.org/~neale/src/xss) is a suite of X screensaver
[xss](http://woozle.org/neale/g.cgi/x11/xss) is a suite of X screensaver
utilities. You can use shell scripts to glue the tools together to
build your own screen saver and/or locker. You can use any
`xscreensaver` hack instead of the built-in `magic` hack, or you can use
@ -86,9 +86,9 @@ won't lock if the cursor's at the top of the screen.
Download
--------
You can [browse the source](http://woozle.org/~neale/g.cgi/xss),
You can [browse the source](http://woozle.org/neale/g.cgi/x11/xss),
download a [tarball of the latest
commit](http://woozle.org/~neale/g.cgi/xss/snapshot/xss-master.tar.gz), or clone the
commit](http://woozle.org/neale/g.cgi/x11/xss/snapshot/xss-master.tar.gz), or clone the
git repository:
git clone http://woozle.org/~neale/projects/xss