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.

Another fix I ran across comes from an initial pull from a remote repository that is empty. Because the original repository (empty) shares no files in common with my local repository (that I have added files to.) Git gets upset. The error generated looks something like this:

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as ‘master’.
fatal: The remote end hung up unexpectedly

It can be fixed with the following command:

git push origin master

Then all remaining pushes should be fine as now you have a shared reference to use for future pushes.

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.
  • rpmdev-setuptree is one of several tools available in the rpmdevtools package (yum install rpmdevtools.)   Running this command will setup a local build directory in THAT USERS home directory (as you should NEVER build packages as root using the system wide build directory.) Additionally it will create a stock .rpmmacros config file.  You will still want to define your own %packager and %vendor macros.
  • Package Guidelines – The definitive guide from Redhat on creating Fedora/Redhat rpm files for distribution.
  • RPM Dev Tools – Web listing of some of the new automated packing tools for RPM based distributions.  Things like creating your default build environment and spec file format checker.
  • CPAN2RPM – A tool for building rpm files from the Comprehensive Perl Archiving Network.  While tools like cpanplus work well for package installation, I prefer the flexibility and consistency of rpm packages and this is a nice way to be able to use rpm files for CPAN modules.
  • cpanspec – Another tool for building spec files (and therefore rpm packages) from cpan repository information.  Generally I use cpan2rpm to create a basic package and then modify the spec file to work anyway, so this might be a better option.

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.

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

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.

Am I Really Supposed to Believe…

That a company can be a technologically innovative, cutting edge, information driven entity when I get emails from them that have this on the bottom?

NOTICE: This message is covered by the Electronic Communications Privacy Act, Title 18, United States Code, Sections 2510-2521. This e-mail and any attached files are the exclusive property of Pictometry International Corp., are deemed privileged and confidential, and are intended solely for the use of the individual(s) or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or believe that you have received this message in error, please delete this e-mail and any attachments and notify the sender immediately. Any other use, re-creation, dissemination, forwarding or copying of this e-mail is strictly prohibited and may be unlawful.

Does anyone in the world seriously believe that putting this crap at the bottom of am email actually protect them from ANYTHING?

Players win games, teams win championships

Some thoughts & quotes from John Maxwell’s “Equipping 101”

The most expensive employee isn’t the highest paid one, but the least productive one.

Attitude is:
-The advance man of our true selves.
-Our best friend or our worst enemy.
-Is more honest and more consistent that our words.
-Is the thing that draws people to us or repels them from us.
-Is the librarian of our past.
-Is the speaker of our present.
-Is the prophet of our future.

People become like their models. Who are our leaders models?

Finding good leaders is like mining for gold, you have to dig out 2 tons worth of dirt to find it but once found pays for all of the work.

You can tell a persons character by his/her relationships.

Finding talent in a business is no different than finding talent for a professional sports team. You have to recruit, scout, and draft the best you can find. Eventually, you will have to pay for that talent or risk loosing it; so stop investing in players that don’t grow.

Leaders attract potential leaders!

An organization’s Growth potential is directly related to its personnel potential.

As a potential leader you are either an asset to an organization or a liability to it.

I am sure the grapes are sour

I am just documenting a couple Firefox settings that need to be fixed.  These settings can be modified in the about:config section of the browser.  Why Firefox seems to think they need to copy everything Chrome and Safari do is beyond me but they keep changing things anyway:

browser.tabs.insertRelatedAfterCurrent, false -Changes the default behavior in FF4 to that of FF3.6 when it comes to opening tabs. After the change tabs will open at the END of the tab bar as GOD intended them to.

browser.tabs.closeButtons;3 – Places the close button at the end of the tab bar by itself instead of on each individual tab.  When clicking the close button the currently viewable tab will be closed.  This is a simple user interface standard that Firefox has botched-up back in version 3.  Close buttons per tab break good UI design because the tabs shift as they close and the close icons (when on the tabs) are NEVER in the same place.  Additionally, it is simply easier to close multiple tabs if you don’t have to move your mouse to close them.

This Too Shall Pass

The following are some of my favorite excepts from O.G. Mandio’s “The Greatest Salesman in the World.”  They are broken down by scroll number the quote comes from.  It is a short book that is really more of a “guide for living” than a “guide for selling”.

