Matt Hackmann

To Become the Most Boring Person I Can Be

Posted On
Tags
general
mundane

This blog has once again fallen into dusty shambles. So, I'm going to kick in another post-a-day type experiment... starting tomorrow.

What I'm going to do is keep a daily log for a week, but instead of my usual type rambling, it'll be just 100% facts, completely devoid of emotion, opinion, or adjectives/adverbs (using as few as possible). A little something like this:

I woke up at 10:15am this morning. I didn't actually want to leave my bed, so I fished my iPad out from under my bed and checked my email, Facebook, and reddit. I decided to make German potato salad today but lacked all the ingredients required. After deliberation, I decided I would bike. I geared up, but after getting out the door noticed that my back tire was again low. I put the bike back in my apartment and took the car instead. Since I was no longer worried about distance or the roads I would need to take, I went to Safeway because they have a better selection of food than Target. Once at the store, I purchased potatoes, scallions, bacon, and white wine vinegar. After returning home, I cleaned a large pot to boil the potatoes in. They are currently boiling now.

Seems a bit like those old journal entries of mine, no?. For contrast, here's how I'd rewrite the first couple of sentences.

Given that I'm only half way into this day, I would label it as almost entirely ordinary. Consciousness began to return to me somewhere around 10:15a, about an hour later than my usual 9a (largely thankful to my late night of playing Danganronpa, no doubt). Despite the lateness, I didn't feel like leave the warm comforts of my bed, so I grabbed my iPad (generally kept beneath my bed) to entertain myself with. I did a quick check of my email, Facebook, and skimmed reddit. Despite Alien Blue being a pretty nice app, I don't like to "deep dive" into my usual subreddits on a mobile device because I feel the experience would be diminished on a small screen (moe must be observed with as many pixels as possible).

So, yeah. That's a thing I'm going to do because I'm otherwise bored and have little to write about (or am not willing to expend the effort in doing so).

Head Sensations

Posted On
Tags
general

I'd been considering writing a blog post on this subject for some time, but balked because it seemed an odd thing to talk about. But, after the topic came up at lunch not long ago, I figured why not. Besides, I need to post something this month as I've not missed posting at least one thing per month since August 2010. Gotta keep the streak alive.

The aforementioned topic is a physical sensation that's been dubbed on the internet as "ASMR", or "autonomous sensory meridian response".It's honestly a really shitty name and I thought the original idea of "brain orgasm" explained it better, but the community doesn't take kindly to that since it's not a sexual thing. To actually describe the feeling is a bit difficult as there's nothing really to relate it to. The usual description is "head tingles" and, while that's not entirely untrue, it doesn't seem quite accurate either. I'd describe it more as a feeling of mild pressure sensation on the top and back of the scalp that will at times "bloom" in intensity across the scalp in response to stimuli. Yes, there are also tingles.

What triggers this seems to be hit and miss. Slow, steady, soft speech patterns or rustling noises can do it, so does close personal attention such as a visit to the eye doctor. The aforementioned community is a subreddit that deals in posting videos that cause this sensation for people. These generally range from creepy videos of people whispering things into a microphone to creepy videos of people making various noises with various things or sometimes role play videos that are a mix of the two. There's no getting around the creepy factor, because it is and doubly so if you don't know what the fuck is going on.

As for myself and my history with this... condition(?), I've had it for as long as I can remember. I recall fairly well the first time I actually tried to vocalize it to somebody. One of my cousins and I were coloring at my grandma's house and I said something about tickles in my brain. I believe I was six or seven at the time. My young self would try to figure out ways of inducing the "tingles", at one point settling on raising and lowering my eyebrows repeatedly in erratic patterns (the results were mixed).

As I rolled into my later teen years, I kind of forgot about whole thing except when I would go to the optometrist. It wasn't until mid-2012 when I saw an ad for the subreddit that it was brought back to my attention and a little bit of perspective put on the whole thing. Having been tuned back into the phenomenon and having a better idea of how to trigger it, I tested the waters with the creepy videos and, though it's hit and miss, they work. Now, late in the evening, I'll often put one of those videos on, lay down on my bed or the couch with my earbuds in, and take a train to Relaxation Town.

It's quite nice, really.

Getting Around the Iron Curtains

Posted On
Tags
coding
webdev

Last week, a friend clued me into CloudFlare, a CDN service that also somehow has a free tier with unlimited bandwidth. This played right into my fears of hitting the 4TB bandwidth ceiling on my current hosting tier. Put into perspective, that's pretty close to all the digital storage I have available in my apartment. Also, it quells the fears that users on the other side of the pond are getting subpar download times. So, with minimal weighing of the consequences, I flipped everything over. And, lo and behold, it worked!

Almost...

You see, some countries and ISPs think that blocking shit on the internet is a really great idea. I'm not going to go on a political rampage right now because that's not my style, but when you're getting messages about users unable to download content from your hosting due to these reasons, it's more than a little irritating. But, goddammit, I'm a programmer and there had to be a solution that'd get me the best of both worlds without shelling out additional money.

