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.

Similarities Between Coding Things And Watering Places

coding

Admit it or not, coding things is pretty much an exhausting task. Not only will you need stock knowledge on just about every kind of industry known to man as you plan the kind of system you will make in order for the world to become a great place to live in, but also need some know-hows on just about every kind of industry known to man as you apply the kind of system you have made in order for the world to become a greater place to live in.

But you know what?

Believe it or not, coding things is pretty much an exciting task. Not only will you have stock knowledge on just about every kind of industry known to man as you apply the kind of system you have made in order for the world to become a great place to live in, but also have some know-hows on just about every kind of industry known to man as you plan the kind of system you will make in order for the world to become a greater place to live in.

And you know what?

It’s just like watering places like your own garden in the backyard – or drinking water from those on https://ro-systemhub.com/, even.

You see, coding things involves stock knowledge that takes time to cultivate. It’s like watering places, wherein you need to make sure that the foundation of what you will plant in that exact place is firm and healthy like no other – just like how stock knowledge should be cultivated over those years in your life. Because you see, coding things is only the first step of what is yet to come gracefully and that is your knowledge finally making a difference to the world you live in and making people see things in a different perspective like no other.

You also see, coding things involves some know-hows that takes effort to master. It’s like watering places, wherein you have to make sure that the foundation of what you have planted in that exact place is firm and fit like never before – just like how some know-hows should be mastered over those challenges in your life. Because you see, coding things is only the next step of what has yet to leave graciously and that is your know-hows finally making a difference to the world you will live in and making people experience things in a new way like never before.

What do you think about this blog post? Share your thoughts with us below!

Where To Go If You’re Running Out Of Ideas: A Programmer’s Woe

coding

Admit it or not, being a programmer is not that easy. Not only will you need your mind to be active the entire day, but also need your heart to be in check the whole day for you to get through it without getting tired that easily. Not only will you need your body to be active the entire day, but also need your spirit to be in check the whole day for you to get through it without getting pained easily.

But you know what?

Believe it or not, being a programmer is not that hard. Not only will you have your mind active enough the entire day, but also your heart in check enough the whole day to get through it without getting tired that easily. Not only will you have your body active enough the entire day, but also your spirit in check enough the whole day to get through it without getting pained easily.

And you know what?

There’s more to programming than it seems to be. And that’s because you can always look for inspiration outside of coding whenever you’re running out of ideas. There’s also more to being a programmer than it seems to be. And that’s also because you can always look for motivation beyond the coding whenever you’re running out of ideas.

Now, here’s where to go if you’re running out of ideas – or even when you need to use one of the greatest robotic pool cleaners:

Parks

If you think parks are only great for when you need to run in circles as part of your daily exercise routine, think again. You see and as a programmer who stays indoors most of the time, parks are breaths of fresh air – making your mind active enough and your heart in check enough for you to last the entire day without getting tired easily and for you to get more inspired with those coding tasks, thanks to the wonders of Mother Nature herself in the form of providing you a natural and positive environment.

Pools

And if you think pools are only great for when you need to swim in circles as part of your monthly workout routine, think again. You also see and as a person who stays indoors most of the time, pools are breaths of fresh sun – making your body active enough and your spirit in check enough for you to last the whole day without getting pained easily and for you to get more motivated with those other tasks, thanks to the miracles of Mother Nature herself in the form of providing you a natural and constructive environment.

Keeping Kids Safe on the Internet

kids computer

kids computer

To say that the internet has become a part of many people’s daily life would be an understatement. Many people spend time online every day for varied reasons including children who are often quick to learn their way around it. Whether it is for homework or entertainment or everything else in between, the internet has become a go-to place for many kids.

But just how safe is the internet? Not as much as most people would likely think. Adults and children alike are vulnerable to online threats, many of which they may be unaware of. There are several ways internet users, especially children may be put at risk. Without proper adult supervision and safety measures in place, children are exposed to the dangers that lurk on the internet that even adults face.

Saying that the internet can be a dangerous place is not meant to scare people away from it. Rather, the idea is for users to be aware of the potential risks and find ways to protect themselves. More importantly, it is to promote the need to educate children about online safety and the security measures parents and other adults around them can use to ensure that they are protected.

Teaching kids about the do’s and don’ts when online is a great way to prepare them to become more responsible digital users. There are internet safety games designed for kids that can make about keeping safe online more fun and engaging. Parents and school administrators can also set some guidelines on usage as well as install internet safety software that can protect kids from malware and prevent them from visiting malicious sites.

What Are The Benefits of Learning Shell Scripting

Shell Script

Learning Shell Script could be difficult at first.

So, what is a shell script? It allows the program orders in chains. Just like batch files, it executes them as a scripted event.

Also, it can take input from a user file then output them to the visual screen. To help you understand how this work, here’s some uses of shell script.

Monitor Linux System

Linux

A shell script is used to analyze performance in real-time. Monitoring a network or system will inform you whenever an issue is detected. This is important to avoid network problems. It can also be used to solve a system failure quickly.

Data backup

One of the most important things to do is to back everything up. This is essential to secure and protect important files. You don’t want to lose something precious to you, right? Use the shell script to secure all vital information and data.

Find out what’s eating your system resources

You can easily found hidden programs that are eating up your system. By using Shell Script, you can identify what processes consume your available system resources.

Find available and free memory

To make a program run faster, you’ll need more memory. Finding a free memory will be easier with the use of Shell Script.

To make coding easier, try drinking a cup of delightful tea while learning! It will help you focus and relax while coding. Learn more about the varieties of tea here. I guarantee you. This will help you a lot!

 

There you have it, coders! Above are some of the uses of Shell Script. It’s up to you to find it’s full capability and uses. Use your curiosity to learn more about the Shell Script and its importance!