Saturday, August 17, 2013

Sunday, March 10, 2013

Loan's Beautiful Thoughts


Click to enlarge

* Feeding children, and taking them out for fun is easy. But teaching children to know and to follow in righteousness is hard.
* Cho con ăn ngon thì dể, cho con đi chơi thật thú vị cũng dể. Nhưng dạy con biết và làm theo dúng phải thì khó.

And from Billy Graham:
* Pleasures are the things that appeal to our flesh and to our lust. But joy is something else. Joy runs deep.
* Vui thích là điều xuất phát trong xác thịt và tình dục. Nhưng vui mừng thì khác hẵn. Vui mừng thật sâu đậm.

You can find more inspiration from Loan's musings and some of her favorite quotes here in English, and here in Vietnamese.

In Him.

Friday, March 08, 2013

Gnome3 Terminal does not execute my .bash_profile

If you have ever had this issue where changes to your .bash_profile do not take effect the next time you launch the gnome-terminal.  Well, do not worry.  Just open the gnome-terminal and go to Edit -> Profile Preferences _> Title and Command (tab), and you will see this:

Click to enlarge

Make sure that the "Run commnad as a login shell" is checked.  Then close, and close the terminal, and relaunch gnome-terminal, and you should see that your .bash_profile has been executed.

Hope that helps.

Tuesday, March 05, 2013

SOLUTION: fatal: Couldn't find remote ref {Branch} Unexpected end of command stream

Symptoms:  You issue a command and get the error like this:

$ git pull --rebase upstream a_branch_that_we_KNOW_is_there
fatal: Couldn't find remote ref a_branch_that_we_KNOW_is_there
Unexpected end of command stream

Assumptions:
1) the name of your remote repository is "upstream"
2) the branch you are pulling from is called "a_branch_that_we_KNOW_is_there"

There may be many ways to get this kind of error, but I suspect that I am not the only one who will get caught by this time wasting variant.

Reason: The reason you are getting the error is because the branch DOES exist at the correct repository, but you have requested a pull or fetch from the wrong repository.  And that branch name does NOT exist in the repo that you have requested a pull or fetch from.

How is that possible?

Cause: You may have accidentally added a remote name that points to the wrong git repository.

You can check the repository that your remote points to this way:
$ git remote show upstream
* remote upstream
  Fetch URL: https://github.com/pkg/pkg-module.git
  Push  URL: https://github.com/pkg/pkg-module.git
  HEAD branch: master
  Remote branches:
    some_other_branch_that_we_do_not_expect  tracked
    master                                   tracked
  Local ref configured for 'git push':
    master pushes to master (local out of date)

Or maybe this way:
$ git config --list | grep upstream
remote.upstream.url=https://github.com/pkg/pkg-module.git
remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*

Either way, check very carefully that the Fetch URL is correct.  If you are silly like we are and have several modules in the same package, you may not have noticed the rogue:

git remote add upstream https://github.com/pkg/pkg-module.git

instead of the correct git repository:

git remote add upstream https://github.com/pkg/pkg-modulo.git

Easy to miss something like this, if you ask me.

Solution: remove the name of the remote that points to the wrong repo, and re-add the name back so that it points to the correct git repository.  Assuming your remote alias name is "upstream", you can fix that like this:

$ git remote rm upstream
$ git remote add upstream https://github.com/pkg/pkg-modulo.git

Now Your pull command should work successfully. But just in case, here is yet another way to check to make sure:

$ git ls-remote | grep a_branch_that_we_KNOW_is_there
From https://github.com/pkg/pkg-modulo.git
934a29d142efda2f40efced8a2126c5499162e03 refs/heads/a_branch_that_we_KNOW_is_there

Hope that helps.

Friday, February 22, 2013

sort find results by date and time


Have you ever wanted to find all the files below your current directory and sort them by thier last modification time? Try this:
find . -printf "%T+\t%p\n" | sort
Here is the breakdown:

%T is file's last modification time in the format specified by k, which is the same as for %A. By the way, %A could be used to sort by access times instead of modification times.

+ means render the date and time, separated by "+", for example "2013-02-22+08:19:06.3877437110".

\t is a tab character

%p is the file name

All of this information and more might be gleaned by typing "man find" and searching for the section describing "printf" and its options.

Hope that helps.

Please help us learn how to do this on a mac (or windows) on the command line without a 20 minute mac ports install.

Saturday, February 02, 2013

Fun family pictures


Hello sushi!


Hello flowers ... peek - a - boo!


Looks delicious.


Froggy


Uh ... mazing Korean food in Diamond Bar, CA.
Young Dong Tofu.   Try their Bipp n' bopp!


Bipp n' Bopp in the lower left stone bowl ... yummmm.


Good-bye :-)

  

Hmm.



Wednesday, January 30, 2013

Dashes or other special characters "confuse" Spotlight on mac osx ...

Have you been trying to figure out why spotlight cannot find a file with a dash in the name?  How much time have you wasted wondering about this?  Well, look no further.  If your problem is something like this:
You know that there is a file on your mac called "something-book.pdf", so like an idiot, thinking that Spotlight will be friendly, you type what you know, -book.pdf, into Spotlight, and the "Top Hit" is "App Store" ... sigh.  You _know_ that the file is there somewhere!  But where is it?  Well, simply try this:

Solution:  Put the fragment of the filename in quotes, and viola, there is your file.  


Why should you have to put it in quotes you ask?  Why wouldn't it automatically default to putting everything in quotes itself, you ask?  Why isn't it more user friendly?  Well the answer is apparently embedded in the logic sourced in this document.

http://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html

Let me know, when you have memorized that document, and can explain this is layman's terms.  Until then, let's see if you and I are the only two people who have ever experienced any issue with Spotlight.  The comments (or lack thereof) should be very telling.

Hope that helps.

Tuesday, January 22, 2013

Sunday, January 06, 2013

New post ... old picture

It's always fun to find great older pictures.