Journaling on estrip is easy and free. sign up here

Jim's Journal

jim
My Podcast Link

07/22/2009 10:27 #49353

Terminal Tips
Category: unix
These are for bash shells, and may be Mac-specific also, and would go in .bash_profile or .bash_login or as marked specifically below:

1. Always open new terminal windows in the location of the last directory that you cd'd to (source: ):


pathed_cd () {
if [ "$1" == "" ]; then
cd
else
cd "$1"
fi
pwd > ~/.cdpath
}
alias cd="pathed_cd"

if [ -f ~/.cdpath ]; then
cd $(cat ~/.cdpath)
fi



2. Erase duplicate entries from command history (source: ):


export HISTCONTROL=erasedups
shopt -s histappend



3. Allow partial matching of previous history instead of scrolling back through full history (note this one goes in .inputrc, source: ):


  1. do not make noise
set bell-style none

  1. By default up/down are bound to previous-history
  2. and next-history respectively. The following does the
  3. same but gives the extra functionality where if you
  4. type any text (or more accurately, if there is any text
  5. between the start of the line and the cursor),
  6. the subset of the history starting with that text
  7. is searched (like 4dos for e.g.).
  8. Note to get rid of a line just Ctrl-C
"e[B": history-search-forward
"e[A": history-search-backward

$if Bash
# F10 toggles mc on and off
# Note Ctrl-o toggles panes on and off in mc
"e[21~": "mcC-M"

#do history expansion when space entered
Space: magic-space
$endif

  1. Include system wide settings which are ignored
  2. by default if one has their own .inputrc
$include /etc/inputrc




4. Add status indicator for local changes to git or svn versioned directories (source: ):



  1. Prompt setup, with SCM status
parse_git_branch() {
    local DIRTY STATUS
    STATUS=$(git status 2>/dev/null)
    [ $? -eq 1 ] || return
    [[ "$STATUS" == *'working directory clean'* ]] || DIRTY=' *'
    echo "($(git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* //')$DIRTY)"
}

parse_svn_revision() {
    local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
    [ "$REV" ] || return
    [ "$(svn st)" ] && DIRTY=' *'
    echo "(r$REV$DIRTY)"
}

PS1='u@h:W$(parse_git_branch)$(parse_svn_revision) $ '



5. Misc aliases.



  1. various ls aliases
alias ll="ls -lp"
alias la="ls -ap"
alias lla="ls -lap"

  1. shorthand to search history, "h blah"
alias h="history | grep "

  1. open current directory in finder
alias o='open .'

  1. add all new files, which aren't ignored, to svn repo
alias san='svn status | grep "^?" | awk "{print $2}" | xargs svn add'



paul - 07/25/09 16:19
Ya, thanks those were awesome.
enknot - 07/23/09 09:32
thank you jim.
jim - 07/22/09 10:28
A [pre] or [code] tag would be nice :)

07/22/2009 09:59 #49352

I hate spammers.
Category: internets
This is crap that gets submitted as sources for Buffalo Feed every day.

Presented as an image so not as to help them out.

image

I know, spam is nothing new, but this is why we can't have nice things :(

07/21/2009 10:03 #49342

Steak Cake
Category: deliciousness
A chocolate cake frosted to look like a steak.

image

(from Thread Cakes )


tinypliny - 07/23/09 14:13
I wonder what you would say if I told you that I have actually eaten many many lunches sitting right next to a torn-apart cadaver. :) Its almost like cycling - once you get the hang of it, nothing repulses you any more.
enknot - 07/23/09 09:36
(e:tiny) that was not cool, now lunch is gonna be difficult. (e:jim) niffty, dunno how you get off the hook, but nifty.
tinypliny - 07/21/09 12:40
Or this
:::link:::
tinypliny - 07/21/09 12:38
You mean like these?
:::link:::

:::link:::

:::link:::

:::link:::

joshua - 07/21/09 12:15
Wow... that is disturbing. What's next, a cake iced to look exactly like someone's severed forearm? Haha.
matthew - 07/21/09 10:54
Is this supposed to be some cruel practical joke for people with gluten intolerance??
paul - 07/21/09 10:15
yum

07/20/2009 08:53 #49336

Finger Lakes Weekend Trip
Category: vacation
Went with James, Terry, Paul, Matthew, Chris & Chris, & Mike & Kara(Cara?).

A short video:

::Download Flash Video::



The drive up was rainy:

image

But the rest of the trip had nice weather:

image

image

image

image

image

image

image

image

180 degree Panorama ( full size ):

image

It was a lot of fun, except for James didn't feel so hot yesterday and somehow I had to make about 6 trips over 2 days to the local Shur-Fine grocery store.

Thanks guys!

paul - 07/20/09 23:33
It was such a fun weekend.

07/17/2009 19:53 #49321

Weekend Away


Hope weather is better tomorrow.
image
paul - 07/17/09 22:31
Looks like your prayers were answered, at least for tonight.