GithubHelp home page GithubHelp logo

kerikun11 / .dotfiles Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 359 KB

My Configuration Files for UNIX Systems

Shell 83.34% Perl 3.89% PowerShell 7.29% Vim Script 5.48%
vimrc zshrc latexmkrc shellscript dotfiles

.dotfiles's Introduction

kerikun11/.dotfiles

My Configuration Files for UNIX Systems

Install .dotfiles Automatically

See install.sh for details.

## Install .dotfiles with curl
sh -c "$(curl -fsSL https://raw.github.com/kerikun11/.dotfiles/main/install.sh)"
## Install .dotfiles with wget
sh -c "$(wget -qO - https://raw.github.com/kerikun11/.dotfiles/main/install.sh)"
## Install Requirements before Install
REQUIREMENTS="curl git zsh";\
type sudo   &>/dev/null && test "$(whoami)" != "root" && SUDO="sudo" || SUDO="";\
type apt    &>/dev/null && $SUDO apt update -q && $SUDO apt install -yq $REQUIREMENTS;\
type pacman &>/dev/null && $SUDO pacman -Sy -q --noconfirm --needed     $REQUIREMENTS;\
type apk    &>/dev/null && $SUDO apk add -q                             $REQUIREMENTS;\
type yum    &>/dev/null && $SUDO yum install -yq                        $REQUIREMENTS;\
sh -c "$(curl -fsSL https://raw.github.com/kerikun11/.dotfiles/main/install.sh)"

Useful Commands

## Allow me to run sudo without password
echo "$USER ALL=NOPASSWD: ALL" | sudo EDITOR='tee -a' visudo
## Ubuntu Desktop Settings
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"
LANG=C xdg-user-dirs-gtk-update # rename home dirs in English
## Open GNOME Control Center in SSH X11 Forwarding Env
sudo -E XDG_CURRENT_DESKTOP=GNOME gnome-control-center
# Configure qemu-user-static
sudo docker run --rm --privileged multiarch/qemu-user-static --reset --persistent yes
# Configure Swap File
SWAP_SIZE=16G
sudo fallocate -l $SWAP_SIZE /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap defaults 0 0' | sudo tee -a /etc/fstab

Instant Shell Theme

## Bash Instant Prompt Theme
PS1='\n\[\e[0;31m\]# \[\e[0;32m\]\u \[\e[0m\]@ \[\e[0;36m\]\h \[\e[0m\]in \[\e[0;33m\]\w \[\e[0;37m\]\D{%Y/%m/%d} \t\n\[\e[0;34m\]\$ \[\e[0m\]'
## Zsh Instant Prompt Theme
PROMPT=$'\n''%F{red}# %F{green}%n %F{white}@ %F{cyan}%m %F{white}in %F{yellow}%~ %F{240}%D{%Y/%m/%d} %*'$'\n''%F{blue}%# %f'

Bash

## ignore case at completion
S="set completion-ignore-case on" F="$HOME/.inputrc" && grep "$S" $F &>/dev/null || echo "$S" >> $F
## realtime history
S="HISTFILESIZE=10000" F="$HOME/.bashrc" && grep "$S" $F &>/dev/null || echo "$S" >> $F
S="PROMPT_COMMAND='history -a; history -r'" F="$HOME/.bashrc" && grep "$S" $F &>/dev/null || echo "$S" >> $F
## prompt customize
S="PS1='\n\[\e[0;31m\]# \[\e[0;32m\]\u \[\e[0m\]@ \[\e[0;36m\]\h \[\e[0m\]in \[\e[0;33m\]\w \[\e[0;37m\]\D{%Y/%m/%d} \t\n\[\e[0;34m\]\$ \[\e[0m\]'" F="$HOME/.bashrc" && grep "$S" $F &>/dev/null || echo "$S" >> $F

SSH-Agent

## ssh-agent
SSH_AGENT_FILE=/tmp/.ssh-agent
source $SSH_AGENT_FILE &> /dev/null
if ! ssh-add -l &> /dev/null; then
    ssh-agent > $SSH_AGENT_FILE
    source $SSH_AGENT_FILE &> /dev/null
    ssh-add
fi

Dockerfile

# Add an user to a group
sudo gpasswd --add $USER docker && newgrp docker
## base image
FROM ubuntu
## install packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    ca-certificates \
    curl \
    git \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## personal shell settings
RUN echo y | sh -c "$(curl -fsSL https://raw.github.com/kerikun11/.dotfiles/main/install.sh)"
CMD [ "zsh" ]

PowerShell

## Link PowerShell Profile
New-Item -Force -Type SymbolicLink `
    $PROFILE `
    -Value $HOME/.dotfiles/config/powershell/Microsoft.PowerShell_profile.ps1

.dotfiles's People

Contributors

kerikun11 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.