flash[:error] = "#{@post.errors.full_messages.to_sentence}"
http://stackoverflow.com/a/808776/1180523
# model
validates :email, :uniqueness => { message: "is wrong" }
validates :name, :uniqueness => { message: "Your name is wrong" }
HUMANIZED_ATTRIBUTES = {
:email => "E-mail address",
:name => "" # don't include column name in error
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.
Let's say you have a guest machine with the name ubuntu-lucid-lynx-base
#!/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…" |
- The Basics
- Outline:
- Learn to create a new Rails project to keep track of your Starship Fleet. (You have a Fleet, right?)
- Outline:
- Some good, clean, DRY code
- Coming next time...
- Making our Tracker actually useful
- Coming next time...
- Layouts, Mailers, and Looking good while we work
# 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
Check: https://askubuntu.com/a/142430/54348
-
for Linux
/etc/ssh/ssh_config
-
for Mac:
~/.ssh/config
- or
/etc/ssh/ssh_config
Add this to your SSH config file:
https://bosnadev.com/2015/12/15/allow-remote-connections-postgresql-database-server/
- Type:
PostgreSQL
- Protocol:
TCP
- Port Range:
5432
- Source:
Custom
0.0.0.0/0
Some references:
- https://www.justinrummel.com/resizing-a-vmware-fusion-ubuntu-server-virtual-hard-drive-via-easy-mode/
- don't follow this one, it'll piss you off
- only follow the start down to where you resize disk, download GParted (already downloaded with rest of ISO's), then mount it
- https://youtu.be/cDgUwWkvuIY?t=5m36s
- remove any snapshots (you cannot increase size in VMWare until you've done so)