Archive for April, 2009

Tinkering

Tuesday, April 21st, 2009

I’d hate to travel the entire world, to finally have seen it all, and to know that there is no place I can go that my imagination can precede me.

Spending 30 minutes doing 30 tedious 1 minute chores is infinitely inferior to learning or creating a method for doing each chore in 5 seconds. Even if the process takes 4 hours.

Sometimes maybe it’s useful to think of God in human terms rather than philosophical terms. If the major religions are any testament, God is not human, but carries a lot of human qualities. A “jealous” God, an “angry” God. Maybe I’m dancing off of thoughts from my father, but I don’t really ascribe these sort of imperfect qualities to God directly: I feel they are a way he’s given us to relate to him. We’ll never know what it’s like to have an infinite mind and arms so sensitive that they can place an atom as quickly as they can smash it to pieces (whatever those are called), but we do know what it’s like to feel in control. We see “powerful” people, and we know wisdom when it falls on us. We think hard sometimes. Especially on 4/20 ;) . We can relate… kinda. And all this makes me wonder what it must have felt like at the beginning of time.

Out of eternity you appear, either like a blink or a mountain rumbling out of an ocean. Both of them would be equally majestic given your size. And you begin placing rocks in a dark, quiet, almost sterile universe. The cracking sounds of your creation aren’t even audible because you haven’t poured in the air for them to sing in. And yet the act of creation amidst the immense peace and patience of the galaxies you’re building is grating in your head like a migraine. Intertwined with your gentle activity is this uncontrollable flood of events that will take place on the stage you are piecing together. Every movement is just a tiny action, but requires the energy to move millions of years of history. Knowing that the entire series of every drama man will ever take part in, every massacre, every love story, every redemption, every injustice, every everyday happening. It’s all coming. It’s all effected. That’s gotta be powerful, but I cannot imagine the feeling; so words like “powerful” work for me.

At some unknown point in time, I fell out of the habit of testing every truth I came across against the truth that I already had. What I found is that there is truth everywhere, amidst a million lies. But it’s best that way. Without contrast, nothing is anything. And without lies, what is truth. The existence of lies does not permit us to ignore new truth, nor does the presence of truth suggest that everything is.

With almost every concept, it’s easy to play the extremist. Pry out the line drawers, ask them to place their bets, then test their tenacity as they admit to increasingly horrible, outrageous things. When you’ve had enough of them, snap the spine of that little line. Hold nothing back. You win. Enduring another cold night in your dark hole of complete certainty will be just a little bit easier. But everyone knows you’re mathematically deficient if for every optimum you try both ends, but nowhere center.

Clear pee is so satisfying… especially if it’s from like seven cokes. If I were a waiter I would daydream every shift thinking of a way to automate the entire process of feeding people.

We should add a subsidy to the tax system that rewards horrible people for not having children that year. By shifting the cost/reward ratio in favor of people who really want children, at least the kids that we do have will be loved.

If you want to do something, you better have a few really good reasons why you shouldn’t do it, or you should do it. Developing a great idea and then blowing it off is some sort of tacit acknowledgement that you’re a weiner who can’t even do what you want to do. You’re a waste of america.

Tax Day Tea Party

Thursday, April 16th, 2009

If you’ve followed much of the television news recently, you’ve at least heard tidbits about the tax day “tea party”, where people are mailing (or faxing) in tea bags with their tax returns to let Washington know that gosh darnit we hate taxes.

Seriously, wtf? Two things are wrong.

First of all, the politicians know you hate taxes. They also know you want all this spending. The greasy politician is the perfect embodiment of the consensus of American desire, and nowhere is that more perfectly illustrated than in the two-facedness of our policy makers. Americans want oratory, they want promises, and they want the whole of government to cater solely to their selfish whims. Moreover, these lovely citizens will be happy so long as it seems like the attention is on them, and those are the only rules of the game. The one way your elected officials can do this is to lie, because mutual exclusion lends itself to impossibility and later, mutual unhappiness. But if this batch isn’t good at lying we will find better liars. We deserve the best. It’s not even partisian, we all know it’s true. Lies are best hidden behind complex systems and large bureaucracies. Yes, some things require a lot of paperwork and a lot of manpower. Yes, bureaucracies do a good job at keeping a status quo, at maintaining an equilibrium when an otherwise unruly public would whipsaw the country to death. But they also do a pleasant job hiding things, even unintentionally. You can fact check and promise write and quote and platform all you want, there’s just no way to deliver everything.

Secondly, the Boston Tea Party was a real effing big deal. It didn’t make history books because people made a few cented symbolic gesture. Symbolic gestures are the sort of thing that people do when they are ready for the government to screw them wherever it hurts. Symbolic gestures are the blog posts against censorship, the last few squeals that come from a body that is just about ready to give up under a crushing force. Symbolic nonsense. Better to keel over and die. You don’t get people dressing up in costumes and lighting crap on FIRE sort of effect when all you’re posturing is half dollar tea. Oh bomb squads came out to examine your tea? Wow. What happened in history was domestic terrorism, what we have now is a disgrace to that entire attitude and the American drive that put us where we are today. You don’t have to hurt anyone to make a point, but is anyone REALLY effected? Maybe someone was forced to make a speech that said “I heard you.” Which really means: “I acknowledge your existence and have already calculated you into my plan. I’d allot more resources toward your causes but we have already hit a policy equilibrium and unless that is upset by external electoral forces I have no reason to adjust the numbers.” Darn, maybe next year.

Let’s maintain our dignity during these trying times. Please don’t fall for the gimmicks. Make your moves count, lest they become a commodity of the existing orders.

Business Idea: Placebo Pharmacy

Monday, April 6th, 2009

A lot of people are well aware of the placebo effect: a medical (and probably psychological) phenomenon that people respond to simply being treated, whether or not the treatment has any medical value. The simplest example is issuing a sugar pill as an anti-depressant. A lot of patients feel that they need medication and their body responds appropriately.

This is well known and studied extensively. Wikipedia has several interesting (and cited) facts like:

  • The color of the pill in relation to the expected effect is significant.
  • The greater price of the placebo the greater the effect.
  • Injections work better than pills.

You can already buy placebos through Walgreens (if your doctor prescribes Cebocap or similar sounding drugs, you’ve been duped) by prescription. Walgreens rakes in $50 per 100 pills or so, and all you’re getting is a very fancy looking sugar pill. But this is just the first step.

The placebo pharmacy would require extensive research. There are studies that suggest over the counter cough treatments don’t “work”, beta-blockers don’t “help”, drugs for ear infections are no better than placebo, and fake knee surgery works just as well as real knee surgery in cases. This isn’t because people are stupid, it’s because the brain is so much more complex than we can imagine. But the trick is that placebo can often times be much better than no treatment at all. Doctors are able to prescribe Cebocap because it works, and people will continue to buy it with all its markup because it really does provide a benefit to them (so long as they’re in the dark). You can’t just say that since these medicines provide no benefit above placebo that they are worthless, because there is effect.

Enter, Pharcebo. Every treatment that offers no benefit over placebo, every prescription that really doesn’t need a medicine, tons of stomach pains and anti-depressants, all under the guise (intentionally) that it really does work. Intense propoganda would be necessary to keep the secret from leaking out and spoiling all its medicines, but maybe these could be subsidized by the inevitable testimonies from people for whom the medicines work. And so long as the employees themselves believe it too, the placebo effect is enhanced by their smiles and confidence that the treatments will work.

Homeopathy operates almost entirely under the placebo effect; why let shady practicioners take all the profits. America needs a Pharcebo on every corner, if only to truly psychologically scar the people who will inevitably learn its secrets.

Rsync Backup

Thursday, April 2nd, 2009

Backups are horrendous, and rsync with the –delete option can be disastrous. I don’t know how many times I’ve double checked the order of arguments just to avoid catastrophe. Enter: nrepo.

Insert a file at the root of the directory you’re wishing to synchronize called .nrepo. Inside, put the full path of the rsync. Mine:

