Tech Diary

Bash config files: what gets run when?

$ bash
~/.bashrc


$ bash -l
~/.bash_profile or ~/.profile


$ ssh localhost
~/.bash_profile or ~/.profile


$ ssh localhost bash
~/.bashrc
^CKilled by signal 2.


$ ssh localhost 'bash -l'
~/.bashrc
~/.bash_profile or ~/.profile
Holy shift

Once you learn that shift/unshift are like push/pop on the other end of the array, you can mentally drop the ‘f’ from the name of the methods to remember which one ‘dumps’ elements and which one ‘inserts’ them. :)

Stack Overflow

Better than lsof

sudo opensnoop -n installd

git symbolic refs

are like dynamic tags — tags always reference commits but symbolic refs can reference other refs.

TodoTxtMac is a minimalist, keyboard-driven to-do manager for Mac OS X… that conforms to the todo.txt format spec.

GitPrep is Github clone. you can install portable github system into unix/linux. You can create users and repositories without limitation

distinctions

  • / for files required at startup, /usr for files that are part of the operating system but not required for startup, /usr/local for files that are not part of the operating system
  • sbin (vs bin) for root-only programs
  • opt for self-contained programs

http://askubuntu.com/questions/130186/what-is-the-rationale-for-the-usr-directory

Gonna be using this to copy/paste code into emails.

http://markup.su/highlighter/

Gonna be using this to copy/paste code into emails.

http://markup.su/highlighter/

The way to make this less of an issue, at least when examining output, is to use something that prints escape codes instead of unicode. By the way, since no one has mentioned it, here’s why these variations exist:

  • - Use hyphens for hyphenated words, hyphenated line breaks, and grouping: follow-up, em-dash, heavily-affected servers.

  • − Use the minus sign for math. (Also see the multiplication sign ×.)

  • — Use em-dashes for appositives—kind of like this.

  • – Use en-dashes to indicate ranges: I’m free today 2–7am. Also, if you like spaces before and after your em-dashes, use an en-dash instead – like this.

The hyphen is the only ASCII character in this set, so it’s the one used in programming. If you want to convey meaning without typing special characters:

  • Use a single dash for minus (like in programming)
  • Use a single dash for ranges
  • Use two dashes for appositives

If you’re using a text preprocessor or autocorrect that “smartens” hyphens [exs], two hyphens usually becomes an en-dash and three becomes an em-dash.

[exs]: MS Word and http://daringfireball.net/projects/smartypants/