Winter Running

Winter running is always a bit tricky, unless you live down south or in a warm climate that doesn’t have a change of seasons; I live in “mile-high” country and, trust me, winter is definitely here. I don’t typically run outside as often as I would like during the winter; during the spring & summer I run 5-6 days a week (5 days on, 1 day off), averaging 5 miles on weekday runs (except Fridays where I put in 6) and somewhere between 8-13 or 14 miles on weekend day runs.

It’s not the cold, I can handle the cold (to about 25 degrees); it’s all about layers. My issue is usually around snow and ice; particularly snow and ice that has been walked or driven, melted a bit, frozen again, etc. This condition is a recipe for twisting an ankle or falling on your face (and hoping no one was around to see it and/or post it on YouTube; usually there’s not, except for the hardcore runners out there).

I’m not a fast runner by any stretch, but I do like to maintain a fairly decent pace (most days I consistently maintain an 8 min pace; some days I can get into low 7s; not terribly bad for someone in their forties). With winter running though, the idea of maintaining a pace, as well as proper form, kind of goes out the window real quick; it’s more of navigating where to step and remaining upright. If the path I’m on is snow-covered, I try to stay on the edges where either there’s a little less snow, or, preferably, actual ground (mud, really, but that’s all semantics) where I can get some traction. If I can’t find a good edge, I try to hit dirt patches on the path; I’m sure from an outsider’s view-point I must look pretty odd bounding around like that. As a last resort I’ll step where everyone else has stepped, but cautiously so that I don’t injure myself. When I’m running I [almost] always try to be a considerate runner by “staying in my lane” so to speak versus wondering all over the place (you know who you are). Well, that too, kind of gets tossed aside when running on path blanketed with snow; I will go out of my way to find “the path of least resistance” if you catch my drift.

Winter running is not for the faint of heart and not something that should be done nonchalantly; if you’re not an experienced runner, you probably shouldn’t risk doing so and maybe instead go to a gym and run on treadmill, or, if you’re like me and think a gym membership is monumental waste of money (why would someone pay someone else to lift heavy objects or exercise?), consider investing in a treadmill (or an elliptical, or a rowing machine, or an exercise bike). Basically, the goal is to stay safe and injury free; otherwise you won’t be doing any running, which would be a very bad thing.

And that’s all I have to say about that.

Posted in Fitness | Tagged , , , , , , , , | Leave a comment

Cache Busting CSS

If you maintain your own site you’ve probably run into overzealous caching of CSS by either the web server, ISPs, the browser or some combination of all of all three. Here’s a quick-n-dirty way to bust the caching of CSS without compromising performance:

<?php echo '<link rel="stylesheet" type="text/css" href="/css/index.css?<?php echo(time());?>"/>

The above results in:

<link rel="stylesheet" type="text/css" href="/css/index.css?1492810248" />

The highlighted portion tricks whatever’s caching the .css file into thinking that it has been updated and forces download of a new one to the client. Using the current time (seconds since the Unix Epoch [January 1 1970 00:00:00 GMT]) keeps you from having to generate your own versioning scheme. You can do the same for .js files as well.

And that’s all I have to say about that.

Posted in Geek, PHP, Programming | Leave a comment

Who Cares

Who cares that porn actress, Kim Kardashian, had another kid? Yes, she’s a porn actress, plain and simple; she posted a video of her having sex to the world and for some reason got famous for it and still breaks the Internet flashing herself to the World. Who cares what celebrities are getting divorced? Do we really care that Gwen Stefani’s marriage failed due to, from what I can gather, a cheating spouse or that Ben Affleck got it on with the nanny; how cliché is that? To be honest, and granted I don’t nor will I ever know or meet these people or have any inclination or desire to do so, how could someone step out on those two? But again, I don’t know them and, as I already stated, never will. Who cares what celebrity got married to some other celebrity? Who cares, and this may seem callous, what illness a celebrity may have contracted? Show of hands, who didn’t see this coming for Charlie Sheen? Really just a matter of time before you read about him either showing up dead or, as is the case now, afflicted with a deadly disease. And what idiot thinks it’s OK to have unprotected sex with someone who has been diagnosed with AIDS? No doctor would ever be able to convince me that it would be safe; protected or not. Who cares that some celebrity adopted yet another child? While it’s great the Sandra Bullock is doing what she can to give abandoned children a better life, it’s hardly news worthy. At least she adopted a child in the U.S. instead of buying a kid from some other country like Madonna and Brad Pitt & Angelina Jolie do. What, were the hundreds of thousands of orphaned, abandoned children in the United States spoken for and that’s why they shopped elsewhere or was the adoption process too hard for them? Sandra seemed to been able to navigate through that bureaucracy a couple of times unscathed.

These are everyday events that happen to everyday people. It doesn’t make them any more significant because it happened to some famous person who plays make-believe for a living, spreads their legs for attention or sings.

I guess what I’m trying to get across, is that we as a society need to stop living vicariously through these narcissistic people and start living our own lives. Celebrities only exist to provide us with temporary entertainment to distract us from our otherwise mundane lives and then we don’t think about them anymore; much like the world’s oldest profession where you pay someone for services rendered and show them the door afterwards.

And that’s all I have to say about that.

Posted in General | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Simple Update Notifier

If you have a debian-based distro that is not Ubuntu or Mint (both of which I view as Linux for Apple for Microsoft GUI babies) you may or may not have an update checker task bar applet that lets you know updates are available. Below is a simple script that will do just that.

#!/usr/bin/python
import os
import commands
import re

packages = -1
security = -1

command = commands.getoutput('/usr/lib/update-notifier/apt-check --human-readable')
lines = command.split('\n')

for line in lines:
    match = re.match('\d+ packages can be updated.', line, re.M|re.I)
    if match:
        parts = line.split(' ')
        packages = int(parts[0])
    match = re.match('\d+ updates are security updates.', line, re.M|re.I)
    if match:
        parts = line.split(' ')
        security = int(parts[0])

updates = (packages > 0) or (security > 0)

if  updates:
    os.system("/usr/bin/yad --notification --no-buttons --text=\"package updates: " + str(packages) + "\nsecurity updates: " + str(security) + "\"")

Here’s how it will show in the task bar (I use tint2):

screenshot-20151130213546_253x48

 

 

Then you simply run:

sudo apt-get -y upgrade

Here’s a wrapper script that you can throw into your crontab:

#!/bin/sh

LOCK=/tmp/update_checker.lock ; export LOCK

if [ -f $LOCK ]; then
  echo "$0 already running; exiting ..."
  exit 1
fi

touch $LOCK

$HOME/bin/update_check.py >> $LOCK 2>&1

rm $LOCK

Execute the above script every 4 hours (or however frequent you want):

* */4 * * * DISPLAY=:0 /home/cygnus/bin/update_checker.sh > /dev/null 2>&1
Posted in Geek, Linux, Scripting | Leave a comment

Google+

I thought I read recently that Google was retiring the failed experiment Google+. Why then do I need a Google+ account to change my profile image on YouTube? The same holds true for Gmail. So, Google, are you nixing Google+ or aren’t you and why do I need to join that SPAM engine that you laughingly pass off as a social media site?

And that’s all I have to say about that.

Posted in Geek, General | Leave a comment