• Stars
    star
    226
  • Rank 176,514 (Top 4 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SSH wrapper script that brings your dotfiles always with you on Linux and OSX

kyrat

Kyrat - A simple ssh wrapper script that brings your dotfiles always with you on Linux and OSX

Project Status Communication
Build status Join the gitter chat at https://gitter.im/fsquillace/kyrat

Table of Contents

Description

kyrat is a ssh wrapper that allows to source local dotfiles on a ssh session to a remote host. No installations or root access on the remote host are required. It works either from/to a Linux or OSX machines.

kyrat can transfer to the remote host and source the following dotfiles:

  • bashrc files (located in either ~/.config/kyrat/bashrc or inside the directory ~/.config/kyrat/bashrc.d/).
  • inputrc files (located in either ~/.config/kyrat/inputrc or inside the directory ~/.config/kyrat/inputrc.d/)
  • vimrc files (located in either ~/.config/kyrat/vimrc or inside the directory ~/.config/kyrat/vimrc.d/).
  • tmux.conf files (located in either ~/.config/kyrat/tmux.conf or inside the directory ~/.config/kyrat/tmux.conf.d/).
  • zshrc files (located in either ~/.config/kyrat/zshrc or inside the directory ~/.config/kyrat/zshrc.d/).

Environment variables

  • KYRAT_SHELL can be used to set which shell to spawn remotely (default is bash). The allowed shells are bash, zsh and sh.
  • KYRAT_TMPDIR remote location to store the dotfiles (default /tmp).

Kyrat features

The following summarizes the Kyrat features:

  • Dotfile types supported: bashrc, vimrc, inputrc, tmux.conf, zshrc
  • Platform: Linux, OSX
  • Compression during tranfer: gzip
  • Encoding during transfer: base64
  • Automatic removal of remote dotfiles when exiting from Kyrat session
  • Remote dotfile location: /tmp (configurable via KYRAT_TMPDIR env variable)
  • Remote shells available to spawn: bash, zsh or sh (configurable via KYRAT_SHELL env variable)

How it works?

This is the sequence of steps that occur when running Kyrat:

  • The dotfiles are encoded using Base64 and compressed with Gzip
  • The dotfile blobs are passed through the ssh command line containing a script
  • The remote host will execute such script with the instructions of:
    • how to decode and extract the dotfiles
    • where to store the dotfiles (according to KYRAT_TMPDIR variable)
    • which environment variables to set to make the dotfiles working properly
    • which remote shell to spawn (bash, zsh or sh according to KYRAT_SHELL variable)

Quickstart

Bash

Write locally in either ~/.config/kyrat/bashrc or any files inside ~/.config/kyrat/bashrc.d/:

alias q=exit

function processof(){
    ps -U $1 -u $1 u
}

export PATH=$PATH:/sbin:/usr/sbin

Now, just access to your remote host:

$> kyrat [email protected]
myserver.com $> processof feel
    feel     20567  0.3  0.0  14748   952 pts/5    S+   12:44   0:13 ping www.google.com
    feel     23458  0.0  0.0  12872  1372 pts/9    R+   13:49   0:00 ps -U feel -u feel u

myserver.com $> q
exit

Or even inline:

$> kyrat [email protected] -- processorof feel

Vim

Write locally in either ~/.config/kyrat/vimrc or any files inside ~/.config/kyrat/vimrc.d/:

nnoremap <silent> <Leader>e :Explore<CR>

Now, just access to your remote host via kyrat, run vim and you will have the shortcut \e for running the vim file explorer.

Inputrc

Write locally in either ~/.config/kyrat/inputrc or any files inside ~/.config/kyrat/inputrc.d/:

set completion-ignore-case On

Now, just access to your remote host via kyrat and the terminal will have case insensitive tab completion.

Tmux

Write locally in either ~/.config/kyrat/tmux.conf or any files inside ~/.config/kyrat/tmux.conf.d/:

bind e setw synchronize-panes on \; display "Synchronization ON"
bind E setw synchronize-panes off \; display "Synchronization OFF"

Now, just access to your remote host via kyrat and run the following:

tmux -f "$TMUX_CONF"

This will open a tmux session and you can now toggle synchronization between panes on the same window with the keys e/E.

Installation

Dependencies

Before installing Kyrat be sure that all dependencies are properly installed in your system. The Kyrat dependencies are the following:

Linux

Assuming all Kyrat dependencies are properly installed in the system, to install Kyrat run the following:

    git clone https://github.com/fsquillace/kyrat ~/.local/share/kyrat
    export PATH=$PATH:~/.local/share/kyrat/bin

OSX

In order to install all Kyrat dependencies, you first need to install Homebrew.

To install all the needed dependencies via Homebrew:

brew update
brew install bash coreutils

Once all Kyrat dependencies are properly installed in the system, to install Kyrat run the following:

    git clone https://github.com/fsquillace/kyrat ~/.local/share/kyrat
    export PATH=$PATH:~/.local/share/kyrat/bin

Troubleshooting

This section has been left blank intentionally. It will be filled up as soon as troubles come in!

Contributing

You could help improving Kyrat in the following ways:

Donating

To sustain the project please consider funding by donations through the GitHub Sponsors page.

Authors

Kyrat was originally created in April 2014 by Filippo Squillace ([email protected]).

Here is a list of really appreciated contributors!

Last words

Consider your origins:
You were not born to live like brutes
but to follow virtue and knowledge.
[verse, Dante Alighieri, from Divine Comedy]

More Repositories

1

junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
Shell
2,072
star
2

buava

The utility library for Bash you always dreamed of
Shell
14
star
3

ibis

The Arch Linux based distro for Desktop Environments tailored to minimalists.
Python
9
star
4

juju-old

The universal GNU/Linux package manager. DEPRECATED. Look https://github.com/fsquillace/junest instead.
Shell
7
star
5

pearl

DEPRECATED: in favor of https://github.com/pearl-core/pearl - The Linux Shell made easy
Shell
6
star
6

junest-builder

Script used for building the JuNest images
Shell
5
star
7

pycious

Simple and efficient widget library for the awesome window manager written in Python
Python
5
star
8

twelve-factor-app

Reference of the twelve- factor app book (http://12factor.net/).
4
star
9

cuspla

A CULA wrapper with a high-level interface for CUSP
C++
3
star
10

cusp

Improved version of CUSP Parallel Algorithms for Sparse Matrix
C
3
star
11

notebooks

Various examples of handy Jupyter notebooks
Jupyter Notebook
2
star
12

junest-aur-repo

Repository containing essential packages for JuNest
Shell
2
star
13

junest-repo

Precompiled packages for JuNest
2
star
14

autotuning

Linear solver problem for lambda modes using PETSC
C
2
star
15

minos

PKGBUILD and manual generator for AUR packages
Shell
2
star
16

pearl-utils

Shell
1
star
17

scrssi

Screen+irssi daemon for Archlinux
Shell
1
star
18

mopidy-restorer

Restore mopidy state after a hard reboot
Shell
1
star
19

ganimede

The most complete Jupyter notebook server
Jupyter Notebook
1
star
20

tier-list-videogames

1
star
21

golpy

A Conway's Game of Life Simulator written in Python
Python
1
star
22

lambda-modes

C++
1
star
23

junest-site

JuNest Linux website
CSS
1
star
24

ryuk

Simple HTTP Server with upload file capabilities
Python
1
star
25

pearl-dotfiles

Python
1
star
26

juju-docker

Arch Linux container for building JuJu images
Shell
1
star
27

charon

A collection of data structures for pyCUDA
1
star
28

greetme

An automatic birthday greeting facebook application
JavaScript
1
star
29

groot

Yet another enhanced chroot command with mounting capabilities
Shell
1
star