Giter Site home page Giter Site logo

magnetizer's Introduction

Magnetizer

http://magnet-cl.github.io/magnetizer/

Description

At Magnet we use Magnetizer to quickly setup the terminal in local and remote Linux machines. The tasks included are listed in the available commands section.

Magnetizer uses python's Fabric tools to run tasks on remote (and local) machines. Since Fabric works over SSH, Magnetizer is configured to load the settings present in the ssh config file, for instance, hostname aliases.

Installation

Run ./install.sh.

Usage

You have a list of commands you can execute in your local machine or a remote one. To print the list of available tasks type:

fab -l.

Each task must be ran as follows:

fab <task>

You can get the description of a task with the -d parameter:

fab -d <task>

You need to specify the target machine, so it will ask you for the host in which you wish to run the task and assume your user is your current terminal user.

You can override this behaviour using the H parameter:

fab -H <user>@<host> <task>

You can also concatenate commands:

fab -H <user>@<host> <task1> <task2>

Examples

To get zsh installed and set as the default shell on your local machine, you should run:

fab -H <user>@localhost zsh.install

A concatenation example could be that you want that your current public key is accepted in your own computer (to speed up Magnetizer calls) and install vim configuration:

fab -H <user>@localhost ssh.add_authorized_key vim.install

Server initial configuration

In order to configure a new server (usually a VPS), you must run the following sequence of commands:

  1. Add <user> with sudo as extra group: fab admin.add_user:<user>,sudo -H root@host
  2. Allow sudoers without password: fab admin.sudo_without_password -H root@host
  3. Disable password authentication: fab ssh.disable_password_authentication -H root@host
  4. Disable root login: fab ssh.disable_root_login -H root@host
  5. Add your public ssh key to the authorized keys: fab ssh.add_authorized_key -H <user>@host (Please notice that this command must be run giving the user previously created).
  6. Reloads SSH configuration: fab ssh.reload_configuration root@host

Afterwards, we strongly recommend you to install zsh and vim through the tasks provided.

Available commands

* admin.add_user: Adds user, its group can also be specified.
* admin.add_swap: Adds a swap partition to the system.
* docker.install: Installs Docker.
* nginx.install_passenger: Installs nginx with passenger support.
* nix.install: Installs Nix.
* node.install: Installs node.
* postgresql.install: Installs PostgreSQL and its development packages.
* ruby.install: Installs Ruby.
* ruby.install_rails: Installs Ruby on Rails.
* ruby.install_wirble: Improves irb console.
* ssh.add_authorized_key: Adds your local public key to the authorized
  keys.
* ssh.disable_password_authentication: Disables password authentication.
* ssh.disable_root_login: Disables root login authentication.
* ssh.generate_key: Generates public and private ssh keys.
* tmux.configure: Uploads the tmux configuration file.
* tmux.install: Installs and configure tmux.
* vim.install: Installs vim, fully configured fo maximum programmer
  efficiency.
* vim.restore_backup: Restores vim to a pre-magnetizer configuration if
  available.
* vim.update: Updates vim with the latest Magnetizer configuration.
* zsh.configure: Deploys the configuration file asking some preferences.
* zsh.install: Installs zsh, fully configured.
* zsh.update: Updates zsh with the latest Magnetizer configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.