Pebkac

I'm a pimp. And pimps don't commit suicide.

Crucial M4 and 5180hrs

In Febuary of this year I purchased a Crucial M4 256gb SSD. I have had zero issues with it and the speed increase has been nothing short of amazing. That all come to end this last week or so. It started when using torrents, if I got up to a certain download speed the PC would lock up and I would have to hard reboot. Figured it was just a hiccup but it started happening more and more often, even while doing many different things. The only solution was a hard reboot. No bueno.

Last night, after about 30-40 mins of uptime, I would attempt to issue a command only to be greated with an Input/Output error. I thought ” Are you $%!@ing serious?!”. Started looking through all my logs, dmesgs and did some serious GoogleFU. Logs and dmesg didnt’t revealed anything worth a damn and my GoogleFU was all over the place. Then I found this

Well I’ll be, one command later and I had my answer….

1
2
3
4
5
6
7
8
9
10
# smartctl -a /dev/sdX

...snippet

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   050    Pre-fail  Always       -       0
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   100   100   001    Old_age   Always       -       5270

As you can see the ‘Power_on_Hours’ is 5270. That would be well over the 5000 mark.

Simple enough fix, download the ISO and burn into to a CD or you can use “DD and burn it to a USB. After this SSD runs great again.

1
2
3
4
5
# hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads:   18804 MB in  2.00 seconds = 9416.06 MB/sec
 Timing buffered disk reads: 1370 MB in  3.00 seconds = 456.30 MB/sec

Import Gmail Contacts Into Mutt

I use a very simple Mutt config. I do not use OfflineImap or any other types syncing options.

Today I found a very easy way to import my Gmail contacts into my alias file for Mutt. Before finding this script I was manually importing each e-mail address as I used it. Monumental_pain_in_the_dick. Well thanks to to Pbrisbin we can use the gmail2mutt.py script, thus adding many minutes back to my life.

You could ‘git clone’ the whole thing but I just copy/pasta’d the one file. I decided to put in my ~/.mutt dir but you can put it anywhere just make sure you use your real path to your aliases file with the next command.

1
$ GMAIL_USER='x@gmail.com' GMAIL_PASS='x' ./gmail2mutt.py > aliases

Of course add your address and password where needed.

Now when you create an e-mail you can use tab-completion for the person you are sending it too, and depending on the size of your contact list, ya just saved many hours.

VIM: A Text Editor

About six months ago I decided I wanted to learn VIM, so I removed NANO and Gedit from my system and left myself no choice. I would either sink or swim, currently I believe I am merely treading water. I have just barely scratched the sureface on all that this power text editor can do.

I started with Gedit which is a nice, simple and effective text editor but I quickly grew tired of it having to open it’s own window. For that reason I switched to Nano. The issue I had with Nano was it didn’t really support line numbers without using the “-c” switch which I had aliased. Also syntax highlighting was available but not to the degree that it is VIM.

Enter VIM. The amount of support from the community towards VIM was shocking. There is a plug-in for just about anything you’d ever need. I personally prefer the Vundle way of installing plugins. Simply add the username/git to your ~/.vimrc

1
2
3
4
5
6
7
8
9
10
11
12
13
" Plugins Sample from my ~/.vimrc
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Lokaltog/vim-powerline'
Bundle 'w0ng/vim-hybrid'
Bundle 'scrooloose/syntastic'
Bundle 'tpope/vim-fugitive'
Bundle 'tangledhelix/vim-octopress'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "honza/snipmate-snippets"
Bundle "garbas/vim-snipmate"

Then run this in your terminal

1
vim +BundleInstall +qall

Noteable plugins to look at:

PowerLine - Make sure you get/patch your font

Syntastic - Syntax checker.

Fugitive - Best GIT wrapper I’ve used

SnipeMate - Great for repetitive code. Read the install and get the additional deps.

Octopress - Nice pluggin for OctoPress blogs.

These are just a few that I use and by no means the end all be all.

Archlinux and Octopress

To start off with my first post I will go into my battle with Archlinux and Octopress’s syntax highlighting.

Made a post, included syntax highlighting, ran

1
$ rake generate

only to see this fill my terminal

1
2
3
4
5
Building site: source -> public/libvarnam
File "", line 1
import sys; print sys.executable
^
SyntaxError: invalid syntax

WTF?! So I went searching and during my GoogleFu sessions I found a post here.

Being a not_so_veteran linux/python guy I was a bit confused on it’s vagueness at first glance. After I had read it about 15 times it finally sunk in.(It was so painfully obvious) Simply add this one line script to ~/octopress/plugins/ruby_fix_archlinux.rb

ruby_fix_archlinux.rb
1
RubyPython.configure :python_exe => 'python2.7'