Fucking Shell Scripts

Completely confused by Chef? Blowing your brains out over Ansible? Wanna just use fucking shell scripts to configure a server? Read on!

Features

  • Wraps up the fog gem, so it can be used on any cloud service, including AWS, rackspace, etc.
  • We’ve intentionally designed this tool to be insanely easy to use

Step 0: Install the gem

gem install fucking_shell_scripts

Step 1: Create a project directory

mkdir config_management

Folder structure:

  • /servers (required) – yaml server definitions (see example below)
  • /scripts (required) – the shell scripts that will configure your servers (see example below)
  • /files (optional) – files to be transferred to servers (nginx.conf, ssh keys, database.yml, etc.)

An example folder structure:

./config_management
├── files
│   ├── keys
│   │   └── deploy_key
│   └── rails_config
│       └── database.yml
├── scripts
│   ├── apt.sh
│   ├── deploy_key.sh
│   ├── git.sh
│   ├── redis.sh
│   ├── ruby2.sh
│   ├── rubygems.sh
│   ├── search_service_code.sh
│   └── search_service_env.sh
└── servers
    ├── defaults.yml
    └── search-service.yml

Step 2: Create a server definition file

The server definition file defines how to build a type of server. Server definitions override settings in defaults.yml.

# servers/search-server.yml
##################################################
# This file defines how to build our search server
##################################################

security_groups: pd-app-server
instance_type: c1.xlarge
image_id: ami-e76ac58e
availability_zone: us-east-1d
region: us-east-1
key_name: pd-app-server

name: search-server
private_key_path: /Users/yourname/.ssh/pd-app-server
security_groups: search-service  # override the security_groups defined in defaults.yml
instance_type: c1.medium
image_id: ami-90374bf9

############################################
# Files necessary to build the search server
############################################

files:
  - files/keys/deploy_key

###########################################
# Scripts needed to build the search server
###########################################

scripts:
  - scripts/apt.sh
  - scripts/search_service_env.sh
  - scripts/git.sh
  - scripts/ruby2.sh
  - scripts/rubygems.sh
  - scripts/redis.sh
  - scripts/deploy_key.sh

servers/defaults.ymlhas the same structure and keys a server definition file, except, you cannot define scripts or files.

# servers/defaults.yml
################################
# This file defines our defaults
################################

security_groups: simple-group
instance_type: c1.medium
image_id: ami-e76ac58e
availability_zone: us-east-1d
region: us-east-1
key_name: global-key

Step 3: Add shell scripts that configure the server

Seriously…just write shell scripts.

Want to install Ruby 2? Here’s an example:

#!/bin/sh
#
# scripts/ruby2.sh
#
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar -xzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
./configure --prefix=/usr/local
make
sudo make install
rm -rf /tmp/ruby*

Step 4: Build/configure your server

fss search-service

This command does 2 things:

  1. Builds the new server
  2. Runs the scripts configuration

To build only:

fss --build search-service

To configure only:

fss --instance-id i-9ad6d7af --configure search-service

Note: --instance-idis required when using the --configure option

Step 5: Remove your chef repo and all its contents.

rm -rf ~/old_config_management/chef

HOLY SHIT THAT WAS EASY.

Bowblade Turns You into Virtual Marksman

Do you want to be a modern day Robin Hood? How about Hawkeye, Green Arrow? or perhaps the iconic Katniss Everdeen?

Katniss

Unfortunately, you don’t have the time and space for neither your archer practice nor the money to afford the fastest compound bow or recurve bow.

Don’t worry…Here comes the BowBlade.

BowBlade is a gaming peripheral designed by the chiropractor Ron Green. Primarily created as an exercise tool and gaming simulator, this device aims to turn aspiring iOS and Android archers into excellent virtual marksmen.

This gaming simulator is a rectangular bow that has flexible, gliding blades that users are required to pull back as if they are using a regular bow instead of a taut string. This mechanism makes it’s easier to draw, aim, and shoot while still providing a good amount of resistance for a workout. But when playing the 35 different touchscreen games on iOS, users are actually pulling something similar to a gun trigger that is attached to a capacitive stylus tip, simulating a finger touch to the screen.

Since this device makes use of the gyroscope, BowBlade can actually more closely simulate the feeling of hunting something and enhancing that feeling, though it does little to change the general dynamics of games. That could change if developers make specialty games designed just for it.

A smartphone mount and a string-activated stylus allow the $185 version of the BowBlade to be used for gaming with augmented reality archery titles. But a $200 exercise version with stiffer blades is also available for those who care more about their figure than a high score ranking.

Along with the iPhones and iPods, the device can also be adjusted to work with Android devices and Nintendo’s Wii. The company is also striving to get it set up for console systems like the Xbox 360 and PlayStation 3.