Using Nslookup to Check MX Records

nslookup
> set type=MX

>yahoo.com

Posted in Uncategorized | Leave a comment

Macbook Pro Hard Drive Replacement

My beloved Macbook keeps running out of space so I keep putting bigger hard drives in it.  The latest is a fabulously large 500GB Hitachi drive.

The process will void your warranty but is pretty straight forward thanks to the phenomenal instructions here-

http://www.ifixit.com/Guide/Repair/MacBook-Pro-15-Inch-Core-Duo-Hard-Drive-Replacement/486/1

Posted in Hardware | Tagged | Leave a comment

Postgres Update from function

I always forgot the syntax of the Postgresql update from functionality
UPDATE employees SET sales_count = sales_count + 1 FROM accounts
  WHERE accounts.name = 'Acme Corporation'
  AND employees.id = accounts.sales_person;
Posted in Postgresql | Leave a comment

Screen keyboard shortcuts

Screen is an amazing little utility that allows you to have multiple sessions going within one terminal session.

Here’s a link to the man page - http://man.cx/screen

Here’s a quick cheatsheet borrowed from http://www.pixelbeat.org/lkdb/screen.html

Key Action Notes
Ctrl+a c new window
Ctrl+a n next window I bind F12 to this
Ctrl+a p previous window I bind F11 to this
Ctrl+a “ select window from list I have window list in the status line
Ctrl+a Ctrl+a previous window viewed
Ctrl+a S split terminal horizontally into regions Ctrl+a c to create new window there
Ctrl+a :resize resize region
Ctrl+a :fit fit screen size to new terminal size Ctrl+a F is the same. Do after resizing xterm
Ctrl+a :remove remove region Ctrl+a X is the same
Ctrl+a tab Move to next region
Ctrl+a d detach screen from terminal Start screen with -r option to reattach
Ctrl+a A set window title
Ctrl+a x lock session Enter user password to unlock
Ctrl+a [ enter scrollback/copy mode Enter to start and end copy region. Ctrl+a ] to leave this mode
Ctrl+a ] paste buffer Supports pasting between windows
Ctrl+a > write paste buffer to file useful for copying between screens
Ctrl+a < read paste buffer from file useful for pasting between screens
Ctrl+a ? show key bindings/command names Note unbound commands only in man page
Ctrl+a : goto screen command prompt up shows last command entered
Posted in Linux Admin | Tagged | Leave a comment

Learn VIM in 5 Minutes

I found a great Stack Overflow question on learning VIM here-
http://stackoverflow.com/questions/2573/vim-tutorials
Here are some of the resources mentioned in the article-
http://rayninfo.co.uk/vimtips.html
http://blog.interlinked.org/tutorials/vim_tutorial.html
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html
"Here is your 5 minute tutorial. The easiest way to learn vi is to know what the letters stand for:"
y(ank) - copy
d(elete) - delete
c(hange) - change
p(aste) - put from buffer after cursor
o(pen) - start a new line
i(nsert) - insert before current character
a(fter) - insert after current character
w(ord) - moves to beginning of next word
b(ack) - moves to beginning of current word or prior word
e(end) - moves to end of current word or next word
f(ind) - moves to a character on the current line
movement keys you just need to learn: h,j,k,l

^ - beginning of text on a line
$ - end of text on a line
0 - first position on line

most commands can be prefaced with numeric modifiers.
2w - means move 2 words
5h - means move 5 charcters to the left
3k - means move 3 lines up
3fs - means move to the 3rd letter s folling the cursor

modification commands (d,c,y) need to know how much to work on.
dd - delete a line into memory
yy - yank a line into memory
cc - change the whole line
c$ - change from current position to the end
c2w - change the text spanning the next 2 words
3dd - delete 3 lines
d2f. - delete to the second period.

. - means redo the last modification command.
/ - searches for text, and then n(ext) will go the next found occurance. N will go prior.
? - searches backwards through the document.
Posted in Linux Admin | Leave a comment

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

Posted in Uncategorized | 1 Comment