Skip to content

Instantly share code, notes, and snippets.

View skplunkerin's full-sized avatar
🐰
Working W02K1N6 01110111 01101111 01110010 01101011 01101001 01101110 01100111

Skplunkerin skplunkerin

🐰
Working W02K1N6 01110111 01101111 01110010 01101011 01101001 01101110 01100111
View GitHub Profile
@skplunkerin
skplunkerin / mysql_columns.sql
Last active August 29, 2015 14:06
Grab Table Column Names
/* Slow Method */
SHOW COLUMNS FROM table_name;
/* Fast Method */
DESC table_name;
@skplunkerin
skplunkerin / mysql_insert.sql
Created September 24, 2014 11:23
Mysql Insert Statement
INSERT INTO table_name (column_name1, column_name2, etc)
VALUES
('value1','value2','etc');
@skplunkerin
skplunkerin / vimfile.rb
Created October 8, 2014 01:06
VIM format file
# http://stackoverflow.com/a/14114909/1180523
:filetype indent on
:set filetype=html # abbrev - :set ft=html
:set smartindent # abbrev - :set si
# Then gg=G
# In my experience this doesn't ALWAYS work (like it should)... but sometimes it does.
@skplunkerin
skplunkerin / create_env_values.md
Last active August 29, 2015 14:10
rails ENV env, how do I setup rails env variables
@skplunkerin
skplunkerin / truncate.md
Last active August 29, 2015 14:21
rails sqlite truncate single table
@skplunkerin
skplunkerin / errors.md
Last active August 29, 2015 14:23
rails model error message to sentence
flash[:error] = "#{@post.errors.full_messages.to_sentence}"

How to setup your VMWare Fusion 6 images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base

@skplunkerin
skplunkerin / center_me.css
Last active June 20, 2016 15:52
css center
/* http://www.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/ */
.Absolute-Center {
height: 500px;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
@skplunkerin
skplunkerin / backitup.sh
Created August 3, 2016 16:04 — forked from wyliethomas/backitup.sh
Wylies mysql s3 backup daily backup cron solution
#!/bin/bash
NOWDATE=`date +%Y-%m-%d`
BACKUPNAME="$NOWDATE.sql.gz"
echo "Creating backup of database finances to $BACKUPNAME"
mysqldump --user=[username] --password=[password] [database] | gzip -9 > $BACKUPNAME
echo "Succesfully created database backup"
echo "Uploading backup to Amazon S3 bucket…"
@skplunkerin
skplunkerin / scribbles.md
Created August 26, 2016 01:11
ruby on rails local environment recipe
# Install Git and Ruby
$ sudo apt-get install git ruby

# Install Node v5 (or higher)
(https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)

$ curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
$ sudo apt-get install -y nodejs build-essential