Git Product home page Git Product logo

dotfiles's Introduction

Indeximal Dotfiles

Personal configuration and VM setup files

This repo is inspired by this Blog post by Fatih Arslan. However, I decided to use Make for everything and not just the symlinks.

There are two Makefiles in this repo, the first one Makefile is dotfile functionality. So symlinking config files and creating a common work enviroment. The second one Installers.make is for installing different executables. This might easly change in the future.

Usage

Clone the repo and run

# Link dotfiles and set up environment. Run as unpriviledges sudoers user.
make all
# Install essential executables. Can be run as root (for essentials)
make -f Installers.make essentials
# Install facelapse prerequisites (as unprivildeged)
make -f Installers.make facelapse

When creating a new droplet on DigitalOcean use this code as user data.

#!/bin/bash
set -euo pipefail

USERNAME=cyrill

# Create user and immediately expire password to force a change on login
useradd --create-home --shell "/bin/bash" --groups sudo "${USERNAME}"
passwd --delete "${USERNAME}"
chage --lastday 0 "${USERNAME}"

# Create SSH directory for sudo user and move keys over
home_directory="$(eval echo ~${USERNAME})"
mkdir --parents "${home_directory}/.ssh"
cp /root/.ssh/authorized_keys "${home_directory}/.ssh"
chmod 0700 "${home_directory}/.ssh"
chmod 0600 "${home_directory}/.ssh/authorized_keys"
chown --recursive "${USERNAME}":"${USERNAME}" "${home_directory}/.ssh"

# Disable root SSH login with password
sed --in-place 's/^PermitRootLogin.*/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
if sshd -t -q; then systemctl restart sshd; fi

# Set up dotfiles and install programs
git clone https://github.com/Indeximal/dotfiles.git ${home_directory}/dotfiles
chown -R cyrill:cyrill dotfiles/
cd ${home_directory}/dotfiles
apt install make
make -f Installers.make essentials
# make all  # only works for the current user, which is root in this script

Todos

  • Installers for Samba
  • vim plugins (especially for fish scripts)

dotfiles's People

Contributors

indeximal avatar

Watchers

James Cloos avatar  avatar

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.