After disabling the caching layer on that subdomain (cdn.awwni.me), I began weighing my options. Somehow I needed to find out if a particular user had the ability to talk to CloudFlare (now working through licdn.awwni.me). Most views were going to be served straight out of reddit.com, but I had a couple of attack vectors: the redditbooru.com main site, which is hit often for people doing repost checks or looking at albums that have been posted to reddit, and the RedditBooru browser extensions. The former was going to be the easiest to tinker with (so I thought) and affect the most people.

Since I had a way to test availability, I needed to actually perform the test itself. What I devised was an iframe that would be loaded on every page of RedditBooru. It would load the following script:

Code: html
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="http://licdn.awwni.me/cdncheck.js"></script>
  4. </head>
  5. </html>

Code: javascript
  1. // If this page has managed to load, go ahead and set the CDN cookie to expire on my 100th birthday
  2. var date = (new Date('2086/6/8')).toGMTString();
  3. document.cookie = 'use_cdn=true; expires=' + date;

If the user has access to the licdm subdomain, a cookie is set noting such and does so on the cdn.awwni.me domain. Since these users were now marked, this information can be used in nginx to reroute the user.

Code: nginx
  1. if ($host != licdn.awwni.me) {
  2. set $useCdn <S>"P"</S>;
  3. }
  4. if ($http_cookie ~<em> 'use_cdn') {
  5. set $useCdn <S>"${useCdn}C"</S>;
  6. }
  7. if ($useCdn = PC) {
  8. rewrite ^/(.</em>) http://licdn.awwni.me/$1 permanent;
  9. }

Getting around nginx' inability to do multiple conditionals in one line aside, the above checks to make sure that the cookie is set and that the user is not coming from the licdn.awwni.me domain. That last bit was added when I accidentally set the CDN cookie on licdn and got caught in an infinite redirect loop for a while. If either of the conditions aren't met, the image will just serve out of my machine.

There are a few drawbacks to this approach. First of all, every request still hits my machine, so I'm still taking a bandwidth hit. Secondly, those getting served out of the CDN have an extra hop for the redirect. However, I believe neither of these issues are bad enough to warrant removing it completely. For starters, on my side I'm now only serving a handful of bytes as opposed to millions. Secondly, a redirect on a single image is pretty much inconsequential to the user's experience.

I've only been running with this solution for a few hours, so I don't yet have a good look on how great the benefits are. Time will tell on that one, but I haven't yet heard any issues on images not loading, so there's some comfort.

My God, I am a creepy person

Posted On
Tags
general

I have this personal website, which essentially means I am my own little mini NSA. If I wanted to, for example, find out if a person I have very few details on were to visit here, I'd be able to find that out. Let's say, for example, I know what probable day they'd view this blog, what page they'd be coming from, and approximately where they live.

Well, I have enough data to know (probably) if that person hit my site and what they did when they got here.

As a hypothetical example, let's say I know they're somewhere in Northern California, probably came to the homepage via a Google search, and did so on February 13th. Alright, first thing's first, grep the logs for that day, that page, and exclude crawlers...

Sweet, now I have a list of IPs. Let's plug those into MaxMind geoip lookup and see what comes of it.

Hmm, no exact match, but ISPs are fuzzy about location and this one is certainly within the area! Alright, now grep the logs for that IP address...

Okay, the person was on the homepage for about three seconds before going to the art page. Once there, they clicked on three pieces of art before leaving the site. All in all, about a minute of time elapsed between the first and final requests.

Other fun things you can find out while grepping logs is that your mother and former boss are the most frequent visitors to your site. The latter - going under a pseudonym - even listened to the Inception soundtrack on your music page sometime back in November while at work.

This is, of course, all hypothetical.

Systems Architecture in the Unknown

Posted On
Tags
webdev
coding

Just over a year ago, I launched redditbooru to the world, rolling together a bunch of ideas spawned by the awwnime repost checker into a single place. In addition to that, I added the ability for users to host content in addition to being able to index multiple subreddits. To say that it became a wild success would almost be selling it short. At launch, it was indexing maybe 5 subs, now it's 16, my server went from averaging ~23/Kbps per month to over 10/Mbps, and am nearing 100k pageviews for a rolling 30 day period. Despite exponential growth in traffic, the site has experienced almost no traffic related issues proving that my code is able to handle scale. What started off as a fun little afternoon of experimenting has become quite a success.

However, things are not without their flaws. On the technical side, the cron that does the indexing has some issues; items hosted through redditbooru can't be posted to more than one sub and indexed in both places and sometimes, in an attempt to pick up on items removed by mods, posts will be incorrectly marked as hidden. On the front end, the user experience is a bit of a mess as I kept bolting on features. In typical Matt Hackmann fashion, I decided that I would rework the entire thing mostly from the ground up with all of my learnings in mind while adding in some user requests. But, I was going to eschew the tried and true PHP/MySQL setup for nodejs/MySQL/mongodb in an attempt to learn something new and bring myself up to speed with the current development fad.

Two weeks into development, I am questioning that decision.Read More