Be the John Connor Terminal Terminator Find and Kill

Ran into a few issues with running an IRC server from my localhost. Having these command at your fingertips will save John Connor.

First list all processes running on your machine
$ ps -A

Yuck, thats a long list

To make this more useful pipe to grep, and search for the process:

$ ps -A | grep "Sara Connor"

Then kill the process id

kill -9 [process id]

Save the human race and crush Unix oneliners.

Integrate Hubot into Slack Chat App

Hubot & Heroku deployment is free and straight forward.
This installation will only install the vanilla shipped scripts from Hubot.

Before we start you will need

  • Nodejs
  • NPM
  • CoffeeScript Compiler (Yes, I know…)
  • Slack Channel with Integreation Service
  • Heroku App Instance
  • REDIS TO GO (Yes, there is a free option)

Create Git Repo to push to Heroku

$ git init hubot
$ git add .
$ git commit -m "init"

Once the above is up and running you can run each of these lines:

$ heroku create
$ npm install hubot -g
$ hubot --create [pathToRepo]
$ npm install hubot-slack --save
$ npm install
$ echo "web: bin/hubot -a slack -n Hubot" > Procfile
$ cd ./scripts && npm install
$ git push heroku master

Issues, computer not cooperatingrun:

$ heroku logs

Helpful links with more or less details

Questions? Leave Comments. Trolling welcome but will be ignored.

Install Nodejs on Rasp Pi v0.10.26

How compile nodejs to run on the Rasp Pi.

Please note you may have to sudo all these commands based on your setup. This also assumes you have apt-get updated and either curl or wget.

$ cd /opt/node
#if don't have that dir created yet
$ mkdir -p /opt/node
$ wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
$ tar -xvf node-v0.10.26.tar.gz
$ cd node-v0.10.26
$ ./configure
$ sudo make
# note above make takes forever to build
$ sudo make install
$ node -v

TMUX Terminal Multiplexer

TMUX allows you to run multiple session in a single terminal window and/or detach them so they run in a background process. You can also allow other users access to you machine and peer code the same file together.

Find project homepage here:
http://tmux.sourceforge.net/

Install tmux:
$brew instal tmux

tmux commands

#Sessions

#start new session
$tmux new -s sessionName

#List all sessions
$ tmux ls

#Target a session
$tmux attach -t sessionName

#Windows

#Start new session with window name and run top
$ tmux new -s name -n top

#Rename Session
$ <C-b> ,

#Create a new window
$<C-b> c

Next window of index value
$<C-b> n

Previous window of index value
$<C-b> p

Goto index
$<C-b> 0

#Show menu
$<C-b> w

#Search for name
$<contrl+b> m

Panes
vsplit pane
$<contrl+b> %

split pane
$<contrl+b> "

switch pane
$<contrl+b> o

split all panes
$<contrl+b> spacekey

close pane
$<contrl+b> x

#Create a tmux configuration file:
$ touch ~/.tmux.conf

TMUX Configuration FIle

# remap C-b to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

#set index to 1
set -g base-index 1
set -g base-pane-index 1

#split window horizontal
bind v split-window -h
bind h split-window -v

#color borders of pane
set -g pane-border -fg green
set -g pane-border -bg black
set -g pane-active-border -fg white
set -g pane-active-border -bg yellow

#prefix session to menu
set -g status-left "Sesssion: #S"
set -g status-right "#H #[fg-white, bg=defualt]%a%l%M:%S %p#[defualt]

Jade Select Element for States

Decided to post since I can never find it when it’s needed.

select(name='State')
option(value='', selected='selected') Select a State
option(value='AL') Alabama
option(value='AK') Alaska
option(value='AZ') Arizona
option(value='AR') Arkansas
option(value='CA') California
option(value='CO') Colorado
option(value='CT') Connecticut
option(value='DE') Delaware
option(value='DC') District Of Columbia
option(value='FL') Florida
option(value='GA') Georgia
option(value='HI') Hawaii
option(value='ID') Idaho
option(value='IL') Illinois
option(value='IN') Indiana
option(value='IA') Iowa
option(value='KS') Kansas
option(value='KY') Kentucky
option(value='LA') Louisiana
option(value='ME') Maine
option(value='MD') Maryland
option(value='MA') Massachusetts
option(value='MI') Michigan
option(value='MN') Minnesota
option(value='MS') Mississippi
option(value='MO') Missouri
option(value='MT') Montana
option(value='NE') Nebraska
option(value='NV') Nevada
option(value='NH') New Hampshire
option(value='NJ') New Jersey
option(value='NM') New Mexico
option(value='NY') New York
option(value='NC') North Carolina
option(value='ND') North Dakota
option(value='OH') Ohio
option(value='OK') Oklahoma
option(value='OR') Oregon
option(value='PA') Pennsylvania
option(value='RI') Rhode Island
option(value='SC') South Carolina
option(value='SD') South Dakota
option(value='TN') Tennessee
option(value='TX') Texas
option(value='UT') Utah
option(value='VT') Vermont
option(value='VA') Virginia
option(value='WA') Washington
option(value='WV') West Virginia
option(value='WI') Wisconsin
option(value='WY') Wyoming

Install and Run Elasticsearch with Homebrew

If you have installed Elasticsearch with Homebrew and don’t want it to start on sys boot, which will automatically default to 9200 try and start a cluster, possibly with other machines on your connection.

$ brew install elasticsearch
$brew info elasticsearch

Info details how to work with the installation.

elasticsearch -f -D es.config=/usr/local/opt/elasticsearch/config/elasticsearch.yml

For connivence I created a function in my dotfiles to run adhoc from my machine.
#function run elasticsearch
function runelasticsearch() {
elasticsearch -f -D es.config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
}

Replace Notes.app Default Font OSX , 3 steps

First if you are a Mavericks User there is nothing to see here. Move along kindly.

If you haven’t upgraded congratulations! You can now make personalized touches to the Notes.app.

Yes, I know relax! sit down! and lets get on with it.

Update Fonts in Notes.app:

1. Type this in the prompt:

sudo vim /Applications/Notes.app/Contents/Resources/en.lproj/DefaultFonts.plist

This opens the files in VIM, feel free to use whatever tools you prefer.

2. Find and replace font name and write quit.

Vim users type the following in command mode if you want “Helvetica”:

:%/s:Noteworthy-light/Helvetica/gc

3. Kill Notes.app and restart.

Now rock that notepad and have fun.
Add comments, troll bashes, and funny stuff below.