Skip to content

Instantly share code, notes, and snippets.

@WesleyAC
Last active November 6, 2018 07:30
Show Gist options
  • Save WesleyAC/cfac4e1011b3cc8a7362ddc148299775 to your computer and use it in GitHub Desktop.
Save WesleyAC/cfac4e1011b3cc8a7362ddc148299775 to your computer and use it in GitHub Desktop.
Daily Musings
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Wesley's Daily Musings</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775"/>
<link rel="self" href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775/raw/feed.xml"/>
<updated>2017-11-20T17:56:45Z</updated>
<author>
<name>Wesley Aptekar-Cassles</name>
</author>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775</id>
<entry>
<title>AWS Loft</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L3"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L3</id>
<updated>2017-11-07T00:00:00Z</updated>
</entry>
<entry>
<title>Clothes</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L16"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L16</id>
<updated>2017-11-08T00:00:00Z</updated>
</entry>
<entry>
<title>Systems</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L32"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L32</id>
<updated>2017-11-09T00:00:00Z</updated>
</entry>
<entry>
<title>Failure</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L46"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L46</id>
<updated>2017-11-10T00:00:00Z</updated>
</entry>
<entry>
<title>Eye velocity</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L65"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L65</id>
<updated>2017-11-11T00:00:00Z</updated>
</entry>
<entry>
<title>Plan 9</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L78"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L78</id>
<updated>2017-11-12T00:00:00Z</updated>
</entry>
<entry>
<title>Typography</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L95"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L95</id>
<updated>2017-11-13T00:00:00Z</updated>
</entry>
<entry>
<title>Dream Data</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L104"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L104</id>
<updated>2017-11-15T00:00:00Z</updated>
</entry>
<entry>
<title>Time Passing</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L112"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L112</id>
<updated>2017-11-16T00:00:00Z</updated>
</entry>
<entry>
<title>Cryptocurrency</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L121"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L121</id>
<updated>2017-11-18T00:00:00Z</updated>
</entry>
<entry>
<title>Bugs</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L134"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L134</id>
<updated>2017-11-19T00:00:00Z</updated>
</entry>
<entry>
<title>Systems Programming</title>
<link href="https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L142"/>
<id>https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775#file-muse-txt-L142</id>
<updated>2017-11-20T00:00:00Z</updated>
</entry>
</feed>
#!/usr/bin/env python3
from datetime import datetime
filename = "muse.txt"
feed_file = "feed.xml"
main_url = "https://gist.github.com/WesleyAC/cfac4e1011b3cc8a7362ddc148299775"
post_url = main_url + "#file-muse-txt-L{}"
class Post:
def __init__(self, date, title, linenum):
self.date = date
self.title = title
self.url = post_url.format(linenum)
def to_xml(self):
return """
<entry>
<title>{title}</title>
<link href="{url}"/>
<id>{url}</id>
<updated>{date}</updated>
</entry>""".format(title=self.title,
date=to_rfc3339(self.date),
url=self.url)
def to_rfc3339(date):
return date.strftime('%Y-%m-%dT%H:%M:%S') + "Z"
def gen_feed():
posts = []
in_post = False
post_date = None
with open(filename) as fh:
for linenum, line in enumerate(fh):
if not in_post:
try:
# We detect each post by the fact that it starts with a
# date in the correct format.
post_date = datetime.strptime(line.strip(), "%b %d %Y")
in_post = True
except ValueError:
pass
else:
posts.append(Post(post_date, line.strip(), linenum))
in_post = False
return """\
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Wesley's Daily Musings</title>
<link href="{url}"/>
<link rel="self" href="{url}/raw/{feedfile}"/>
<updated>{date}</updated>
<author>
<name>Wesley Aptekar-Cassles</name>
</author>
<id>{url}</id>
{entries}
</feed>""".format(url=main_url,
feedfile=feed_file,
date=to_rfc3339(datetime.now()),
entries="\n".join([e.to_xml() for e in posts]))
if __name__ == "__main__":
with open(feed_file, "w") as fh:
fh.write(gen_feed())
-------------------------------[ Daily Musings ]-------------------------------
Nov 07 2017
AWS Loft
---
I was working from the AWS Pop-up Loft in NYC today. I walked in, signed up on
their fancy iPad sign in station (luckily my email account is associated with
AWS, or they wouldn't have let me in), and took a seat in the coworking area.
They had free soda, coffee, beer, and food.
On the five-block walk back home, I walked past two homeless people, trying to
drum up donations so they could get food to eat.
Something about this situation seems off.
Nov 08 2017
Clothes
---
I bought some clothes today. I was surprised by how much a coat cost, but when I
think about it more, it's actually more surprising how little it costs - it was
produced in Vietnam, and made out of a combination of wool, cotton, and
polyester. It's possible that the cotton was grown in Vietnam, but for the wool
at least, it's much more likely that it was produced in Australia, shipped to
Vietnam, assembled into a coat, shipped to a warehouse in the US, then
eventually to the store I bought it from - it's impressive that all the parties
involved can make some profit when the final cost of the coat is < $40 USD.
And that's not even considering all the 5 for $10 tee shirts I see in Chinatown.
Economies of scale, I guess. And probably really terrible labour laws as well.
Nov 09 2017
Systems
---
I spent this evening doing some binary reversing/exploiting. I think that the
reason that it's so appealing to me is just because of the simplicity of it -
there's just a stream of bytes as input - get the right bytes, and you can
make magic happen :)
Although on the other hand, there are some exploits that are really beautiful
despite not fitting into this model (rowhammer, etc).
I guess I just like the idea of finding ways that the stated rules of a system
are different from the actual rules, which is really the core of hacking.
Nov 10 2017
Failure
---
I read the book "How Children Fail" a few months ago - it's a book by an
elementary school teacher about the systemic ways that our school systems fail
- it's quite good. It includes various stories from the author's teaching
experience, which are actually some of the most memorable parts of the book for
me, although for a strange reason...
They're often describing kids working on simple math problems (for example
solving 11 * 2), and struggling as a result of some fundamental misunderstanding
or flaw in their approach. As a result, whenever I work on hard problems, I just
imagine that I'm like one of the kids described in the book - despite my best
efforts, unable to see the flaws in my reasoning and approach that would be
obvious if I were just smarter.
It's a completely useless way of thinking about things, but that doesn't stop
me from thinking about it.
Nov 11 2017
Eye velocity
---
I was on the subway today, and there was a red and white striped pattern on the
wall of the tunnel (somewhat like caution tape). If I just looked straight
ahead, it was completely blurred, but when I flicked my eyes in the reverse of
the direction the train was going, I could see the pattern clearly for a split
second. This is surprising to me, given the speed of the train, and the fact
that I was only sitting a few feet away from the wall. I guess eyes move way
faster than I though. Either that, or there's some sort of stabilization that
my brain does that lets me see the image properly. Either way, it was quite
surprising to me.
Nov 12 2017
Plan 9
---
I installed Plan 9 in a VM today an played around with it. I can't speak for
any of the deeper design ideas, but from a UX perspective, it's *awful*.
Everything is a text field, and all text fields are always editable. You can
go back and edit the scrollback history in the terminal, for example. An even
worse example of this is in `acme` - one of the text editors. Both the menu bars
and the editor buffers are text fields, which are editable. When you click on
a command, it doesn't matter if it's in the menu bar or the editor buffer,
it'll be executed. To add to all of that, it has a sloppy focus model, where
the text field that has focus is the one that your keystrokes will go into, so
if you bump the mouse a bit, you end up editing your menu bar.
I liked plan 9 much better when I was reading about it's design and philosophy
than now that I've actually used it...
Nov 13 2017
Typography
---
I spent part of today reading about typography - it makes me really curious
about what goes into font rendering - apparently in TrueType, there's a full-on
VM used for hinting, complete with branching/looping/etc. And OpenType supports
a monsterous number of optional doodads. It seems like an incredible amount of
complexity and work, but the results are quite beautiful.
Nov 15 2017
Dream Data
---
It's somewhat mind boggling the amount of data that's generated and then
immediately discarded in the form of people dreaming and then forgetting about
it upon waking. Billions of people conjuring up worlds of their own design
every night, and then collectively forgetting about them as soon as they wake.
Nov 16 2017
Time Passing
---
It's odd how difficult it is to notice the flow of time. Usually, we break up
our days and think of them as discreet units of time, arranged into weeks or
months or years. It's only when my sleep schedule gets completely screwed up
that I realize that time is continuously passing, and that our methods of
breaking it up are completely artificial.
Nov 18 2017
Cryptocurrency
---
I'm finding it really funny to watch hippie/anarchist/outcast crypto folks
completely reinvent the stock market without realizing at all that they're
becoming everything that they hated. So many smart people are seeing dollar
signs with scam ICOs and new cryptocurrencies, but spending your life following
the bitcoin exchange rate is no better than being a bleary-eyed trader,
succumbing to sleep each night to fever dreams of stock tickers. Many of the
same folks who were chanting “We are the 99%” five years ago are spending their
days now staring at exchange rate charts and trying to decide which altcoins
will give the best returns.
Nov 19 2017
Bugs
---
It's sort of depressing to think that, given the rate at which secuity issues
are found, it's almost certian that all of the devices that I own have major
security issues in them, and this will continue to be the case for the
forseeable future.
Nov 20 2017
Systems Programming
---
I think the reason that I like systems/low-level programming is that it's
simple, relative to other programming - you actually have a chance at holding
everything that's going on in your head, which is essentially impossible in
higher-level languages and systems. Given that, I find it funny that low-level
programming is called "systems programming" - all other types of programming
inherently involve dealing with much more complicated systems, just by virtue
of being built on top of "systems programming." Yet only the low-level stuff is
called "systems programming."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment