April 29, 2012

What I have been Tweeting

  • Oklahoma has BOTH the Norman Music Festival and the Oklahoma City Festival of the Arts! #OKC #NORMAN #OKLAHOMA #
  • …going on right now #

posted by Bobby Rockers • • No Comments

April 28, 2012

Fear Lying Upon a Pallet

Almost all of of my recent work has been using NoSQL solutions, my favorite of which is Couchdb.  Easily the best feature of Couch is the RESTful JSON API that it uses to provide data.  Because you get your DB queries back to you directly as JavaScript objects, you don’t have to worry about application servers or middle tier systems for N-Tier development.  This is HUGE and make the whole web development (and given that most mobile applications are actually web apps) must cleaner, faster, and more functional for the end user.

Couch does have a couple weaknesses.  The one that has been giving me the most headaches is the lack of documentation for their parameters that the server can handle as part of the JSON View (map/reduce) phase. So here are a number that I have found useful over the last few months.  I will update this list as I find more.

  • key=abc The most commonly passed option to a given couchdb view.  This provides a way to select a single unique (well, I guess probably unique) key for a given view.  That said, view keys DON’T HAVE TO BE UNIQUE in couchdb.  Meaning, that if more than one result returns with abc this will also return those multiple results.
  • keys=[abc,123,ACC] A JSON encoded list of keys to use in a given map/reduce function.  Basically the same as above but without the need to call multiple network queries.
  • startkey=abc Used with endkey=abC to provide reange selection for a given view.  startkey will accept (as valid input) anything that would be valid in a standard couchdb view key, even JSON objects.  So think startkey=[a,]&endkey=[a,{}] to get a range of all keys=[a,somethingElse].
  • endkey=abC Counterpart of startkey, see the above reference.  One thing to note, it is generally better to specify another object and the end of a range if you want to inclusively select a range.  So {} is a better end range value than ZZZZZZZZ is.
  • limit=100 Select on the first N number of results.  This parameter is particularly useful for paginated return results (like “showing 1-100 of 399.)  Reduces network bandwidth for a given request.  Because map/reduce functions are cached upon request, the response time for the server isn’t any faster, but there is less data to download.
  • skip=100 Work with the above parameter limit to return a group result set.  For example you can limit the return result to 100 documents starting from 101 going through 200 (think email counts in gmail) with the ?limit=100&skip=100.
  • descending=true Reverses the return result order.  Will also work with limit, skip, startkey, etc…
  • group=true The default result for a given map/reduce function (which has been re-reduced) is a total, i.e. a single number.  In my case this is seldom the result I am actually looking for so this command provides the bridge between the full re-reduce and what I is most commonly sought, the groups result.  Your final results when this option have been passed it to return the reduced functions grouped by the map keys.  Instead of a single row with {key:null, value:9999} you will get multiple rows with the key being the name of the map key i.e [{key:"bob",value:"444"},{key:"tom",value:555}].  If you created design documents and view them inside of Futon, group=true is the default.  Which can be a little confusing when you actually try and make a JSON request and find you get a different result.
  • group_level=2 An alternative to the above parameter is the group_level option which will actual group the resulting reduce by the number of levels specified IF you key is an array matching at least that many arguments.  While the example above is for two levels the number can be as many array places as your key has.  This become particularly helpful when working with years and dates.  For a detailed example checkout this post.  That said, group=true is the functional equivalent of group_level=exact.
  • reduce=false Turn OFF the reduce function on a given map/reduce query.  This is the default if not reduce is defined but you can override it on views that DO have a reduce function if you only want the results of the map.
  • include_docs=true For map queries (that do not have a corresponding view) this option will include the original document in the final result set.  This means the structure of your JSON rows object will be {_id, key, value, doc} instead of the normal {_id, key, value}.  This will save you an additional JSON request if you are using the map query as a lookup for a particular database query.

posted by Bobby Rockers • • No Comments

Landed on Us

The new graphical boot splash for Linux is a program call Plymouth.  It provides feature like kernel mode graphics, flicker free boot messages, full boot logging, and… animation. The install is pretty simply, as the root user do the following:

yum -y install plymouth-theme-*
plymouth-set-default-theme –list (to see a list of all installed plymouth themes)
plymouth-set-default-theme nameOfMyTheme -R

Of particular note is that the -R is different from earlier installs of plymouth that required you run the command plymouth-rebuild-initrd.  Most tutorials online list the old way of rebuilding plymouth and following them will leave you with an unchanged system.

One of the nice features of plymouth is that the boot splash is loaded before the actual boot process when the initial RAM disk image is being loaded.  This means you get the pretty boot image while you are doing things like entering your hard drive decryption pass phrase.

posted by Bobby Rockers • • No Comments

April 18, 2012

that the ripest might fall

Git is simply amazing when it comes to branching and merging.  I probably have half a dozen branches, each with a unique feature I am working on.  Git makes combining and working with branches so easy that it simply seems natural to store test-functionality on different branches, across multiple repositories, and between different developers.

…and HOLY CRAP is it fast!

That said I hit a problem today that I had to hunt down the answer to, so I am posting it here for easy reference in the future.  The basic issue is that whenever you create a new branch that is then pushed to someone else as a remote branch, git automatically (as would be logical) associates those branches together because they share the same name.  This makes future pushes easy and allows other users to continually get updates when you have commits you want to make available.

The problem occurs when you try to PULL from that new remote branch (because the users or repository has made some of their own changes.)  Git does NOT automatically associate pulls with the remote branch of the same name, even though this associates pushes.  So how do you fix this?  The error message says to modify your config file and look at the git-pull man page, but that could quickly cause insanity based solely on the extent of the complexity of the command set for git.  I probably spent an hour looking through documentation.

The answer was, like you didn’t know where this was going, Google.  Ultimately you can the problem with a fairly simple command that WILL AUTOMATICALLY update your config.

git branch --set-upstream yourBranchName origin/yourBranchName

And that is it! Hopefully that saves someone the time that I lost.

posted by Bobby Rockers • • No Comments

April 15, 2012

What I have been Tweeting

  • AHHHHH… can someone please get rid of the fscking .service extension on #fedora 16 systemd. Simplicity, your doing it wrong! #
  • Now we are down to Obama, Obama Light, and #ronpaul GO RON PAUL! #
  • Oh yeah. My vote for Charlie & Warren, my request form for meeting passes, and the annual report! #berkshirehathaway http://t.co/LQeVX3pp #
  • Tornadoes evidently hit part of Norman. Some buildings downtown are damaged. Looks like an exciting weekend #OK #OU #

posted by Bobby Rockers • • No Comments

April 12, 2012

Geniuses remove it

I am starting to believe that in the Poettering household, simplicity was considered a cancer that must be tortured and destroyed with extreme vigor.  Systemd is quickly becoming thoroughly ubiquitous in Linux systems everywhere.  While Systemd tries to do everything for everybody (it is supposed to eventually replace sysvinit, chkconfig, automount, logging, cron, and a whole host of other things) ultimately the primary intent of Systemd is to speed up the boot process.  It does this job exceedingly well.  This concern about boot time is a direct response to the speed of which other Unix based OSes boot and reference material even explicitly points to Apple as a reference.

That said, sysvinit did have one thing going for it… IT WAS SIMPLE.  Heck, just getting a list of available services is a pain in the ass now and generally requires looking up documentation just to remember how to do it.  Simple actions in systemd are annoyingly complex with a cheat sheet that looks like it was written by a Perl regular expression programmer on acid.  I will be the first to admit that systemd-analyze plot is pretty awesome and, considering that systemd was designed by the same guy who created PulseAudio, we should probably be thankful that it isn’t even MORE complex.  But still, something just seems wrong about using an all-for-everything program on an OS that was designed to be simple and efficient.

posted by Bobby Rockers • • No Comments

April 8, 2012

What I have been Tweeting

  • I have been living in #oklahoma long enough that I find something uniquely comforting about a strong wind on a warm day. #
  • Somebody pinch me… #Thunder have beaten the Lakers, Clippers, Heat, and Bulls in the last 6 games… by a total of 39 POINTS! #
  • I would really like to know what activities Justices Breyer and Ginsburg think DO NOT fall under Article 1 Section 8? #supremecourt #
  • I 235 is a parking lot hope everyone in #okc is okay tonight #
  • "When one has not had a good father, one must create one."
    –Friedrich Nietzsche #

posted by Bobby Rockers • • No Comments

April 6, 2012

to create a space for them

OK, first I have a new favorite quote:

Concentrated power is not rendered harmless by the good intentions of those who create it.
–Milton Friedman

And second… Well, this was a topic I had not expected to be posting about again but the last couple weeks I have found myself spending more and more time building RPM packages for Fedora.  Thankfully the development stack (and documentation) for Fedora is noticeably better than it was for Redhat 9.  So, in my usual fashon, I am listing some of the more useful information I have RECENTLY come across for building RPM packages on Fedora 16.

  • Recommended Method for adding Users & Groups — A Fedora wiki page that discusses the best way to add new users to a system during the rpm install process.  There is no recommendation for REMOVING users during uninstall.  Additionally, rpmlint will scream about un-registered users if you don’t provide reference users for rpmlint.  This bugzilla report discusses how to best alleviate that problem.
  • Packaging Tricks — A stupidly useful Fedora wiki article discussing common issues/fixes for doing package builds.  Some of them are simply look-up problems (like knowing group package groups are available.)   Some of the information is much more advanced package configuration tips (like converting badly encoded files to UTF-8.)  All are really helpful.
  • Frequently Made Mistakes — In the same vein as the Packaging Tricks but specifically focused on problematic RPM methodology.  One correction on this page.  The correct location for checking SPEC files from other Fedora packages is not correctly listed (Fedora doesn’t use CVS anymore.)  The correct location is in their git repository.
  • Creating Sub-packages — Is a very early stage draft document on the Fedora Documentation website that discusses how to best create multiple sub-packages from a given SPEC file.  I had been needing good documentation on this process and this seems to be the start of it.
  • RPM Groups — Raw list of valid RPM package groups.
  • How to Make RPM Packages — Exactly what the name implies.  Probably the best starting point for Fedora Linux software packagers.
  • rpm –showrc — This command will list all the current Macros defined for the rpm build environment.  It even includes your custom local setup.  It is a great place to grep for path information and to verify directory locations for installation.  It has probably been around forever but I honestly didn’t know about it until a couple days ago.

posted by Bobby Rockers • • No Comments

April 1, 2012

What I have been Tweeting

posted by Bobby Rockers • • No Comments

March 25, 2012

What I have been Tweeting

  • Screw u @Loves… Swipe card, enter least 4 digits, press y or n for car wash…. Ahhhh just give me my damn gas! #
  • Looks like a beautiful Saturday Oklahoma! Have a great weekend everybody #

posted by Bobby Rockers • • No Comments

March 21, 2012

fair company, wonderful price

“The first evidence of a dying company is that is creates more policies than it does ideas.  Forms ultimately kill more creativity than competition does.”
–Bobby Rockers

posted by Bobby Rockers • • No Comments

March 18, 2012

What I have been Tweeting

  • Trying out a command line twitter client. So far TTYtter is pretty awsome. #
  • Ya, TTYtter is pretty freggin awsome: http://t.co/wR3Fhy0K #
  • How do they find anyone to actually put up Mitt Romney posters? I don't know anyone who is actually excited enough about him to bother. #
  • In the world of computer science there are two kinds of documentation 1) Reference manuals for users who already know wh #
  • and 2) Simple HOWTO tutorials that are enough to get a new developer started… I always seem to be in the "OTHER" group from the one that #
  • Heather loved it when I showed her the RPG I made as a kid. I love that woman! #
  • new favorite playlist? metal covers of 80s songs! Dope, You Spin Me; Marilyn Manson, Tainted Love; Placebo, , running up that hill; etc.. #
  • #npr Remind me to follow Steve Martin's Caps Lock #
  • Best use for #Pabst I have ever seen. They aren't even worried about someone stealing it. http://t.co/6tRHueOz #
  • my wife always seems to root for the "bad guy" in movies. I need to stop being so nice to her. #

posted by Bobby Rockers • • No Comments

March 16, 2012

to understand the simplicity

Quick links to some Fedora repositories that I have been using on multiple machines.  For the last four years I have been using OpenSuse on my primary systems, but dumb decision after dumb decision has made it too frustrating for server use.  I don’t know how Windows users do it but I find it amazingly frustrating having to use one system for my desktop and another for my servers, so it is Fedora 16 all around.

  • Adobe Flash Repo — Hosted Fedora rpm’s for Adobe Flash.  Because we all need to to watch YouTube clips of the evolution of dance.
  • Fedora Project Third Party Repository List — Fedora keeps a list of approved third party repos.  The list is basically required for a truly complete Linux distribution.
  • RpmFusion — A uber useful repository made from the combined efforts of three of the best RPM repositories Fedora ever had; Dribble, FreshRPMS, and Livna.
  • Livna — Yes, yes, I know I just said that RpmFusion combined the efforts of Livna; but for legal reason there was a single package that could not be included in RpmFusion.  Livna has stayed in existence for distribution of this single package and maintains compatibility with both the RpmFusion repos and the primary Fedora repos.
  • nodejs — Fedora repository linking to primary node.js and Google V8 packages.  Node.js is a JavaScript platform built on Google’s Chrome JavaScript runtime.  This allows you to build JavaScript files as locally executable applications the same way you would Python or Perl.
  • Google Apps — There are actually links to popular Google applications (Map, Chrome, etc.) The rpm packages, when installed, actually add their remote repositories to your yum list for future updates.

posted by Bobby Rockers • • No Comments

March 4, 2012

What I have been Tweeting

  • Best Tea EVER! TAZO Vanilla Rooibos. It didn't even need honey, or suger, or something to make it tast good. http://t.co/4UMi40S0 #

posted by Bobby Rockers • • No Comments

March 1, 2012

81,000 Pages and Counting

My new favorite quote:

Corruptissima republica plurimae leges
–Publius Cornelius Tacitus

posted by Bobby Rockers • • No Comments

February 26, 2012

whatever it takes to give away

I have been using Git for basically all my personal projects lately and have found it to be exceedingly powerful.  While the entire system is worth using simply for the content level tracking; the flexability of a fully distributed version control platform lends itself to thinking about software development entirely differently.  That said, it takes a little configuring to get it working (the way I like) on all my development systems.  Below is a random mash of links, config files, settings, and tips that I have had to re-reference while using git.

  • gitolite – Hosting (and managing) your own git central server..  Done forget to ‘git push’ you changes when done.
  • git Repos with gitolite – The gitolite people are not particularly… cuddly.  This is an easier how-to for gitolite.
  • git crash course – git for svn users.
  • git cheat sheet – Huge list of misc. git commands, configuration information, usage, cloning, etc..
  • git push origin master – The command I most often forget when push back from a cloned repository.

Here is my default ~/.gitignore file:

# Desktop Linux #
#################
.*
!.gitignore
*~
.directory

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db

My primary git configuration settings look like this.  The most useful parts are the alias (that not coincidentally look similar to SVN) and the colorized output.

color.ui=auto
color.branch.current=yellow reverse
color.branch.local=yellow
color.branch.remote=green
color.diff.meta=yellow bold
color.diff.frag=magenta bold
color.diff.old=red bold
color.diff.new=green bold
color.status.added=yellow
color.status.changed=green
color.status.untracked=cyan
alias.st=status
alias.ci=commit
alias.br=branch
alias.co=commit
alias.df=diff
alias.dc=diff –cached
alias.lg=log -p
alias.lol=log –graph –decorate –pretty=oneline –abbrev-commit
alias.lola=log –graph –decorate –pretty=oneline –abbrev-commit –all
alias.ls=ls-files

Of course core.excludesfile, user.name, and user.email have to be set but they are depend on which system I am running on.

posted by Bobby Rockers • • No Comments

February 22, 2012

Proud of the ones I’ve got

Got a few really handy debug/development features inside of Catalyst that I have been using lately.

  1. RenderView‘s dump_info parameter.  Basically when using the default view close handler in Catalyst (i.e. Catalyst::Action::RenderView) you can add ?dump_info=1 to the end of any URL in your application server to get the exception dump.  While this will need to be turned off in any live environment, it is crazy helpful during development or when hunting down a bug in your code.
  2. StackTrace  is Catalyst plug-in (i.e. Catalyst::Plugin::StackTrace) that gives better detailed information to the server during the request process.  You add it to the primary project module library under lib/MyProjectName.pm INSIDE the use Catalyst parameter.
  3. If you are using Template Toolkit for your Catalyst template layouts you can include the following hook as well.  [% USE Dumper(Indent=1) -%]  will allow you to Data::Dumper variables to the browser window for debugging purposes.  After specifying the use statement you can simply [% Dumper.dump(variablename) %] out anything you want to see.  Again, bad for production, but really really good for development.
  4. Finally, one of my favorites; if you run DBIC_TRACE=1 script/myapp_server.pl -r for your development server (instead of the standard script/myapp_server.pl) you get automatic refreshes AND full DBIC traces of your error messages.  Think detailed messages with full function states when your server crashes.  The best part is that you simply don’t use the DBIC_TRAC option on production to remove the functionality when you are live.

posted by Bobby Rockers • • No Comments

February 19, 2012

as necessary as food to the body

As anyone who has ever meet her will attests, I married WAY WAY out of my league, something I am constantly amazed and grateful for.  Today I am especially grateful for her cooking, specifically my most recent addiction, hummus.  So as a quick post (and to help me find it next time I need it) I thought I would post her receipe.  The following is Heather’s Lemon and Spice hummus.  It is unquestionably the best hummus I have ever had, as can be proven by the fact that it actually gets me to eat large quantities of vegetables in the consumption of it.  Just blend everything listed below.

  • 15oz can of chickpeas
  • 4 Tbsp lemon juice
  • 1/4 cup extra virgin olive oil
  • 2 cloves garlic chopped (or 2 tsp if you buy it pre-chopped)
  • 1/2 tsp sea salt (we really only eat sea salt anymore but the flavor quality REALLY matters in this recipe)
  • 1 tsp cumin
  • 1/2 tsp cayenne pepper
  • parsley to taste

posted by Bobby Rockers • • No Comments

February 18, 2012

the parents of security

When developing in Unix, on any software project of marginal size, the remote toolkit of choice is always ssh.  Besides being stupidly secure it is also crazy fast and is supported on almost every platform in existence.  The only problem that slowly starts to develop is directly related to how often it is used… password management.  Thankfully ssh has support for key sharing requiring you to only enter you passphrase during the initial login on a given machine.  On KDE there is even a tool for getting your passphrase requested when initially logging in. That said, installing it DOES NOT set it up so here are some basic instructions for getting it working on any current version of Suse.  It even has support for kwallet to store the password (but if you do so remember to has a wallet password AT LEAST as strong as your passphrase or the whole point is mute from a security standpoint.

Start by installing ksshaskpass:

zypper install ksshaskpass

Now, create a file called ssh-add.sh and put it into your .kde4/Autostart directory. It should contain the following:

#!/bin/sh
export SSH_ASKPASS=/usr/lib64/ssh/ksshaskpass
/usr/bin/ssh-add

The export path will depend on the install location of ksshaskpass. Try typing:

which ksshaskpass

and see what the result is. Make it executable by only your local users. While not really required it is a simply thing that can be done to help make the whole install a little more secure.

chmod 700 ./ssh-add.sh

posted by Bobby Rockers • • No Comments

February 17, 2012

And if it’s a bad script…

JavaScript has a couple features that I wasn’t aware of until I saw a recent video on Node.js.

  • – splice – A function to pull out a single element from an array.  So [1,2,3,4,5].splice(1,1); will return 2.  Additionally the array will afterwords look like [1,3,4,5].
  • – indexOf – Need to find out what a specific index number for a given value is (basically a reverse index look-up) something like [8,7,6,5,4].indexOf(7); will return a 1.  I actually thought indexOf was a function of the HTML DOM for some reason.
  • – delete – Built in function to delete a specific index of an array.  Something like a=[5,6,7,8]; delete a[0] will remove the individual entry for a[0].  Now depending on environment delete will shorten the array for that element, some environments will simply turn that array element to null effectively blanking out that one entry.

posted by Bobby Rockers • • No Comments
Next Page »