Scroll Number I:

“Time teaches all things to him who lives forever but I have not the luxury of eternity.”

“Failure is man’s inability to reach his goals in life, whatever they may be.”

“…the only difference between those who have failed and those who have succeeded lies in the difference of their habits… I will form good habits and become their slave.”

Scroll Number II:

“I will love the ambitious for they can inspire me!  I will love the failures for they can teach me.  I will love the kings for they are but human; I will love the meek for they are divine.  I will love the rich for they are yet lonely; I will love the poor for they are so many.  I will love the young for the faith they hold; I will love the old for the wisdom they share.  I will love the beautiful for their eyes of sadness; I will love the ugly for their souls of peace.  I will great this day with love in my heart.”

Scroll Number III:

“So long as there is breath in me, that long will I persist.  For now I know one of the greatest principles of success; if I persist long enough I will win.”

Scroll Number IV:

“I am nature’s greatest miracle.  Vain attempts to imitate others no longer will I make… I will begin now to accent my differences; hide my similarities.”

Scroll Number V:

” I will live this day as if it is my last… I will waste not a moment mourning yesterday’s misfortunes, yesterdays defeats, yesterday’s aches of the heart, for why should I throw good after bad.”

” I will avoid with fury the killers of time.  procrastination I will destroy with action; doubt I will bury under faith; fear I will dismember with confidence.”

“Henceforth I know that to court idleness is to steal food, clothing, and warmth from those I love. “

” This day I will make the best day of my life.  This day I will drink every minute to its full.  I will savor its taste and give thanks.  I will maketh every hour count and each minute I will trade only for something of value.  I will labor harder than ever before and push my muscles until they cry for relief, and then I will continue.”

Scroll Number VI:

“Today I will be master of my emotions… Weak is he who permits his thoughts to control his actions; strong is he who forces his actions to control his thoughts.”

“If I feel all-powerful I will try to stop the wind. If I attain great wealth I will remember one unfed mouth. If I become overly proud I will remember a moment of weakness.  If I feel my skill is unmatched I will look at the stars.”

Scroll Number VII:

“I will laugh at the world.  No living creature can laugh except man.”

” For all worldly things shall indeed pass.  When I am heavy with heartache I shall console myself that this too shall pass; when I am puffed with success I shall warn myself that this too shall pass. “

“Never will I allow myself to become so important, so wise, so dignified, so powerful, that I forget how to laugh at myself and my world.”

Scroll Number VIII:

“Today I will multiply my value a hundredfold… To surpass the deeds of others is unimportant; to surpass my own deeds is all.”

“I will commit not the terrible crime of aiming too low.  I will do the work that a failure will not do.  I will always let my reach exceed my grasp.”

Scroll Number IX:

“…dreams are worthless, my plans are dust, my goals are impossible.  All are of no value unless they are followed by action.  I will act now.”

“Never has there been a map, however carefully executed to detail and scale, which carried its owner over even one inch of ground.”

“I will not avoid the tasks of today and charge them to tomorrow for I know that tomorrow never comes.  Let me act now even though my actions may not bring happiness or success for it is better to act and fail than not act and flounder.”

“I will act now… When I awake I will say (these words) and leap from my cot while the failure sleeps yet another hour.”

“Tomorrow is the day reserved for the labor of the lazy.  I am not lazy.”

“This is the time.  This is the place.  I am the man.  I will act now.”

Scroll Number X:

“Guide me, God.”

The book itself has got me thinking about writing down the outline for my own personal philosophy.  I am not talking about a religious creed or a statement of beliefs but a guide to define the philosophy of life I would like to follow.  In ancient Greece, and to a lesser extent in later Roman cultures, it was common for the upper classes to adopt a philosophy of life.  In fact parents sent their sons to schools of philosophy, like Stoicism and Asceticism, partly to acquire such a philosophy.

And now for something completely

Working on an install of kubuntu that is farily non-standard and my lvm configuration caused grub to go totally insane. So are some notes I am posting from the live CD (that doesn’t have lvm configured.)

If separate /boot
$ sudo mount /dev/mapper/Qmail-root /mnt
$ sudo mount /dev/sda1 /mnt/boot
$ grub-install –root-directory=/mnt /dev/sda

And here and here are some specific grub2 install information for Ubuntu.