root@iamnafets.com:/data/backup

Next, run nrepo push to push your directory to the remote location, deleting only what doesn’t exist locally and nrepo pull to pull the remote server into your local directory. This keeps you from having to remember paths, etc, and keeps the syntax minimal. Even better, the server is kept clean and simple has a directory with the updates. Additionally you can do nrepo co <path> [name] to pull down a remote location into a directory with the corresponding .nrepo file. Once my music files finish uploading (never), this should make synchronizing them among my computers a breeze.

#!/bin/bash
 
case "$1" in
  co)
    if [ "$2$3" == "" ]; then
      echo "Need at least a remote location."
      exit 1
    else
      remote=$2
      if [ "$3" == "" ]; then
        dir=./
      else
        dir=$3
      fi
      echo "Creating nrepo of $remote at $dir."
      mkdir $dir/
      echo $remote > $dir/.nrepo
      nrepo pull $dir
    fi
    ;;
  push)
    echo "Pushing..."
    if [ "$2" == "" ]; then
      dir="./" #This is the default
    else
      dir=$2
    fi
    if [ -f $dir/.nrepo ]; then
      remote=`cat $dir/.nrepo`
    else
      echo "Not an nrepo."
      exit 1
    fi
    rsync -av --progress --delete --exclude=.nrepo $dir $remote
    ;;
  pull)
    echo "Pulling..."
    if [ "$2" == "" ]; then
      dir="./" #This is the default
    else
      dir=$2
    fi
    if [ -f $dir/.nrepo ]; then
      remote=`cat $dir/.nrepo`
    else
      echo "Not an nrepo."
      exit 1
    fi
    rsync -av --progress --delete --exclude=.nrepo $remote $dir
    ;;
  *)
    echo "Wrong Args"
    ;;
esac

Xanga Dump Part 1

Wednesday, April 1st, 2009

So I wrote a lot of really awful Xanga stuff in high school that is almost embarassing it’s so awful. But in some ways it’s fun to look back and see how stupid you were as a kid (or how stupid I am now…looking back from 2020) and thus I’d like to archive my Xanga.

It’s been a really long time since somebody worked on a script to dump Xangas into a WordPress (or other) importable format. The last project I can see met its demise around 2005. Hopefully this one won’t be as complex and thus will require a lot less maintenance. I’d like to use a sed template so that the script can just as easily write SQL as it can XML. My bash is a little rusty, so it should be good practice. I’m going to break this up into three steps, and since this is bash, three files.

  1. Find all the URLs associated with an account.
  2. Download all the URLs and separate each post.
  3. Parse each post and bind all the information to variables for a template.

The first step is getting an index of all the pages that we’re going to want to pull. The following script will pull down pages and look for the “next” link.  Then it will recursively pull that page looking for another next link. The script dies once it’s clear we’ve found no more next links.

#!/bin/bash
 
# Pulls all the urls associated with <username>'s Xanga
# and outputs them on stdout
#
# USAGE: ./xanga_urls <username>
#
# Stefan Mai
# ====================================================
 
LAST_COUNT="-1"
URL_COUNT="1"
URL_REGEX="http://$1.xanga.com/\?nextdate=[^&]*&direction=n"
if [ "$1!!" == "!!" ]; then
  echo "USAGE: $0 " >&2
else
  echo http://$1.xanga.com &gt; urls
  while [ "$URL_COUNT" != "$LAST_COUNT" ];  do
    echo -e "\033[1mFound $URL_COUNT url(s).\033[0m" >&2
    echo "========================================"
    LAST_COUNT=$URL_COUNT
    curl `tail -n1 urls`  |
      egrep 'Next 5' |
      egrep -o "$URL_REGEX" >> urls
    URL_COUNT=`wc -l urls | cut -d' ' -f1`
  done
  cat urls
  rm urls
  echo "Done!" >&2
fi

It wouldn’t be absurd to cache each of these pages, but I don’t think anyone does this process more than once and I think Xanga’s servers can take the massive amount of traffic produced.

More later.