Skip to content

Instantly share code, notes, and snippets.

@venkateshshukla
Last active October 14, 2016 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venkateshshukla/777404ba2cbec82e2486 to your computer and use it in GitHub Desktop.
Save venkateshshukla/777404ba2cbec82e2486 to your computer and use it in GitHub Desktop.
Linux config files for various stuff like vim, screen, bashrc etc.

####Config Files for Linux As I change OS, I have to add these configuration files over and over again. A gist having these files would help. This is more of a personal TODO than an actual project.

Move these files into your home repo and add a dot (.) in front of their filenames.

Also, move the setprompt to ~/bin/

cp setprompt ~/bin/

For setting up pathogen in vim, carry out the following steps:

git clone https://github.com/tpope/vim-pathogen
cp vim-pathogen/pathogen.vim ~/.vim/autoload/pathogen.vim

Then, the following git repo are present in ~/.vim/bundle

  1. vim-flavored-markdown
  2. vim-gradle
  3. vim-yaml
  4. xmledit
#!/bin/bash
# User specific aliases and functions
alias ll='ls -alh'
alias la='ls -A'
alias l='ls -CFlh'
# Show random art everytime
alias ssh="ssh -o VisualHostKey=yes"
# Maven aliases
alias maven305="alias mvn='~/libs/apache-maven-3.0.5/bin/mvn'"
alias maven311="alias mvn='~/libs/apache-maven-3.1.1/bin/mvn'"
alias maven325="alias mvn='~/libs/apache-maven-3.2.5/bin/mvn'"
# Android aliases
alias sdk_update="android update sdk --no-ui"
# Interactive rm command
alias rm="rm -iv"
# .bashrc
# If not running interactively, don't do anything
[[ $- == *i* ]] || return
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Add all the aliases in separate file
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# Hand made scripts to be added to $HOME/bin
export PATH=$PATH:$HOME/bin
# setprompt script is present at $HOME/bin/setprompt
if [ -f $HOME/bin/setprompt ]; then
source $HOME/bin/setprompt
fi
# History to be huge
export HISTFILESIZE=20000
export HISTSIZE=10000
shopt -s histappend
# Combine multiline commands into one in history
shopt -s cmdhist
# Ignore duplicates, ls without options and builtin commands
HISTCONTROL=ignoredups
# Check window size after each command and if necessary update the values of
# LINES and COLUMNS.
shopt -s checkwinsize
# User specific aliases and functions
# List aliases
alias ll='ls -alh'
alias la='ls -A'
alias l='ls -CFlh'
# Show random art everytime
alias ssh="ssh -o VisualHostKey=yes"
# Java home
#export JAVA_HOME="/usr/java/jdk1.8.0_31"
export JAVA_HOME="/usr/java/jdk1.7.0_75"
#export JAVA_HOME="/usr/java/jdk1.6.0_45"
# Android Sdk Home
export ANDROID_HOME="/android-sdk"
# Android SDK Path
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
# Android Studio path
export PATH=$PATH:/android-studio/bin
# Google App Engine path
export PATH=$PATH:/google_appengine
# Maven aliases
alias maven305="alias mvn='~/libs/apache-maven-3.0.5/bin/mvn'"
alias maven311="alias mvn='~/libs/apache-maven-3.1.1/bin/mvn'"
alias maven325="alias mvn='~/libs/apache-maven-3.2.5/bin/mvn'"
# Gradle home
export GRADLE_HOME="/home/venkatesh/libs/gradle-2.2.1"
export PATH=$PATH:$GRADLE_HOME/bin
# Android aliases
alias sdk_update="android update sdk --no-ui"
fortune | cowsay
Heading
Body
Signed-off-by: FirstName SecondName <username@domain.tldomain>
[user]
name = FirstName LastName
email = username@domain.tldomain
[core]
editor = vim
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
ui = auto
whitespace = red reverse
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = blue bold
old = red
new = green
whitespace = red reverse
[color "status"]
added = green
changed = blue
untracked = red
[commit]
template = /home/venkatesh/.gitcommit_template
[merge]
tool = meld
[push]
default = matching
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_auth",
"mod_webdav",
# "mod_rewrite",
)
server.document-root = "/home/venkatesh/Downloads"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 443
$SERVER["socket"] == ":8080" {
server.document-root = "/home/venkatesh/Downloads"
}
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
dir-listing.activate = "enable"
dir-listing.hide-dotfiles = "enable"
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/etc/lighttpd/.passwd"
auth.debug = 2
auth.require = ( "/" =>
(
"method" => "digest",
"realm" => "Authorized users only",
"require" => "valid-user"
)
)
webdav.activate = "enable"
webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db"
# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
port 80
proto tcp
dev tun
ca ca.crt
cert venkatesh.crt
key venkatesh.key
dh dh.pem
server 10.100.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
log-append /var/log/openvpn.log
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
client-to-client
defscrollback = unlimited
vbell off
startup_message off
shell bash
altscreen
hardstatus on
hardstatus alwayslastline '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'
#!/bin/bash
# The original
PS1='[\u@\h \W]\$ '
# Reset
Reset='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
Purple='\e[0;35m' # Purple
Cyan='\e[0;36m' # Cyan
White='\e[0;37m' # White
# Bold
BBlack='\e[1;30m' # Black
BRed='\e[1;31m' # Red
BGreen='\e[1;32m' # Green
BYellow='\e[1;33m' # Yellow
BBlue='\e[1;34m' # Blue
BPurple='\e[1;35m' # Purple
BCyan='\e[1;36m' # Cyan
BWhite='\e[1;37m' # White
# Underline
UBlack='\e[4;30m' # Black
URed='\e[4;31m' # Red
UGreen='\e[4;32m' # Green
UYellow='\e[4;33m' # Yellow
UBlue='\e[4;34m' # Blue
UPurple='\e[4;35m' # Purple
UCyan='\e[4;36m' # Cyan
UWhite='\e[4;37m' # White
# Background
On_Black='\e[40m' # Black
On_Red='\e[41m' # Red
On_Green='\e[42m' # Green
On_Yellow='\e[43m' # Yellow
On_Blue='\e[44m' # Blue
On_Purple='\e[45m' # Purple
On_Cyan='\e[46m' # Cyan
On_White='\e[47m' # White
# High Intensity
IBlack='\e[0;90m' # Black
IRed='\e[0;91m' # Red
IGreen='\e[0;92m' # Green
IYellow='\e[0;93m' # Yellow
IBlue='\e[0;94m' # Blue
IPurple='\e[0;95m' # Purple
ICyan='\e[0;96m' # Cyan
IWhite='\e[0;97m' # White
# Bold High Intensity
BIBlack='\e[1;90m' # Black
BIRed='\e[1;91m' # Red
BIGreen='\e[1;92m' # Green
BIYellow='\e[1;93m' # Yellow
BIBlue='\e[1;94m' # Blue
BIPurple='\e[1;95m' # Purple
BICyan='\e[1;96m' # Cyan
BIWhite='\e[1;97m' # White
# High Intensity backgrounds
On_IBlack='\e[0;100m' # Black
On_IRed='\e[0;101m' # Red
On_IGreen='\e[0;102m' # Green
On_IYellow='\e[0;103m' # Yellow
On_IBlue='\e[0;104m' # Blue
On_IPurple='\e[0;105m' # Purple
On_ICyan='\e[0;106m' # Cyan
On_IWhite='\e[0;107m' # White
# Finally the prompt
PS1="[\[${Blue}\]\u@\h \t\[${Reset}\]] \[${Purple}\]\W \[${Reset}\]\$ "
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/home/venkatesh/Downloads",
"download-queue-enabled": true,
"download-queue-size": 20,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": true,
"incomplete-dir": "/home/venkatesh/Incomplete",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"peer-port": 63402,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": true,
"peer-socket-tos": "default",
"pex-enabled": true,
"port-forwarding-enabled": true,
"preallocation": 1,
"prefetch-enabled": 1,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 1,
"ratio-limit-enabled": true,
"rename-partial-files": true,
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{a8f7615b2b64f6cff5d20a9f8b6545bec746bca3OsRTZ64P",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "perceptron",
"rpc-whitelist": "127.0.0.1,10.100.0.*,130.211.247.91",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 18,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'kien/ctrlp.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'romainl/Apprentice'
call vundle#end() " required
filetype plugin indent on " required
" Line number
set number
" Indentation
set smarttab
set smartindent
set autoindent
set shiftwidth=4
set tabstop=4
set cindent
set cinoptions=l1,:0
" Search defaults
set ignorecase
set smartcase
set incsearch
" The default blue is just impossible to see on a black terminal
highlight Comment ctermfg=Brown
" clearly point out when someone have trailing spaces
highlight ExtraWhitespace ctermbg=red guibg=red
" Show trailing whitespace and spaces before a tab:
match ExtraWhitespace /\s\+$\| \+\ze\t/
" Alias capital W to w and similar
command WQ wq
command Wq wq
command W w
command Q q
set pastetoggle=<F3>
"autocmd vimenter * NERDTree
map <C-n> :NERDTreeToggle<CR>
set laststatus=2
colorscheme apprentice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment