Coder Social home page Coder Social logo

.config's Introduction

Rafi's Workstations Config

Workstation software configuration, tested on Archlinux and OSX (using Macports).

Install

# Clone
git clone --recursive git://github.com/rafi/.config.git ~/.config
cd ~/.config

# Symlink 4 files manually:
cd ~
ln -s .config/bash/bashrc .bashrc
ln -s .config/bash/profile .profile
ln -s .config/ctags/config .ctags
ln -s .config/xorg/xinitrc .xinitrc      # Just for Linux
ln -s .config/xorg/xinitrc_osx .xinitrc  # Just for OSX

# Prepare cache directories
mkdir -p ~/.cache/vim/{backup,bookmarks,swap,plugins,tags,undo}
mkdir -p ~/.cache/{aria2,beets,mpd,mpdscribble,npm,pacaur,rtorrent,subtitles,mux,z}
mkdir -p ~/.cache/ncmpcpp/lyrics

# Prepare user local
mkdir -p ~/.local/bin
mkdir -p ~/.local/share/{composer,vagrant,virtualbox}
mkdir -p ~/.local/lib/{nodejs,python2.7,ruby}
mkdir -p ~/.local/lib/python2.7/virtualenvs

OSX-specific Software

XDG Conformity

Configuration directories are organized neatly by defining specific environment variables in bash/exports and aliases in bash/aliases. There are some programs you'll need to create custom scripts to load the proper config files: bug-warrior, mpdscribble, mutt, mysql, ncmpc, ncmpcpp, rtorrent, tmux. See examples at rafi/.local/bin.

Protecting Secrets

Using .gitattributes filters clean and smudge. Setup custom filter:

cd ~/.config
git config --local filter.vault.clean "sed -f ~/.config/clean.sed"
git config --local filter.vault.smudge "sed -f ~/.config/smudge.sed"

The sed script clean.sed is included. You have to create smudge.sed yourself:

cat > ~/.config/smudge.sed
s/{{ \(DIANA\|ARIA2\)_TOKEN }}/secret/
s/{{ LASTFM_USER }}/username/
s/{{ LASTFM_TOKEN }}/token/
s/{{ LASTFM_PASS }}/token/
s/{{ SPOTIFY_USER }}/username/
s/{{ SPOTIFY_PASS }}/password/
s/{{ ECHONEST_TOKEN }}/token/
s/{{ JIRA_URL }}/url/
s/{{ JIRA_USER }}/username/
s/{{ JIRA_PASS }}/password/
s/{{ GIT_\(PERSONAL\|WORK\)_NAME }}/Joe Shmoe/
s/{{ GIT_PERSONAL_EMAIL }}/[email protected]/
s/{{ GIT_WORK_EMAIL }}/[email protected]/
s/{{ GIT_\(PERSONAL\|WORK\)_USER }}/joe/
s/{{ WEATHER_TOKEN }}/token/

Now whenever you stage files, the clean.sed will prevent secrets being committed. And on checkout, the smudge.sed will inject your secrets into their proper placeholders. Note that smudge.sed is ignored from being committed mistakenly.

.config's People

Contributors

rafi avatar

Watchers

 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.