Monday, January 26, 2015

Dropbox setup for shell scripts

There are quite a few shell scripts that that I have to have for my bash environment. For the last few years, I've backed these up to Dropbox and used symbolic links to insert them into the system.

Within Dropbox itself, I have a Scripts directory that I keep all my scripting files in. Most of these are dotfiles and in order to display them properly in Finder and other utilities, I prefix the word "dot" to the beginning and use CamelCase for readability. For example, my .profile is named dotProfile in the Scripts directory.

Here's a brief rundown of the files that I normally use:

.profile -> dotProfile

This mostly contains the aliases that I've accumulated over the years and a few shell settings.

alias ls='ls -G'
This basically shows document colors in the ls output. I could also set the CLICOLOR and LSCOLORS environment variables, but this is usually easier for me.

export HISTSIZE=10000
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
These three commands control the bash history. The HISTSIZE setting allows for a maximum of 10,000 lines to be saved in bash history. 

The HISTCONTROL setting removes duplicate lines from the history. I have a tendency to do ls a lot and it keeps my history from getting cluttered with multiple lines of the same thing. There's some interesting info on this setting in this StackExchange question.

The histappend setting has to do with the way bash handles multiple simultaneous sessions. Normally, the history is written at the end of each session and the file is overwritten. This setting appends new history lines at the end of the file instead.

.bash_history -> dotBash_history

If I'm going to all the trouble of making sure my bash history is the way I want it, I might as well back it up in Dropbox and have it available for parsing outside of a bash prompt.

.ssh -> dotSsh

This one is actually a directory and contains all my SSH settings. It's most important for having my authorized keys and known hosts available again whenever I have to reinstall or upgrade my OS. There are some security concerns that you need to take into consideration when saving information like this, but it's probably too long to go into on this post. I'll probably write it up someday.

.vimrc -> dotVimrc

Obviously vi/vim is my editor of choice. I've been using it for years, and have the options setup the way I like. I basically set the following:
  • syntax on
    • Turn on syntax highlighting. Works with most major programming languages, but I mostly use it for bash and Perl.
  • set showmode
    • Show the current mode on the last line
  • set number
    • Show line numbers
  • set ruler
    • Show the ruler, which is basically line and character position separated by a comma
  • set autoindent
    • Use smart autoindenting. Useful for keeping codeblocks in order.
  • set nocompatible
    • Reduce compatibility with vi in order to use more advanced features of vim.




Thursday, January 22, 2015

It's been a while ...

My last post was September 9th, 2012. Geez, that's a long time. Might as well get back into it.

Sunday, September 16, 2012

DaisyDisk Live Updates Icon While Scanning

DaisyDisk (Mac App Store Link) is a utility for scanning hard drives and presenting the used space in a beautiful interactive map. It's a great app, and it works wonderfully well. But it wasn't until today that I noticed the amazing attention to detail by the developers.

While scanning on of my hard drives, I noticed that the icon updates itself with the scanning progress on both the Dock icon and the icon used when cmd-tab is invoked. Sadly, I was unable to get a screenshot of the latter.

Dock icon at 45% of scanning complete

Dock icon at 70% of scanning complete

Monday, September 10, 2012

Google Chrome for Mac (retro-post)


This was written when Google Chrome was just released for Mac in 2011, but it sat in my Drafts folder since I never got around to writing a full post.

Chrome has since become a permanent addition to my dock, so it's interesting to see my thoughts when it was first released. I've added annotations for some of the items in hindsight.

Likes


  • animating tabs
  • delete to go back to previous page (I still use this alot and get annoyed when a browser doesn't support it, *mumble*Safari)
  • themes (I liked them at first, but stopped using them after about a week. The clean look is much nicer.)
  • speed (It's still a really fast browser)
  • the video is cool: http://www.youtube.com/googlechromethemes
  • child tabs open next to parent tab, grandchild tabs open next to child tabs, new child tabs open between child and grandchild tabs (Safari now does the same thing for child tabs)
  • status tabs popup on the bottom when loading or mousing over a link
  • unified search field (Safari 6 has this now as well.)

Dislikes


  • opening lots of tabs shrinks them. Much better in safari. (This is still relevant. Also, Safari 6's new Tab View is much nicer.)
  • the website icon takes up a lot of horizontal space. Safari's centered text is much better. (Still relevant.)

Tuesday, August 21, 2012

Relativistic Baseball by XKCD

This is what makes Tuesdays awesome.

Laziness or Busyness

I haven't posted here for almost a year, but I've been pretty involved with a ton of projects at work. I spent quite a bit of time building an HSPA+ Network for my company. We did that in about 5 months, which has to be some kind of record.

Other than that, I've been focused on other things. Hopefully, I'll be back on here a bit more for all 7 of you that read my blog last month.

Cheers.

Tuesday, September 27, 2011

MYTH: Apple is a marketing company

The best rebuttal I've seen for this myth:

"Apple Is A Marketing Company" at Brian S Hall's blog

Other company's commercials focus on pizazz and marketing. Apple focuses on people using its products. Marketing my ass.

Thursday, September 22, 2011

Great Printable Productivity Tools

Productivity Tools by David Seah.

There's so much good stuff here.

Tuesday, September 13, 2011

Manu Samoa Prayer

‎"Our players who art in Blue, Rugby be thy game.
When full-time come, thy will be done, in 2011 as it was in '91.
Give us each game our daily victory, and forgive us our previous shortcomings...
As we forgive those who coached in '07 (and after '91).
And lead us not to knock-out round failure, but deliver us from World Cup drought.
In the name of Fats, Birtwhistle and the Holy Samoa islands.
AMEN!"
GO BLUE!
(via Mark Esau and family)