parent
d15767a938
commit
490e0c86c5
89 changed files with 12214 additions and 0 deletions
@ -0,0 +1 @@ |
||||
bash_logout |
@ -0,0 +1 @@ |
||||
bash_profile |
@ -0,0 +1 @@ |
||||
gitconfig |
@ -0,0 +1,33 @@ |
||||
\documentclass[12pt]{article} |
||||
|
||||
\usepackage{geometry} % Required for adjusting page dimensions |
||||
\usepackage{amsmath} |
||||
\usepackage{amsthm} |
||||
\usepackage{amssymb} |
||||
\usepackage{amsfonts} |
||||
\usepackage{longtable} |
||||
\usepackage{booktabs} |
||||
\usepackage[UKenglish]{babel} |
||||
\geometry{ |
||||
paper=a4paper, % Change to letterpaper for US letter |
||||
top=3cm, % Top margin |
||||
bottom=1.5cm, % Bottom margin |
||||
left=4.5cm, % Left margin |
||||
right=4.5cm, % Right margin |
||||
%showframe, % Uncomment to show how the type block is set on the page |
||||
} |
||||
|
||||
\title{<++>} |
||||
\author{Jonathan Hodgson} |
||||
\date{\today} |
||||
|
||||
|
||||
\begin{document} |
||||
\maketitle |
||||
|
||||
|
||||
\section{<++>} |
||||
<++> |
||||
|
||||
|
||||
\end{document} |
@ -0,0 +1,12 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title><++></title> |
||||
<++> |
||||
</head> |
||||
<body> |
||||
<++> |
||||
</body> |
||||
</html> |
||||
|
@ -0,0 +1 @@ |
||||
article.latex |
@ -0,0 +1,37 @@ |
||||
\documentclass[12pt,stdletter,orderfromtodate,sigleft,a4paper,dateleft,addrfromemail,addrfromphone]{newlfm} |
||||
\usepackage{blindtext, xfrac} |
||||
\usepackage{longtable} |
||||
\usepackage{booktabs} |
||||
\usepackage[UKenglish]{babel} |
||||
|
||||
\newcommand{\latex}{\LaTeX} |
||||
|
||||
\newlfmP{dateskipbefore=20pt} |
||||
\newlfmP{sigsize=20pt} |
||||
\newlfmP{sigskipbefore=50pt} |
||||
|
||||
\newlfmP{Headlinewd=0pt,Footlinewd=0pt} |
||||
|
||||
\namefrom{Jonathan Hodgson} |
||||
\addrfrom{Cherrydown \\ The Meadows \\ Station Road \\ Cotton \\ Stowmarket \\ Suffolk \\ IP14 4NZ \\ |
||||
} |
||||
\phonefrom{07753 492267} |
||||
\emailfrom{jonathan@lunarweb.co.uk} |
||||
|
||||
\nameto{<+Recipient Name+>} |
||||
\addrto{% |
||||
<+Recipient Address+> |
||||
} |
||||
|
||||
\dateset{\today} |
||||
\regarding{<+Subject+>} |
||||
|
||||
\greetto{<+Dear Sir or Madam+>} |
||||
\closeline{Yours sincerely,} %Sincerly if you know the name. Failthfully if you don't |
||||
|
||||
\begin{document} |
||||
\begin{newlfm} |
||||
|
||||
<+Message+> |
||||
\end{newlfm} |
||||
\end{document} |
@ -0,0 +1,60 @@ |
||||
%---------------------------------------------------------------------------------------- |
||||
% DOCUMENT CONFIGURATION |
||||
%---------------------------------------------------------------------------------------- |
||||
|
||||
\documentclass[12pt,a4paper,stdletter,sigleft]{newlfm} % 10pt font size default, 11pt and 12pt are also possible |
||||
|
||||
|
||||
%\longindentation=0pt % Un-commenting this line will push the closing "Sincerely," to the left of the page |
||||
|
||||
|
||||
\usepackage[T1]{fontenc} % Output font encoding for international characters |
||||
\usepackage[utf8]{inputenc} % Required for inputting international characters |
||||
\usepackage[UKenglish]{babel} |
||||
\usepackage{stix} % Use the Stix font by default |
||||
|
||||
\usepackage{microtype} % Improve justification |
||||
|
||||
%---------------------------------------------------------------------------------------- |
||||
% YOUR NAME & ADDRESS SECTION |
||||
%---------------------------------------------------------------------------------------- |
||||
|
||||
\signature{Jonathan Hodgson} % Your name for the signature at the bottom |
||||
|
||||
\address{Cherrydown \\ The Meadows \\ Station Road \\ Cotton \\ Stowmarket \\ Suffolk \\ IP14 4NZ \\ 07753 492267} % Your address and phone number |
||||
|
||||
%---------------------------------------------------------------------------------------- |
||||
|
||||
\begin{document} |
||||
|
||||
%---------------------------------------------------------------------------------------- |
||||
% ADDRESSEE SECTION |
||||
%---------------------------------------------------------------------------------------- |
||||
|
||||
\begin{letter}{<++>} % Name/title of the addressee{Recipient Name \\ Recipient Address} |
||||
|
||||
%---------------------------------------------------------------------------------------- |
||||
% LETTER CONTENT SECTION |
||||
%---------------------------------------------------------------------------------------- |
||||
|
||||
\opening{\textbf{Dear Sir or Madam,}} |
||||
|
||||
<++> |
||||
|
||||
Thank you for your time and consideration. |
||||
|
||||
I look forward to your reply. |
||||
|
||||
\vspace{2\parskip} % Extra whitespace for aesthetics |
||||
\closing{Yours failthfully,} |
||||
\vspace{2\parskip} % Extra whitespace for aesthetics |
||||
|
||||
%\ps{P.S. You can find additional information attached to this letter.} % Postscript text, comment this line to remove it |
||||
|
||||
%\encl{Copyright permission form} % Enclosures with the letter, comment this line to remove it |
||||
|
||||
%---------------------------------------------------------------------------------------- |
||||
|
||||
\end{letter} |
||||
|
||||
\end{document} |
@ -0,0 +1,3 @@ |
||||
# |
||||
# ~/.bash_logout |
||||
# |
@ -0,0 +1,10 @@ |
||||
# |
||||
# ~/.bash_profile |
||||
# |
||||
|
||||
|
||||
[[ -f ~/.bashrc ]] && . ~/.bashrc |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,344 @@ |
||||
# |
||||
# ~/.bashrc |
||||
# |
||||
|
||||
# If not running interactively, don't do anything |
||||
[[ $- != *i* ]] && return |
||||
|
||||
export TERMINAL=/usr/bin/konsole |
||||
export TERM=xterm-256color |
||||
export PATH=~/.bin:/opt/lampp/bin:$PATH:. |
||||
export EDITOR=vim |
||||
export CDPATH=.:~:~/Sites |
||||
|
||||
#Ruby things |
||||
#GEM_HOME=$(ls -t -U | ruby -e 'puts Gem.user_dir') |
||||
#GEM_PATH=$GEM_HOME |
||||
#export PATH=$PATH:$GEM_HOME/bin |
||||
#export GEM_HOME=$(ruby -e 'print Gem.user_dir') |
||||
|
||||
big-chromium () { |
||||
chromium --force-device-scale-factor=$1 |
||||
} |
||||
|
||||
big-new-chromium () { |
||||
chromium-snapshot-bin --force-device-scale-factor=$1 |
||||
} |
||||
|
||||
#Swap two files |
||||
function swap() { |
||||
mv $1 $1._tmp; |
||||
mv $2 $1; |
||||
mv $1._tmp $2; |
||||
} |
||||
|
||||
function old() { |
||||
mv "$1" "$1.old" |
||||
} |
||||
|
||||
#This prints the current working directory after doing a cd" |
||||
cdls(){ |
||||
cd "$@" |
||||
ls -F --color=auto |
||||
} |
||||
|
||||
#Takes you to the aquarius theme |
||||
function aquarius() { |
||||
public_html=${PWD%/public_html*}/public_html |
||||
if [ -d $public_html ]; then |
||||
theme=$public_html/wp-content/themes |
||||
if [ -d $theme ]; then |
||||
cdls $theme/aquarius |
||||
else |
||||
echo " Can't find theme folder " |
||||
fi |
||||
else |
||||
echo " Can't find public_html folder." |
||||
fi |
||||
} |
||||
|
||||
#Takes you to the child theme |
||||
function theme() { |
||||
public_html=${PWD%/public_html*}/public_html |
||||
if [ -d $public_html ]; then |
||||
theme=$public_html/wp-content/themes |
||||
if [ -d $theme ]; then |
||||
child=$(ls -d $theme/*/ | grep -v "$theme\/aquarius" | grep -v "$theme\/twenty*" | grep -v "$theme\/barelycorporate" -m 1) |
||||
cdls $child |
||||
else |
||||
echo " Can't find theme folder " |
||||
fi |
||||
else |
||||
echo " Can't find public_html folder." |
||||
fi |
||||
} |
||||
|
||||
######################################## |
||||
## ## |
||||
## Search Functions ## |
||||
## ## |
||||
######################################## |
||||
|
||||
#These search functions use grep to search all sub-folders of the current working directory |
||||
searchjs() { |
||||
# This will search through .js and .es6 files but won't search minified files |
||||
grep -r -i -n --color="auto" --include=\*.{js,es6} --exclude=\*.min.js "$1" . |
||||
} |
||||
searchcss() { |
||||
# This will search through .css and .less files but won't search minified files |
||||
grep -r -i -n --color="auto" --include=\*.{css,less} --exclude=\*.min.css "$1" . |
||||
} |
||||
searchphp() { |
||||
grep -r -i -n --color="auto" --include="*.php" "$1" . |
||||
} |
||||
|
||||
# This makes cd use function above |
||||
alias cd="cdls" |
||||
|
||||
# These alow me to easily set the file and folder permissions for a wordpress instilation. |
||||
alias folder-perms='find . -type d -not -path "./.git/*" -not -path "./.git" -exec chmod 775 {} \;' |
||||
alias file-perms='find . -type f -not -path "./.git/*" -not -path "./.git" -exec chmod 664 {} \;' |
||||
alias wp-perms='folder-perms; file-perms' |
||||
|
||||
# Make ls add Indicators to file names and colour the output |
||||
alias ls='ls -F --color=auto' |
||||
|
||||
# Make tree add indicators and color |
||||
alias tree='tree -F -C' |
||||
|
||||
#Start cups |
||||
alias cups='sudo systemctl start org.cups.cupsd.service' |
||||
|
||||
#Start network manager |
||||
alias net='sudo systemctl start NetworkManager.service' |
||||
|
||||
# Alias lampp because I don't want to clog my PATH |
||||
alias lampp='/opt/lampp/lampp' |
||||
alias glampp='gksudo /opt/lampp/manager-linux-x64.run' |
||||
|
||||
#Always make all directories necesary |
||||
alias mkdir='mkdir -p' |
||||
|
||||
# Shortcut for rewriting wp permalinks |
||||
alias perms='wp rewrite flush' |
||||
|
||||
#Clear terminal and screenfetch |
||||
alias cls='clear; screenfetch' |
||||
|
||||
#An alias for my standard less configuration |
||||
#I don't set it to lessc because sometimes I don't use this config and I always forget how to ignore an alias |
||||
#alias myless='lessc --clean-css --source-map-basepath=/home/jonathan/Sites/charts/public_html --source-map --autoprefix="last 3 versions, ie >= 9" styles.less styles.min.css' |
||||
alias myless='lessc --clean-css --source-map --autoprefix="last 3 versions, ie >= 9" styles.less styles.min.css' |
||||
|
||||
# Git shortcuts |
||||
alias status='git status ' |
||||
alias st='git status' |
||||
alias checkout='git checkout' |
||||
alias ch='git checkout' |
||||
alias push='git push ' |
||||
alias pull='git pull ' |
||||
alias bb='git open' |
||||
|
||||
# Always make grep ouput color |
||||
alias grep="grep --color=auto" |
||||
|
||||
# Shortcuts to sites folder |
||||
alias sites="cd ~/Sites" |
||||
alias s="cd ~/Sites" |
||||
|
||||
# Shortcuts to documents folder |
||||
alias documents="cd ~/Documents/" |
||||
alias d="cd ~/Documents/" |
||||
|
||||
# Shortcuts to home folder |
||||
alias home="cd ~/" |
||||
alias ~="cd ~/" |
||||
|
||||
#Goes up to the public_html folder |
||||
alias ph='cd ${PWD%/public_html*}/public_html' |
||||
|
||||
# Quit the terminal using :q (The same as Vi/Vim) |
||||
alias :q='exit;' |
||||
|
||||
# Not sure why and how but this makes sudo work with my aliases |
||||
alias sudo='sudo ' |
||||
|
||||
#Make the cal command default to start on Sunday |
||||
alias cal='cal -s' |
||||
|
||||
# update the third party wordpress plugins we are mirroring |
||||
alias u3p='update3rdPartyPlugins' |
||||
|
||||
# Edit my bashrc |
||||
alias brc='$EDITOR ~/.bashrc' |
||||
|
||||
# Edit my vimrc |
||||
alias vrc='$EDITOR ~/.vimrc' |
||||
|
||||
# Go to my .vim folder |
||||
alias .v='cd ~/.vim/' |
||||
# Go to my dotfiles folder |
||||
if [[ $(hostname) == "jonathansnuc" ]]; then |
||||
#Please don't judge - This is a reminant from first days of version controlling dotfiles |
||||
alias df='cd ~/Downloads/laptopConfig/' |
||||
else |
||||
alias df='cd ~/.dotfiles' |
||||
fi |
||||
|
||||
#Old ps1 |
||||
#PS1='[\u@\h \W]\$ ' |
||||
|
||||
|
||||
# bash completion for the `wp` command |
||||
_wp_complete() { |
||||
local OLD_IFS="$IFS" |
||||
local cur=${COMP_WORDS[COMP_CWORD]} |
||||
IFS=$'\n'; # want to preserve spaces at the end |
||||
local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")" |
||||
if [[ "$opts" =~ \<file\>\s* ]] |
||||
then |
||||
COMPREPLY=( $(compgen -f -- $cur) ) |
||||
elif [[ $opts = "" ]] |
||||
then |
||||
COMPREPLY=( $(compgen -f -- $cur) ) |
||||
else |
||||
COMPREPLY=( ${opts[*]} ) |
||||
fi |
||||
IFS="$OLD_IFS" |
||||
return 0 |
||||
} |
||||
complete -o nospace -F _wp_complete wp |
||||
|
||||
export GIT_PS1_SHOWDIRTYSTATE=1 # Show the +(Staged) or *(unstaged) next to branch name for |
||||
export GIT_PS1_SHOWUNTRACKEDFILES=1 # Show the %(Untracked) next to branch name |
||||
export GIT_PS1_SHOWUPSTREAM="auto" |
||||
|
||||
source /usr/share/git/completion/git-completion.bash |
||||
source /usr/share/git/completion/git-prompt.sh |
||||
|
||||
############################################ |
||||
## ## |
||||
## Colours for output ## |
||||
## ## |
||||
############################################ |
||||
#{{{ |
||||
# Reset |
||||
Color_Off="\[\033[0m\]" # Text Reset |
||||
|
||||
# Regular Colors |
||||
Black="\[\033[0;30m\]" # Black |
||||
Red="\[\033[0;31m\]" # Red |
||||
Green="\[\033[0;32m\]" # Green |
||||
Yellow="\[\033[0;33m\]" # Yellow |
||||
Blue="\[\033[0;34m\]" # Blue |
||||
Purple="\[\033[0;35m\]" # Purple |
||||
Cyan="\[\033[0;36m\]" # Cyan |
||||
White="\[\033[0;37m\]" # White |
||||
|
||||
# Bold |
||||
BBlack="\[\033[1;30m\]" # Black |
||||
BRed="\[\033[1;31m\]" # Red |
||||
BGreen="\[\033[1;32m\]" # Green |
||||
BYellow="\[\033[1;33m\]" # Yellow |
||||
BBlue="\[\033[1;34m\]" # Blue |
||||
BPurple="\[\033[1;35m\]" # Purple |
||||
BCyan="\[\033[1;36m\]" # Cyan |
||||
BWhite="\[\033[1;37m\]" # White |
||||
|
||||
# Underline |
||||
UBlack="\[\033[4;30m\]" # Black |
||||
URed="\[\033[4;31m\]" # Red |
||||
UGreen="\[\033[4;32m\]" # Green |
||||
UYellow="\[\033[4;33m\]" # Yellow |
||||
UBlue="\[\033[4;34m\]" # Blue |
||||
UPurple="\[\033[4;35m\]" # Purple |
||||
UCyan="\[\033[4;36m\]" # Cyan |
||||
UWhite="\[\033[4;37m\]" # White |
||||
|
||||
# Background |
||||
On_Black="\[\033[40m\]" # Black |
||||
On_Red="\[\033[41m\]" # Red |
||||
On_Green="\[\033[42m\]" # Green |
||||
On_Yellow="\[\033[43m\]" # Yellow |
||||
On_Blue="\[\033[44m\]" # Blue |
||||
On_Purple="\[\033[45m\]" # Purple |
||||
On_Cyan="\[\033[46m\]" # Cyan |
||||
On_White="\[\033[47m\]" # White |
||||
|
||||
# High Intensty |
||||
IBlack="\[\033[0;90m\]" # Black |
||||
IRed="\[\033[0;91m\]" # Red |
||||
IGreen="\[\033[0;92m\]" # Green |
||||
IYellow="\[\033[0;93m\]" # Yellow |
||||
IBlue="\[\033[0;94m\]" # Blue |
||||
IPurple="\[\033[0;95m\]" # Purple |
||||
ICyan="\[\033[0;96m\]" # Cyan |
||||
IWhite="\[\033[0;97m\]" # White |
||||
|
||||
# Bold High Intensty |
||||
BIBlack="\[\033[1;90m\]" # Black |
||||
BIRed="\[\033[1;91m\]" # Red |
||||
BIGreen="\[\033[1;92m\]" # Green |
||||
BIYellow="\[\033[1;93m\]" # Yellow |
||||
BIBlue="\[\033[1;94m\]" # Blue |
||||
BIPurple="\[\033[1;95m\]" # Purple |
||||
BICyan="\[\033[1;96m\]" # Cyan |
||||
BIWhite="\[\033[1;97m\]" # White |
||||
|
||||
# High Intensty backgrounds |
||||
On_IBlack="\[\033[0;100m\]" # Black |
||||
On_IRed="\[\033[0;101m\]" # Red |
||||
On_IGreen="\[\033[0;102m\]" # Green |
||||
On_IYellow="\[\033[0;103m\]" # Yellow |
||||
On_IBlue="\[\033[0;104m\]" # Blue |
||||
On_IPurple="\[\033[10;95m\]" # Purple |
||||
On_ICyan="\[\033[0;106m\]" # Cyan |
||||
On_IWhite="\[\033[0;107m\]" # White |
||||
#}}} |
||||
# Various variables you might want for your PS1 prompt instead |
||||
Time12h="\T" |
||||
Time12a="\@" |
||||
PathShort="\w" |
||||
PathFull="\W" |
||||
NewLine="\n" |
||||
Jobs="\j" |
||||
Username="\u" |
||||
|
||||
# Default PS1 |
||||
# \u@\h [\w]$ |
||||
export PS1=$Username" "$Yellow$PathShort$Color_Off'$(git branch &>/dev/null;\ |
||||
if [ $? -eq 0 ]; then \ |
||||
echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \ |
||||
if [ "$?" -eq "0" ]; then \ |
||||
echo "'$Green'"$(__git_ps1 " (%s)");\ |
||||
else \ |
||||
echo "'$Red'"$(__git_ps1 " (%s)");\ |
||||
fi)"; \ |
||||
fi)'$Color_Off'\$ ' |
||||
|
||||
# export PS1="\[\033[0;97m\]\u \[\033[0;33m\]\w"'$(git branch &>/dev/null;\ |
||||
# if [ $? -eq 0 ]; then \ |
||||
# echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \ |
||||
# if [ "$?" -eq "0" ]; then \ |
||||
# echo "\[\033[0;32m\]"$(__git_ps1 " (%s)");\ |
||||
# else \ |
||||
# echo "\[\033[0;91m\]"$(__git_ps1 " (%s)");\ |
||||
# fi)"; \ |
||||
# fi)\[\033[0m\]\$ ' |
||||
function _update_ps1() { |
||||
export PS1="$(~/.config/powerline-shell/powerline-shell.py $? 2> /dev/null)" |
||||
} |
||||
|
||||
if [ "$TERM" != "linux" ]; then |
||||
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" |
||||
fi |
||||
|
||||
[ -r "$HOME/.smartcd_config" ] && ( [ -n $BASH_VERSION ] || [ -n $ZSH_VERSION ] ) && source ~/.smartcd_config |
||||
|
||||
#If on work computer, cd into sites |
||||
|
||||
clear |
||||
screenfetch |
||||
set -o vi |
||||
|
||||
# vim: foldmethod=marker |
@ -0,0 +1,26 @@ |
||||
#!/usr/bin/bash |
||||
if [ $1 ]; then |
||||
case $1 in |
||||
-h|--help) |
||||
echo "Add entrys to your hosts file" |
||||
echo "" |
||||
echo -e "addhost domain.com\t\t\t\tadds domain.com to your hosts and points to local machine" |
||||
echo -e "addhost (alex|aaron|jonathan) domain.com\tadds domain.com to your hosts and points to persons machine" |
||||
;; |
||||
alex) |
||||
echo -e "10.0.1.201\t$2" | sudo tee -a /etc/hosts |
||||
;; |
||||
aaron) |
||||
echo -e "10.0.1.202\t$2" | sudo tee -a /etc/hosts |
||||
;; |
||||
jonathan) |
||||
echo -e "10.0.1.203\t$2" | sudo tee -a /etc/hosts |
||||
;; |
||||
*) |
||||
echo -e "127.0.0.1\t$1" | sudo tee -a /etc/hosts |
||||
;; |
||||
esac |
||||
else |
||||
echo "You need to add at least a domain" |
||||
fi |
||||
|
@ -0,0 +1,3 @@ |
||||
#!/usr/bin/bash |
||||
v=$(xset -q | grep Caps) |
||||
echo ${v:7:17} |
@ -0,0 +1,22 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
TITLE="$1" |
||||
shift |
||||
|
||||
enscript -1 --media=A4 \ |
||||
--toc \ |
||||
--header '%H - $N | | page $% of $= in file $v' \ |
||||
--font "Menlo-Regular@8.5" \ |
||||
--header-font "Menlo-Bold@10" \ |
||||
--margins=60:60:18:60 \ |
||||
--fancy-header=sjl \ |
||||
--title $TITLE \ |
||||
--baselineskip 3 \ |
||||
--line-numbers \ |
||||
--highlight \ |
||||
--color \ |
||||
--mark-wrapped-lines=arrow \ |
||||
-p - \ |
||||
--word-wrap $* \ |
||||
| ps2pdf -i -o code.pdf |
||||
|
@ -0,0 +1,157 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
""" |
||||
csvtomd 0.2.1 |
||||
|
||||
Convert your CSV files into Markdown tables. |
||||
|
||||
More info: http://github.com/mplewis/csvtomd |
||||
""" |
||||
|
||||
import argparse |
||||
import csv |
||||
import sys |
||||
|
||||
|
||||
def check_negative(value): |
||||
try: |
||||
ivalue = int(value) |
||||
except ValueError: |
||||
raise argparse.ArgumentTypeError( |
||||
'"%s" must be an integer' % value) |
||||
if ivalue < 0: |
||||
raise argparse.ArgumentTypeError( |
||||
'"%s" must not be a negative value' % value) |
||||
return ivalue |
||||
|
||||
|
||||
def pad_to(unpadded, target_len): |
||||
""" |
||||
Pad a string to the target length in characters, or return the original |
||||
string if it's longer than the target length. |
||||
""" |
||||
under = target_len - len(unpadded) |
||||
if under <= 0: |
||||
return unpadded |
||||
return unpadded + (' ' * under) |
||||
|
||||
|
||||
def normalize_cols(table): |
||||
""" |
||||
Pad short rows to the length of the longest row to help render "jagged" |
||||
CSV files |
||||
""" |
||||
longest_row_len = max([len(row) for row in table]) |
||||
for row in table: |
||||
while len(row) < longest_row_len: |
||||
row.append('') |
||||
return table |
||||
|
||||
|
||||
def pad_cells(table): |
||||
"""Pad each cell to the size of the largest cell in its column.""" |
||||
col_sizes = [max(map(len, col)) for col in zip(*table)] |
||||
for row in table: |
||||
for cell_num, cell in enumerate(row): |
||||
row[cell_num] = pad_to(cell, col_sizes[cell_num]) |
||||
return table |
||||
|
||||
|
||||
def horiz_div(col_widths, horiz, vert, padding): |
||||
""" |
||||
Create the column dividers for a table with given column widths. |
||||
|
||||
col_widths: list of column widths |
||||
horiz: the character to use for a horizontal divider |
||||
vert: the character to use for a vertical divider |
||||
padding: amount of padding to add to each side of a column |
||||
""" |
||||
horizs = [horiz * w for w in col_widths] |
||||
div = ''.join([padding * horiz, vert, padding * horiz]) |
||||
return div.join(horizs) |
||||
|
||||
|
||||
def add_dividers(row, divider, padding): |
||||
"""Add dividers and padding to a row of cells and return a string.""" |
||||
div = ''.join([padding * ' ', divider, padding * ' ']) |
||||
return div.join(row) |
||||
|
||||
|
||||
def md_table(table, *, padding=1, divider='|', header_div='-'): |
||||
""" |
||||
Convert a 2D array of items into a Markdown table. |
||||
|
||||
padding: the number of padding spaces on either side of each divider |
||||
divider: the vertical divider to place between columns |
||||
header_div: the horizontal divider to place between the header row and |
||||
body cells |
||||
""" |
||||
table = normalize_cols(table) |
||||
table = pad_cells(table) |
||||
header = table[0] |
||||
body = table[1:] |
||||
|
||||
col_widths = [len(cell) for cell in header] |
||||
horiz = horiz_div(col_widths, header_div, divider, padding) |
||||
|
||||
header = add_dividers(header, divider, padding) |
||||
body = [add_dividers(row, divider, padding) for row in body] |
||||
|
||||
table = [header, horiz] |
||||
table.extend(body) |
||||
table = [row.rstrip() for row in table] |
||||
return '\n'.join(table) |
||||
|
||||
|
||||
def csv_to_table(file, delimiter): |
||||
return list(csv.reader(file, delimiter=delimiter)) |
||||
|
||||
|
||||
def main(): |
||||
parser = argparse.ArgumentParser( |
||||
description='Read one or more CSV files and output their contents in ' |
||||
'the form of Markdown tables.') |
||||
parser.add_argument('files', metavar='csv_file', type=str, nargs='*', |
||||
default=['-'], |
||||
help="One or more CSV files to be converted. " |
||||
"Use - for stdin.") |
||||
parser.add_argument('-n', '--no-filenames', action='store_false', |
||||
dest='show_filenames', |
||||
help="Don't display filenames when outputting " |
||||
"multiple Markdown tables.") |
||||
parser.add_argument('-p', '--padding', type=check_negative, default=2, |
||||
help="The number of spaces to add between table cells " |
||||
"and column dividers. Default is 2 spaces.") |
||||
parser.add_argument('-d', '--delimiter', default=',', |
||||
help='The delimiter to use when parsing CSV data. ' |
||||
'Default is "%(default)s"') |
||||
|
||||
args = parser.parse_args() |
||||
first = True |
||||
|
||||
if '-' in args.files and len(args.files) > 1: |
||||
print('Standard input can only be used alone.', file=sys.stderr) |
||||
exit(1) |
||||
for file_num, filename in enumerate(args.files): |
||||
# Print space between consecutive tables |
||||
if not first: |
||||
print('') |
||||
else: |
||||
first = False |
||||
# Read the CSV files |
||||
if filename == '-': |
||||
table = csv_to_table(sys.stdin, args.delimiter) |
||||
else: |
||||
with open(filename, 'rU') as f: |
||||
table = csv_to_table(f, args.delimiter) |
||||
# Print filename for each table if --no-filenames wasn't passed and |
||||
# more than one CSV was provided |
||||
file_count = len(args.files) |
||||
if args.show_filenames and file_count > 1: |
||||
print(filename + '\n') |
||||
# Generate and print Markdown table |
||||
print(md_table(table, padding=args.padding)) |
||||
|
||||
|
||||
if __name__ == '__main__': |
||||
main() |
@ -0,0 +1,80 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
if [ -f $1 ] ; then |
||||
case $1 in |
||||
*.tar.bz2) |
||||
if [ "$2" ]; then |
||||
tar xvjf $1 -C $2 |
||||
else |
||||
tar xvjf $1 |
||||
fi |
||||
;; |
||||
*.tar.gz) |
||||
if [ "$2" ]; then |
||||
tar xvzf $1 -C $2 |
||||
else |
||||
tar xvzf $1 |
||||
fi |
||||
;; |
||||
*.bz2) |
||||
if [ "$2" ]; then |
||||
bunzip -c $1 > $2 |
||||
else |
||||
bunzip $1 |
||||
fi |
||||
;; |
||||
#*.rar) rar x $1 ;; |
||||
*.gz) |
||||
if [ "$2" ]; then |
||||
gunzip -c $1 > $2 |
||||
else |
||||
gunzip $1 |
||||
fi |
||||
;; |
||||
*.tar) |
||||
if [ "$2" ]; then |
||||
tar xvf $1 -C $2 |
||||
else |
||||
tar xvf $1 |
||||
fi |
||||
;; |
||||
*.tbz2) |
||||
if [ "$2" ]; then |
||||
tar xvjf $1 -C $2 |
||||
else |
||||
tar xvjf $1 |
||||
fi |
||||
;; |
||||
*.tgz) |
||||
if [ "$2" ]; then |
||||
tar xvzf $1 -C $2 |
||||
else |
||||
tar xvzf $1 |
||||
fi |
||||
;; |
||||
*.zip) |
||||
if [ "$2" ]; then |
||||
unzip $1 -d $2 |
||||
else |
||||
unzip $1 |
||||
fi |
||||
;; |
||||
*.Z) |
||||
if [ "$2" ]; then |
||||
uncompress -c $1 > $2 |
||||
else |
||||
uncompress $1 |
||||
fi |
||||
;; |
||||
*.7z) |
||||
if [ "$2" ]; then |
||||
7z x $1 -o$2 |
||||
else |
||||
7z x $1 |
||||
fi |
||||
;; |
||||
*) echo "don't know how to extract '$1'..." ;; |
||||
esac |
||||
else |
||||
echo "'$1' is not a valid file!" |
||||
fi |
@ -0,0 +1,75 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
function help() { |
||||
cat <<HELP |
||||
Git Clean |
||||
https://jonathanh.co.uk |
||||
|
||||
Some code came from Ben Alman |
||||
http://benalman.com/ |
||||
|
||||
|
||||
Usage: $(basename "$0") [command] |
||||
|
||||
Commands: |
||||
clean Remove current unstaged changes/untracked files** |
||||
cleanall Remove all saved tags, unstaged changes and untracked files** |
||||
|
||||
** This action is destructive and cannot be undone! |
||||
|
||||
Description: |
||||
Cleans unstaged changes and untracked files |
||||
|
||||
Copyright (c) 2014 "Cowboy" Ben Alman |
||||
Licensed under the MIT license. |
||||
http://benalman.com/about/license/ |
||||
HELP |
||||
} |
||||
|
||||
function usage() { |
||||
echo "Usage: $(basename "$0") [clean | cleanall]" |
||||
} |
||||
|
||||
function git_head_sha() { |
||||
git rev-parse --short HEAD |
||||
} |
||||
|
||||
# Get absolute path to root of Git repo |
||||
function git_repo_toplevel() { |
||||
git rev-parse --show-toplevel |
||||
} |
||||
|
||||
# Clean (permanently) current changes and remove the current saved tag |
||||
function clean() { |
||||
local head_sha=$(git_head_sha) |
||||
git tag -d "git-jump-$head_sha" &>/dev/null |
||||
if [[ $? == 0 ]]; then |
||||
echo "Removed stored data for commit $head_sha." |
||||
fi |
||||
local repo_root="$(git_repo_toplevel)" |
||||
git reset HEAD "$repo_root" >/dev/null |
||||
git clean -f -d -q -- "$repo_root" >/dev/null |
||||
git checkout -- "$repo_root" >/dev/null |
||||
echo "Unstaged changes and untracked files removed." |
||||
} |
||||
|
||||
# Remove (permanently) all saved tags |
||||
function clean_all_tags() { |
||||
git for-each-ref refs/tags --format='%(refname:short)' | \ |
||||
while read tag; do |
||||
if [[ "$tag" =~ ^git-jump- ]]; then |
||||
git tag -d "$tag" |
||||
fi |
||||
done |
||||
} |
||||
|
||||
# Handle CLI arguments |
||||
if [[ "$1" == "clean" ]]; then |
||||
clean |
||||
elif [[ "$1" == "cleanall" ]]; then |
||||
clean_all_tags |
||||
clean |
||||
else |
||||
usage |
||||
exit 1 |
||||
fi |
@ -0,0 +1,24 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
test -z "$1" && echo "submodule required" 1>&2 && exit 1 |
||||
#cd "$(git root)" |
||||
test ! -f .gitmodules && echo ".gitmodules file not found" 1>&2 && exit 2 |
||||
|
||||
NAME="$(echo "$1" | sed 's/\/$//g')" |
||||
test -z \ |
||||
"$(git config --file=.gitmodules submodule."$NAME".url)" \ |
||||
&& echo "submodule not found" 1>&2 && exit 3 |
||||
|
||||
# 1. Delete the relevant section from .git/config and clean submodule files |
||||
git submodule deinit -f "$NAME" || exit 4 |
||||
rmdir "$NAME" |
||||
rm -rf .git/modules/"$NAME" |
||||
# 2. Delete the relevant line from .gitmodules |
||||
git config --file=.gitmodules --remove-section submodule."$NAME" |
||||
git add .gitmodules |
||||
# 3. Run git rm --cached path_to_submodule |
||||
git rm --cached -rf "$NAME" |
||||
# 4. Need to confirm and commit the changes for yourself |
||||
echo |
||||
echo "Now submodule $NAME is deleted." |
||||
echo 'Confirm with `git submodule status` and commit the changes for yourself.' |
@ -0,0 +1,158 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
function help() { |
||||
cat <<HELP |
||||
Git Jump (Forward & Back) |
||||
http://benalman.com/ |
||||
|
||||
Modified slightly by Jonathan Hodgson |
||||
https://jonathanh.co.uk/ |
||||
|
||||
Copyright (c) 2017 Jonathan Hodgson |
||||
Licensed under the MIT license. |
||||
https://en.wikipedia.org/wiki/MIT_License |
||||
|
||||
Usage: $(basename "$0") [command] |
||||
|
||||
Commands: |
||||
next Jump forward to the next commit in this branch |
||||
prev Jump backward to the next commit in this branch |
||||
|
||||
|
||||
Git config: |
||||
git-jump.branch Branch to jump through. If not set, defaults to master |
||||
|
||||
Description: |
||||
"Replay" Git commits by moving forward / backward through a branch's |
||||
history. Before jumping, any current unstaged changes and untracked |
||||
files are saved in a tag for later retrieval, which is restored when |
||||
jumped back to. |
||||
|
||||
Original Licence: |
||||
Copyright (c) 2014 "Cowboy" Ben Alman |
||||
Licensed under the MIT license. |
||||
http://benalman.com/about/license/ |
||||
HELP |
||||
} |
||||
|
||||
function usage() { |
||||
echo "Usage: $(basename "$0") [next | prev]" |
||||
} |
||||
|
||||
# Get branch stored in Git config or default to master |
||||
git_branch="$(git config git-jump.branch || echo "master")" |
||||
|
||||
# Get some (short) SHAs |
||||
function git_branch_sha() { |
||||
git rev-parse --short "$git_branch" |
||||
} |
||||
function git_head_sha() { |
||||
git rev-parse --short HEAD |
||||
} |
||||
function git_prev_sha() { |
||||
git log --format='%h' "$git_branch" "$@" | awk "/^$(git_head_sha)/{getline; print}" |
||||
} |
||||
function git_next_sha() { |
||||
git_prev_sha --reverse |
||||
} |
||||
|
||||
# Get absolute path to root of Git repo |
||||
function git_repo_toplevel() { |
||||
git rev-parse --show-toplevel |
||||
} |
||||
|
||||
# Get subject of specified commit |
||||
function git_commit_subject() { |
||||
git log --format='%s' -n 1 $1 |
||||
} |
||||
|
||||
# Save changes for later retrieval |
||||
function save() { |
||||
local status="" |
||||
local head_sha=$(git_head_sha) |
||||
# Checkout current HEAD by SHA to force detached state |
||||
git checkout -q $head_sha |
||||
# Add all files in repo |
||||
git add "$(git_repo_toplevel)" |
||||
# Commit changes (if there were any) |
||||
git commit --no-verify -m "Git Jump: saved changes for $head_sha" >/dev/null |
||||
# If the commit was successful, tag it (overwriting any previous tag) |
||||
if [[ $? == 0 ]]; then |
||||
status="*" |
||||
git tag -f "git-jump-$head_sha" >/dev/null |
||||
fi |
||||
echo "Previous HEAD was $head_sha$status, $(git_commit_subject $head_sha)" |
||||
} |
||||
|
||||
# Restore previously-saved changes |
||||
function restore() { |
||||
local status="" |
||||
# Save current changes before restoring |
||||
save |
||||
# Attempt to restore saved changes for specified commit |
||||
git checkout "git-jump-$1" 2>/dev/null |
||||
if [[ $? == 0 ]]; then |
||||
# If the restore was successful, figure out exactly what was saved, check |
||||
# out the original commit, then restore the saved changes on top of it |
||||
status="*" |
||||
local patch="$(git format-patch HEAD^ --stdout)" |
||||
git checkout HEAD^ 2>/dev/null |
||||
echo "$patch" | git apply - |
||||
else |
||||
# Otherwise, just restore the original commit |
||||
git checkout "$1" 2>/dev/null |
||||
fi |
||||
echo "HEAD is now $1$status, $(git_commit_subject $1)" |
||||
} |
||||
|
||||
# Jump to next commit |
||||
function next() { |
||||
local next_sha=$(git_next_sha) |
||||
if [[ "$next_sha" == "$(git_head_sha)" ]]; then |
||||
# Abort if no more commits |
||||
echo "Already at last commit in $git_branch. Congratulations!" |
||||
else |
||||
# Checkout branch by name if at its HEAD |
||||
if [[ "$next_sha" == "$(git_branch_sha)" ]]; then |
||||
next_sha="$git_branch" |
||||
fi |
||||
echo "Jumping ahead to next commit." |
||||
restore $next_sha |
||||
fi |
||||
} |
||||
|
||||
# Jump to previous commit |
||||
function prev() { |
||||
local prev_sha=$(git_prev_sha) |
||||
if [[ "$prev_sha" == "$(git_head_sha)" ]]; then |
||||
# Abort if no more commits |
||||
echo "Already at first commit in $git_branch." |
||||
else |
||||
echo "Jumping back to previous commit." |
||||
restore $prev_sha |
||||
fi |
||||
} |
||||
|
||||
# Show help if requested |
||||
if [[ "$1" == "--help" || "$1" == "-h" ]]; then |
||||
help |
||||
exit |
||||
fi |
||||
|
||||
# Check if branch is valid |
||||
git rev-parse "$git_branch" &>/dev/null |
||||
if [[ $? != 0 ]]; then |
||||
echo "Error: Branch \"$git_branch\" does not appear to be valid." |
||||
echo "Try $(basename "$0") --help for more information." |
||||
exit 1 |
||||
fi |
||||
|
||||
# Handle CLI arguments |
||||
if [[ "$1" == "next" ]]; then |
||||
next |
||||
elif [[ "$1" == "prev" ]]; then |
||||
prev |
||||
else |
||||
usage |
||||
exit 1 |
||||
fi |
@ -0,0 +1,12 @@ |
||||
#!/bin/sh |
||||
# |
||||
# Nukes a branch locally and on the origin remote. |
||||
# |
||||
# $1 - Branch name. |
||||
# |
||||
# Examples |
||||
# |
||||
# git nuke add-git-nuke |
||||
|
||||
git branch -D $1 |
||||
git push origin :$1 |
@ -0,0 +1,149 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# Opens the BitBucket/GitHub page for a repo/branch in your browser. |
||||
# |
||||
# git open |
||||
# git open [remote] [branch] |
||||
|
||||
|
||||
# are we in a git repo? |
||||
git rev-parse --is-inside-work-tree &>/dev/null |
||||
|
||||
if [[ $? != 0 ]]; then |
||||
echo "Not a git repository." 1>&2 |
||||
exit 1 |
||||
fi |
||||
|
||||
|
||||
# assume origin if not provided |
||||
# fallback to upstream if neither is present. |
||||
remote="origin" |
||||
if [ -n "$1" ]; then |
||||
if [ "$1" == "issue" ]; then |
||||
currentBranch=$(git symbolic-ref -q --short HEAD) |
||||
regex='^issue' |
||||
if [[ $currentBranch =~ $regex ]]; then |
||||
issue=${currentBranch#*#} |
||||
else |
||||
echo "'git open issue' expect branch naming to be issues/#123" 1>&2 |
||||
exit 1 |
||||
fi |
||||
else |
||||
remote="$1" |
||||
fi |
||||
fi |
||||
|
||||
remote_url="remote.${remote}.url" |
||||
|
||||
giturl=$(git config --get "$remote_url") |
||||
if [ -z "$giturl" ]; then |
||||
echo "$remote_url not set." 1>&2 |
||||
exit 1 |
||||
fi |
||||
|
||||
# get current branch |
||||
if [ -z "$2" ]; then |
||||
branch=$(git symbolic-ref -q --short HEAD) |
||||
else |
||||
branch="$2" |
||||
fi |
||||
|
||||
# Make # and % characters url friendly |
||||
# github.com/paulirish/git-open/pull/24 |
||||
branch=${branch//%/%25} && branch=${branch//#/%23} |
||||
|
||||
# URL normalization |
||||
# GitHub gists |
||||
if grep -q gist.github <<<$giturl; then |
||||
giturl=${giturl/git\@gist.github\.com\:/https://gist.github.com/} |
||||
providerUrlDifference=tree |
||||
|
||||
# GitHub |
||||
elif grep -q github <<<$giturl; then |
||||
giturl=${giturl/git\@github\.com\:/https://github.com/} |
||||
|
||||
# handle SSH protocol (links like ssh://git@github.com/user/repo) |
||||
giturl=${giturl/#ssh\:\/\/git\@github\.com\//https://github.com/} |
||||
|
||||
providerUrlDifference=tree |
||||
|
||||
# Bitbucket |
||||
elif grep -q bitbucket <<<$giturl; then |
||||
giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/} |
||||
# handle SSH protocol (change ssh://https://bitbucket.org/user/repo to https://bitbucket.org/user/repo) |
||||
giturl=${giturl/#ssh\:\/\/git\@/https://} |
||||
|
||||
rev="$(git rev-parse HEAD)" |
||||
git_pwd="$(git rev-parse --show-prefix)" |
||||
providerUrlDifference="src/${rev}/${git_pwd}" |
||||
branch="?at=${branch}" |
||||
|
||||
# Atlassian Bitbucket Server |
||||
elif grep -q "/scm/" <<<$giturl; then |
||||
re='(.*)/scm/(.*)/(.*)\.git' |
||||
if [[ $giturl =~ $re ]]; then |
||||
giturl=${BASH_REMATCH[1]}/projects/${BASH_REMATCH[2]}/repos/${BASH_REMATCH[3]} |
||||
providerUrlDifference=browse |
||||
branch="?at=refs%2Fheads%2F${branch}" |
||||
fi |
||||
|
||||
# GitLab |
||||
else |
||||
# custom GitLab |
||||
gitlab_domain=$(git config --get gitopen.gitlab.domain) |
||||
gitlab_ssh_domain=$(git config --get gitopen.gitlab.ssh.domain) |
||||
gitlab_ssh_domain=${gitlab_ssh_domain:-$gitlab_domain} |
||||
gitlab_ssh_port=$(git config --get gitopen.gitlab.ssh.port) |
||||
|
||||
gitlab_protocol=$(git config --get gitopen.gitlab.protocol) |
||||
if [ -z "$gitlab_protocol" ]; then |
||||
gitlab_protocol=https |
||||
fi |
||||
|
||||
if [ -n "$gitlab_domain" ]; then |
||||
if egrep -q "${gitlab_domain}|${gitlab_ssh_domain}" <<<$giturl; then |
||||
|
||||
# Handle GitLab's default SSH notation (like git@gitlab.domain.com:user/repo) |
||||
giturl=${giturl/git\@${gitlab_ssh_domain}\:/${gitlab_protocol}://${gitlab_domain}/} |
||||
|
||||
# handle SSH protocol (links like ssh://git@gitlab.domain.com/user/repo) |
||||
giturl=${giturl/#ssh\:\/\//${gitlab_protocol}://} |
||||
|
||||
# remove git@ from the domain |
||||
giturl=${giturl/git\@${gitlab_ssh_domain}/${gitlab_domain}/} |
||||
|
||||
# remove SSH port |
||||
if [ -n "$gitlab_ssh_port" ]; then |
||||
giturl=${giturl/\/:${gitlab_ssh_port}\///} |
||||
fi |
||||
providerUrlDifference=tree |
||||
fi |
||||
# hosted GitLab |
||||
elif grep -q gitlab <<<$giturl; then |
||||
giturl=${giturl/git\@gitlab\.com\:/https://gitlab.com/} |
||||
providerUrlDifference=tree |
||||
fi |
||||
fi |
||||
giturl=${giturl%\.git} |
||||
|
||||
if [ -n "$issue" ]; then |
||||
giturl="${giturl}/issues/${issue}" |
||||
elif [ -n "$branch" ]; then |
||||
giturl="${giturl}/${providerUrlDifference}/${branch}" |
||||
fi |
||||
|
||||
# simplify URL for master |
||||
giturl=${giturl/tree\/master/} |
||||
|
||||
# get current open browser command |
||||
case $( uname -s ) in |
||||
Darwin) open=open;; |
||||
MINGW*) open=start;; |
||||
CYGWIN*) open=cygstart;; |
||||
MSYS*) open="powershell.exe –NoProfile Start";; |
||||
*) open=${BROWSER:-xdg-open};; |
||||
esac |
||||
|
||||
# open it in a browser |
||||
$open "$giturl" &> /dev/null |
||||
exit $? |
@ -0,0 +1,349 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
|
||||
# usage info |
||||
usage() { |
||||
cat <<EOF |
||||
Usage: git recall [options] |
||||
Options: |
||||
-d, --date Show logs for last n days. |
||||
-a, --author Author name. |
||||
-f, --fetch fetch commits. |
||||
-h, --help This message. |
||||
-v, --version Show version. |
||||
-- End of options. |
||||
EOF |
||||
} |
||||
|
||||
|
||||
# Global variables |
||||
SINCE="1 days ago" # show logs for last day by default |
||||
AUTHOR="" |
||||
FETCH=false |
||||
GIT_FORMAT="" |
||||
GIT_LOG="" |
||||
COMMITS="" |
||||
COMMITS_UNCOL=() # commits without colors |
||||
LESSKEY=false |
||||
SED_BIN="" # Sed option to use according OS. |
||||
VERSION="1.1.10" |
||||
|
||||
# Are we in a git repo? |
||||
if [[ ! -d ".git" ]] && ! git rev-parse --git-dir &>/dev/null; then |
||||
echo "abort: not a git repository." 1>&2 |
||||
exit 1 |
||||
fi |
||||
|
||||
# Parse options |
||||
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do |
||||
case $1 in |
||||
-v | --version ) |
||||
echo "$version" |
||||
exit |
||||
;; |
||||
-d | --date ) |
||||
SINCE="$2 days ago" |
||||
shift; |
||||
;; |
||||
-a | --author ) |
||||
AUTHOR="$2" |
||||
shift |
||||
;; |
||||
-f | --fetch ) |
||||
FETCH=true |
||||
;; |
||||
-h | --help ) |
||||
usage |
||||
exit |
||||
;; |
||||
* ) |
||||
echo "abort: unknown argument" 1>&2 |
||||
exit 1 |
||||
esac |
||||
shift |
||||
done |
||||
if [[ "$1" == "--" ]]; then shift; fi |
||||
|
||||
|
||||
# Colored output. |
||||
function colored() { |
||||
GREEN=$(tput setaf 4) |
||||
YELLOW=$(tput setaf 3) |
||||
NORMAL=$(tput sgr0) |
||||
REVERSE=$(tput rev) |
||||
} |
||||
|
||||
# Uncolored output. |
||||
function uncolored() { |
||||
GREEN="" |
||||
YELLOW="" |
||||
NORMAL="" |
||||
REVERSE="" |
||||
} |
||||
|
||||
# Enable colors if supported by terminal. |
||||
if [[ -t 1 ]] && [[ -n "$TERM" ]] && which tput &>/dev/null && tput colors &>/dev/null; then |
||||
ncolors=$(tput colors) |
||||
if [[ -n "$ncolors" ]] && [[ "$ncolors" -ge 8 ]] ; then |
||||
colored |
||||
else |
||||
uncolored |
||||
fi |
||||
else |
||||
uncolored |
||||
fi |
||||
|
||||
# Check if lesskey is installed. |
||||
if command -v lesskey &> /dev/null; then |
||||
LESSKEY=true |
||||
fi |
||||
|
||||
# Set AUTHOR to current user if no param passed or display for all users if param equal to "all". |
||||
if [[ ! -n $AUTHOR ]]; then |
||||
AUTHOR=$(git config user.name 2>/dev/null) |
||||
elif [[ $AUTHOR = "all" ]]; then |
||||
AUTHOR=".*" |
||||
fi |
||||
|
||||
# Fetch changes before. |
||||
if [[ $FETCH == true ]]; then |
||||
echo "${GREEN}Fetching changes...${NORMAL}" |
||||
git fetch --all &> /dev/null |
||||
tput cuu1 |
||||
tput ed # clear screen |
||||
fi |
||||
|
||||
# Log template. |
||||
GIT_FORMAT="%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" |
||||
|
||||
# Log command. |
||||
GIT_LOG="git log --pretty=format:'${GIT_FORMAT}' |
||||
--author \"$AUTHOR\" |
||||
--since \"$SINCE\" --abbrev-commit" |
||||
|
||||
# Change temporary the IFS to store GIT_LOG's output into an array. |
||||
IFS=$'\n' |
||||
COMMITS=($(eval ${GIT_LOG} 2>/dev/null)) |
||||
unset IFS |
||||
|
||||
NI=${#COMMITS[@]} # Total number of items. |
||||
SN=$(( `tput lines` - 1 )) # Screen's number of lines. |
||||
CN=$(tput cols) # Screen's number of columns. |
||||
TN=$(( $NI < $((SN -1)) ? $NI : $((SN -1)))) # Number of lines that we will display. |
||||
OFFSET=0 #Incremented by one each time a commit's length is higher than teminal width. |
||||
|
||||
# If there is no items, exit. |
||||
if [[ $NI = 0 ]]; then |
||||
if [[ $AUTHOR = ".*" ]]; then |
||||
echo "${YELLOW}All contributors did nothing during this period.${NORMAL}" && exit 0 |
||||
else |
||||
echo "${YELLOW}The contributor \"${AUTHOR}\" did nothing during this period.${NORMAL}" && exit 0 |
||||
fi |
||||
fi |
||||
|
||||
# Set correct sed option according OS's type |
||||
case "$OSTYPE" in |
||||
darwin*) SED_BIN="sed -E" ;; |
||||
*) SED_BIN="sed -r" ;; |
||||
esac |
||||
|
||||
# Create array with uncolred commits (removing escape sequences using sed) |
||||
for elt in "${COMMITS[@]}" |
||||
do |
||||
ELT="$(echo "$elt" | $SED_BIN "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")" # remove colors escape codes |
||||
COMMITS_UNCOL+=("$ELT") |
||||
done |
||||
# Add +1 to OFFSET if a commit's length is bigger than the current terminal session's width. (This is to fix a redraw issue) |
||||
for C in "${COMMITS_UNCOL[@]}" |
||||
do |
||||
if [[ ${#C} -gt $CN ]]; then |
||||
OFFSET=$(( OFFSET + 1 )) |
||||
fi |
||||
done |
||||
|
||||
# Set keys. |
||||
au="`echo -e '\e[A'`" # arrow up |
||||
au_1="k" # arrow up |
||||
ad="`echo -e '\e[B'`" # arrow down |
||||
ad_1="j" # arrow down |
||||
ec="`echo -e '\e'`" # escape |
||||
nl="`echo -e '\n'`" # newline |
||||
nl_1="e" # expand |
||||
co="c" # checkout |
||||
|
||||
# Create a temporary lesskey file to change the keybindings so the user can use the TAB key to quit less. (more convenient) |
||||
if [[ $LESSKEY = true ]]; then |
||||
echo "\t quit" | lesskey -o $HOME/.lsh_less_keys_tmp -- - &> /dev/null |
||||
fi |
||||
|
||||
## Get commit's diff. |
||||
function get_diff() { |
||||
ELT="$(echo "${COMMITS_UNCOL[$CP-1]}")" |
||||
DIFF_TIP=${ELT:0:7} |
||||
DIFF_CMD="git show $DIFF_TIP --color=always" |
||||
DIFF=$(eval ${DIFF_CMD} 2>/dev/null) |
||||
tmp_diff="$(echo "$DIFF" | $SED_BIN "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")" # remove colors escape codes |
||||
off=$(echo "$tmp_diff" | grep -c ".\{$CN\}") #Number of lines in the diff that are longer than terminal width. |
||||
DIFF_LINES_NUMBER="$(echo "$DIFF" | wc -l)" |
||||
DIFF_LINES_NUMBER=$(( DIFF_LINES_NUMBER + off )) |
||||
} |
||||
|
||||
## This function will print the diff according the commit's tip. If the diff is too long, the result will be displayed using 'less'. |
||||
function print_diff() { |
||||
get_diff # get commit's diff |
||||
if [[ $(( TN + DIFF_LINES_NUMBER + OFFSET )) -ge $(( `tput lines` - 1 )) ]]; then |
||||
if [[ $LESSKEY = true ]]; then |
||||
echo "$DIFF" | less -r -k $HOME/.lsh_less_keys_tmp |
||||
else |
||||
echo "$DIFF" | less -r |
||||
fi |
||||
tput ed # Clear screen |
||||
else |
||||
stop=false |
||||
tput ed |
||||
for i in `seq 1 $TN` |
||||
do |
||||
echo -n "$NORMAL" |
||||
[[ $CP == "$i" ]] && echo -n "$REVERSE" |
||||
echo "${COMMITS[$i - 1]}" |
||||
[[ $CP == "$i" ]] && echo "$DIFF" |
||||
done |
||||
# Wait for user action. |
||||
while ! $stop |
||||
do |
||||
read -sn 1 key |
||||
case "$key" in |
||||
"$nl" | "$nl_1") |
||||
stop=true |
||||
;; |
||||
"q") |
||||
stop=true |
||||
END=true |
||||
;; |
||||
esac |
||||
done |
||||
[[ $END = false ]] && tput cuu $(( TN + DIFF_LINES_NUMBER + OFFSET )) && tput ed |
||||
[[ $END = true ]] && tput cuu 1 |
||||
fi |
||||
} |
||||
|
||||
function do_checkout(){ |
||||
ELT="$(echo "${COMMITS_UNCOL[$CP-1]}")" |
||||
DIFF_TIP=${ELT:0:7} |
||||
eval "git checkout $DIFF_TIP 2> /dev/null" |
||||
} |
||||
|
||||
# Calculate OFFSET to avoid bad redraw. |
||||
function calculate_offset { |
||||
tmp=1 |
||||
index=$(( SI -1 )) |
||||
while [[ $tmp -lt $SN ]] |
||||
do |
||||
el=${COMMITS_UNCOL[$index]} |
||||
if [[ ${#el} -gt $CN ]] && [[ $CP -lt $((SN -1)) ]]; then |
||||
OFFSET_2=$(( OFFSET_2 + 1 )) |
||||
tmp=$(( tmp + 1 )) |
||||
fi |
||||
tmp=$(( tmp + 1 )) |
||||
index=$(( index + 1 )) |
||||
done |
||||
} |
||||
|
||||
{ # capture stdout to stderr |
||||
|
||||
tput civis # hide cursor. |
||||
CP=1 # current position |
||||
SI=1 # index |
||||
END=false # end while loop |
||||
EXT=0 # Used to extend the number of lines to display. |
||||
|
||||
## Loops, reads inputs and prints commits until user presses 'q' to exit or TAB to show the diff. |
||||
while ! $END |
||||
do |
||||
END_INDEX=0 # Index for the last item to display |
||||
# When the number of item is higher than screen's number of lines, OFFSET_2 is recalculated each time we select a new item |
||||
# Set last index to print. (based on OFFSET) |
||||
if [[ $TN == $NI ]]; then |
||||
END_INDEX=$TN |
||||
OFFSET_2=$OFFSET |
||||
elif [[ $TN == $(( SN - 1 )) ]]; then |
||||
# Calculate new OFFSET. |
||||
if [[ $OFFSET != 0 ]]; then |
||||
[[ $CP -lt $((SN -1)) ]] && OFFSET_2=0 |
||||
EXT=1 |
||||
calculate_offset |
||||
fi |
||||
END_INDEX=$(( TN + SI -1 + EXT - OFFSET_2 )) |
||||
fi |
||||
|
||||
# Loop and echo commits |
||||
for i in `seq $SI $END_INDEX` |
||||
do |
||||
echo -n "$NORMAL" |
||||
[[ $CP == $i ]] && echo -n "$REVERSE" |
||||
echo "${COMMITS[$i - 1]}" |
||||
done |
||||
|
||||
read -sn 1 key |
||||
[[ "$key" == "$ec" ]] && |
||||
{ |
||||
read -sn 2 k2 |
||||
key="$key$k2" |
||||
} |
||||
|
||||
case "$key" in |
||||
|
||||
"$au" | "$au_1") |
||||
CP=$(( CP - 1 )) |
||||
[[ $CP == 0 ]] && [[ $SI == 1 ]] && [[ $TN == $(( SN - 1 )) ]] && CP=$NI && SI=$(( NI - SN + 2 + OFFSET_2 )) |
||||
[[ $CP == 0 ]] && [[ $SI == 1 ]] && [[ $TN == $NI ]] && CP=$TN |
||||
[[ $CP == $(( SI - 1 )) ]] && [[ $SI != 1 ]] && SI=$(( SI - 1 )) |
||||
|
||||
[[ $TN != $(( SN - 1 )) ]] && tput cuu $(( TN + OFFSET_2 )) |
||||
[[ $TN == $(( SN - 1 )) ]] && tput cuu $(( TN + EXT )) |
||||
[[ $SI != 1 ]] && tput ed # clear screen |
||||
;; |
||||
|
||||
"$ad" | "$ad_1") |
||||
CP=$(( CP + 1 )) |
||||
[[ $CP == $(( NI + 1 )) ]] && CP=1 && SI=1 |
||||
[[ $CP == $(( SN + SI - 1 + EXT - OFFSET_2 )) ]] && [[ $TN == $(( SN - 1 )) ]] && SI=$(( SI + 1 )) |
||||
|
||||
[[ $TN != $(( SN - 1 )) ]] && tput cuu $(( TN + OFFSET_2 )) |
||||
[[ $TN == $(( SN - 1 )) ]] && tput cuu $(( TN + EXT )) |
||||
[[ $SI != 1 ]] && tput ed # clear screen |
||||
[[ $SI = 1 ]] && [[ $CP = 1 ]] && tput ed # clear screen |
||||
;; |
||||
|
||||
"$nl" | "$nl_1") |
||||
[[ $TN == $NI ]] && tput cuu $(( TN + OFFSET_2 )) |
||||
[[ $TN != $NI ]] && tput cuu $(( TN + EXT )) |
||||
print_diff |
||||
;; |
||||
"$co") |
||||
si=false |
||||
END=true |
||||
do_checkout |
||||
tput cuu 1 #move cursor up one line. (remove extra line) |
||||
;; |
||||
|
||||
"q") |
||||
si=false |
||||
END=true |
||||
tput cuu 1 #move cursor up one line. (remove extra line) |
||||
;; |
||||
|
||||
* ) |
||||
tput cuu $(( TN + OFFSET_2 )) |
||||
esac |
||||
|
||||
done |
||||
|
||||
# remove temporary less keybindings |
||||
[[ $LESSKEY = true ]] && rm $HOME/.lsh_less_keys_tmp |
||||
|
||||
tput cnorm # unhide cursor |
||||
echo "$NORMAL" # normal colors |
||||
|
||||
} >&2 # END capture |
||||
|
@ -0,0 +1,364 @@ |
||||
#!/usr/bin/env ruby |
||||
|
||||
HELP = <<EOS |
||||
git-wtf displays the state of your repository in a readable, easy-to-scan |
||||
format. It's useful for getting a summary of how a branch relates to a remote |
||||
server, and for wrangling many topic branches. |
||||
|
||||
git-wtf can show you: |
||||
- How a branch relates to the remote repo, if it's a tracking branch. |
||||
- How a branch relates to integration branches, if it's a feature branch. |
||||
- How a branch relates to the feature branches, if it's an integration |
||||
branch. |
||||
|
||||
git-wtf is best used before a git push, or between a git fetch and a git |
||||
merge. Be sure to set color.ui to auto or yes for maximum viewing pleasure. |
||||
EOS |
||||
|
||||
KEY = <<EOS |
||||
KEY: |
||||
() branch only exists locally |
||||
{} branch only exists on a remote repo |
||||
[] branch exists locally and remotely |
||||
|
||||
x merge occurs both locally and remotely |
||||
~ merge occurs only locally |
||||
(space) branch isn't merged in |
||||
|
||||
(It's possible for merges to occur remotely and not locally, of course, but |
||||
that's a less common case and git-wtf currently doesn't display anything |
||||
special for it.) |
||||
EOS |
||||
|
||||
USAGE = <<EOS |
||||
Usage: git wtf [branch+] [options] |
||||
|
||||
If [branch] is not specified, git-wtf will use the current branch. The possible |
||||
[options] are: |
||||
|
||||
-l, --long include author info and date for each commit |
||||
-a, --all show all branches across all remote repos, not just |
||||
those from origin |
||||
-A, --all-commits show all commits, not just the first 5 |
||||
-s, --short don't show commits |
||||
-k, --key show key |
||||
-r, --relations show relation to features / integration branches |
||||
--dump-config print out current configuration and exit |
||||
|
||||
git-wtf uses some heuristics to determine which branches are integration |
||||
branches, and which are feature branches. (Specifically, it assumes the |
||||
integration branches are named "master", "next" and "edge".) If it guesses |
||||
incorrectly, you will have to create a .git-wtfrc file. |
||||
|
||||
To start building a configuration file, run "git-wtf --dump-config > |
||||
.git-wtfrc" and edit it. The config file is a YAML file that specifies the |
||||
integration branches, any branches to ignore, and the max number of commits to |
||||
display when --all-commits isn't used. git-wtf will look for a .git-wtfrc file |
||||
starting in the current directory, and recursively up to the root. |
||||
|
||||
IMPORTANT NOTE: all local branches referenced in .git-wtfrc must be prefixed |
||||
with heads/, e.g. "heads/master". Remote branches must be of the form |
||||
remotes/<remote>/<branch>. |
||||
EOS |
||||
|
||||
COPYRIGHT = <<EOS |
||||
git-wtf Copyright 2008--2009 William Morgan <wmorgan at the masanjin dot nets>. |
||||
This program is free software: you can redistribute it and/or modify it |
||||
under the terms of the GNU General Public License as published by the Free |
||||
Software Foundation, either version 3 of the License, or (at your option) |
||||
any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT |
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
||||
more details. |
||||
|
||||
You can find the GNU General Public License at: http://www.gnu.org/licenses/ |
||||
EOS |
||||
|
||||
require 'yaml' |
||||
CONFIG_FN = ".git-wtfrc" |
||||
|
||||
class Numeric; def pluralize s; "#{to_s} #{s}" + (self != 1 ? "s" : "") end end |
||||
|
||||
if ARGV.delete("--help") || ARGV.delete("-h") |
||||
puts USAGE |
||||
exit |
||||
end |
||||
|
||||
## poor man's trollop |
||||
$long = ARGV.delete("--long") || ARGV.delete("-l") |
||||
$short = ARGV.delete("--short") || ARGV.delete("-s") |
||||
$all = ARGV.delete("--all") || ARGV.delete("-a") |
||||
$all_commits = ARGV.delete("--all-commits") || ARGV.delete("-A") |
||||
$dump_config = ARGV.delete("--dump-config") |
||||
$key = ARGV.delete("--key") || ARGV.delete("-k") |
||||
$show_relations = ARGV.delete("--relations") || ARGV.delete("-r") |
||||
ARGV.each { |a| abort "Error: unknown argument #{a}." if a =~ /^--/ } |
||||
|
||||
## search up the path for a file |
||||
def find_file fn |
||||
while true |
||||
return fn if File.exist? fn |
||||
fn2 = File.join("..", fn) |
||||
return nil if File.expand_path(fn2) == File.expand_path(fn) |
||||
fn = fn2 |
||||
end |
||||
end |
||||
|
||||
want_color = `git config color.wtf` |
||||
want_color = `git config color.ui` if want_color.empty? |
||||
$color = case want_color.chomp |
||||
when "true"; true |
||||
when "auto"; $stdout.tty? |
||||
end |
||||
|
||||
def red s; $color ? "\033[31m#{s}\033[0m" : s end |
||||
def green s; $color ? "\033[32m#{s}\033[0m" : s end |
||||
def yellow s; $color ? "\033[33m#{s}\033[0m" : s end |
||||
def cyan s; $color ? "\033[36m#{s}\033[0m" : s end |
||||
def grey s; $color ? "\033[1;30m#{s}\033[0m" : s end |
||||
def purple s; $color ? "\033[35m#{s}\033[0m" : s end |
||||
|
||||
## the set of commits in 'to' that aren't in 'from'. |
||||
## if empty, 'to' has been merged into 'from'. |
||||
def commits_between from, to |
||||
if $long |
||||
`git log --pretty=format:"- %s [#{yellow "%h"}] (#{purple "%ae"}; %ar)" #{from}..#{to}` |
||||
else |
||||
`git log --pretty=format:"- %s [#{yellow "%h"}]" #{from}..#{to}` |
||||
end.split(/[\r\n]+/) |
||||
end |
||||
|
||||
def show_commits commits, prefix=" " |
||||
if commits.empty? |
||||
puts "#{prefix} none" |
||||
else |
||||
max = $all_commits ? commits.size : $config["max_commits"] |
||||
max -= 1 if max == commits.size - 1 # never show "and 1 more" |
||||
commits[0 ... max].each { |c| puts "#{prefix}#{c}" } |
||||
puts grey("#{prefix}... and #{commits.size - max} more (use -A to see all).") if commits.size > max |
||||
end |
||||
end |
||||
|
||||
def ahead_behind_string ahead, behind |
||||
[ahead.empty? ? nil : "#{ahead.size.pluralize 'commit'} ahead", |
||||
behind.empty? ? nil : "#{behind.size.pluralize 'commit'} behind"]. |
||||
compact.join("; ") |
||||
end |
||||
|
||||
def widget merged_in, remote_only=false, local_only=false, local_only_merge=false |
||||
left, right = case |
||||
when remote_only; %w({ }) |
||||
when local_only; %w{( )} |
||||
else %w([ ]) |
||||
end |
||||
middle = case |
||||
when merged_in && local_only_merge; green("~") |
||||
when merged_in; green("x") |
||||
else " " |
||||
end |
||||
print left, middle, right |
||||
end |
||||
|
||||
def show b |
||||
have_both = b[:local_branch] && b[:remote_branch] |
||||
|
||||
pushc, pullc, oosync = if have_both |
||||
[x = commits_between(b[:remote_branch], b[:local_branch]), |
||||
y = commits_between(b[:local_branch], b[:remote_branch]), |
||||
!x.empty? && !y.empty?] |
||||
end |
||||
|
||||
if b[:local_branch] |
||||
puts "Local branch: " + green(b[:local_branch].sub(/^heads\//, "")) |
||||
|
||||
if have_both |
||||
if pushc.empty? |
||||
puts "#{widget true} in sync with remote" |
||||
else |
||||
action = oosync ? "push after rebase / merge" : "push" |
||||
puts "#{widget false} NOT in sync with remote (you should #{action})" |
||||
show_commits pushc unless $short |
||||
end |
||||
end |
||||
end |
||||
|
||||
if b[:remote_branch] |
||||
puts "Remote branch: #{cyan b[:remote_branch]} (#{b[:remote_url]})" |
||||
|
||||
if have_both |
||||
if pullc.empty? |
||||
puts "#{widget true} in sync with local" |
||||
else |
||||
action = pushc.empty? ? "merge" : "rebase / merge" |
||||
puts "#{widget false} NOT in sync with local (you should #{action})" |
||||
show_commits pullc unless $short |
||||
end |
||||
end |
||||
end |
||||
|
||||
puts "\n#{red "WARNING"}: local and remote branches have diverged. A merge will occur unless you rebase." if oosync |
||||
end |
||||
|
||||
def show_relations b, all_branches |
||||
ibs, fbs = all_branches.partition { |name, br| $config["integration-branches"].include?(br[:local_branch]) || $config["integration-branches"].include?(br[:remote_branch]) } |
||||
if $config["integration-branches"].include? b[:local_branch] |
||||
puts "\nFeature branches:" unless fbs.empty? |
||||
fbs.each do |name, br| |
||||
next if $config["ignore"].member?(br[:local_branch]) || $config["ignore"].member?(br[:remote_branch]) |
||||
next if br[:ignore] |
||||
local_only = br[:remote_branch].nil? |
||||
remote_only = br[:local_branch].nil? |
||||
name = if local_only |
||||
purple br[:name] |
||||
elsif remote_only |
||||
cyan br[:name] |
||||
else |
||||
green br[:name] |
||||
end |
||||
|
||||
## for remote_only branches, we'll compute wrt the remote branch head. otherwise, we'll |
||||
## use the local branch head. |
||||
head = remote_only ? br[:remote_branch] : br[:local_branch] |
||||
|
||||
remote_ahead = b[:remote_branch] ? commits_between(b[:remote_branch], head) : [] |
||||
local_ahead = b[:local_branch] ? commits_between(b[:local_branch], head) : [] |
||||
|
||||
if local_ahead.empty? && remote_ahead.empty? |
||||
puts "#{widget true, remote_only, local_only} #{name} #{local_only ? "(local-only) " : ""}is merged in" |
||||
elsif local_ahead.empty? |
||||
puts "#{widget true, remote_only, local_only, true} #{name} merged in (only locally)" |
||||
else |
||||
behind = commits_between head, (br[:local_branch] || br[:remote_branch]) |
||||
ahead = remote_only ? remote_ahead : local_ahead |
||||
puts "#{widget false, remote_only, local_only} #{name} #{local_only ? "(local-only) " : ""}is NOT merged in (#{ahead_behind_string ahead, behind})" |
||||
show_commits ahead unless $short |
||||
end |
||||
end |
||||
else |
||||
puts "\nIntegration branches:" unless ibs.empty? # unlikely |
||||
ibs.sort_by { |v, br| v }.each do |v, br| |
||||
next if $config["ignore"].member?(br[:local_branch]) || $config["ignore"].member?(br[:remote_branch]) |
||||
next if br[:ignore] |
||||
local_only = br[:remote_branch].nil? |
||||
remote_only = br[:local_branch].nil? |
||||
name = remote_only ? cyan(br[:name]) : green(br[:name]) |
||||
|
||||
ahead = commits_between v, (b[:local_branch] || b[:remote_branch]) |
||||
if ahead.empty? |
||||
puts "#{widget true, local_only} merged into #{name}" |
||||
else |
||||
#behind = commits_between b[:local_branch], v |
||||
puts "#{widget false, local_only} NOT merged into #{name} (#{ahead.size.pluralize 'commit'} ahead)" |
||||
show_commits ahead unless $short |
||||
end |
||||
end |
||||
end |
||||
end |
||||
|
||||
#### EXECUTION STARTS HERE #### |
||||
|
||||
## find config file and load it |
||||
$config = { "integration-branches" => %w(heads/master heads/next heads/edge), "ignore" => [], "max_commits" => 5 }.merge begin |
||||
fn = find_file CONFIG_FN |
||||
if fn && (h = YAML::load_file(fn)) # yaml turns empty files into false |
||||
h["integration-branches"] ||= h["versions"] # support old nomenclature |
||||
h |
||||
else |
||||
{} |
||||
end |
||||
end |
||||
|
||||
if $dump_config |
||||
puts $config.to_yaml |
||||
exit |
||||
end |
||||
|
||||
## first, index registered remotes |
||||
remotes = `git config --get-regexp ^remote\.\*\.url`.split(/[\r\n]+/).inject({}) do |hash, l| |
||||
l =~ /^remote\.(.+?)\.url (.+)$/ or next hash |
||||
hash[$1] ||= $2 |
||||
hash |
||||
end |
||||
|
||||
## next, index followed branches |
||||
branches = `git config --get-regexp ^branch\.`.split(/[\r\n]+/).inject({}) do |hash, l| |
||||
case l |
||||
when /branch\.(.*?)\.remote (.+)/ |
||||
name, remote = $1, $2 |
||||
|
||||
hash[name] ||= {} |
||||
hash[name].merge! :remote => remote, :remote_url => remotes[remote] |
||||
when /branch\.(.*?)\.merge ((refs\/)?heads\/)?(.+)/ |
||||
name, remote_branch = $1, $4 |
||||
hash[name] ||= {} |
||||
hash[name].merge! :remote_mergepoint => remote_branch |
||||
end |
||||
hash |
||||
end |
||||
|
||||
## finally, index all branches |
||||
remote_branches = {} |
||||
`git show-ref`.split(/[\r\n]+/).each do |l| |
||||
sha1, ref = l.chomp.split " refs/" |
||||
|
||||
if ref =~ /^heads\/(.+)$/ # local branch |
||||
name = $1 |
||||
next if name == "HEAD" |
||||
branches[name] ||= {} |
||||
branches[name].merge! :name => name, :local_branch => ref |
||||
elsif ref =~ /^remotes\/(.+?)\/(.+)$/ # remote branch |
||||
remote, name = $1, $2 |
||||
remote_branches["#{remote}/#{name}"] = true |
||||
next if name == "HEAD" |
||||
ignore = !($all || remote == "origin") |
||||
|
||||
branch = name |
||||
if branches[name] && branches[name][:remote] == remote |
||||
# nothing |
||||
else |
||||
name = "#{remote}/#{branch}" |
||||
end |
||||
|
||||
branches[name] ||= {} |
||||
branches[name].merge! :name => name, :remote => remote, :remote_branch => "#{remote}/#{branch}", :remote_url => remotes[remote], :ignore => ignore |
||||
end |
||||
end |
||||
|
||||
## assemble remotes |
||||
branches.each do |k, b| |
||||
next unless b[:remote] && b[:remote_mergepoint] |
||||
b[:remote_branch] = if b[:remote] == "." |
||||
b[:remote_mergepoint] |
||||
else |
||||
t = "#{b[:remote]}/#{b[:remote_mergepoint]}" |
||||
remote_branches[t] && t # only if it's still alive |
||||
end |
||||
end |
||||
|
||||
show_dirty = ARGV.empty? |
||||
targets = if ARGV.empty? |
||||
[`git symbolic-ref HEAD`.chomp.sub(/^refs\/heads\//, "")] |
||||
else |
||||
ARGV.map { |x| x.sub(/^heads\//, "") } |
||||
end.map { |t| branches[t] or abort "Error: can't find branch #{t.inspect}." } |
||||
|
||||
targets.each do |t| |
||||
show t |
||||
show_relations t, branches if $show_relations || t[:remote_branch].nil? |
||||
end |
||||
|
||||
modified = show_dirty && `git ls-files -m` != "" |
||||
uncommitted = show_dirty && `git diff-index --cached HEAD` != "" |
||||
|
||||
if $key |
||||
puts |
||||
puts KEY |
||||
end |
||||
|
||||
puts if modified || uncommitted |
||||
puts "#{red "NOTE"}: working directory contains modified files." if modified |
||||
puts "#{red "NOTE"}: staging area contains staged but uncommitted files." if uncommitted |
||||
|
||||
# the end! |
@ -0,0 +1,103 @@ |
||||
#!/bin/bash |
||||
|
||||
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux; |
||||
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It |
||||
# only accepts ESC backslash for ST. |
||||
function print_osc() { |
||||
if [[ $TERM == screen* ]] ; then |
||||
printf "\033Ptmux;\033\033]" |
||||
else |
||||
printf "\033]" |
||||
fi |
||||
} |
||||
|
||||
# More of the tmux workaround described above. |
||||
function print_st() { |
||||
if [[ $TERM == screen* ]] ; then |
||||
printf "\a\033\\" |
||||
else |
||||
printf "\a" |
||||
fi |
||||
} |
||||
|
||||
# print_image filename inline base64contents |
||||
# filename: Filename to convey to client |
||||
# inline: 0 or 1 |
||||
# base64contents: Base64-encoded contents |
||||
function print_image() { |
||||
print_osc |
||||
printf '1337;File=' |
||||
if [[ -n "$1" ]]; then |
||||
printf 'name='`echo -n "$1" | base64`";" |
||||
fi |
||||
if $(base64 --version 2>&1 | grep GNU > /dev/null) |
||||
then |
||||
BASE64ARG=-d |
||||
else |
||||
BASE64ARG=-D |
||||
fi |
||||
echo -n "$3" | base64 $BASE64ARG | wc -c | awk '{printf "size=%d",$1}' |
||||
printf ";inline=$2" |
||||
printf ";width=50" |
||||
printf ":" |
||||
echo -n "$3" |
||||
print_st |
||||
printf '\n' |
||||
} |
||||
|
||||
function error() { |
||||
echo "ERROR: $*" 1>&2 |
||||
} |
||||
|
||||
function show_help() { |
||||
echo "Usage: imgcat filename ..." 1>& 2 |
||||
echo " or: cat filename | imgcat" 1>& 2 |
||||
} |
||||
|
||||
## Main |
||||
|
||||
if [ -t 0 ]; then |
||||
has_stdin=f |
||||
else |
||||
has_stdin=t |
||||
fi |
||||
|
||||
# Show help if no arguments and no stdin. |
||||
if [ $has_stdin = f -a $# -eq 0 ]; then |
||||
show_help |
||||
exit |
||||
fi |
||||
|
||||
# Look for command line flags. |
||||
while [ $# -gt 0 ]; do |
||||
case "$1" in |
||||
-h|--h|--help) |
||||
show_help |
||||
exit |
||||
;; |
||||
-*) |
||||
error "Unknown option flag: $1" |
||||
show_help |
||||
exit 1 |
||||
;; |
||||
*) |
||||
if [ -r "$1" ] ; then |
||||
print_image "$1" 1 "$(base64 < "$1")" |
||||
else |
||||
error "imgcat: $1: No such file or directory" |
||||
exit 2 |
||||
fi |
||||
;; |
||||
esac |
||||
shift |
||||
done |
||||
|
||||
# Read and print stdin |
||||
if [ $has_stdin = t ]; then |
||||
print_image "" 1 "$(cat | base64)" |
||||
fi |
||||
|
||||
echo |
||||
echo |
||||
|
||||
exit 0 |
@ -0,0 +1,91 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
if [ $1 ]; then |
||||
while test $# -gt 0; do |
||||
case $1 in |
||||
-h|--help) |
||||
echo "Create files from template" |
||||
echo "" |
||||
echo "Usage: new [options] newFile" |
||||
echo "" |
||||
echo "Options:" |
||||
echo "--------" |
||||
echo -e "{-t,--template} filename \t Force use of template in Template Directory" |
||||
echo -e "{-l,--list} \t\t\t Lists the available templates" |
||||
echo -e "{-h,--help} \t\t\t Show this help text" |
||||
exit 0 |
||||
;; |
||||
-t|--template) |
||||
shift |
||||
if [[ -f "$HOME/Templates/$1" ]]; then |
||||
template="$HOME/Templates/$1" |
||||
else |
||||
echo "The file $HOME/Templates/$1 does not exits" |
||||
exit 1 |
||||
fi |
||||
shift |
||||
;; |
||||
-l|--list) |
||||
shift |
||||
for file in $HOME/Templates/*$1; do |
||||
echo ${file##*/} |
||||
done |
||||
exit 0 |
||||
;; |
||||
*) |
||||
file=$1 |
||||
if [[ "$template" == "" ]]; then |
||||
extention=${file##*.} |
||||
posTemplates=() |
||||
if [[ -f $HOME/Templates/$extention ]]; then |
||||
posTemplates+=("$HOME/Templates/$extention") |
||||
fi |
||||
for template in $HOME/Templates/*.$extention; do |
||||
if [[ -f $template ]]; then |
||||
posTemplates+=( $template ) |
||||
fi |
||||
done |
||||
if [[ ${#posTemplates[@]} == 1 ]]; then |
||||
echo "Only one template" |
||||
template=${posTemplates[0]} |
||||
else |
||||
|
||||
posTemplates+=("Cancel") |
||||
while |
||||
echo Your options are: |
||||
for (( i=0; i<${#posTemplates[@]}; i++ )); do |
||||
echo "$i: ${posTemplates[$i]##*/}" |
||||
done |
||||
echo -e -n "Please enter a number: [0] " |
||||
read input |
||||
if [[ "$input"=="" ]]; then |
||||
test=0 |
||||
fi; |
||||
if [[ "$input" == "$(expr ${#posTemplates[@]} - 1)" ]]; then |
||||
echo "Exited By User" |
||||
exit 0 |
||||
fi |
||||
template=${posTemplates[$input]} |
||||
[[ $input>=${#posTemplates[@]} || $input<0 ]] |
||||
do |
||||
echo |
||||
echo Please chose one of the available options |
||||
done |
||||
fi |
||||
fi |
||||
|
||||
|
||||
if [[ -f "$file" ]]; then |
||||
echo "$file already exists" |
||||
echo "delete it first" |
||||
exit 1 |
||||
fi |
||||
cat "$template" > "$file" |
||||
echo "$file created from template $template" |
||||
exit 0 |
||||
;; |
||||
esac |
||||
done |
||||
else |
||||
echo "You haven't given anything to work with" |
||||
fi |
@ -0,0 +1,31 @@ |
||||
#!/usr/bin/bash |
||||
line=$(php --version | grep "PHP" -m 1) |
||||
target="$1" |
||||
lampp='/opt/lampp/lampp' |
||||
echo $phpexe |
||||
if [ "$(id -u)" != "0" ]; then |
||||
echo "Sorry, you are not root." |
||||
exit 1 |
||||
fi |
||||
if [[ $target = "" ]]; then |
||||
echo "PLease specify the version you want" |
||||
exit 1 |
||||
fi; |
||||
|
||||
file="/opt/lampp/etc/extra/httpd-xampp-php$target.conf" |
||||
phpexe=$(ls /opt/lampp/bin/php-$target*) |
||||
phpcgi=$(ls /opt/lampp/bin/php-cgi-$target*) |
||||
phpconfig=$(ls /opt/lampp/bin/php-config-$target*) |
||||
phpize=$(ls /opt/lampp/bin/phpize-$target*) |
||||
|
||||
$lampp stopapache |
||||
ln -s -f $file /opt/lampp/etc/extra/httpd-xampp.conf |
||||
ln -s -f $phpexe /opt/lampp/bin/php |
||||
ln -s -f $phpcgi /opt/lampp/bin/php-cgi |
||||
ln -s -f $phpconfig /opt/lampp/bin/php-config |
||||
ln -s -f $phpize /opt/lampp/bin/phpize |
||||
|
||||
$lampp startapache |
||||
echo |
||||
echo "Now on PHP $target" |
||||
exit 0 |
@ -0,0 +1,8 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
pluginFolder="/home/jonathan/WPPlugins" |
||||
for dir in $pluginFolder/*/; do |
||||
cd $dir |
||||
pwd | cowsay |
||||
git-svn-mirror update |
||||
done |
@ -0,0 +1,7 @@ |
||||
#!/usr/bin/bash |
||||
initial=$@ |
||||
place=${initial// /+} |
||||
if [[ "$place" == "" ]]; then |
||||
place="Bury+St+Edmunds" |
||||
fi |
||||
curl "wttr.in/$place" |
@ -0,0 +1,2 @@ |
||||
#!/usr/bin/bash |
||||
find . -name "$1" | sed 's/[^/]\+$//' | uniq -c | sort -g |
@ -0,0 +1,4 @@ |
||||
default-themes-1.1.cmtp.7z |
||||
default-themes-1.2.cmtp.7z |
||||
default-themes-2.1.cmtp.7z |
||||
default-themes-2.1.cmtp.7z |
@ -0,0 +1,54 @@ |
||||
background yes |
||||
update_interval 0.2 |
||||
|
||||
|
||||
double_buffer yes |
||||
no_buffers yes |
||||
text_buffer_size 2048 |
||||
|
||||
gap_x 10 |
||||
gap_y 10 |
||||
|
||||
own_window yes |
||||
own_window_type override |
||||
own_window_class Conky |
||||
own_window_transparent yes |
||||
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
||||
own_window_colour 000000 |
||||
#own_window_argb_visual yes |
||||
#own_window_argb_value 128 |
||||
|
||||
border_inner_margin 0 |
||||
border_outer_margin 0 |
||||
alignment top_left |
||||
|
||||
|
||||
draw_shades no |
||||
draw_outline no |
||||
draw_borders no |
||||
draw_graph_borders no |
||||
|
||||
override_utf8_locale yes |
||||
use_xft yes |
||||
xftfont caviar dreams:size=10 |
||||
xftalpha 0.5 |
||||
uppercase no |
||||
|
||||
# Defining colors |
||||
default_color FFFFFF |
||||
# Shades of Gray |
||||
color1 DDDDDD |
||||
color2 AAAAAA |
||||
color3 888888 |
||||
# Blue |
||||
color4 2f519a |
||||
# Green |
||||
color5 77B753 |
||||
|
||||
|
||||
minimum_size 250 500 |
||||
own_window_argb_value 0 |
||||
own_window_argb_visual no |
||||
TEXT |
||||
${font GE Inspira:pixelsize=30}${execpi 60 python ~/.conky/BibleVerse/bibleGateway.py} |
||||
${color 2f519a}${execpi 60 python ~/.conky/BibleVerse/reference.py} |
@ -0,0 +1,11 @@ |
||||
__author__ = 'jonathan' |
||||
|
||||
import urllib.request |
||||
import json |
||||
import html |
||||
import textwrap |
||||
|
||||
f = urllib.request.urlopen("http://www.biblegateway.com/votd/get/?format=json&version=ESV") |
||||
content = json.loads(f.read().decode("utf-8")) |
||||
|
||||
print(textwrap.fill(html.unescape(content['votd']['text']),30)) |
@ -0,0 +1,8 @@ |
||||
__author__ = 'jonathan' |
||||
|
||||
import urllib.request |
||||
import json |
||||
|
||||
f = urllib.request.urlopen("http://www.biblegateway.com/votd/get/?format=json&version=ESV") |
||||
content = json.loads(f.read().decode("utf-8")) |
||||
print(content['votd']['reference']) |
@ -0,0 +1,42 @@ |
||||
use_xft yes |
||||
xftfont 123:size=8 |
||||
xftalpha 0.1 |
||||
update_interval 0.5 |
||||
total_run_times 0 |
||||
|
||||
own_window yes |
||||
own_window_type override |
||||
own_window_class Conky |
||||
own_window_transparent yes |
||||
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
||||
own_window_colour 000000 |
||||
#own_window_argb_visual yes |
||||
#own_window_argb_value 128 |
||||
|
||||
background yes |
||||
|
||||
double_buffer yes |
||||
maximum_width 500 |
||||
draw_shades no |
||||
draw_outline no |
||||
draw_borders no |
||||
draw_graph_borders no |
||||
default_color white |
||||
default_shade_color red |
||||
default_outline_color green |
||||
alignment top_right |
||||
gap_x 0 |
||||
gap_y 10 |
||||
no_buffers yes |
||||
uppercase no |
||||
cpu_avg_samples 2 |
||||
net_avg_samples 1 |
||||
override_utf8_locale yes |
||||
|
||||
|
||||
own_window_argb_value 0 |
||||
own_window_argb_visual no |
||||
minimum_size 0 0 |
||||
TEXT |
||||
${color EAEAEA}${font GE Inspira:pixelsize=120}${time %H:%M}${color 2f519a}${time :%S}${font} |
||||
${color EAEAEA}${font GE Inspira:pixelsize=58}${time %A}${font GE Inspira:pixelsize=42}${color 2f519a}${time %d}${font GE Inspira:pixelsize=22}${color EAEAEA}${time %B} ${time %Y} |
Binary file not shown.
@ -0,0 +1,60 @@ |
||||
# -- Conky settings -- # |
||||
background no |
||||
update_interval 2 |
||||
|
||||
cpu_avg_samples 2 |
||||
net_avg_samples 2 |
||||
|
||||
override_utf8_locale yes |
||||
|
||||
double_buffer yes |
||||
no_buffers yes |
||||
|
||||
text_buffer_size 2048 |
||||
imlib_cache_size 0 |
||||
|
||||
# -- Window specifications -- # |
||||
|
||||
own_window yes |
||||
own_window_type override |
||||
own_window_class Conky |
||||
own_window_transparent yes |
||||
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
||||
own_window_colour 000000 |
||||
#own_window_argb_visual yes |
||||
#own_window_argb_value 128 |
||||
border_inner_margin 0 |
||||
border_outer_margin 0 |
||||
|
||||
minimum_size 7266 748 |
||||
|
||||
# -- Graphics settings -- # |
||||
draw_shades no |
||||
draw_outline no |
||||
draw_borders no |
||||
draw_graph_borders no |
||||
|
||||
# -- Text settings -- # |
||||
use_xft yes |
||||
xftfont Santana:size=8 |
||||
xftalpha 0.8 |
||||
|
||||
uppercase no |
||||
|
||||
default_color FFFFFF |
||||
|
||||
# -- Lua load -- # |
||||
lua_load main.lua |
||||
lua_draw_hook_pre main |
||||
lua_startup_hook setup |
||||
|
||||
alignment top_left |
||||
gap_x 280 |
||||
gap_y 80 |
||||
own_window_argb_value 0 |
||||
own_window_argb_visual yes |
||||
own_window_colour 000000 |
||||
TEXT |
||||
#${offset 636}${voffset 223}${font Roboto:size=12}${time %l:%M %P } |
||||
${offset 630}${voffset 228}${font Roboto:size=35}Arch |
||||
|
@ -0,0 +1 @@ |
||||
./face.png |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 2.6 KiB |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,17 @@ |
||||
|
||||
# dimenstions |
||||
WIDTH = 1366; |
||||
HEIGHT = 748; |
||||
|
||||
# network |
||||
NETWORK = wlo1; |
||||
|
||||
# cpu |
||||
NO_OF_CORES = 8; |
||||
|
||||
# color scheme the values are DARK or WHITE |
||||
COLOR = WHITE; |
||||
|
||||
# gmail account |
||||
MAIL = '''MAIL''':'''PASSWARD''' https://mail.google.com/mail/feed/atom/unread; |
||||
|
@ -0,0 +1,8 @@ |
||||
sleep 5s |
||||
killall conky |
||||
cd "/home/jonathan/.conky/BibleVerse" |
||||
conky -c "/home/jonathan/.conky/BibleVerse/bibleGateway" & |
||||
cd "/home/jonathan/.conky/MyBlue" |
||||
conky -c "/home/jonathan/.conky/MyBlue/MyBlue" & |
||||
cd "/home/jonathan/.conky/Octupi_Arch" |
||||
conky -c "/home/jonathan/.conky/Octupi_Arch/co_main" & |
@ -0,0 +1,36 @@ |
||||
#!/bin/bash |
||||
|
||||
scrot -z /tmp/screen.png |
||||
convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png |
||||
|
||||
if [[ -f $HOME/.config/screen-lock.png ]] |
||||
then |
||||
# placement x/y |
||||
PX=0 |
||||
PY=0 |
||||
# lockscreen image info |
||||
R=$(file ~/.config/screen-lock.png | grep -o '[0-9]* x [0-9]*') |
||||
RX=$(echo $R | cut -d' ' -f 1) |
||||
RY=$(echo $R | cut -d' ' -f 3) |
||||
|
||||
|
||||
|
||||
SR=$(xrandr --query | grep ' connected' | cut -f4 -d' ') |
||||
echo $SR |
||||
for RES in $SR |
||||
do |
||||
echo $RES |
||||
# monitor position/offset |
||||
SRX=$(echo $RES | cut -d'x' -f 1) # x pos |
||||
SRY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 1) # y pos |
||||
SROX=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 2) # x offset |
||||
SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset |
||||
PX=$(($SROX + $SRX/2 - $RX/2)) |
||||
PY=$(($SROY + $SRY/2 - $RY/2)) |
||||
convert /tmp/screen.png $HOME/.config/screen-lock.png -geometry +$PX+$PY -composite -matte /tmp/screen.png |
||||
echo "done" |
||||
done |
||||
fi |
||||
# dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop |
||||
# i3lock -I 10 -d -e -u -n -i /tmp/screen.png |
||||
i3lock -e -n -i /tmp/screen.png |
@ -0,0 +1,31 @@ |
||||
#!/bin/sh |
||||
lock() { |
||||
~/.config/i3/fadeLockScreen |
||||
#i3lock |
||||
} |
||||
|
||||
case "$1" in |
||||
lock) |
||||
lock |
||||
;; |
||||
logout) |
||||
i3-msg exit |
||||
;; |
||||
suspend) |
||||
systemctl suspend && lock |
||||
;; |
||||
hibernate) |
||||
systemctl hibernate && lock |
||||
;; |
||||
reboot) |
||||
systemctl reboot |
||||
;; |
||||
shutdown) |
||||
systemctl poweroff |
||||
;; |
||||
*) |
||||
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" |
||||
exit 2 |
||||
esac |
||||
|
||||
exit 0 |
File diff suppressed because one or more lines are too long
@ -0,0 +1,86 @@ |
||||
# Changes |
||||
|
||||
2016-04-16 |
||||
|
||||
* Fix issue around unicode function for python 3 |
||||
|
||||
2016-04-01 |
||||
|
||||
* Refactor of the way the git segment manages data about git's state. |
||||
([@b-ryan](https://github.com/milkbikis/powerline-shell/pull/221)) |
||||
|
||||
2015-12-26 |
||||
|
||||
* Beginnings of unit testing for segments. Included in this change was a |
||||
refactor of the way segments are added to powerline. Now, instead of looking |
||||
for a global `powerline` object, `powerline` is passed into the function to |
||||
add the segment. Segments will also no longer add the segments by calling the |
||||
`add` function themselves. |
||||
([@b-ryan](https://github.com/milkbikis/powerline-shell/pull/212)) |
||||
* Python3 fixes for `lib/color_compliment.py`. |
||||
([@ceholden](https://github.com/milkbikis/powerline-shell/pull/220)) |
||||
|
||||
2015-11-25 |
||||
|
||||
* `virtual_env` segment now supports environments made with `conda` |
||||
([@ceholden](https://github.com/milkbikis/powerline-shell/pull/198)) |
||||
|
||||
2015-11-21 |
||||
|
||||
* Fixes for Python 3 compatibility |
||||
([@b-ryan](https://github.com/milkbikis/powerline-shell/pull/211)) |
||||
|
||||
2015-11-18 |
||||
|
||||
* The git segment has gotten a makeover |
||||
([@MartinWetterwald](https://github.com/milkbikis/powerline-shell/pull/136)) |
||||
* Fix git segment when git is not on the standard PATH |
||||
([@andrejgl](https://github.com/milkbikis/powerline-shell/pull/153)) |
||||
* Fix `--cwd-max-depth` showing duplicates when it's <= 2 |
||||
([@b-ryan](https://github.com/milkbikis/powerline-shell/pull/209)) |
||||
* Add padding around `exit_code` segment |
||||
([@phatblat](https://github.com/milkbikis/powerline-shell/pull/205)) |
||||
|
||||
2015-10-02 |
||||
|
||||
* New option (`--cwd-max-dir-size`) which allows you to limit each directory |
||||
that is displayed to a number of characters. This currently does not apply |
||||
if you are using `--cwd-mode plain`. |
||||
([@mart-e](https://github.com/milkbikis/powerline-shell/pull/127)) |
||||
|
||||
2015-08-26 |
||||
|
||||
* New `plain` mode of displaying the current working directory which can be |
||||
used by adding `--cwd-only plain` to `powerline-shell.py`. |
||||
This deprecates the `--cwd-only` option. `--cwd-mode dironly` can be used |
||||
instead. ([@paol](https://github.com/milkbikis/powerline-shell/pull/156)) |
||||
|
||||
2015-08-18 |
||||
|
||||
* New `time` segment |
||||
([@filipebarros](https://github.com/milkbikis/powerline-shell/pull/107)) |
||||
|
||||
2015-08-01 |
||||
|
||||
* Use `print` function for some python3 compatibility |
||||
([@strycore](https://github.com/milkbikis/powerline-shell/pull/195)) |
||||
|
||||
2015-07-31 |
||||
|
||||
* The current working directory no longer follows symbolic links |
||||
* New `exit_code` segment |
||||
([@disruptek](https://github.com/milkbikis/powerline-shell/pull/129)) |
||||
|
||||
2015-07-30 |
||||
|
||||
* Fix ZSH root indicator |
||||
([@nkcfan](https://github.com/milkbikis/powerline-shell/pull/150)) |
||||
* Add uptime segment |
||||
([@marcioAlmada](https://github.com/milkbikis/powerline-shell/pull/139)) |
||||
|
||||
2015-07-27 |
||||
|
||||
* Use `python2` instead of `python` in hashbangs |
||||
([@Undeterminant](https://github.com/milkbikis/powerline-shell/pull/100)) |
||||
* Add `node_version` segment |
||||
([@mmilleruva](https://github.com/milkbikis/powerline-shell/pull/189)) |
@ -0,0 +1,20 @@ |
||||
The MIT License (MIT) |
||||
|
||||
Copyright (c) 2014 Shrey Banga and contributors |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of |
||||
this software and associated documentation files (the "Software"), to deal in |
||||
the Software without restriction, including without limitation the rights to |
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
||||
the Software, and to permit persons to whom the Software is furnished to do so, |
||||
subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@ -0,0 +1,170 @@ |
||||
A Powerline style prompt for your shell |
||||
======================================= |
||||
|
||||
A [Powerline](https://github.com/Lokaltog/vim-powerline) like prompt for Bash, ZSH and Fish: |
||||
|
||||
![MacVim+Solarized+Powerline+CtrlP](https://raw.github.com/milkbikis/dotfiles-mac/master/bash-powerline-screenshot.png) |
||||
|
||||
* Shows some important details about the git/svn/hg/fossil branch (see below) |
||||
* Changes color if the last command exited with a failure code |
||||
* If you're too deep into a directory tree, shortens the displayed path with an ellipsis |
||||
* Shows the current Python [virtualenv](http://www.virtualenv.org/) environment |
||||
* It's easy to customize and extend. See below for details. |
||||
|
||||
### Version Control |
||||
|
||||
All of the version control systems supported by powerline shell give you a |
||||
quick look into the state of your repo: |
||||
|
||||
* The current branch is displayed and changes background color when the |
||||
branch is dirty. |
||||
* When the local branch differs from the remote, the difference in number |
||||
of commits is shown along with `⇡` or `⇣` indicating whether a git push |
||||
or pull is pending |
||||
|
||||
In addition, git has a few extra symbols: |
||||
|
||||
* `✎` -- a file has been modified, but not staged for commit |
||||
* `✔` -- a file is staged for commit |
||||
* `✼` -- a file has conflicts |
||||
|
||||
FIXME |
||||
* A `+` appears when untracked files are present (except for git, which |
||||
uses `?` instead) |
||||
|
||||
Each of these will have a number next to it if more than one file matches. |
||||
|
||||
# Setup |
||||
|
||||
This script uses ANSI color codes to display colors in a terminal. These are |
||||
notoriously non-portable, so may not work for you out of the box, but try |
||||
setting your $TERM to `xterm-256color`, because that works for me. |
||||
|
||||
* Patch the font you use for your terminal: see https://github.com/Lokaltog/powerline-fonts |
||||
|
||||
* If you struggle too much to get working fonts in your terminal, you can use "compatible" mode. |
||||
* If you're using old patched fonts, you have to use the older symbols. Basically reverse [this commit](https://github.com/milkbikis/powerline-shell/commit/2a84ecc) in your copy |
||||
|
||||
* Clone this repository somewhere: |
||||
|
||||
git clone https://github.com/milkbikis/powerline-shell |
||||
|
||||
* Copy `config.py.dist` to `config.py` and edit it to configure the segments you want. Then run |
||||
|
||||
./install.py |
||||
|
||||
* This will generate `powerline-shell.py` |
||||
|
||||
* (optional) Create a symlink to this python script in your home: |
||||
|
||||
ln -s <path/to/powerline-shell.py> ~/powerline-shell.py |
||||
|
||||
* If you don't want the symlink, just modify the path in the commands below |
||||
|
||||
* For python2.6 you have to install argparse |
||||
|
||||
pip install argparse |
||||
|
||||
### All Shells: |
||||
There are a few optional arguments which can be seen by running `powerline-shell.py --help`. |
||||
|
||||
``` |
||||
--cwd-mode {fancy,plain,dironly} |
||||
How to display the current directory |
||||
--cwd-max-depth CWD_MAX_DEPTH |
||||
Maximum number of directories to show in path |
||||
--cwd-max-dir-size CWD_MAX_DIR_SIZE |
||||
Maximum number of letters displayed for each directory |
||||
in the path |
||||
--colorize-hostname Colorize the hostname based on a hash of itself. |
||||
--mode {patched,compatible,flat} |
||||
The characters used to make separators between |
||||
segments |
||||
``` |
||||
|
||||
### Bash: |
||||
Add the following to your `.bashrc` (or `.profile` on Mac): |
||||
|
||||
``` |
||||
function _update_ps1() { |
||||
PS1="$(~/powerline-shell.py $? 2> /dev/null)" |
||||
} |
||||
|
||||
if [ "$TERM" != "linux" ]; then |
||||
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" |
||||
fi |
||||
``` |
||||
|
||||
### ZSH: |
||||
Add the following to your `.zshrc`: |
||||
|
||||
``` |
||||
function powerline_precmd() { |
||||
PS1="$(~/powerline-shell.py $? --shell zsh 2> /dev/null)" |
||||
} |
||||
|
||||
function install_powerline_precmd() { |
||||
for s in "${precmd_functions[@]}"; do |
||||
if [ "$s" = "powerline_precmd" ]; then |
||||
return |
||||
fi |
||||
done |
||||
precmd_functions+=(powerline_precmd) |
||||
} |
||||
|
||||
if [ "$TERM" != "linux" ]; then |
||||
install_powerline_precmd |
||||
fi |
||||
``` |
||||
|
||||
### Fish: |
||||
Redefine `fish_prompt` in ~/.config/fish/config.fish: |
||||
|
||||
``` |
||||
function fish_prompt |
||||
~/powerline-shell.py $status --shell bare ^/dev/null |
||||
end |
||||
``` |
||||
|
||||
# Customization |
||||
|
||||
### Adding, Removing and Re-arranging segments |
||||
|
||||
The `config.py` file defines which segments are drawn and in which order. Simply |
||||
comment out and rearrange segment names to get your desired arrangement. Every |
||||
time you change `config.py`, run `install.py`, which will generate a new |
||||
`powerline-shell.py` customized to your configuration. You should see the new |
||||
prompt immediately. |
||||
|
||||
### Contributing new types of segments |
||||
|
||||
The `segments` directory contains python scripts which are injected as is into |
||||
a single file `powerline_shell_base.py`. Each segment script defines a function |
||||
that inserts one or more segments into the prompt. If you want to add a new |
||||
segment, simply create a new file in the segments directory and add its name to |
||||
the `config.py` file at the appropriate location. |
||||
|
||||
Make sure that your script does not introduce new globals which might conflict |
||||
with other scripts. Your script should fail silently and run quickly in any |
||||
scenario. |
||||
|
||||
Make sure you introduce new default colors in `themes/default.py` for every new |
||||
segment you create. Test your segment with this theme first. |
||||
|
||||
You should add tests for your segment as best you are able. Unit and |
||||
integration tests are both welcome. Run your tests with the `nosetests` command |
||||
after install the requirements in `dev_requirements.txt`. |
||||
|
||||
### Themes |
||||
|
||||
The `themes` directory stores themes for your prompt, which are basically color |
||||
values used by segments. The `default.py` defines a default theme which can be |
||||
used standalone, and every other theme falls back to it if they miss colors for |
||||
any segments. Create new themes by copying any other existing theme and |
||||
changing the values. To use a theme, set the `THEME` variable in `config.py` to |
||||
the name of your theme. |
||||
|
||||
A script for testing color combinations is provided at `themes/colortest.py`. |
||||
Note that the colors you see may vary depending on your terminal. When designing |
||||
a theme, please test your theme on multiple terminals, especially with default |
||||
settings. |
@ -0,0 +1,5 @@ |
||||
dependencies: |
||||
pre: |
||||
- sudo pip install -r dev_requirements.txt |
||||
- git config --global user.email "tester@example.com" |
||||
- git config --global user.name "Tester McGee" |
@ -0,0 +1,57 @@ |
||||
# This is the configuration file for your powerline-shell prompt |
||||
# Every time you make a change to this file, run install.py to apply changes |
||||
# |
||||
# For instructions on how to use the powerline-shell.py script, see the README |
||||
|
||||
# Add, remove or rearrange these segments to customize what you see on the shell |
||||
# prompt. Any segment you add must be present in the segments/ directory |
||||
|
||||
SEGMENTS = [ |
||||
# Set the terminal window title to user@host:dir |
||||
'set_term_title', |
||||
|
||||
# Show current virtual environment (see http://www.virtualenv.org/) |
||||
'virtual_env', |
||||
|
||||
# Show the current user's username as in ordinary prompts |
||||
'username', |
||||
|
||||
# Show the machine's hostname. Mostly used when ssh-ing into other machines |
||||
# 'hostname', |
||||
|
||||
# Show a padlock when ssh-ing from another machine |
||||
'ssh', |
||||
|
||||
# Show the current directory. If the path is too long, the middle part is |
||||
# replaced with ellipsis ('...') |
||||
'cwd', |
||||
|
||||
# Show a padlock if the current user has no write access to the current |
||||
# directory |
||||
'read_only', |
||||
|
||||
# Show the current git branch and status |
||||
'git', |
||||
|
||||
# Show the current mercurial branch and status |
||||
'hg', |
||||
|
||||
# Show the current svn branch and status |
||||
'svn', |
||||
|
||||
# Show the current fossil branch and status |
||||
'fossil', |
||||
|
||||
# Show number of running jobs |
||||
'jobs', |
||||
|
||||
# Show the last command's exit code if it was non-zero |
||||
# 'exit_code', |
||||
|
||||
# Shows a '#' if the current user is root, '$' otherwise |
||||
# Also, changes color if the last command exited with a non-zero error code |
||||
'root', |
||||
] |
||||
|
||||
# Change the colors used to draw individual segments in your prompt |
||||
THEME = 'default' |
@ -0,0 +1,57 @@ |
||||
# This is the configuration file for your powerline-shell prompt |
||||
# Every time you make a change to this file, run install.py to apply changes |
||||
# |
||||
# For instructions on how to use the powerline-shell.py script, see the README |
||||
|
||||
# Add, remove or rearrange these segments to customize what you see on the shell |
||||
# prompt. Any segment you add must be present in the segments/ directory |
||||
|
||||
SEGMENTS = [ |
||||
# Set the terminal window title to user@host:dir |
||||
# 'set_term_title', |
||||
|
||||
# Show current virtual environment (see http://www.virtualenv.org/) |
||||
'virtual_env', |
||||
|
||||
# Show the current user's username as in ordinary prompts |
||||
'username', |
||||
|
||||
# Show the machine's hostname. Mostly used when ssh-ing into other machines |
||||
'hostname', |
||||
|
||||
# Show a padlock when ssh-ing from another machine |
||||
'ssh', |
||||
|
||||
# Show the current directory. If the path is too long, the middle part is |
||||
# replaced with ellipsis ('...') |
||||
'cwd', |
||||
|
||||
# Show a padlock if the current user has no write access to the current |
||||
# directory |
||||
'read_only', |
||||
|
||||
# Show the current git branch and status |
||||
'git', |
||||
|
||||
# Show the current mercurial branch and status |
||||
'hg', |
||||
|
||||
# Show the current svn branch and status |
||||
'svn', |
||||
|
||||
# Show the current fossil branch and status |
||||
'fossil', |
||||
|
||||
# Show number of running jobs |
||||
'jobs', |
||||
|
||||
# Show the last command's exit code if it was non-zero |
||||
# 'exit_code', |
||||
|
||||
# Shows a '#' if the current user is root, '$' otherwise |
||||
# Also, changes color if the last command exited with a non-zero error code |
||||
'root', |
||||
] |
||||
|
||||
# Change the colors used to draw individual segments in your prompt |
||||
THEME = 'default' |
@ -0,0 +1,3 @@ |
||||
nose>=1.3.7 |
||||
mock>=1.3.0 |
||||
sh>=1.11 |
@ -0,0 +1,49 @@ |
||||
#!/usr/bin/env python |
||||
from __future__ import print_function |
||||
import os |
||||
import stat |
||||
|
||||
try: |
||||
import config |
||||
except ImportError: |
||||
print('Created personal config.py for your customizations') |
||||
import shutil |
||||
shutil.copyfile('config.py.dist', 'config.py') |
||||
import config |
||||
|
||||
TEMPLATE_FILE = 'powerline_shell_base.py' |
||||
OUTPUT_FILE = 'powerline-shell.py' |
||||
SEGMENTS_DIR = 'segments' |
||||
THEMES_DIR = 'themes' |
||||
|
||||
def load_source(srcfile): |
||||
try: |
||||
return ''.join(open(srcfile).readlines()) + '\n\n' |
||||
except IOError: |
||||
print('Could not open', srcfile) |
||||
return '' |
||||
|
||||
if __name__ == "__main__": |
||||
source = load_source(TEMPLATE_FILE) |
||||
source += load_source(os.path.join(THEMES_DIR, 'default.py')) |
||||
|
||||
if config.THEME != 'default': |
||||
source += load_source(os.path.join(THEMES_DIR, config.THEME + '.py')) |
||||
|
||||
for segment in config.SEGMENTS: |
||||
source += load_source(os.path.join(SEGMENTS_DIR, segment + '.py')) |
||||
|
||||
# assumes each segment file will have a function called |
||||
# add_segment__[segment] that accepts the powerline object |
||||
source += 'add_{}_segment(powerline)\n'.format(segment) |
||||
|
||||
source += 'sys.stdout.write(powerline.draw())\n' |
||||
|
||||
try: |
||||
open(OUTPUT_FILE, 'w').write(source) |
||||
st = os.stat(OUTPUT_FILE) |
||||
os.chmod(OUTPUT_FILE, st.st_mode | stat.S_IEXEC) |
||||
print(OUTPUT_FILE, 'saved successfully') |
||||
except IOError: |
||||
print('ERROR: Could not write to powerline-shell.py. Make sure it is writable') |
||||
exit(1) |
@ -0,0 +1,3 @@ |
||||
history |
||||
bookmarks |
||||
tagged |
@ -0,0 +1,61 @@ |
||||
# This is a sample commands.py. You can add your own commands here. |
||||
# |
||||
# Please refer to commands_full.py for all the default commands and a complete |
||||
# documentation. Do NOT add them all here, or you may end up with defunct |
||||
# commands when upgrading ranger. |
||||
|
||||
# You always need to import ranger.api.commands here to get the Command class: |
||||
from ranger.api.commands import * |
||||
|
||||
# A simple command for demonstration purposes follows. |
||||
# ----------------------------------------------------------------------------- |
||||
|
||||
# You can import any python module as needed. |
||||
import os |
||||
|
||||
# Any class that is a subclass of "Command" will be integrated into ranger as a |
||||
# command. Try typing ":my_edit<ENTER>" in ranger! |
||||
|
||||
|
||||
class my_edit(Command): |
||||
# The so-called doc-string of the class will be visible in the built-in |
||||
# help that is accessible by typing "?c" inside ranger. |
||||
""":my_edit <filename> |
||||
|
||||
A sample command for demonstration purposes that opens a file in an editor. |
||||
""" |
||||
|
||||
# The execute method is called when you run this command in ranger. |
||||
def execute(self): |
||||
# self.arg(1) is the first (space-separated) argument to the function. |
||||
# This way you can write ":my_edit somefilename<ENTER>". |
||||
if self.arg(1): |
||||
# self.rest(1) contains self.arg(1) and everything that follows |
||||
target_filename = self.rest(1) |
||||
else: |
||||
# self.fm is a ranger.core.filemanager.FileManager object and gives |
||||
# you access to internals of ranger. |
||||
# self.fm.thisfile is a ranger.container.file.File object and is a |
||||
# reference to the currently selected file. |
||||
target_filename = self.fm.thisfile.path |
||||
|
||||
# This is a generic function to print text in ranger. |
||||
self.fm.notify("Let's edit the file " + target_filename + "!") |
||||
|
||||
# Using bad=True in fm.notify allows you to print error messages: |
||||
if not os.path.exists(target_filename): |
||||
self.fm.notify("The given file does not exist!", bad=True) |
||||
return |
||||
|
||||
# This executes a function from ranger.core.acitons, a module with a |
||||
# variety of subroutines that can help you construct commands. |
||||
# Check out the source, or run "pydoc ranger.core.actions" for a list. |
||||
self.fm.edit_file(target_filename) |
||||
|
||||
# The tab method is called when you press tab, and should return a list of |
||||
# suggestions that the user will tab through. |
||||
# tabnum is 1 for <TAB> and -1 for <S-TAB> by default |
||||
def tab(self, tabnum): |
||||
# This is a generic tab-completion function that iterates through the |
||||
# content of the current directory. |
||||
return self._tab_directory_content() |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,618 @@ |
||||
# =================================================================== |
||||
# This file contains the default startup commands for ranger. |
||||
# To change them, it is recommended to create the file |
||||
# ~/.config/ranger/rc.conf and add your custom commands there. |
||||
# |
||||
# If you copy this whole file there, you may want to set the environment |
||||
# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice. |
||||
# |
||||
# The purpose of this file is mainly to define keybindings and settings. |
||||
# For running more complex python code, please create a plugin in "plugins/" or |
||||
# a command in "commands.py". |
||||
# |
||||
# Each line is a command that will be run before the user interface |
||||
# is initialized. As a result, you can not use commands which rely |
||||
# on the UI such as :delete or :mark. |
||||
# =================================================================== |
||||
|
||||
# =================================================================== |
||||
# == Options |
||||
# =================================================================== |
||||
|
||||
# Which viewmode should be used? Possible values are: |
||||
# miller: Use miller columns which show multiple levels of the hierarchy |
||||
# multipane: Midnight-commander like multipane view showing all tabs next |
||||
# to each other |
||||
set viewmode miller |
||||
#set viewmode multipane |
||||
|
||||
# How many columns are there, and what are their relative widths? |
||||
set column_ratios 1,3,4 |
||||
|
||||
# Which files should be hidden? (regular expression) |
||||
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ |
||||
|
||||
# Show hidden files? You can toggle this by typing 'zh' |
||||
set show_hidden false |
||||
|
||||
# Ask for a confirmation when running the "delete" command? |
||||
# Valid values are "always", "never", "multiple" (default) |
||||
# With "multiple", ranger will ask only if you delete multiple files at once. |
||||
set confirm_on_delete multiple |
||||
|
||||
# Which script is used to generate file previews? |
||||
# ranger ships with scope.sh, a script that calls external programs (see |
||||
# README.md for dependencies) to preview images, archives, etc. |
||||
set preview_script ~/.config/ranger/scope.sh |
||||
|
||||
# Use the external preview script or display simple plain text or image previews? |
||||
set use_preview_script true |
||||
|
||||
# Automatically count files in the directory, even before entering them? |
||||
set automatically_count_files true |
||||
|
||||
# Open all images in this directory when running certain image viewers |
||||
# like feh or sxiv? You can still open selected files by marking them. |
||||
set open_all_images true |
||||
|
||||
# Be aware of version control systems and display information. |
||||
set vcs_aware true |
||||
|
||||
# State of the three backends git, hg, bzr. The possible states are |
||||
# disabled, local (only show local info), enabled (show local and remote |
||||
# information). |
||||
set vcs_backend_git enabled |
||||
set vcs_backend_hg disabled |
||||
set vcs_backend_bzr disabled |
||||
|
||||
# Use one of the supported image preview protocols |
||||
set preview_images true |
||||
|
||||
# Set the preview image method. Supported methods: |
||||
# |
||||
# * w3m (default): |
||||
# Preview images in full color with the external command "w3mimgpreview"? |
||||
# This requires the console web browser "w3m" and a supported terminal. |
||||
# It has been successfully tested with "xterm" and "urxvt" without tmux. |
||||
# |
||||
# * iterm2: |
||||
# Preview images in full color using iTerm2 image previews |
||||
# (http://iterm2.com/images.html). This requires using iTerm2 compiled |
||||
# with image preview support. |
||||
# |
||||
# * urxvt: |
||||
# Preview images in full color using urxvt image backgrounds. This |
||||
# requires using urxvt compiled with pixbuf support. |
||||
# |
||||
# * urxvt-full: |
||||
# The same as urxvt but utilizing not only the preview pane but the |
||||
# whole terminal window. |
||||
set preview_images_method w3m |
||||
|
||||
# Use a unicode "..." character to mark cut-off filenames? |
||||
set unicode_ellipsis false |
||||
|
||||
# Show dotfiles in the bookmark preview box? |
||||
set show_hidden_bookmarks true |
||||
|
||||
# Which colorscheme to use? These colorschemes are available by default: |
||||
# default, jungle, snow, solarized |
||||
set colorscheme default |
||||
|
||||
# Preview files on the rightmost column? |
||||
# And collapse (shrink) the last column if there is nothing to preview? |
||||
set preview_files true |
||||
set preview_directories true |
||||
set collapse_preview true |
||||
|
||||
# Save the console history on exit? |
||||
set save_console_history true |
||||
|
||||
# Draw the status bar on top of the browser window (default: bottom) |
||||
set status_bar_on_top false |
||||
|
||||
# Draw a progress bar in the status bar which displays the average state of all |
||||
# currently running tasks which support progress bars? |
||||
set draw_progress_bar_in_status_bar true |
||||
|
||||
# Draw borders around columns? |
||||
set draw_borders true |
||||
|
||||
# Display the directory name in tabs? |
||||
set dirname_in_tabs false |
||||
|
||||
# Enable the mouse support? |
||||
set mouse_enabled true |
||||
|
||||
# Display the file size in the main column or status bar? |
||||
set display_size_in_main_column true |
||||
set display_size_in_status_bar true |
||||
|
||||
# Display files tags in all columns or only in main column? |
||||
set display_tags_in_all_columns true |
||||
|
||||
# Set a title for the window? |
||||
set update_title false |
||||
|
||||
# Set the title to "ranger" in the tmux program? |
||||
set update_tmux_title false |
||||
|
||||
# Shorten the title if it gets long? The number defines how many |
||||
# directories are displayed at once, 0 turns off this feature. |
||||
set shorten_title 3 |
||||
|
||||
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger? |
||||
set tilde_in_titlebar false |
||||
|
||||
# How many directory-changes or console-commands should be kept in history? |
||||
set max_history_size 20 |
||||
set max_console_history_size 50 |
||||
|
||||
# Try to keep so much space between the top/bottom border when scrolling: |
||||
set scroll_offset 8 |
||||
|
||||
# Flush the input after each key hit? (Noticeable when ranger lags) |
||||
set flushinput true |
||||
|
||||
# Padding on the right when there's no preview? |
||||
# This allows you to click into the space to run the file. |
||||
set padding_right true |
||||
|
||||
# Save bookmarks (used with mX and `X) instantly? |
||||
# This helps to synchronize bookmarks between multiple ranger |
||||
# instances but leads to *slight* performance loss. |
||||
# When false, bookmarks are saved when ranger is exited. |
||||
set autosave_bookmarks true |
||||
|
||||
# You can display the "real" cumulative size of directories by using the |
||||
# command :get_cumulative_size or typing "dc". The size is expensive to |
||||
# calculate and will not be updated automatically. You can choose |
||||
# to update it automatically though by turning on this option: |
||||
set autoupdate_cumulative_size false |
||||
|
||||
# Turning this on makes sense for screen readers: |
||||
set show_cursor false |
||||
|
||||
# One of: size, natural, basename, atime, ctime, mtime, type, random |
||||
set sort natural |
||||
|
||||
# Additional sorting options |
||||
set sort_reverse false |
||||
set sort_case_insensitive true |
||||
set sort_directories_first true |
||||
set sort_unicode false |
||||
|
||||
# Enable this if key combinations with the Alt Key don't work for you. |
||||
# (Especially on xterm) |
||||
set xterm_alt_key false |
||||
|
||||
# Whether to include bookmarks in cd command |
||||
set cd_bookmarks true |
||||
|
||||
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to |
||||
# disable this feature. |
||||
set preview_max_size 0 |
||||
|
||||
# Add the highlighted file to the path in the titlebar |
||||
set show_selection_in_titlebar true |
||||
|
||||
# The delay that ranger idly waits for user input, in milliseconds, with a |
||||
# resolution of 100ms. Lower delay reduces lag between directory updates but |
||||
# increases CPU load. |
||||
set idle_delay 2000 |
||||
|
||||
# When the metadata manager module looks for metadata, should it only look for |
||||
# a ".metadata.json" file in the current directory, or do a deep search and |
||||
# check all directories above the current one as well? |
||||
set metadata_deep_search false |
||||
|
||||
# Clear all existing filters when leaving a directory |
||||
set clear_filters_on_dir_change false |
||||
|
||||
# Disable displaying line numbers in main column |
||||
set line_numbers false |
||||
|
||||
# =================================================================== |
||||
# == Local Options |
||||
# =================================================================== |
||||
# You can set local options that only affect a single directory. |
||||
|
||||
# Examples: |
||||
# setlocal path=~/downloads sort mtime |
||||
|
||||
# =================================================================== |
||||
# == Command Aliases in the Console |
||||
# =================================================================== |
||||
|
||||
alias e edit |
||||
alias q quit |
||||
alias q! quitall |
||||
alias qa quitall |
||||
alias qall quitall |
||||
alias setl setlocal |
||||
|
||||
alias filter scout -prt |
||||
alias find scout -aeit |
||||
alias mark scout -mr |
||||
alias unmark scout -Mr |
||||
alias search scout -rs |
||||
alias search_inc scout -rts |
||||
alias travel scout -aefiklst |
||||
|
||||
# =================================================================== |
||||
# == Define keys for the browser |
||||
# =================================================================== |
||||
|
||||
# Basic |
||||
map Q quit! |
||||
map q quit |
||||
copymap q ZZ ZQ |
||||
|
||||
map R reload_cwd |
||||
map <C-r> reset |
||||
map <C-l> redraw_window |
||||
map <C-c> abort |
||||
map <esc> change_mode normal |
||||
map ~ set viewmode! |
||||
|
||||
map i display_file |
||||
map ? help |
||||
map W display_log |
||||
map w taskview_open |
||||
map S shell $SHELL |
||||
|
||||
map : console |
||||
map ; console |
||||
map ! console shell%space |
||||
map @ console -p6 shell %%s |
||||
map # console shell -p%space |
||||
map s console shell%space |
||||
map r chain draw_possible_programs; console open_with%%space |
||||
map f console find%space |
||||
map cd console cd%space |
||||
|
||||
# Change the line mode |
||||
map Mf linemode filename |
||||
map Mi linemode fileinfo |
||||
map Mm linemode mtime |
||||
map Mp linemode permissions |
||||
map Ms linemode sizemtime |
||||
map Mt linemode metatitle |
||||
|
||||
# Tagging / Marking |
||||
map t tag_toggle |
||||
map ut tag_remove |
||||
map "<any> tag_toggle tag=%any |
||||
map <Space> mark_files toggle=True |
||||
map v mark_files all=True toggle=True |
||||
map uv mark_files all=True val=False |
||||
map V toggle_visual_mode |
||||
map uV toggle_visual_mode reverse=True |
||||
|
||||
# For the nostalgics: Midnight Commander bindings |
||||
map <F1> help |
||||
map <F3> display_file |
||||
map <F4> edit |
||||
map <F5> copy |
||||
map <F6> cut |
||||
map <F7> console mkdir%space |
||||
map <F8> console delete |
||||
map <F10> exit |
||||
|
||||
# In case you work on a keyboard with dvorak layout |
||||
map <UP> move up=1 |
||||
map <DOWN> move down=1 |
||||
map <LEFT> move left=1 |
||||
map <RIGHT> move right=1 |
||||
map <HOME> move to=0 |
||||
map <END> move to=-1 |
||||
map <PAGEDOWN> move down=1 pages=True |
||||
map <PAGEUP> move up=1 pages=True |
||||
map <CR> move right=1 |
||||
#map <DELETE> console delete |
||||
map <INSERT> console touch%space |
||||
|
||||
# VIM-like |
||||
copymap <UP> k |
||||
copymap <DOWN> j |
||||
copymap <LEFT> h |
||||
copymap <RIGHT> l |
||||
copymap <HOME> gg |
||||
copymap <END> G |
||||
copymap <PAGEDOWN> <C-F> |
||||
copymap <PAGEUP> <C-B> |
||||
|
||||
map J move down=0.5 pages=True |
||||
map K move up=0.5 pages=True |
||||
copymap J <C-D> |
||||
copymap K <C-U> |
||||
|
||||
# Jumping around |
||||
map H history_go -1 |
||||
map L history_go 1 |
||||
map ] move_parent 1 |
||||
map [ move_parent -1 |
||||
map } traverse |
||||
|
||||
map gh cd ~ |
||||
map ge cd /etc |
||||
map gu cd /usr |
||||
map gd cd /dev |
||||
map gl cd -r . |
||||
map gL cd -r %f |
||||
map go cd /opt |
||||
map gv cd /var |
||||
map gm cd /media |
||||
map gM cd /mnt |
||||
map gs cd /srv |
||||
map gr cd / |
||||
map gR eval fm.cd(ranger.RANGERDIR) |
||||
map g/ cd / |
||||
map g? cd /usr/share/doc/ranger |
||||
|
||||
# External Programs |
||||
map E edit |
||||
map du shell -p du --max-depth=1 -h --apparent-size |
||||
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh |
||||
map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b |
||||
map yd shell -f echo -n %d | xsel -i; xsel -o | xsel -i -b |
||||
map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b |
||||
|
||||
# Filesystem Operations |
||||
map = chmod |
||||
|
||||
map cw console rename%space |
||||
map a rename_append |
||||
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%")) |
||||
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7) |
||||
|
||||
map pp paste |
||||
map po paste overwrite=True |
||||
map pP paste append=True |
||||
map pO paste overwrite=True append=True |
||||
map pl paste_symlink relative=False |
||||
map pL paste_symlink relative=True |
||||
map phl paste_hardlink |
||||
map pht paste_hardlinked_subtree |
||||
|
||||
map dD console delete |
||||
|
||||
map dd cut |
||||
map ud uncut |
||||
map da cut mode=add |
||||
map dr cut mode=remove |
||||
map dt cut mode=toggle |
||||
|
||||
map yy copy |
||||
map uy uncut |
||||
map ya copy mode=add |
||||
map yr copy mode=remove |
||||
map yt copy mode=toggle |
||||
|
||||
# Temporary workarounds |
||||
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) |
||||
map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) |
||||
map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) |
||||
map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) |
||||
map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) |
||||
map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) |
||||
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) |
||||
map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) |
||||
|
||||
# Searching |
||||
map / console search%space |
||||
map n search_next |
||||
map N search_next forward=False |
||||
map ct search_next order=tag |
||||
map cs search_next order=size |
||||
map ci search_next order=mimetype |
||||
map cc search_next order=ctime |
||||
map cm search_next order=mtime |
||||
map ca search_next order=atime |
||||
|
||||
# Tabs |
||||
map <C-n> tab_new ~ |
||||
map <C-w> tab_close |
||||
map <TAB> tab_move 1 |
||||
map <S-TAB> tab_move -1 |
||||
map <A-Right> tab_move 1 |
||||
map <A-Left> tab_move -1 |
||||
map gt tab_move 1 |
||||
map gT tab_move -1 |
||||
map gn tab_new ~ |
||||
map gc tab_close |
||||
map uq tab_restore |
||||
map <a-1> tab_open 1 |
||||
map <a-2> tab_open 2 |
||||
map <a-3> tab_open 3 |
||||
map <a-4> tab_open 4 |
||||
map <a-5> tab_open 5 |
||||
map <a-6> tab_open 6 |
||||
map <a-7> tab_open 7 |
||||
map <a-8> tab_open 8 |
||||
map <a-9> tab_open 9 |
||||
|
||||
# Sorting |
||||
map or set sort_reverse! |
||||
map oz set sort=random |
||||
map os chain set sort=size; set sort_reverse=False |
||||
map ob chain set sort=basename; set sort_reverse=False |
||||
map on chain set sort=natural; set sort_reverse=False |
||||
map om chain set sort=mtime; set sort_reverse=False |
||||
map oc chain set sort=ctime; set sort_reverse=False |
||||
map oa chain set sort=atime; set sort_reverse=False |
||||
map ot chain set sort=type; set sort_reverse=False |
||||
map oe chain set sort=extension; set sort_reverse=False |
||||
|
||||
map oS chain set sort=size; set sort_reverse=True |
||||
map oB chain set sort=basename; set sort_reverse=True |
||||
map oN chain set sort=natural; set sort_reverse=True |
||||
map oM chain set sort=mtime; set sort_reverse=True |
||||
map oC chain set sort=ctime; set sort_reverse=True |
||||
map oA chain set sort=atime; set sort_reverse=True |
||||
map oT chain set sort=type; set sort_reverse=True |
||||
map oE chain set sort=extension; set sort_reverse=True |
||||
|
||||
map dc get_cumulative_size |
||||
|
||||
# Settings |
||||
map zc set collapse_preview! |
||||
map zd set sort_directories_first! |
||||
map zh set show_hidden! |
||||
map <C-h> set show_hidden! |
||||
map zI set flushinput! |
||||
map zi set preview_images! |
||||
map zm set mouse_enabled! |
||||
map zp set preview_files! |
||||
map zP set preview_directories! |
||||
map zs set sort_case_insensitive! |
||||
map zu set autoupdate_cumulative_size! |
||||
map zv set use_preview_script! |
||||
map zf console filter%space |
||||
|
||||
# Bookmarks |
||||
map `<any> enter_bookmark %any |
||||
map '<any> enter_bookmark %any |
||||
map m<any> set_bookmark %any |
||||
map um<any> unset_bookmark %any |
||||
|
||||
map m<bg> draw_bookmarks |
||||
copymap m<bg> um<bg> `<bg> '<bg> |
||||
|
||||
# Generate all the chmod bindings with some python help: |
||||
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg)) |
||||
|
||||
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) |
||||
eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg)) |
||||
|
||||
# =================================================================== |
||||
# == Define keys for the console |
||||
# =================================================================== |
||||
# Note: Unmapped keys are passed directly to the console. |
||||
|
||||
# Basic |
||||
cmap <tab> eval fm.ui.console.tab() |
||||
cmap <s-tab> eval fm.ui.console.tab(-1) |
||||
cmap <ESC> eval fm.ui.console.close() |
||||
cmap <CR> eval fm.ui.console.execute() |
||||
cmap <C-l> redraw_window |
||||
|
||||
copycmap <ESC> <C-c> |
||||
copycmap <CR> <C-j> |
||||
|
||||
# Move around |
||||
cmap <up> eval fm.ui.console.history_move(-1) |
||||
cmap <down> eval fm.ui.console.history_move(1) |
||||
cmap <left> eval fm.ui.console.move(left=1) |
||||
cmap <right> eval fm.ui.console.move(right=1) |
||||
cmap <home> eval fm.ui.console.move(right=0, absolute=True) |
||||
cmap <end> eval fm.ui.console.move(right=-1, absolute=True) |
||||
cmap <a-left> eval fm.ui.console.move_word(left=1) |
||||
cmap <a-right> eval fm.ui.console.move_word(right=1) |
||||
|
||||
# Line Editing |
||||
cmap <backspace> eval fm.ui.console.delete(-1) |
||||
cmap <delete> eval fm.ui.console.delete(0) |
||||
cmap <C-w> eval fm.ui.console.delete_word() |
||||
cmap <A-d> eval fm.ui.console.delete_word(backward=False) |
||||
cmap <C-k> eval fm.ui.console.delete_rest(1) |
||||
cmap <C-u> eval fm.ui.console.delete_rest(-1) |
||||
cmap <C-y> eval fm.ui.console.paste() |
||||
|
||||
# And of course the emacs way |
||||
copycmap <up> <C-p> |
||||
copycmap <down> <C-n> |
||||
copycmap <left> <C-b> |
||||
copycmap <right> <C-f> |
||||
copycmap <home> <C-a> |
||||
copycmap <end> <C-e> |
||||
copycmap <delete> <C-d> |
||||
copycmap <backspace> <C-h> |
||||
|
||||
# Note: There are multiple ways to express backspaces. <backspace> (code 263) |
||||
# and <backspace2> (code 127). To be sure, use both. |
||||
copycmap <backspace> <backspace2> |
||||
|
||||
# This special expression allows typing in numerals: |
||||
cmap <allow_quantifiers> false |
||||
|
||||
# =================================================================== |
||||
# == Pager Keybindings |
||||
# =================================================================== |
||||
|
||||
# Movement |
||||
pmap <down> pager_move down=1 |
||||
pmap <up> pager_move up=1 |
||||
pmap <left> pager_move left=4 |
||||
pmap <right> pager_move right=4 |
||||
pmap <home> pager_move to=0 |
||||
pmap <end> pager_move to=-1 |
||||
pmap <pagedown> pager_move down=1.0 pages=True |
||||
pmap <pageup> pager_move up=1.0 pages=True |
||||
pmap <C-d> pager_move down=0.5 pages=True |
||||
pmap <C-u> pager_move up=0.5 pages=True |
||||
|
||||
copypmap <UP> k <C-p> |
||||
copypmap <DOWN> j <C-n> <CR> |
||||
copypmap <LEFT> h |
||||
copypmap <RIGHT> l |
||||
copypmap <HOME> g |
||||
copypmap <END> G |
||||
copypmap <C-d> d |
||||
copypmap <C-u> u |
||||
copypmap <PAGEDOWN> n f <C-F> <Space> |
||||
copypmap <PAGEUP> p b <C-B> |
||||
|
||||
# Basic |
||||
pmap <C-l> redraw_window |
||||
pmap <ESC> pager_close |
||||
copypmap <ESC> q Q i <F3> |
||||
pmap E edit_file |
||||
|
||||
# =================================================================== |
||||
# == Taskview Keybindings |
||||
# =================================================================== |
||||
|
||||
# Movement |
||||
tmap <up> taskview_move up=1 |
||||
tmap <down> taskview_move down=1 |
||||
tmap <home> taskview_move to=0 |
||||
tmap <end> taskview_move to=-1 |
||||
tmap <pagedown> taskview_move down=1.0 pages=True |
||||
tmap <pageup> taskview_move up=1.0 pages=True |
||||
tmap <C-d> taskview_move down=0.5 pages=True |
||||
tmap <C-u> taskview_move up=0.5 pages=True |
||||
|
||||
copytmap <UP> k <C-p> |
||||
copytmap <DOWN> j <C-n> <CR> |
||||
copytmap <HOME> g |
||||
copytmap <END> G |
||||
copytmap <C-u> u |
||||
copytmap <PAGEDOWN> n f <C-F> <Space> |
||||
copytmap <PAGEUP> p b <C-B> |
||||
|
||||
# Changing priority and deleting tasks |
||||
tmap J eval -q fm.ui.taskview.task_move(-1) |
||||
tmap K eval -q fm.ui.taskview.task_move(0) |
||||
tmap dd eval -q fm.ui.taskview.task_remove() |
||||
tmap <pagedown> eval -q fm.ui.taskview.task_move(-1) |
||||
tmap <pageup> eval -q fm.ui.taskview.task_move(0) |
||||
tmap <delete> eval -q fm.ui.taskview.task_remove() |
||||
|
||||
# Basic |
||||
tmap <C-l> redraw_window |
||||
tmap <ESC> taskview_close |
||||
copytmap <ESC> q Q w <C-c> |
||||
|
||||
# =================================================================== |
||||
# == My Additions |
||||
# =================================================================== |
||||
# Start terminal at location |
||||
map S shell bash -c "cd %d ; bash" |
@ -0,0 +1,211 @@ |
||||
# vim: ft=cfg |
||||
# |
||||
# This is the configuration file of "rifle", ranger's file executor/opener. |
||||
# Each line consists of conditions and a command. For each line the conditions |
||||
# are checked and if they are met, the respective command is run. |
||||
# |
||||
# Syntax: |
||||
# <condition1> , <condition2> , ... = command |
||||
# |
||||
# The command can contain these environment variables: |
||||
# $1-$9 | The n-th selected file |
||||
# $@ | All selected files |
||||
# |
||||
# If you use the special command "ask", rifle will ask you what program to run. |
||||
# |
||||
# Prefixing a condition with "!" will negate its result. |
||||
# These conditions are currently supported: |
||||
# match <regexp> | The regexp matches $1 |
||||
# ext <regexp> | The regexp matches the extension of $1 |
||||
# mime <regexp> | The regexp matches the mime type of $1 |
||||
# name <regexp> | The regexp matches the basename of $1 |
||||
# path <regexp> | The regexp matches the absolute path of $1 |
||||
# has <program> | The program is installed (i.e. located in $PATH) |
||||
# env <variable> | The environment variable "variable" is non-empty |
||||
# file | $1 is a file |
||||
# directory | $1 is a directory |
||||
# number <n> | change the number of this command to n |
||||
# terminal | stdin, stderr and stdout are connected to a terminal |
||||
# X | $DISPLAY is not empty (i.e. Xorg runs) |
||||
# |
||||
# There are also pseudo-conditions which have a "side effect": |
||||
# flag <flags> | Change how the program is run. See below. |
||||
# label <label> | Assign a label or name to the command so it can |
||||
# | be started with :open_with <label> in ranger |
||||
# | or `rifle -p <label>` in the standalone executable. |
||||
# else | Always true. |
||||
# |
||||
# Flags are single characters which slightly transform the command: |
||||
# f | Fork the program, make it run in the background. |
||||
# | New command = setsid $command >& /dev/null & |
||||
# r | Execute the command with root permissions |
||||
# | New command = sudo $command |
||||
# t | Run the program in a new terminal. If $TERMCMD is not defined, |
||||
# | rifle will attempt to extract it from $TERM. |
||||
# | New command = $TERMCMD -e $command |
||||
# Note: The "New command" serves only as an illustration, the exact |
||||
# implementation may differ. |
||||
# Note: When using rifle in ranger, there is an additional flag "c" for |
||||
# only running the current file even if you have marked multiple files. |
||||
|
||||
#------------------------------------------- |
||||
# Websites |
||||
#------------------------------------------- |
||||
# Rarely installed browsers get higher priority; It is assumed that if you |
||||
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the |
||||
# other hand are often only installed as fallback browsers. |
||||
ext x?html?, has surf, X, flag f = surf -- file://"$1" |
||||
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@" |
||||
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@" |
||||
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" |
||||
ext x?html?, has dwb, X, flag f = dwb -- "$@" |
||||
ext x?html?, has jumanji, X, flag f = jumanji -- "$@" |
||||
ext x?html?, has luakit, X, flag f = luakit -- "$@" |
||||
ext x?html?, has uzbl, X, flag f = uzbl -- "$@" |
||||
ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@" |
||||
ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@" |
||||
ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@" |
||||
ext x?html?, has midori, X, flag f = midori -- "$@" |
||||
ext x?html?, has chromium, X, flag f = chromium -- "$@" |
||||
ext x?html?, has opera, X, flag f = opera -- "$@" |
||||
ext x?html?, has firefox, X, flag f = firefox -- "$@" |
||||
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" |
||||
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@" |
||||
ext x?html?, has epiphany, X, flag f = epiphany -- "$@" |
||||
ext x?html?, has konqueror, X, flag f = konqueror -- "$@" |
||||
ext x?html?, has elinks, terminal = elinks "$@" |
||||
ext x?html?, has links2, terminal = links2 "$@" |
||||
ext x?html?, has links, terminal = links "$@" |
||||
ext x?html?, has lynx, terminal = lynx -- "$@" |
||||
ext x?html?, has w3m, terminal = w3m "$@" |
||||
|
||||
#------------------------------------------- |
||||
# Misc |
||||
#------------------------------------------- |
||||
# Define the "editor" for text files as first action |
||||
mime ^text, label editor = $EDITOR -- "$@" |
||||
mime ^text, label pager = "$PAGER" -- "$@" |
||||
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" |
||||
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" |
||||
|
||||
ext 1 = man "$1" |
||||
ext s[wmf]c, has zsnes, X = zsnes "$1" |
||||
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1" |
||||
ext nes, has fceux, X = fceux "$1" |
||||
ext exe = wine "$1" |
||||
name ^[mM]akefile$ = make |
||||
|
||||
#-------------------------------------------- |
||||
# Code |
||||
#------------------------------------------- |
||||
ext py = python -- "$1" |
||||
ext pl = perl -- "$1" |
||||
ext rb = ruby -- "$1" |
||||
ext js = node -- "$1" |
||||
ext sh = sh -- "$1" |
||||
ext php = php -- "$1" |
||||
|
||||
#-------------------------------------------- |
||||
# Audio without X |
||||
#------------------------------------------- |
||||
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@" |
||||
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" |
||||
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" |
||||
ext midi?, terminal, has wildmidi = wildmidi -- "$@" |
||||
|
||||
#-------------------------------------------- |
||||
# Video/Audio with a GUI |
||||
#------------------------------------------- |
||||
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@" |
||||
mime ^video|audio, has smplayer, X, flag f = smplayer "$@" |
||||
mime ^video, has mpv, X, flag f = mpv -- "$@" |
||||
mime ^video, has mpv, X, flag f = mpv --fs -- "$@" |
||||
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" |
||||
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" |
||||
mime ^video, has mplayer, X, flag f = mplayer -- "$@" |
||||
mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@" |
||||
mime ^video|audio, has vlc, X, flag f = vlc -- "$@" |
||||
mime ^video|audio, has totem, X, flag f = totem -- "$@" |
||||
mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@" |
||||
|
||||
#-------------------------------------------- |
||||
# Video without X: |
||||
#------------------------------------------- |
||||
mime ^video, terminal, !X, has mpv = mpv -- "$@" |
||||
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" |
||||
mime ^video, terminal, !X, has mplayer = mplayer -- "$@" |
||||
|
||||
#------------------------------------------- |
||||
# Documents |
||||
#------------------------------------------- |
||||
ext pdf, has llpp, X, flag f = llpp "$@" |
||||
ext pdf, has zathura, X, flag f = zathura -- "$@" |
||||
ext pdf, has mupdf, X, flag f = mupdf "$@" |
||||
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@" |
||||
ext pdf, has apvlv, X, flag f = apvlv -- "$@" |
||||
ext pdf, has xpdf, X, flag f = xpdf -- "$@" |
||||
ext pdf, has evince, X, flag f = evince -- "$@" |
||||
ext pdf, has atril, X, flag f = atril -- "$@" |
||||
ext pdf, has okular, X, flag f = okular -- "$@" |
||||
ext pdf, has epdfview, X, flag f = epdfview -- "$@" |
||||
ext pdf, has qpdfview, X, flag f = qpdfview "$@" |
||||
|
||||
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER" |
||||
|
||||
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@" |
||||
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@" |
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@" |
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@" |
||||
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@" |
||||
|
||||
ext djvu, has zathura,X, flag f = zathura -- "$@" |
||||
ext djvu, has evince, X, flag f = evince -- "$@" |
||||
ext djvu, has atril, X, flag f = atril -- "$@" |
||||
|
||||
#------------------------------------------- |
||||
# Image Viewing: |
||||
#------------------------------------------- |
||||
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@" |
||||
mime ^image/svg, has display, X, flag f = display -- "$@" |
||||
|
||||
mime ^image, has pqiv, X, flag f = pqiv -- "$@" |
||||
mime ^image, has sxiv, X, flag f = sxiv -- "$@" |
||||
mime ^image, has feh, X, flag f = feh -- "$@" |
||||
mime ^image, has mirage, X, flag f = mirage -- "$@" |
||||
mime ^image, has ristretto, X, flag f = ristretto "$@" |
||||
mime ^image, has eog, X, flag f = eog -- "$@" |
||||
mime ^image, has eom, X, flag f = eom -- "$@" |
||||
mime ^image, has gimp, X, flag f = gimp -- "$@" |
||||
ext xcf, X, flag f = gimp -- "$@" |
||||
|
||||
#------------------------------------------- |
||||
# Archives |
||||
#------------------------------------------- |
||||
|
||||
# avoid password prompt by providing empty password |
||||
ext 7z, has 7z = 7z -p l "$@" | "$PAGER" |
||||
# This requires atool |
||||
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has als = als -- "$@" | "$PAGER" |
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als = als -- "$@" | "$PAGER" |
||||
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack = aunpack -- "$@" |
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has aunpack = aunpack -- "$@" |
||||
|
||||
# Fallback: |
||||
ext tar|gz, has tar = tar vvtf "$@" | "$PAGER" |
||||
ext tar|gz, has tar = tar vvxf "$@" |
||||
|
||||
#------------------------------------------- |
||||
# Misc |
||||
#------------------------------------------- |
||||
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1" |
||||
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1" |
||||
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1" |
||||
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" |
||||
|
||||
# Define the editor for non-text files + pager as last action |
||||
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask |
||||
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" |
||||
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" |
||||
|
||||
# The very last action, so that it's never triggered accidentally, is to execute a program: |
||||
mime application/x-executable = "$1" |
@ -0,0 +1,128 @@ |
||||
#!/usr/bin/env sh |
||||
# ranger supports enhanced previews. If the option "use_preview_script" |
||||
# is set to True and this file exists, this script will be called and its |
||||
# output is displayed in ranger. ANSI color codes are supported. |
||||
|
||||
# NOTES: This script is considered a configuration file. If you upgrade |
||||
# ranger, it will be left untouched. (You must update it yourself.) |
||||
# Also, ranger disables STDIN here, so interactive scripts won't work properly |
||||
|
||||
# Meanings of exit codes: |
||||
# code | meaning | action of ranger |
||||
# -----+------------+------------------------------------------- |
||||
# 0 | success | success. display stdout as preview |
||||
# 1 | no preview | failure. display no preview at all |
||||
# 2 | plain text | display the plain content of the file |
||||
# 3 | fix width | success. Don't reload when width changes |
||||
# 4 | fix height | success. Don't reload when height changes |
||||
# 5 | fix both | success. Don't ever reload |
||||
# 6 | image | success. display the image $cached points to as an image preview |
||||
# 7 | image | success. display the file directly as an image |
||||
|
||||
# Meaningful aliases for arguments: |
||||
path="$1" # Full path of the selected file |
||||
width="$2" # Width of the preview pane (number of fitting characters) |
||||
height="$3" # Height of the preview pane (number of fitting characters) |
||||
cached="$4" # Path that should be used to cache image previews |
||||
preview_images="$5" # "True" if image previews are enabled, "False" otherwise. |
||||
|
||||
maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln |
||||
|
||||
# Find out something about the file: |
||||
mimetype=$(file --mime-type -Lb "$path") |
||||
extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') |
||||
|
||||
# Functions: |
||||
# runs a command and saves its output into $output. Useful if you need |
||||
# the return value AND want to use the output in a pipe |
||||
try() { output=$(eval '"$@"'); } |
||||
|
||||
# writes the output of the previously used "try" command |
||||
dump() { /bin/echo "$output"; } |
||||
|
||||
# a common post-processing function used after most commands |
||||
trim() { head -n "$maxln"; } |
||||
|
||||
# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success |
||||
safepipe() { "$@"; test $? = 0 -o $? = 141; } |
||||
|
||||
# Image previews, if enabled in ranger. |
||||
if [ "$preview_images" = "True" ]; then |
||||
case "$mimetype" in |
||||
# Image previews for SVG files, disabled by default. |
||||
###image/svg+xml) |
||||
### convert "$path" "$cached" && exit 6 || exit 1;; |
||||
# Image previews for image files. w3mimgdisplay will be called for all |
||||
# image files (unless overriden as above), but might fail for |
||||
# unsupported types. |
||||
image/svg+xml) |
||||
inkscape -e "${cached//.png}" "$path" && exit 6;; |
||||
image/*) |
||||
exit 7;; |
||||
# Image preview for video, disabled by default.: |
||||
video/*) |
||||
ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; |
||||
application/pdf) |
||||
pdftoppm -jpeg -singlefile "$path" "${cached//.jpg}" && exit 6;; |
||||
esac |
||||
fi |
||||
|
||||
case "$extension" in |
||||
# Archive extensions: |
||||
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ |
||||
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) |
||||
try als "$path" && { dump | trim; exit 0; } |
||||
try acat "$path" && { dump | trim; exit 3; } |
||||
try bsdtar -lf "$path" && { dump | trim; exit 0; } |
||||
exit 1;; |
||||
rar) |
||||
# avoid password prompt by providing empty password |
||||
try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; |
||||
7z) |
||||
# avoid password prompt by providing empty password |
||||
try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; |
||||
# PDF documents: |
||||
pdf) |
||||
try pdftotext -l 10 -nopgbrk -q "$path" - && \ |
||||
{ dump | trim | fmt -s -w $width; exit 0; } || exit 1;; |
||||
# BitTorrent Files |
||||
torrent) |
||||
try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; |
||||
# ODT Files |
||||
#odt|ods|odp|sxw) |
||||
# try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; |
||||
# Try to get the text out of a document using libreoffice |
||||
odt|ods|odp|sxw|doc|docx|xls|xlsx|ppt|pptx) |
||||
try libreoffice --cat "$path" && { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; |
||||
# HTML Pages: |
||||
htm|html|xhtml) |
||||
try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } |
||||
try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } |
||||
try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } |
||||
;; # fall back to highlight/cat if the text browsers fail |
||||
esac |
||||
|
||||
case "$mimetype" in |
||||
# Syntax highlight for text files: |
||||
text/* | */xml) |
||||
if [ "$(tput colors)" -ge 256 ]; then |
||||
pygmentize_format=terminal256 |
||||
highlight_format=xterm256 |
||||
else |
||||
pygmentize_format=terminal |
||||
highlight_format=ansi |
||||
fi |
||||
try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } |
||||
try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } |
||||
exit 2;; |
||||
# Ascii-previews of images: |
||||
image/*) |
||||
img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; |
||||
# Display information about media files: |
||||
video/* | audio/*) |
||||
exiftool "$path" && exit 5 |
||||
# Use sed to remove spaces so the output fits into the narrow window |
||||
try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; |
||||
esac |
||||
|
||||
exit 1 |
@ -0,0 +1,81 @@ |
||||
[options] |
||||
scroll_on_output = false |
||||
scroll_on_keystroke = true |
||||
audible_bell = false |
||||
mouse_autohide = false |
||||
allow_bold = true |
||||
dynamic_title = true |
||||
urgent_on_bell = true |
||||
clickable_url = true |
||||
#font = Monospace 12 |
||||
#font = DejaVu Sans Mono for Powerline 12 |
||||
font = Ubuntu Mono derivative Powerline 15 |
||||
font = Roboto Mono for Powerline 12 |
||||
#font = Ubuntu Mono 15 |
||||
scrollback_lines = 10000 |
||||
search_wrap = true |
||||
#icon_name = terminal |
||||
#geometry = 640x480 |
||||
|
||||
# "system", "on" or "off" |
||||
cursor_blink = system |
||||
|
||||
# "block", "underline" or "ibeam" |
||||
cursor_shape = block |
||||
|
||||
# $BROWSER is used by default if set, with xdg-open as a fallback |
||||
#browser = xdg-open |
||||
|
||||
# set size hints for the window |
||||
#size_hints = false |
||||
|
||||
# Hide links that are no longer valid in url select overlay mode |
||||
filter_unmatched_urls = true |
||||
|
||||
# emit escape sequences for extra modified keys |
||||
#modify_other_keys = false |
||||
|
||||
[colors] |
||||
#cursor = #dcdccc |
||||
#cursor_foreground = #dcdccc |
||||
foreground = #dcdccc |
||||
foreground_bold = #ffffff |
||||
background = #3f3f3f |
||||
|
||||
# 20% background transparency (requires a compositor) |
||||
background = rgba(63, 63, 63, 0.95) |
||||
|
||||
# if unset, will reverse foreground and background |
||||
highlight = #2f2f2f |
||||
|
||||
# colors from color0 to color254 can be set |
||||
#color0 = #3f3f3f |
||||
#color1 = #705050 |
||||
#color2 = #60b48a |
||||
#color3 = #dfaf8f |
||||
#color4 = #506070 |
||||
#color5 = #dc8cc3 |
||||
#color6 = #8cd0d3 |
||||
#color7 = #dcdccc |
||||
#color8 = #709080 |
||||
#color9 = #dca3a3 |
||||
#color10 = #c3bf9f |
||||
#color11 = #f0dfaf |
||||
#This is the blue that ls used by default for folders |
||||
color12 = #94bff3 |
||||
#color13 = #ec93d3 |
||||
#color14 = #93e0e3 |
||||
#color15 = #ffffff |
||||
|
||||
[hints] |
||||
#font = Monospace 12 |
||||
#foreground = #dcdccc |
||||
#background = #3f3f3f |
||||
#active_foreground = #e68080 |
||||
#active_background = #3f3f3f |
||||
#padding = 2 |
||||
#border = #3f3f3f |
||||
#border_width = 0.5 |
||||
#roundness = 2.0 |
||||
|
||||
# vim: ft=dosini cms=#%s |
@ -0,0 +1,668 @@ |
||||
# Configuration file for dnsmasq. |
||||
# |
||||
# Format is one option per line, legal options are the same |
||||
# as the long options legal on the command line. See |
||||
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details. |
||||
|
||||
# Listen on this specific port instead of the standard DNS port |
||||
# (53). Setting this to zero completely disables DNS function, |
||||
# leaving only DHCP and/or TFTP. |
||||
#port=5353 |
||||
|
||||
# The following two options make you a better netizen, since they |
||||
# tell dnsmasq to filter out queries which the public DNS cannot |
||||
# answer, and which load the servers (especially the root servers) |
||||
# unnecessarily. If you have a dial-on-demand link they also stop |
||||
# these requests from bringing up the link unnecessarily. |
||||
|
||||
# Never forward plain names (without a dot or domain part) |
||||
#domain-needed |
||||
# Never forward addresses in the non-routed address spaces. |
||||
#bogus-priv |
||||
|
||||
# Uncomment these to enable DNSSEC validation and caching: |
||||
# (Requires dnsmasq to be built with DNSSEC option.) |
||||
#conf-file=/usr/share/dnsmasq/trust-anchors.conf |
||||
#dnssec |
||||
|
||||
# Replies which are not DNSSEC signed may be legitimate, because the domain |
||||
# is unsigned, or may be forgeries. Setting this option tells dnsmasq to |
||||
# check that an unsigned reply is OK, by finding a secure proof that a DS |
||||
# record somewhere between the root and the domain does not exist. |
||||
# The cost of setting this is that even queries in unsigned domains will need |
||||
# one or more extra DNS queries to verify. |
||||
#dnssec-check-unsigned |
||||
|
||||
# Uncomment this to filter useless windows-originated DNS requests |
||||
# which can trigger dial-on-demand links needlessly. |
||||
# Note that (amongst other things) this blocks all SRV requests, |
||||
# so don't use it if you use eg Kerberos, SIP, XMMP or Google-talk. |
||||
# This option only affects forwarding, SRV records originating for |
||||
# dnsmasq (via srv-host= lines) are not suppressed by it. |
||||
#filterwin2k |
||||
|
||||
# Change this line if you want dns to get its upstream servers from |
||||
# somewhere other that /etc/resolv.conf |
||||
#resolv-file= |
||||
|
||||
# By default, dnsmasq will send queries to any of the upstream |
||||
# servers it knows about and tries to favour servers to are known |
||||
# to be up. Uncommenting this forces dnsmasq to try each query |
||||
# with each server strictly in the order they appear in |
||||
# /etc/resolv.conf |
||||
#strict-order |
||||
|
||||
# If you don't want dnsmasq to read /etc/resolv.conf or any other |
||||
# file, getting its servers from this file instead (see below), then |
||||
# uncomment this. |
||||
#no-resolv |
||||
|
||||
# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv |
||||
# files for changes and re-read them then uncomment this. |
||||
#no-poll |
||||
|
||||
# Add other name servers here, with domain specs if they are for |
||||
# non-public domains. |
||||
#server=/localnet/192.168.0.1 |
||||
|
||||
# Example of routing PTR queries to nameservers: this will send all |
||||
# address->name queries for 192.168.3/24 to nameserver 10.1.2.3 |
||||
#server=/3.168.192.in-addr.arpa/10.1.2.3 |
||||
|
||||
# Add local-only domains here, queries in these domains are answered |
||||
# from /etc/hosts or DHCP only. |
||||
#local=/localnet/ |
||||
|
||||
# Add domains which you want to force to an IP address here. |
||||
# The example below send any host in double-click.net to a local |
||||
# web-server. |
||||
#address=/double-click.net/127.0.0.1 |
||||
address=/.localhost/127.0.0.1 |
||||
|
||||
# --address (and --server) work with IPv6 addresses too. |
||||
#address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83 |
||||
|
||||
# Add the IPs of all queries to yahoo.com, google.com, and their |
||||
# subdomains to the vpn and search ipsets: |
||||
#ipset=/yahoo.com/google.com/vpn,search |
||||
|
||||
# You can control how dnsmasq talks to a server: this forces |
||||
# queries to 10.1.2.3 to be routed via eth1 |
||||
# server=10.1.2.3@eth1 |
||||
|
||||
# and this sets the source (ie local) address used to talk to |
||||
# 10.1.2.3 to 192.168.1.1 port 55 (there must be a interface with that |
||||
# IP on the machine, obviously). |
||||
# server=10.1.2.3@192.168.1.1#55 |
||||
|
||||
# If you want dnsmasq to change uid and gid to something other |
||||
# than the default, edit the following lines. |
||||
#user= |
||||
#group= |
||||
|
||||
# If you want dnsmasq to listen for DHCP and DNS requests only on |
||||
# specified interfaces (and the loopback) give the name of the |
||||
# interface (eg eth0) here. |
||||
# Repeat the line for more than one interface. |
||||
#interface= |
||||
# Or you can specify which interface _not_ to listen on |
||||
#except-interface= |
||||
# Or which to listen on by address (remember to include 127.0.0.1 if |
||||
# you use this.) |
||||
#listen-address= |
||||
listen-address=127.0.0.1 |
||||
# If you want dnsmasq to provide only DNS service on an interface, |
||||
# configure it as shown above, and then use the following line to |
||||
# disable DHCP and TFTP on it. |
||||
#no-dhcp-interface= |
||||
|
||||
# On systems which support it, dnsmasq binds the wildcard address, |
||||
# even when it is listening on only some interfaces. It then discards |
||||
# requests that it shouldn't reply to. This has the advantage of |
||||
# working even when interfaces come and go and change address. If you |
||||
# want dnsmasq to really bind only the interfaces it is listening on, |
||||
# uncomment this option. About the only time you may need this is when |
||||
# running another nameserver on the same machine. |
||||
#bind-interfaces |
||||
|
||||
# If you don't want dnsmasq to read /etc/hosts, uncomment the |
||||
# following line. |
||||
#no-hosts |
||||
# or if you want it to read another file, as well as /etc/hosts, use |
||||
# this. |
||||
#addn-hosts=/etc/banner_add_hosts |
||||
|
||||
# Set this (and domain: see below) if you want to have a domain |
||||
# automatically added to simple names in a hosts-file. |
||||
#expand-hosts |
||||
|
||||
# Set the domain for dnsmasq. this is optional, but if it is set, it |
||||
# does the following things. |
||||
# 1) Allows DHCP hosts to have fully qualified domain names, as long |
||||
# as the domain part matches this setting. |
||||
# 2) Sets the "domain" DHCP option thereby potentially setting the |
||||
# domain of all systems configured by DHCP |
||||
# 3) Provides the domain part for "expand-hosts" |
||||
#domain=thekelleys.org.uk |
||||
|
||||
# Set a different domain for a particular subnet |
||||
#domain=wireless.thekelleys.org.uk,192.168.2.0/24 |
||||
|
||||
# Same idea, but range rather then subnet |
||||
#domain=reserved.thekelleys.org.uk,192.68.3.100,192.168.3.200 |
||||
|
||||
# Uncomment this to enable the integrated DHCP server, you need |
||||
# to supply the range of addresses available for lease and optionally |
||||
# a lease time. If you have more than one network, you will need to |
||||
# repeat this for each network on which you want to supply DHCP |
||||
# service. |
||||
#dhcp-range=192.168.0.50,192.168.0.150,12h |
||||
|
||||
# This is an example of a DHCP range where the netmask is given. This |
||||
# is needed for networks we reach the dnsmasq DHCP server via a relay |
||||
# agent. If you don't know what a DHCP relay agent is, you probably |
||||
# don't need to worry about this. |
||||
#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h |
||||
|
||||
# This is an example of a DHCP range which sets a tag, so that |
||||
# some DHCP options may be set only for this network. |
||||
#dhcp-range=set:red,192.168.0.50,192.168.0.150 |
||||
|
||||
# Use this DHCP range only when the tag "green" is set. |
||||
#dhcp-range=tag:green,192.168.0.50,192.168.0.150,12h |
||||
|
||||
# Specify a subnet which can't be used for dynamic address allocation, |
||||
# is available for hosts with matching --dhcp-host lines. Note that |
||||
# dhcp-host declarations will be ignored unless there is a dhcp-range |
||||
# of some type for the subnet in question. |
||||
# In this case the netmask is implied (it comes from the network |
||||
# configuration on the machine running dnsmasq) it is possible to give |
||||
# an explicit netmask instead. |
||||
#dhcp-range=192.168.0.0,static |
||||
|
||||
# Enable DHCPv6. Note that the prefix-length does not need to be specified |
||||
# and defaults to 64 if missing/ |
||||
#dhcp-range=1234::2, 1234::500, 64, 12h |
||||
|
||||
# Do Router Advertisements, BUT NOT DHCP for this subnet. |
||||
#dhcp-range=1234::, ra-only |
||||
|
||||
# Do Router Advertisements, BUT NOT DHCP for this subnet, also try and |
||||
# add names to the DNS for the IPv6 address of SLAAC-configured dual-stack |
||||
# hosts. Use the DHCPv4 lease to derive the name, network segment and |
||||
# MAC address and assume that the host will also have an |
||||
# IPv6 address calculated using the SLAAC alogrithm. |
||||
#dhcp-range=1234::, ra-names |
||||
|
||||
# Do Router Advertisements, BUT NOT DHCP for this subnet. |
||||
# Set the lifetime to 46 hours. (Note: minimum lifetime is 2 hours.) |
||||
#dhcp-range=1234::, ra-only, 48h |
||||
|
||||
# Do DHCP and Router Advertisements for this subnet. Set the A bit in the RA |
||||
# so that clients can use SLAAC addresses as well as DHCP ones. |
||||
#dhcp-range=1234::2, 1234::500, slaac |
||||
|
||||
# Do Router Advertisements and stateless DHCP for this subnet. Clients will |
||||
# not get addresses from DHCP, but they will get other configuration information. |
||||
# They will use SLAAC for addresses. |
||||
#dhcp-range=1234::, ra-stateless |
||||
|
||||
# Do stateless DHCP, SLAAC, and generate DNS names for SLAAC addresses |
||||
# from DHCPv4 leases. |
||||
#dhcp-range=1234::, ra-stateless, ra-names |
||||
|
||||
# Do router advertisements for all subnets where we're doing DHCPv6 |
||||
# Unless overriden by ra-stateless, ra-names, et al, the router |
||||
# advertisements will have the M and O bits set, so that the clients |
||||
# get addresses and configuration from DHCPv6, and the A bit reset, so the |
||||
# clients don't use SLAAC addresses. |
||||
#enable-ra |
||||
|
||||
# Supply parameters for specified hosts using DHCP. There are lots |
||||
# of valid alternatives, so we will give examples of each. Note that |
||||
# IP addresses DO NOT have to be in the range given above, they just |
||||
# need to be on the same network. The order of the parameters in these |
||||
# do not matter, it's permissible to give name, address and MAC in any |
||||
# order. |
||||
|
||||
# Always allocate the host with Ethernet address 11:22:33:44:55:66 |
||||
# The IP address 192.168.0.60 |
||||
#dhcp-host=11:22:33:44:55:66,192.168.0.60 |
||||
|
||||
# Always set the name of the host with hardware address |
||||
# 11:22:33:44:55:66 to be "fred" |
||||
#dhcp-host=11:22:33:44:55:66,fred |
||||
|
||||
# Always give the host with Ethernet address 11:22:33:44:55:66 |
||||
# the name fred and IP address 192.168.0.60 and lease time 45 minutes |
||||
#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m |
||||
|
||||
# Give a host with Ethernet address 11:22:33:44:55:66 or |
||||
# 12:34:56:78:90:12 the IP address 192.168.0.60. Dnsmasq will assume |
||||
# that these two Ethernet interfaces will never be in use at the same |
||||
# time, and give the IP address to the second, even if it is already |
||||
# in use by the first. Useful for laptops with wired and wireless |
||||
# addresses. |
||||
#dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.60 |
||||
|
||||
# Give the machine which says its name is "bert" IP address |
||||
# 192.168.0.70 and an infinite lease |
||||
#dhcp-host=bert,192.168.0.70,infinite |
||||
|
||||
# Always give the host with client identifier 01:02:02:04 |
||||
# the IP address 192.168.0.60 |
||||
#dhcp-host=id:01:02:02:04,192.168.0.60 |
||||
|
||||
# Always give the Infiniband interface with hardware address |
||||
# 80:00:00:48:fe:80:00:00:00:00:00:00:f4:52:14:03:00:28:05:81 the |
||||
# ip address 192.168.0.61. The client id is derived from the prefix |
||||
# ff:00:00:00:00:00:02:00:00:02:c9:00 and the last 8 pairs of |
||||
# hex digits of the hardware address. |
||||
#dhcp-host=id:ff:00:00:00:00:00:02:00:00:02:c9:00:f4:52:14:03:00:28:05:81,192.168.0.61 |
||||
|
||||
# Always give the host with client identifier "marjorie" |
||||
# the IP address 192.168.0.60 |
||||
#dhcp-host=id:marjorie,192.168.0.60 |
||||
|
||||
# Enable the address given for "judge" in /etc/hosts |
||||
# to be given to a machine presenting the name "judge" when |
||||
# it asks for a DHCP lease. |
||||
#dhcp-host=judge |
||||
|
||||
# Never offer DHCP service to a machine whose Ethernet |
||||
# address is 11:22:33:44:55:66 |
||||
#dhcp-host=11:22:33:44:55:66,ignore |
||||
|
||||
# Ignore any client-id presented by the machine with Ethernet |
||||
# address 11:22:33:44:55:66. This is useful to prevent a machine |
||||
# being treated differently when running under different OS's or |
||||
# between PXE boot and OS boot. |
||||
#dhcp-host=11:22:33:44:55:66,id:* |
||||
|
||||
# Send extra options which are tagged as "red" to |
||||
# the machine with Ethernet address 11:22:33:44:55:66 |
||||
#dhcp-host=11:22:33:44:55:66,set:red |
||||
|
||||
# Send extra options which are tagged as "red" to |
||||
# any machine with Ethernet address starting 11:22:33: |
||||
#dhcp-host=11:22:33:*:*:*,set:red |
||||
|
||||
# Give a fixed IPv6 address and name to client with |
||||
# DUID 00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2 |
||||
# Note the MAC addresses CANNOT be used to identify DHCPv6 clients. |
||||
# Note also the they [] around the IPv6 address are obilgatory. |
||||
#dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5] |
||||
|
||||
# Ignore any clients which are not specified in dhcp-host lines |
||||
# or /etc/ethers. Equivalent to ISC "deny unknown-clients". |
||||
# This relies on the special "known" tag which is set when |
||||
# a host is matched. |
||||
#dhcp-ignore=tag:!known |
||||
|
||||
# Send extra options which are tagged as "red" to any machine whose |
||||
# DHCP vendorclass string includes the substring "Linux" |
||||
#dhcp-vendorclass=set:red,Linux |
||||
|
||||
# Send extra options which are tagged as "red" to any machine one |
||||
# of whose DHCP userclass strings includes the substring "accounts" |
||||
#dhcp-userclass=set:red,accounts |
||||
|
||||
# Send extra options which are tagged as "red" to any machine whose |
||||
# MAC address matches the pattern. |
||||
#dhcp-mac=set:red,00:60:8C:*:*:* |
||||
|
||||
# If this line is uncommented, dnsmasq will read /etc/ethers and act |
||||
# on the ethernet-address/IP pairs found there just as if they had |
||||
# been given as --dhcp-host options. Useful if you keep |
||||
# MAC-address/host mappings there for other purposes. |
||||
#read-ethers |
||||
|
||||
# Send options to hosts which ask for a DHCP lease. |
||||
# See RFC 2132 for details of available options. |
||||
# Common options can be given to dnsmasq by name: |
||||
# run "dnsmasq --help dhcp" to get a list. |
||||
# Note that all the common settings, such as netmask and |
||||
# broadcast address, DNS server and default route, are given |
||||
# sane defaults by dnsmasq. You very likely will not need |
||||
# any dhcp-options. If you use Windows clients and Samba, there |
||||
# are some options which are recommended, they are detailed at the |
||||
# end of this section. |
||||
|
||||
# Override the default route supplied by dnsmasq, which assumes the |
||||
# router is the same machine as the one running dnsmasq. |
||||
#dhcp-option=3,1.2.3.4 |
||||
|
||||
# Do the same thing, but using the option name |
||||
#dhcp-option=option:router,1.2.3.4 |
||||
|
||||
# Override the default route supplied by dnsmasq and send no default |
||||
# route at all. Note that this only works for the options sent by |
||||
# default (1, 3, 6, 12, 28) the same line will send a zero-length option |
||||
# for all other option numbers. |
||||
#dhcp-option=3 |
||||
|
||||
# Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5 |
||||
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5 |
||||
|
||||
# Send DHCPv6 option. Note [] around IPv6 addresses. |
||||
#dhcp-option=option6:dns-server,[1234::77],[1234::88] |
||||
|
||||
# Send DHCPv6 option for namservers as the machine running |
||||
# dnsmasq and another. |
||||
#dhcp-option=option6:dns-server,[::],[1234::88] |
||||
|
||||
# Ask client to poll for option changes every six hours. (RFC4242) |
||||
#dhcp-option=option6:information-refresh-time,6h |
||||
|
||||
# Set option 58 client renewal time (T1). Defaults to half of the |
||||
# lease time if not specified. (RFC2132) |
||||
#dhcp-option=option:T1:1m |
||||
|
||||
# Set option 59 rebinding time (T2). Defaults to 7/8 of the |
||||
# lease time if not specified. (RFC2132) |
||||
#dhcp-option=option:T2:2m |
||||
|
||||
# Set the NTP time server address to be the same machine as |
||||
# is running dnsmasq |
||||
#dhcp-option=42,0.0.0.0 |
||||
|
||||
# Set the NIS domain name to "welly" |
||||
#dhcp-option=40,welly |
||||
|
||||
# Set the default time-to-live to 50 |
||||
#dhcp-option=23,50 |
||||
|
||||
# Set the "all subnets are local" flag |
||||
#dhcp-option=27,1 |
||||
|
||||
# Send the etherboot magic flag and then etherboot options (a string). |
||||
#dhcp-option=128,e4:45:74:68:00:00 |
||||
#dhcp-option=129,NIC=eepro100 |
||||
|
||||
# Specify an option which will only be sent to the "red" network |
||||
# (see dhcp-range for the declaration of the "red" network) |
||||
# Note that the tag: part must precede the option: part. |
||||
#dhcp-option = tag:red, option:ntp-server, 192.168.1.1 |
||||
|
||||
# The following DHCP options set up dnsmasq in the same way as is specified |
||||
# for the ISC dhcpcd in |
||||
# http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt |
||||
# adapted for a typical dnsmasq installation where the host running |
||||
# dnsmasq is also the host running samba. |
||||
# you may want to uncomment some or all of them if you use |
||||
# Windows clients and Samba. |
||||
#dhcp-option=19,0 # option ip-forwarding off |
||||
#dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s) |
||||
#dhcp-option=45,0.0.0.0 # netbios datagram distribution server |
||||
#dhcp-option=46,8 # netbios node type |
||||
|
||||
# Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave. |
||||
#dhcp-option=252,"\n" |
||||
|
||||
# Send RFC-3397 DNS domain search DHCP option. WARNING: Your DHCP client |
||||
# probably doesn't support this...... |
||||
#dhcp-option=option:domain-search,eng.apple.com,marketing.apple.com |
||||
|
||||
# Send RFC-3442 classless static routes (note the netmask encoding) |
||||
#dhcp-option=121,192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8 |
||||
|
||||
# Send vendor-class specific options encapsulated in DHCP option 43. |
||||
# The meaning of the options is defined by the vendor-class so |
||||
# options are sent only when the client supplied vendor class |
||||
# matches the class given here. (A substring match is OK, so "MSFT" |
||||
# matches "MSFT" and "MSFT 5.0"). This example sets the |
||||
# mtftp address to 0.0.0.0 for PXEClients. |
||||
#dhcp-option=vendor:PXEClient,1,0.0.0.0 |
||||
|
||||
# Send microsoft-specific option to tell windows to release the DHCP lease |
||||
# when it shuts down. Note the "i" flag, to tell dnsmasq to send the |
||||
# value as a four-byte integer - that's what microsoft wants. See |
||||
# http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true |
||||
#dhcp-option=vendor:MSFT,2,1i |
||||
|
||||
# Send the Encapsulated-vendor-class ID needed by some configurations of |
||||
# Etherboot to allow is to recognise the DHCP server. |
||||
#dhcp-option=vendor:Etherboot,60,"Etherboot" |
||||
|
||||
# Send options to PXELinux. Note that we need to send the options even |
||||
# though they don't appear in the parameter request list, so we need |
||||
# to use dhcp-option-force here. |
||||
# See http://syslinux.zytor.com/pxe.php#special for details. |
||||
# Magic number - needed before anything else is recognised |
||||
#dhcp-option-force=208,f1:00:74:7e |
||||
# Configuration file name |
||||
#dhcp-option-force=209,configs/common |
||||
# Path prefix |
||||
#dhcp-option-force=210,/tftpboot/pxelinux/files/ |
||||
# Reboot time. (Note 'i' to send 32-bit value) |
||||
#dhcp-option-force=211,30i |
||||
|
||||
# Set the boot filename for netboot/PXE. You will only need |
||||
# this is you want to boot machines over the network and you will need |
||||
# a TFTP server; either dnsmasq's built in TFTP server or an |
||||
# external one. (See below for how to enable the TFTP server.) |
||||
#dhcp-boot=pxelinux.0 |
||||
|
||||
# The same as above, but use custom tftp-server instead machine running dnsmasq |
||||
#dhcp-boot=pxelinux,server.name,192.168.1.100 |
||||
|
||||
# Boot for Etherboot gPXE. The idea is to send two different |
||||
# filenames, the first loads gPXE, and the second tells gPXE what to |
||||
# load. The dhcp-match sets the gpxe tag for requests from gPXE. |
||||
#dhcp-match=set:gpxe,175 # gPXE sends a 175 option. |
||||
#dhcp-boot=tag:!gpxe,undionly.kpxe |
||||
#dhcp-boot=mybootimage |
||||
|
||||
# Encapsulated options for Etherboot gPXE. All the options are |
||||
# encapsulated within option 175 |
||||
#dhcp-option=encap:175, 1, 5b # priority code |
||||
#dhcp-option=encap:175, 176, 1b # no-proxydhcp |
||||
#dhcp-option=encap:175, 177, string # bus-id |
||||
#dhcp-option=encap:175, 189, 1b # BIOS drive code |
||||
#dhcp-option=encap:175, 190, user # iSCSI username |
||||
#dhcp-option=encap:175, 191, pass # iSCSI password |
||||
|
||||
# Test for the architecture of a netboot client. PXE clients are |
||||
# supposed to send their architecture as option 93. (See RFC 4578) |
||||
#dhcp-match=peecees, option:client-arch, 0 #x86-32 |
||||
#dhcp-match=itanics, option:client-arch, 2 #IA64 |
||||
#dhcp-match=hammers, option:client-arch, 6 #x86-64 |
||||
#dhcp-match=mactels, option:client-arch, 7 #EFI x86-64 |
||||
|
||||
# Do real PXE, rather than just booting a single file, this is an |
||||
# alternative to dhcp-boot. |
||||
#pxe-prompt="What system shall I netboot?" |
||||
# or with timeout before first available action is taken: |
||||
#pxe-prompt="Press F8 for menu.", 60 |
||||
|
||||
# Available boot services. for PXE. |
||||
#pxe-service=x86PC, "Boot from local disk" |
||||
|
||||
# Loads <tftp-root>/pxelinux.0 from dnsmasq TFTP server. |
||||
#pxe-service=x86PC, "Install Linux", pxelinux |
||||
|
||||
# Loads <tftp-root>/pxelinux.0 from TFTP server at 1.2.3.4. |
||||
# Beware this fails on old PXE ROMS. |
||||
#pxe-service=x86PC, "Install Linux", pxelinux, 1.2.3.4 |
||||
|
||||
# Use bootserver on network, found my multicast or broadcast. |
||||
#pxe-service=x86PC, "Install windows from RIS server", 1 |
||||
|
||||
# Use bootserver at a known IP address. |
||||
#pxe-service=x86PC, "Install windows from RIS server", 1, 1.2.3.4 |
||||
|
||||
# If you have multicast-FTP available, |
||||
# information for that can be passed in a similar way using options 1 |
||||
# to 5. See page 19 of |
||||
# http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf |
||||
|
||||
|
||||
# Enable dnsmasq's built-in TFTP server |
||||
#enable-tftp |
||||
|
||||
# Set the root directory for files available via FTP. |
||||
#tftp-root=/var/ftpd |
||||
|
||||
# Do not abort if the tftp-root is unavailable |
||||
#tftp-no-fail |
||||
|
||||
# Make the TFTP server more secure: with this set, only files owned by |
||||
# the user dnsmasq is running as will be send over the net. |
||||
#tftp-secure |
||||
|
||||
# This option stops dnsmasq from negotiating a larger blocksize for TFTP |
||||
# transfers. It will slow things down, but may rescue some broken TFTP |
||||
# clients. |
||||
#tftp-no-blocksize |
||||
|
||||
# Set the boot file name only when the "red" tag is set. |
||||
#dhcp-boot=tag:red,pxelinux.red-net |
||||
|
||||
# An example of dhcp-boot with an external TFTP server: the name and IP |
||||
# address of the server are given after the filename. |
||||
# Can fail with old PXE ROMS. Overridden by --pxe-service. |
||||
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3 |
||||
|
||||
# If there are multiple external tftp servers having a same name |
||||
# (using /etc/hosts) then that name can be specified as the |
||||
# tftp_servername (the third option to dhcp-boot) and in that |
||||
# case dnsmasq resolves this name and returns the resultant IP |
||||
# addresses in round robin fasion. This facility can be used to |
||||
# load balance the tftp load among a set of servers. |
||||
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name |
||||
|
||||
# Set the limit on DHCP leases, the default is 150 |
||||
#dhcp-lease-max=150 |
||||
|
||||
# The DHCP server needs somewhere on disk to keep its lease database. |
||||
# This defaults to a sane location, but if you want to change it, use |
||||
# the line below. |
||||
#dhcp-leasefile=/var/lib/misc/dnsmasq.leases |
||||
|
||||
# Set the DHCP server to authoritative mode. In this mode it will barge in |
||||
# and take over the lease for any client which broadcasts on the network, |
||||
# whether it has a record of the lease or not. This avoids long timeouts |
||||
# when a machine wakes up on a new network. DO NOT enable this if there's |
||||
# the slightest chance that you might end up accidentally configuring a DHCP |
||||
# server for your campus/company accidentally. The ISC server uses |
||||
# the same option, and this URL provides more information: |
||||
# http://www.isc.org/files/auth.html |
||||
#dhcp-authoritative |
||||
|
||||
# Run an executable when a DHCP lease is created or destroyed. |
||||
# The arguments sent to the script are "add" or "del", |
||||
# then the MAC address, the IP address and finally the hostname |
||||
# if there is one. |
||||
#dhcp-script=/bin/echo |
||||
|
||||
# Set the cachesize here. |
||||
#cache-size=150 |
||||
|
||||
# If you want to disable negative caching, uncomment this. |
||||
#no-negcache |
||||
|
||||
# Normally responses which come from /etc/hosts and the DHCP lease |
||||
# file have Time-To-Live set as zero, which conventionally means |
||||
# do not cache further. If you are happy to trade lower load on the |
||||
# server for potentially stale date, you can set a time-to-live (in |
||||
# seconds) here. |
||||
#local-ttl= |
||||
|
||||
# If you want dnsmasq to detect attempts by Verisign to send queries |
||||
# to unregistered .com and .net hosts to its sitefinder service and |
||||
# have dnsmasq instead return the correct NXDOMAIN response, uncomment |
||||
# this line. You can add similar lines to do the same for other |
||||
# registries which have implemented wildcard A records. |
||||
#bogus-nxdomain=64.94.110.11 |
||||
|
||||
# If you want to fix up DNS results from upstream servers, use the |
||||
# alias option. This only works for IPv4. |
||||
# This alias makes a result of 1.2.3.4 appear as 5.6.7.8 |
||||
#alias=1.2.3.4,5.6.7.8 |
||||
# and this maps 1.2.3.x to 5.6.7.x |
||||
#alias=1.2.3.0,5.6.7.0,255.255.255.0 |
||||
# and this maps 192.168.0.10->192.168.0.40 to 10.0.0.10->10.0.0.40 |
||||
#alias=192.168.0.10-192.168.0.40,10.0.0.0,255.255.255.0 |
||||
|
||||
# Change these lines if you want dnsmasq to serve MX records. |
||||
|
||||
# Return an MX record named "maildomain.com" with target |
||||
# servermachine.com and preference 50 |
||||
#mx-host=maildomain.com,servermachine.com,50 |
||||
|
||||
# Set the default target for MX records created using the localmx option. |
||||
#mx-target=servermachine.com |
||||
|
||||
# Return an MX record pointing to the mx-target for all local |
||||
# machines. |
||||
#localmx |
||||
|
||||
# Return an MX record pointing to itself for all local machines. |
||||
#selfmx |
||||
|
||||
# Change the following lines if you want dnsmasq to serve SRV |
||||
# records. These are useful if you want to serve ldap requests for |
||||
# Active Directory and other windows-originated DNS requests. |
||||
# See RFC 2782. |
||||
# You may add multiple srv-host lines. |
||||
# The fields are <name>,<target>,<port>,<priority>,<weight> |
||||
# If the domain part if missing from the name (so that is just has the |
||||
# service and protocol sections) then the domain given by the domain= |
||||
# config option is used. (Note that expand-hosts does not need to be |
||||
# set for this to work.) |
||||
|
||||
# A SRV record sending LDAP for the example.com domain to |
||||
# ldapserver.example.com port 389 |
||||
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389 |
||||
|
||||
# A SRV record sending LDAP for the example.com domain to |
||||
# ldapserver.example.com port 389 (using domain=) |
||||
#domain=example.com |
||||
#srv-host=_ldap._tcp,ldapserver.example.com,389 |
||||
|
||||
# Two SRV records for LDAP, each with different priorities |
||||
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,1 |
||||
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,2 |
||||
|
||||
# A SRV record indicating that there is no LDAP server for the domain |
||||
# example.com |
||||
#srv-host=_ldap._tcp.example.com |
||||
|
||||
# The following line shows how to make dnsmasq serve an arbitrary PTR |
||||
# record. This is useful for DNS-SD. (Note that the |
||||
# domain-name expansion done for SRV records _does_not |
||||
# occur for PTR records.) |
||||
#ptr-record=_http._tcp.dns-sd-services,"New Employee Page._http._tcp.dns-sd-services" |
||||
|
||||
# Change the following lines to enable dnsmasq to serve TXT records. |
||||
# These are used for things like SPF and zeroconf. (Note that the |
||||
# domain-name expansion done for SRV records _does_not |
||||
# occur for TXT records.) |
||||
|
||||
#Example SPF. |
||||
#txt-record=example.com,"v=spf1 a -all" |
||||
|
||||
#Example zeroconf |
||||
#txt-record=_http._tcp.example.com,name=value,paper=A4 |
||||
|
||||
# Provide an alias for a "local" DNS name. Note that this _only_ works |
||||
# for targets which are names from DHCP or /etc/hosts. Give host |
||||
# "bert" another name, bertrand |
||||
#cname=bertand,bert |
||||
|
||||
# For debugging purposes, log each DNS query as it passes through |
||||
# dnsmasq. |
||||
#log-queries |
||||
|
||||
# Log lots of extra information about DHCP transactions. |
||||
#log-dhcp |
||||
|
||||
# Include another lot of configuration options. |
||||
#conf-file=/etc/dnsmasq.more.conf |
||||
#conf-dir=/etc/dnsmasq.d |
||||
|
||||
# Include all the files in a directory except those ending in .bak |
||||
#conf-dir=/etc/dnsmasq.d,.bak |
||||
|
||||
# Include all files in a directory which end in .conf |
||||
#conf-dir=/etc/dnsmasq.d/,*.conf |
@ -0,0 +1,101 @@ |
||||
# |
||||
# /etc/pacman.conf |
||||
# |
||||
# See the pacman.conf(5) manpage for option and repository directives |
||||
|
||||
# |
||||
# GENERAL OPTIONS |
||||
# |
||||
[options] |
||||
# The following paths are commented out with their default values listed. |
||||
# If you wish to use different paths, uncomment and update the paths. |
||||
#RootDir = / |
||||
#DBPath = /var/lib/pacman/ |
||||
#CacheDir = /var/cache/pacman/pkg/ |
||||
#LogFile = /var/log/pacman.log |
||||
#GPGDir = /etc/pacman.d/gnupg/ |
||||
#HookDir = /etc/pacman.d/hooks/ |
||||
HoldPkg = pacman glibc |
||||
#XferCommand = /usr/bin/curl -C - -f %u > %o |
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u |
||||
#CleanMethod = KeepInstalled |
||||
#UseDelta = 0.7 |
||||
Architecture = auto |
||||
|
||||
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup |
||||
#IgnorePkg = |
||||
#IgnoreGroup = |
||||
|
||||
#NoUpgrade = |
||||
#NoExtract = |
||||
|
||||
# Misc options |
||||
#UseSyslog |
||||
Color |
||||
#TotalDownload |
||||
CheckSpace |
||||
#VerbosePkgLists |
||||
ILoveCandy |
||||
|
||||
# By default, pacman accepts packages signed by keys that its local keyring |
||||
# trusts (see pacman-key and its man page), as well as unsigned packages. |
||||
SigLevel = Required DatabaseOptional |
||||
LocalFileSigLevel = Optional |
||||
#RemoteFileSigLevel = Required |
||||
|
||||
# NOTE: You must run `pacman-key --init` before first using pacman; the local |
||||
# keyring can then be populated with the keys of all official Arch Linux |
||||
# packagers with `pacman-key --populate archlinux`. |
||||
|
||||
# |
||||
# REPOSITORIES |
||||
# - can be defined here or included from another file |
||||
# - pacman will search repositories in the order defined here |
||||
# - local/custom mirrors can be added here or in separate files |
||||
# - repositories listed first will take precedence when packages |
||||
# have identical names, regardless of version number |
||||
# - URLs will have $repo replaced by the name of the current repo |
||||
# - URLs will have $arch replaced by the name of the architecture |
||||
# |
||||
# Repository entries are of the format: |
||||
# [repo-name] |
||||
# Server = ServerName |
||||
# Include = IncludePath |
||||
# |
||||
# The header [repo-name] is crucial - it must be present and |
||||
# uncommented to enable the repo. |
||||
# |
||||
|
||||
# The testing repositories are disabled by default. To enable, uncomment the |
||||
# repo name header and Include lines. You can add preferred servers immediately |
||||
# after the header, and they will be used before the default mirrors. |
||||
|
||||
#[testing] |
||||
#Include = /etc/pacman.d/mirrorlist |
||||
|
||||
[core] |
||||
Include = /etc/pacman.d/mirrorlist |
||||
|
||||
[extra] |
||||
Include = /etc/pacman.d/mirrorlist |
||||
|
||||
#[community-testing] |
||||
#Include = /etc/pacman.d/mirrorlist |
||||
|
||||
[community] |
||||
Include = /etc/pacman.d/mirrorlist |
||||
|
||||
# If you want to run 32 bit applications on your x86_64 system, |
||||
# enable the multilib repositories as required here. |
||||
|
||||
#[multilib-testing] |
||||
#Include = /etc/pacman.d/mirrorlist |
||||
|
||||
#[multilib] |
||||
Include = /etc/pacman.d/mirrorlist |
||||
|
||||
# An example of a custom package repository. See the pacman manpage for |
||||
# tips on creating your own repositories. |
||||
#[custom] |
||||
#SigLevel = Optional TrustAll |
||||
#Server = file:///home/custompkgs |
@ -0,0 +1,16 @@ |
||||
[user] |
||||
email = jonathan@lunarweb.co.uk |
||||
name = Jonathan Hodgson |
||||
[core] |
||||
editor = vim |
||||
[status] |
||||
submoduleSummary = true |
||||
[alias] |
||||
#lol = log --graph --decorate --pretty=oneline --abbrev-commit |
||||
lol = log --graph --pretty=format:\"%C(yellow)%h %C(blue)%cd %C(green)%cn %C(white) - %s\" --date=format:\"%d/%m/%Y %H:%M:%S\" |
||||
#lola = log --graph --decorate --pretty=oneline --abbrev-commit --all |
||||
lola = log --graph --pretty=format:\"%C(yellow)%h %C(blue)%cd %C(green)%cn %C(white) - %s\" --date=format:\"%d/%m/%Y %H:%M:%S\" --all |
||||
ilog = recall |
||||
detach = "!git checkout $(git rev-parse HEAD)" |
||||
undo = reset --soft HEAD^ |
||||
|
@ -0,0 +1,93 @@ |
||||
# |
||||
# Directives controlling the display of server-generated directory listings. |
||||
# |
||||
# Required modules: mod_authz_core, mod_authz_host, |
||||
# mod_autoindex, mod_alias |
||||
# |
||||
# To see the listing of a directory, the Options directive for the |
||||
# directory must include "Indexes", and the directory must not contain |
||||
# a file matching those listed in the DirectoryIndex directive. |
||||
# |
||||
|
||||
# |
||||
# IndexOptions: Controls the appearance of server-generated directory |
||||
# listings. |
||||
# |
||||
IndexOptions FancyIndexing HTMLTable VersionSort |
||||
|
||||
# We include the /icons/ alias for FancyIndexed directory listings. If |
||||
# you do not use FancyIndexing, you may comment this out. |
||||
# |
||||
Alias /icons/ "/opt/lampp/icons/" |
||||
|
||||
<Directory "/opt/lampp/icons"> |
||||
Options Indexes MultiViews |
||||
AllowOverride None |
||||
Require all granted |
||||
</Directory> |
||||
|
||||
# |
||||
# AddIcon* directives tell the server which icon to show for different |
||||
# files or filename extensions. These are only displayed for |
||||
# FancyIndexed directories. |
||||
# |
||||
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip |
||||
|
||||
AddIconByType (TXT,/icons/text.gif) text/* |
||||
AddIconByType (IMG,/icons/image2.gif) image/* |
||||
AddIconByType (SND,/icons/sound2.gif) audio/* |
||||
AddIconByType (VID,/icons/movie.gif) video/* |
||||
|
||||
AddIcon /icons/binary.gif .bin .exe |
||||
AddIcon /icons/binhex.gif .hqx |
||||
AddIcon /icons/tar.gif .tar |
||||
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv |
||||
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip |
||||
AddIcon /icons/a.gif .ps .ai .eps |
||||
AddIcon /icons/layout.gif .html .shtml .htm .pdf |
||||
AddIcon /icons/text.gif .txt |
||||
AddIcon /icons/c.gif .c |
||||
AddIcon /icons/p.gif .pl .py |
||||
AddIcon /icons/f.gif .for |
||||
AddIcon /icons/dvi.gif .dvi |
||||
AddIcon /icons/uuencoded.gif .uu |
||||
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl |
||||
AddIcon /icons/tex.gif .tex |
||||
AddIcon /icons/bomb.gif core |
||||
|
||||
AddIcon /icons/back.gif .. |
||||
AddIcon /icons/hand.right.gif README |
||||
AddIcon /icons/folder.gif ^^DIRECTORY^^ |
||||
AddIcon /icons/blank.gif ^^BLANKICON^^ |
||||
|
||||
# |
||||
# DefaultIcon is which icon to show for files which do not have an icon |
||||
# explicitly set. |
||||
# |
||||
DefaultIcon /icons/unknown.gif |
||||
|
||||
# |
||||
# AddDescription allows you to place a short description after a file in |
||||
# server-generated indexes. These are only displayed for FancyIndexed |
||||
# directories. |
||||
# Format: AddDescription "description" filename |
||||
# |
||||
#AddDescription "GZIP compressed document" .gz |
||||
#AddDescription "tar archive" .tar |
||||
#AddDescription "GZIP compressed tar archive" .tgz |
||||
|
||||
# |
||||
# ReadmeName is the name of the README file the server will look for by |
||||
# default, and append to directory listings. |
||||
# |
||||
# HeaderName is the name of a file which should be prepended to |
||||
# directory indexes. |
||||
ReadmeName README.html |
||||
HeaderName HEADER.html |
||||
|
||||
# |
||||
# IndexIgnore is a set of filenames which directory indexing should ignore |
||||
# and not include in the listing. Shell-style wildcarding is permitted. |
||||
# |
||||
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t |
||||
|
@ -0,0 +1,50 @@ |
||||
# |
||||
# Distributed authoring and versioning (WebDAV) |
||||
# |
||||
# Required modules: mod_alias, mod_auth_digest, mod_authn_core, mod_authn_file, |
||||
# mod_authz_core, mod_authz_user, mod_dav, mod_dav_fs, |
||||
# mod_setenvif |
||||
|
||||
# The following example gives DAV write access to a directory called |
||||
# "uploads" under the ServerRoot directory. |
||||
# |
||||
# The User/Group specified in httpd.conf needs to have write permissions |
||||
# on the directory where the DavLockDB is placed and on any directory where |
||||
# "Dav On" is specified. |
||||
|
||||
DavLockDB "/opt/lampp/var/DavLock" |
||||
|
||||
Alias /uploads "/opt/lampp/uploads" |
||||
|
||||
<Directory "/opt/lampp/uploads"> |
||||
Dav On |
||||
|
||||
AuthType Digest |
||||
AuthName DAV-upload |
||||
# You can use the htdigest program to create the password database: |
||||
# htdigest -c "/opt/lampp/user.passwd" DAV-upload admin |
||||
AuthUserFile "/opt/lampp/user.passwd" |
||||
AuthDigestProvider file |
||||
|
||||
# Allow universal read-access, but writes are restricted |
||||
# to the admin user. |
||||
<RequireAny> |
||||
Require method GET POST OPTIONS |
||||
Require user admin |
||||
</RequireAny> |
||||
</Directory> |
||||
|
||||
# |
||||
# The following directives disable redirects on non-GET requests for |
||||
# a directory that does not include the trailing slash. This fixes a |
||||
# problem with several clients that do not appropriately handle |
||||
# redirects for folders with DAV methods. |
||||
# |
||||
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully |
||||
BrowserMatch "MS FrontPage" redirect-carefully |
||||
BrowserMatch "^WebDrive" redirect-carefully |
||||
BrowserMatch "^WebDAVFS/1.[01234]" redirect-carefully |
||||
BrowserMatch "^gnome-vfs/1.0" redirect-carefully |
||||
BrowserMatch "^XML Spy" redirect-carefully |
||||
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully |
||||
BrowserMatch " Konqueror/4" redirect-carefully |
@ -0,0 +1,90 @@ |
||||
# |
||||
# This configuration file reflects default settings for Apache HTTP Server. |
||||
# |
||||
# You may change these, but chances are that you may not need to. |
||||
# |
||||
|
||||
# |
||||
# Timeout: The number of seconds before receives and sends time out. |
||||
# |
||||
Timeout 300 |
||||
|
||||
# |
||||
# KeepAlive: Whether or not to allow persistent connections (more than |
||||
# one request per connection). Set to "Off" to deactivate. |
||||
# |
||||
KeepAlive On |
||||
|
||||
# |
||||
# MaxKeepAliveRequests: The maximum number of requests to allow |
||||
# during a persistent connection. Set to 0 to allow an unlimited amount. |
||||
# We recommend you leave this number high, for maximum performance. |
||||
# |
||||
MaxKeepAliveRequests 100 |
||||
|
||||
# |
||||
# KeepAliveTimeout: Number of seconds to wait for the next request from the |
||||
# same client on the same connection. |
||||
# |
||||
KeepAliveTimeout 5 |
||||
|
||||
# |
||||
# UseCanonicalName: Determines how Apache constructs self-referencing |
||||
# URLs and the SERVER_NAME and SERVER_PORT variables. |
||||
# When set "Off", Apache will use the Hostname and Port supplied |
||||
# by the client. When set "On", Apache will use the value of the |
||||
# ServerName directive. |
||||
# |
||||
UseCanonicalName Off |
||||
|
||||
# |
||||
# AccessFileName: The name of the file to look for in each directory |
||||
# for additional configuration directives. See also the AllowOverride |
||||
# directive. |
||||
# |
||||
AccessFileName .htaccess |
||||
|
||||
# |
||||
# ServerTokens |
||||
# This directive configures what you return as the Server HTTP response |
||||
# Header. The default is 'Full' which sends information about the OS-Type |
||||
# and compiled in modules. |
||||
# Set to one of: Full | OS | Minor | Minimal | Major | Prod |
||||
# where Full conveys the most information, and Prod the least. |
||||
# |
||||
ServerTokens Full |
||||
|
||||
# |
||||
# Optionally add a line containing the server version and virtual host |
||||
# name to server-generated pages (internal error documents, FTP directory |
||||
# listings, mod_status and mod_info output etc., but not CGI generated |
||||
# documents or custom error documents). |
||||
# Set to "EMail" to also include a mailto: link to the ServerAdmin. |
||||
# Set to one of: On | Off | EMail |
||||
# |
||||
ServerSignature Off |
||||
|
||||
# |
||||
# HostnameLookups: Log the names of clients or just their IP addresses |
||||
# e.g., www.apache.org (on) or 204.62.129.132 (off). |
||||
# The default is off because it'd be overall better for the net if people |
||||
# had to knowingly turn this feature on, since enabling it means that |
||||
# each client request will result in AT LEAST one lookup request to the |
||||
# nameserver. |
||||
# |
||||
HostnameLookups Off |
||||
|
||||
# |
||||
# Set a timeout for how long the client may take to send the request header |
||||
# and body. |
||||
# The default for the headers is header=20-40,MinRate=500, which means wait |
||||
# for the first byte of headers for 20 seconds. If some data arrives, |
||||
# increase the timeout corresponding to a data rate of 500 bytes/s, but not |
||||
# above 40 seconds. |
||||
# The default for the request body is body=20,MinRate=500, which is the same |
||||
# but has no upper limit for the timeout. |
||||
# To disable, set to header=0 body=0 |
||||
# |
||||
<IfModule reqtimeout_module> |
||||
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500 |
||||
</IfModule> |
@ -0,0 +1,36 @@ |
||||
# |
||||
# Get information about the requests being processed by the server |
||||
# and the configuration of the server. |
||||
# |
||||
# Required modules: mod_authz_core, mod_authz_host, |
||||
# mod_info (for the server-info handler), |
||||
# mod_status (for the server-status handler) |
||||
|
||||
# |
||||
# Allow server status reports generated by mod_status, |
||||
# with the URL of http://servername/server-status |
||||
# Change the ".example.com" to match your domain to enable. |
||||
|
||||
<Location /server-status> |
||||
SetHandler server-status |
||||
Require host .example.com |
||||
Require ip 127 |
||||
</Location> |
||||
|
||||
# |
||||
# ExtendedStatus controls whether Apache will generate "full" status |
||||
# information (ExtendedStatus On) or just basic information (ExtendedStatus |
||||
# Off) when the "server-status" handler is called. The default is Off. |
||||
# |
||||
#ExtendedStatus On |
||||
|
||||
# |
||||
# Allow remote server configuration reports, with the URL of |
||||
# http://servername/server-info (requires that mod_info.c be loaded). |
||||
# Change the ".example.com" to match your domain to enable. |
||||
# |
||||
<Location /server-info> |
||||
SetHandler server-info |
||||
Require host .example.com |
||||
Require ip 127 |
||||
</Location> |
@ -0,0 +1,141 @@ |
||||
# |
||||
# Settings for hosting different languages. |
||||
# |
||||
# Required modules: mod_mime, mod_negotiation |
||||
|
||||
# DefaultLanguage and AddLanguage allows you to specify the language of |
||||
# a document. You can then use content negotiation to give a browser a |
||||
# file in a language the user can understand. |
||||
# |
||||
# Specify a default language. This means that all data |
||||
# going out without a specific language tag (see below) will |
||||
# be marked with this one. You probably do NOT want to set |
||||
# this unless you are sure it is correct for all cases. |
||||
# |
||||
# * It is generally better to not mark a page as |
||||
# * being a certain language than marking it with the wrong |
||||
# * language! |
||||
# |
||||
# DefaultLanguage nl |
||||
# |
||||
# Note 1: The suffix does not have to be the same as the language |
||||
# keyword --- those with documents in Polish (whose net-standard |
||||
# language code is pl) may wish to use "AddLanguage pl .po" to |
||||
# avoid the ambiguity with the common suffix for perl scripts. |
||||
# |
||||
# Note 2: The example entries below illustrate that in some cases |
||||
# the two character 'Language' abbreviation is not identical to |
||||
# the two character 'Country' code for its country, |
||||
# E.g. 'Danmark/dk' versus 'Danish/da'. |
||||
# |
||||
# Note 3: In the case of 'ltz' we violate the RFC by using a three char |
||||
# specifier. There is 'work in progress' to fix this and get |
||||
# the reference data for rfc1766 cleaned up. |
||||
# |
||||
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl) |
||||
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de) |
||||
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja) |
||||
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn) |
||||
# Norwegian (no) - Polish (pl) - Portugese (pt) |
||||
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv) |
||||
# Turkish (tr) - Simplified Chinese (zh-CN) - Spanish (es) |
||||
# Traditional Chinese (zh-TW) |
||||
# |
||||
AddLanguage ca .ca |
||||
AddLanguage cs .cz .cs |
||||
AddLanguage da .dk |
||||
AddLanguage de .de |
||||
AddLanguage el .el |
||||
AddLanguage en .en |
||||
AddLanguage eo .eo |
||||
AddLanguage es .es |
||||
AddLanguage et .et |
||||
AddLanguage fr .fr |
||||
AddLanguage he .he |
||||
AddLanguage hr .hr |
||||
AddLanguage it .it |
||||
AddLanguage ja .ja |
||||
AddLanguage ko .ko |
||||
AddLanguage ltz .ltz |
||||
AddLanguage nl .nl |
||||
AddLanguage nn .nn |
||||
AddLanguage no .no |
||||
AddLanguage pl .po |
||||
AddLanguage pt .pt |
||||
AddLanguage pt-BR .pt-br |
||||
AddLanguage ru .ru |
||||
AddLanguage sv .sv |
||||
AddLanguage tr .tr |
||||
AddLanguage zh-CN .zh-cn |
||||
AddLanguage zh-TW .zh-tw |
||||
|
||||
# LanguagePriority allows you to give precedence to some languages |
||||
# in case of a tie during content negotiation. |
||||
# |
||||
# Just list the languages in decreasing order of preference. We have |
||||
# more or less alphabetized them here. You probably want to change this. |
||||
# |
||||
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW |
||||
|
||||
# |
||||
# ForceLanguagePriority allows you to serve a result page rather than |
||||
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback) |
||||
# [in case no accepted languages matched the available variants] |
||||
# |
||||
ForceLanguagePriority Prefer Fallback |
||||
|
||||
# |
||||
# Commonly used filename extensions to character sets. You probably |
||||
# want to avoid clashes with the language extensions, unless you |
||||
# are good at carefully testing your setup after each change. |
||||
# See http://www.iana.org/assignments/character-sets for the |
||||
# official list of charset names and their respective RFCs. |
||||
# |
||||
AddCharset us-ascii.ascii .us-ascii |
||||
AddCharset ISO-8859-1 .iso8859-1 .latin1 |
||||
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen |
||||
AddCharset ISO-8859-3 .iso8859-3 .latin3 |
||||
AddCharset ISO-8859-4 .iso8859-4 .latin4 |
||||
AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru |
||||
AddCharset ISO-8859-6 .iso8859-6 .arb .arabic |
||||
AddCharset ISO-8859-7 .iso8859-7 .grk .greek |
||||
AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew |
||||
AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk |
||||
AddCharset ISO-8859-10 .iso8859-10 .latin6 |
||||
AddCharset ISO-8859-13 .iso8859-13 |
||||
AddCharset ISO-8859-14 .iso8859-14 .latin8 |
||||
AddCharset ISO-8859-15 .iso8859-15 .latin9 |
||||
AddCharset ISO-8859-16 .iso8859-16 .latin10 |
||||
AddCharset ISO-2022-JP .iso2022-jp .jis |
||||
AddCharset ISO-2022-KR .iso2022-kr .kis |
||||
AddCharset ISO-2022-CN .iso2022-cn .cis |
||||
AddCharset Big5.Big5 .big5 .b5 |
||||
AddCharset cn-Big5 .cn-big5 |
||||
# For russian, more than one charset is used (depends on client, mostly): |
||||
AddCharset WINDOWS-1251 .cp-1251 .win-1251 |
||||
AddCharset CP866 .cp866 |
||||
AddCharset KOI8 .koi8 |
||||
AddCharset KOI8-E .koi8-e |
||||
AddCharset KOI8-r .koi8-r .koi8-ru |
||||
AddCharset KOI8-U .koi8-u |
||||
AddCharset KOI8-ru .koi8-uk .ua |
||||
AddCharset ISO-10646-UCS-2 .ucs2 |
||||
AddCharset ISO-10646-UCS-4 .ucs4 |
||||
AddCharset UTF-7 .utf7 |
||||
AddCharset UTF-8 .utf8 |
||||
AddCharset UTF-16 .utf16 |
||||
AddCharset UTF-16BE .utf16be |
||||
AddCharset UTF-16LE .utf16le |
||||
AddCharset UTF-32 .utf32 |
||||
AddCharset UTF-32BE .utf32be |
||||
AddCharset UTF-32LE .utf32le |
||||
AddCharset euc-cn .euc-cn |
||||
AddCharset euc-gb .euc-gb |
||||
AddCharset euc-jp .euc-jp |
||||
AddCharset euc-kr .euc-kr |
||||
#Not sure how euc-tw got in - IANA doesn't list it??? |
||||
AddCharset EUC-TW .euc-tw |
||||
AddCharset gb2312 .gb2312 .gb |
||||
AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2 |
||||
AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4 |
||||
AddCharset shift_jis .shift_jis .sjis |
@ -0,0 +1,33 @@ |
||||
# |
||||
# Provide access to the documentation on your server as |
||||
# http://yourserver.example.com/manual/ |
||||
# The documentation is always available at |
||||
# http://httpd.apache.org/docs/2.4/ |
||||
# |
||||
# Required modules: mod_alias, mod_authz_core, mod_authz_host, |
||||
# mod_setenvif, mod_negotiation |
||||
# |
||||
|
||||
AliasMatch ^/manual(?:/(?:da|de|en|es|fr|ja|ko|pt-br|ru|tr|zh-cn))?(/.*)?$ "/opt/lampp/manual$1" |
||||
|
||||
<Directory "/opt/lampp/manual"> |
||||
Options Indexes |
||||
AllowOverride None |
||||
Require all granted |
||||
|
||||
<Files *.html> |
||||
SetHandler type-map |
||||
</Files> |
||||
# .tr is text/troff in mime.types! |
||||
<Files *.html.tr.utf8> |
||||
ForceType "text/html; charset=utf-8" |
||||
</Files> |
||||
|
||||
AddLanguage da .da |
||||
|
||||
SetEnvIf Request_URI ^/manual/(da|de|en|es|fr|ja|ko|pt-br|ru|tr|zh-cn)/ prefer-language=$1 |
||||
RedirectMatch 301 ^/manual(?:/(da|de|en|es|fr|ja|ko|pt-br|ru|tr|zh-cn)){2,}(/.*)?$ /manual/$1$2 |
||||
|
||||
LanguagePriority en da de es fr ja ko pt-br ru tr |
||||
ForceLanguagePriority Prefer Fallback |
||||
</Directory> |
@ -0,0 +1,119 @@ |
||||
# |
||||
# Server-Pool Management (MPM specific) |
||||
# |
||||
|
||||
# |
||||
# PidFile: The file in which the server should record its process |
||||
# identification number when it starts. |
||||
# |
||||
# Note that this is the default PidFile for most MPMs. |
||||
# |
||||
<IfModule !mpm_netware_module> |
||||
PidFile "logs/httpd.pid" |
||||
</IfModule> |
||||
|
||||
# |
||||
# Only one of the below sections will be relevant on your |
||||
# installed httpd. Use "apachectl -l" to find out the |
||||
# active mpm. |
||||
# |
||||
|
||||
# prefork MPM |
||||
# StartServers: number of server processes to start |
||||
# MinSpareServers: minimum number of server processes which are kept spare |
||||
# MaxSpareServers: maximum number of server processes which are kept spare |
||||
# MaxRequestWorkers: maximum number of server processes allowed to start |
||||
# MaxConnectionsPerChild: maximum number of connections a server process serves |
||||
# before terminating |
||||
<IfModule mpm_prefork_module> |
||||
StartServers 5 |
||||
MinSpareServers 5 |
||||
MaxSpareServers 10 |
||||
MaxRequestWorkers 150 |
||||
MaxConnectionsPerChild 0 |
||||
</IfModule> |
||||
|
||||
# worker MPM |
||||
# StartServers: initial number of server processes to start |
||||
# MinSpareThreads: minimum number of worker threads which are kept spare |
||||
# MaxSpareThreads: maximum number of worker threads which are kept spare |
||||
# ThreadsPerChild: constant number of worker threads in each server process |
||||
# MaxRequestWorkers: maximum number of worker threads |
||||
# MaxConnectionsPerChild: maximum number of connections a server process serves |
||||
# before terminating |
||||
<IfModule mpm_worker_module> |
||||
StartServers 2 |
||||
MinSpareThreads 25 |
||||
MaxSpareThreads 75 |
||||
ThreadsPerChild 25 |
||||
MaxRequestWorkers 150 |
||||
MaxConnectionsPerChild 0 |
||||
</IfModule> |
||||
|
||||
# event MPM |
||||
# StartServers: initial number of server processes to start |
||||
# MinSpareThreads: minimum number of worker threads which are kept spare |
||||
# MaxSpareThreads: maximum number of worker threads which are kept spare |
||||
# ThreadsPerChild: constant number of worker threads in each server process |
||||
# MaxRequestWorkers: maximum number of worker threads |
||||
# MaxConnectionsPerChild: maximum number of connections a server process serves |
||||
# before terminating |
||||
<IfModule mpm_event_module> |
||||
StartServers 2 |
||||
MinSpareThreads 25 |
||||
MaxSpareThreads 75 |
||||
ThreadsPerChild 25 |
||||
MaxRequestWorkers 150 |
||||
MaxConnectionsPerChild 0 |
||||
</IfModule> |
||||
|
||||
# NetWare MPM |
||||
# ThreadStackSize: Stack size allocated for each worker thread |
||||
# StartThreads: Number of worker threads launched at server startup |
||||
# MinSpareThreads: Minimum number of idle threads, to handle request spikes |
||||
# MaxSpareThreads: Maximum number of idle threads |
||||
# MaxThreads: Maximum number of worker threads alive at the same time |
||||
# MaxConnectionsPerChild: Maximum number of connections a thread serves. It |
||||
# is recommended that the default value of 0 be set |
||||
# for this directive on NetWare. This will allow the |
||||
# thread to continue to service requests indefinitely. |
||||
<IfModule mpm_netware_module> |
||||
ThreadStackSize 65536 |
||||
StartThreads 250 |
||||
MinSpareThreads 25 |
||||
MaxSpareThreads 250 |
||||
MaxThreads 1000 |
||||
MaxConnectionsPerChild 0 |
||||
</IfModule> |
||||
|
||||
# OS/2 MPM |
||||
# StartServers: Number of server processes to maintain |
||||
# MinSpareThreads: Minimum number of idle threads per process, |
||||
# to handle request spikes |
||||
# MaxSpareThreads: Maximum number of idle threads per process |
||||
# MaxConnectionsPerChild: Maximum number of connections per server process |
||||
<IfModule mpm_mpmt_os2_module> |
||||
StartServers 2 |
||||
MinSpareThreads 5 |
||||
MaxSpareThreads 10 |
||||
MaxConnectionsPerChild 0 |
||||
</IfModule> |
||||
|
||||
# WinNT MPM |
||||
# ThreadsPerChild: constant number of worker threads in the server process |
||||
# MaxConnectionsPerChild: maximum number of connections a server process serves |
||||
<IfModule mpm_winnt_module> |
||||
ThreadsPerChild 150 |
||||
MaxConnectionsPerChild 0 |
||||
</IfModule> |
||||
|
||||
# The maximum number of free Kbytes that every allocator is allowed |
||||
# to hold without calling free(). In threaded MPMs, every thread has its own |
||||
# allocator. When not set, or when set to zero, the threshold will be set to |
||||
# unlimited. |
||||
<IfModule !mpm_netware_module> |
||||
MaxMemFree 2048 |
||||
</IfModule> |
||||
<IfModule mpm_netware_module> |
||||
MaxMemFree 100 |
||||
</IfModule> |
@ -0,0 +1,52 @@ |
||||
# |
||||
# The configuration below implements multi-language error documents through |
||||
# content-negotiation. |
||||
# |
||||
# Required modules: mod_alias, mod_authz_core, mod_authz_host, |
||||
# mod_include, mod_negotiation |
||||
# |
||||
# We use Alias to redirect any /error/HTTP_<error>.html.var response to |
||||
# our collection of by-error message multi-language collections. We use |
||||
# includes to substitute the appropriate text. |
||||
# |
||||
# You can modify the messages' appearance without changing any of the |
||||
# default HTTP_<error>.html.var files by adding the line: |
||||
# |
||||
# Alias /error/include/ "/your/include/path/" |
||||
# |
||||
# which allows you to create your own set of files by starting with the |
||||
# /opt/lampp/error/include/ files and copying them to /your/include/path/, |
||||
# even on a per-VirtualHost basis. The default include files will display |
||||
# your Apache version number and your ServerAdmin email address regardless |
||||
# of the setting of ServerSignature. |
||||
|
||||
Alias /error/ "/opt/lampp/error/" |
||||
|
||||
<Directory "/opt/lampp/error"> |
||||
AllowOverride None |
||||
Options IncludesNoExec |
||||
AddOutputFilter Includes html |
||||
AddHandler type-map var |
||||
Require all granted |
||||
LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr |
||||
ForceLanguagePriority Prefer Fallback |
||||
</Directory> |
||||
|
||||
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var |
||||
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var |
||||
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var |
||||
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var |
||||
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var |
||||
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var |
||||
ErrorDocument 410 /error/HTTP_GONE.html.var |
||||
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var |
||||
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var |
||||
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var |
||||
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var |
||||
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var |
||||
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var |
||||
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var |
||||
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var |
||||
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var |
||||
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var |
||||
|
@ -0,0 +1,244 @@ |
||||
# |
||||
# This is the Apache server configuration file providing SSL support. |
||||
# It contains the configuration directives to instruct the server how to |
||||
# serve pages over an https connection. For detailed information about these |
||||
# directives see <URL:http://httpd.apache.org/docs/trunk/mod/mod_ssl.html> |
||||
# |
||||
# Do NOT simply read the instructions in here without understanding |
||||
# what they do. They're here only as hints or reminders. If you are unsure |
||||
# consult the online docs. You have been warned. |
||||
# |
||||
# Required modules: mod_log_config, mod_setenvif, mod_ssl, |
||||
# socache_shmcb_module (for default value of SSLSessionCache) |
||||
|
||||
# |
||||
# Pseudo Random Number Generator (PRNG): |
||||
# Configure one or more sources to seed the PRNG of the SSL library. |
||||
# The seed data should be of good random quality. |
||||
# WARNING! On some platforms /dev/random blocks if not enough entropy |
||||
# is available. This means you then cannot use the /dev/random device |
||||
# because it would lead to very long connection times (as long as |
||||
# it requires to make more entropy available). But usually those |
||||
# platforms additionally provide a /dev/urandom device which doesn't |
||||
# block. So, if available, use this one instead. Read the mod_ssl User |
||||
# Manual for more details. |
||||
# |
||||
#SSLRandomSeed startup file:/dev/random 512 |
||||
#SSLRandomSeed startup file:/dev/urandom 512 |
||||
#SSLRandomSeed connect file:/dev/random 512 |
||||
#SSLRandomSeed connect file:/dev/urandom 512 |
||||
|
||||
|
||||
# |
||||
# When we also provide SSL we have to listen to the |
||||
# standard HTTP port (see above) and to the HTTPS port |
||||
# |
||||
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two |
||||
# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" |
||||
# |
||||
Listen 443 |
||||
|
||||
## |
||||
## SSL Global Context |
||||
## |
||||
## All SSL configuration in this context applies both to |
||||
## the main server and all SSL-enabled virtual hosts. |
||||
## |
||||
|
||||
# SSL Cipher Suite: |
||||
# List the ciphers that the client is permitted to negotiate. |
||||
# See the mod_ssl documentation for a complete list. |
||||
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 |
||||
|
||||
# Speed-optimized SSL Cipher configuration: |
||||
# If speed is your main concern (on busy HTTPS servers e.g.), |
||||
# you might want to force clients to specific, performance |
||||
# optimized ciphers. In this case, prepend those ciphers |
||||
# to the SSLCipherSuite list, and enable SSLHonorCipherOrder. |
||||
# Caveat: by giving precedence to RC4-SHA and AES128-SHA |
||||
# (as in the example below), most connections will no longer |
||||
# have perfect forward secrecy - if the server's key is |
||||
# compromised, captures of past or future traffic must be |
||||
# considered compromised, too. |
||||
#SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5 |
||||
#SSLHonorCipherOrder on |
||||
|
||||
# Pass Phrase Dialog: |
||||
# Configure the pass phrase gathering process. |
||||
# The filtering dialog program (`builtin' is an internal |
||||
# terminal dialog) has to provide the pass phrase on stdout. |
||||
SSLPassPhraseDialog builtin |
||||
|
||||
# Inter-Process Session Cache: |
||||
# Configure the SSL Session Cache: First the mechanism |
||||
# to use and second the expiring timeout (in seconds). |
||||
#SSLSessionCache "dbm:/opt/lampp/logs/ssl_scache" |
||||
SSLSessionCache "shmcb:/opt/lampp/logs/ssl_scache(512000)" |
||||
SSLSessionCacheTimeout 300 |
||||
|
||||
## |
||||
## SSL Virtual Host Context |
||||
## |
||||
|
||||
<VirtualHost _default_:443> |
||||
|
||||
# General setup for the virtual host |
||||
DocumentRoot "/opt/lampp/htdocs" |
||||
ServerName www.example.com:443 |
||||
ServerAdmin you@example.com |
||||
ErrorLog "/opt/lampp/logs/error_log" |
||||
TransferLog "/opt/lampp/logs/access_log" |
||||
|
||||
# SSL Engine Switch: |
||||
# Enable/Disable SSL for this virtual host. |
||||
SSLEngine on |
||||
|
||||
# Server Certificate: |
||||
# Point SSLCertificateFile at a PEM encoded certificate. If |
||||
# the certificate is encrypted, then you will be prompted for a |
||||
# pass phrase. Note that a kill -HUP will prompt again. Keep |
||||
# in mind that if you have both an RSA and a DSA certificate you |
||||
# can configure both in parallel (to also allow the use of DSA |
||||
# ciphers, etc.) |
||||
# Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt) |
||||
# require an ECC certificate which can also be configured in |
||||
# parallel. |
||||
SSLCertificateFile "/opt/lampp/etc/ssl.crt/server.crt" |
||||
#SSLCertificateFile "/opt/lampp/etc/server-dsa.crt" |
||||
#SSLCertificateFile "/opt/lampp/etc/server-ecc.crt" |
||||
|
||||
# Server Private Key: |
||||
# If the key is not combined with the certificate, use this |
||||
# directive to point at the key file. Keep in mind that if |
||||
# you've both a RSA and a DSA private key you can configure |
||||
# both in parallel (to also allow the use of DSA ciphers, etc.) |
||||
# ECC keys, when in use, can also be configured in parallel |
||||
SSLCertificateKeyFile "/opt/lampp/etc/ssl.key/server.key" |
||||
#SSLCertificateKeyFile "/opt/lampp/etc/server-dsa.key" |
||||
#SSLCertificateKeyFile "/opt/lampp/etc/server-ecc.key" |
||||
|
||||
# Server Certificate Chain: |
||||
# Point SSLCertificateChainFile at a file containing the |
||||
# concatenation of PEM encoded CA certificates which form the |
||||
# certificate chain for the server certificate. Alternatively |
||||
# the referenced file can be the same as SSLCertificateFile |
||||
# when the CA certificates are directly appended to the server |
||||
# certificate for convenience. |
||||
#SSLCertificateChainFile "/opt/lampp/etc/server-ca.crt" |
||||
|
||||
# Certificate Authority (CA): |
||||
# Set the CA certificate verification path where to find CA |
||||
# certificates for client authentication or alternatively one |
||||
# huge file containing all of them (file must be PEM encoded) |
||||
# Note: Inside SSLCACertificatePath you need hash symlinks |
||||
# to point to the certificate files. Use the provided |
||||
# Makefile to update the hash symlinks after changes. |
||||
#SSLCACertificatePath "/opt/lampp/etc/ssl.crt" |
||||
#SSLCACertificateFile "/opt/lampp/etc/ssl.crt/ca-bundle.crt" |
||||
|
||||
# Certificate Revocation Lists (CRL): |
||||
# Set the CA revocation path where to find CA CRLs for client |
||||
# authentication or alternatively one huge file containing all |
||||
# of them (file must be PEM encoded). |
||||
# The CRL checking mode needs to be configured explicitly |
||||
# through SSLCARevocationCheck (defaults to "none" otherwise). |
||||
# Note: Inside SSLCARevocationPath you need hash symlinks |
||||
# to point to the certificate files. Use the provided |
||||
# Makefile to update the hash symlinks after changes. |
||||
#SSLCARevocationPath "/opt/lampp/etc/ssl.crl" |
||||
#SSLCARevocationFile "/opt/lampp/etc/ssl.crl/ca-bundle.crl" |
||||
#SSLCARevocationCheck chain |
||||
|
||||
# Client Authentication (Type): |
||||
# Client certificate verification type and depth. Types are |
||||
# none, optional, require and optional_no_ca. Depth is a |
||||
# number which specifies how deeply to verify the certificate |
||||
# issuer chain before deciding the certificate is not valid. |
||||
#SSLVerifyClient require |
||||
#SSLVerifyDepth 10 |
||||
|
||||
# Access Control: |
||||
# With SSLRequire you can do per-directory access control based |
||||
# on arbitrary complex boolean expressions containing server |
||||
# variable checks and other lookup directives. The syntax is a |
||||
# mixture between C and Perl. See the mod_ssl documentation |
||||
# for more details. |
||||
#<Location /> |
||||
#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ |
||||
# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \ |
||||
# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \ |
||||
# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \ |
||||
# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \ |
||||
# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ |
||||
#</Location> |
||||
|
||||
# SSL Engine Options: |
||||
# Set various options for the SSL engine. |
||||
# o FakeBasicAuth: |
||||
# Translate the client X.509 into a Basic Authorisation. This means that |
||||
# the standard Auth/DBMAuth methods can be used for access control. The |
||||
# user name is the `one line' version of the client's X.509 certificate. |
||||
# Note that no password is obtained from the user. Every entry in the user |
||||
# file needs this password: `xxj31ZMTZzkVA'. |
||||
# o ExportCertData: |
||||
# This exports two additional environment variables: SSL_CLIENT_CERT and |
||||
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the |
||||
# server (always existing) and the client (only existing when client |
||||
# authentication is used). This can be used to import the certificates |
||||
# into CGI scripts. |
||||
# o StdEnvVars: |
||||
# This exports the standard SSL/TLS related `SSL_*' environment variables. |
||||
# Per default this exportation is switched off for performance reasons, |
||||
# because the extraction step is an expensive operation and is usually |
||||
# useless for serving static content. So one usually enables the |
||||
# exportation for CGI and SSI requests only. |
||||
# o StrictRequire: |
||||
# This denies access when "SSLRequireSSL" or "SSLRequire" applied even |
||||
# under a "Satisfy any" situation, i.e. when it applies access is denied |
||||
# and no other module can change it. |
||||
# o OptRenegotiate: |
||||
# This enables optimized SSL connection renegotiation handling when SSL |
||||
# directives are used in per-directory context. |
||||
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire |
||||
<FilesMatch "\.(cgi|shtml|phtml|php)$"> |
||||
SSLOptions +StdEnvVars |
||||
</FilesMatch> |
||||
<Directory "/opt/lampp/cgi-bin"> |
||||
SSLOptions +StdEnvVars |
||||
</Directory> |
||||
|
||||
# SSL Protocol Adjustments: |
||||
# The safe and default but still SSL/TLS standard compliant shutdown |
||||
# approach is that mod_ssl sends the close notify alert but doesn't wait for |
||||
# the close notify alert from client. When you need a different shutdown |
||||
# approach you can use one of the following variables: |
||||
# o ssl-unclean-shutdown: |
||||
# This forces an unclean shutdown when the connection is closed, i.e. no |
||||
# SSL close notify alert is sent or allowed to be received. This violates |
||||
# the SSL/TLS standard but is needed for some brain-dead browsers. Use |
||||
# this when you receive I/O errors because of the standard approach where |
||||
# mod_ssl sends the close notify alert. |
||||
# o ssl-accurate-shutdown: |
||||
# This forces an accurate shutdown when the connection is closed, i.e. a |
||||
# SSL close notify alert is send and mod_ssl waits for the close notify |
||||
# alert of the client. This is 100% SSL/TLS standard compliant, but in |
||||
# practice often causes hanging connections with brain-dead browsers. Use |
||||
# this only for browsers where you know that their SSL implementation |
||||
# works correctly. |
||||
# Notice: Most problems of broken clients are also related to the HTTP |
||||
# keep-alive facility, so you usually additionally want to disable |
||||
# keep-alive for those clients, too. Use variable "nokeepalive" for this. |
||||
# Similarly, one has to force some clients to use HTTP/1.0 to workaround |
||||
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and |
||||
# "force-response-1.0" for this. |
||||
BrowserMatch "MSIE [2-5]" \ |
||||
nokeepalive ssl-unclean-shutdown \ |
||||
downgrade-1.0 force-response-1.0 |
||||
|
||||
# Per-Server Logging: |
||||
# The home of a custom SSL log file. Use this when you want a |
||||
# compact non-error SSL logfile on a virtual host basis. |
||||
CustomLog "/opt/lampp/logs/ssl_request_log" \ |
||||
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" |
||||
|
||||
</VirtualHost> |
@ -0,0 +1,21 @@ |
||||
# Settings for user home directories |
||||
# |
||||
# Required module: mod_authz_core, mod_authz_host, mod_userdir |
||||
|
||||
# |
||||
# UserDir: The name of the directory that is appended onto a user's home |
||||
# directory if a ~user request is received. Note that you must also set |
||||
# the default access control for these directories, as in the example below. |
||||
# |
||||
#UserDir Sites |
||||
|
||||
# |
||||
# Control access to UserDir directories. The following is an example |
||||
# for a site where these directories are restricted to read-only. |
||||
# |
||||
<Directory "/home/*/Sites"> |
||||
AllowOverride FileInfo AuthConfig Limit Indexes |
||||
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec |
||||
Require method GET POST OPTIONS |
||||
</Directory> |
||||
|
@ -0,0 +1,30 @@ |
||||
# Virtual Hosts |
||||
# |
||||
# Required modules: mod_log_config |
||||
|
||||
# If you want to maintain multiple domains/hostnames on your |
||||
# machine you can setup VirtualHost containers for them. Most configurations |
||||
# use only name-based virtual hosts so the server doesn't need to worry about |
||||
# IP addresses. This is indicated by the asterisks in the directives below. |
||||
# |
||||
# Please see the documentation at |
||||
# <URL:http://httpd.apache.org/docs/2.4/vhosts/> |
||||
# for further details before you try to setup virtual hosts. |
||||
# |
||||
# You may use the command line option '-S' to verify your virtual host |
||||
# configuration. |
||||
|
||||
# |
||||
# VirtualHost example: |
||||
# Almost any Apache directive may go into a VirtualHost container. |
||||
# The first VirtualHost section is used for all requests that do not |
||||
# match a ServerName or ServerAlias in any <VirtualHost> block. |
||||
# |
||||
<VirtualHost *:80> |
||||
ServerName test.local |
||||
ServerAlias *.local |
||||
VirtualDocumentRoot /home/jonathan/Sites/%-2/public_html |
||||
CustomLog /home/jonathan/Sites/access.log vhost_combined |
||||
ErrorLog /home/jonathan/Sites/error.log |
||||
</VirtualHost> |
||||
|
@ -0,0 +1,58 @@ |
||||
#<IfDefine PHP4> |
||||
#LoadModule php4_module modules/libphp4.so |
||||
#</IfDefine> |
||||
#<IfDefine PHP7> |
||||
#LoadModule php7_module modules/libphp7.so |
||||
#</IfDefine> |
||||
|
||||
# We will enable it by default |
||||
#<IfDefine PHP> |
||||
LoadModule php7_module modules/libphp7.so |
||||
#</IfDefine> |
||||
|
||||
LoadModule perl_module modules/mod_perl.so |
||||
|
||||
Alias /phpmyadmin "/opt/lampp/phpmyadmin" |
||||
Alias /phpsqliteadmin "/opt/lampp/phpsqliteadmin" |
||||
|
||||
# since XAMPP 1.4.3 |
||||
<Directory "/opt/lampp/phpmyadmin"> |
||||
AllowOverride AuthConfig Limit |
||||
Require local |
||||
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var |
||||
</Directory> |
||||
|
||||
<Directory "/opt/lampp/phpsqliteadmin"> |
||||
AllowOverride AuthConfig Limit |
||||
Require local |
||||
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var |
||||
</Directory> |
||||
|
||||
# since LAMPP 1.0RC1 |
||||
AddType application/x-httpd-php .php .php3 .php4 |
||||
|
||||
XBitHack on |
||||
|
||||
# since 0.9.8 we've mod_perl |
||||
<IfModule mod_perl.c> |
||||
AddHandler perl-script .pl |
||||
PerlHandler ModPerl::PerlRunPrefork |
||||
PerlOptions +ParseHeaders |
||||
PerlSendHeader On |
||||
</IfModule> |
||||
|
||||
# demo for mod_perl responsehandler |
||||
#PerlModule Apache::CurrentTime |
||||
#<Location /time> |
||||
# SetHandler modperl |
||||
# PerlResponseHandler Apache::CurrentTime |
||||
#</Location> |
||||
|
||||
# AcceptMutex sysvsem is default but on some systems we need this |
||||
# thanks to jeff ort for this hint |
||||
#AcceptMutex flock |
||||
#LockFile /opt/lampp/logs/accept.lock |
||||
|
||||
# this makes mod_dbd happy - oswald, 02aug06 |
||||
# mod_dbd doesn't work in Apache 2.2.3: getting always heaps of "glibc detected *** corrupted double-linked list" on shutdown - oswald, 10sep06 |
||||
#DBDriver sqlite3 |
@ -0,0 +1,90 @@ |
||||
# Configuration example. |
||||
# |
||||
# For detailed information about these directives see |
||||
# <URL:http://httpd.apache.org/docs/2.4/mod/mod_proxy_html.html> |
||||
# and for mod_xml2enc see |
||||
# <URL:http://httpd.apache.org/docs/2.4/mod/mod_xml2enc.html> |
||||
# |
||||
# First, to load the module with its prerequisites. Note: mod_xml2enc |
||||
# is not always necessary, but without it mod_proxy_html is likely to |
||||
# mangle pages in encodings other than ASCII or Unicode (utf-8). |
||||
# |
||||
# For Unix-family systems: |
||||
# LoadFile /usr/lib/libxml2.so |
||||
# LoadModule proxy_html_module modules/mod_proxy_html.so |
||||
# LoadModule xml2enc_module modules/mod_xml2enc.so |
||||
# |
||||
# For Windows (I don't know if there's a standard path for the libraries) |
||||
# LoadFile C:/path/zlib.dll |
||||
# LoadFile C:/path/iconv.dll |
||||
# LoadFile C:/path/libxml2.dll |
||||
# LoadModule proxy_html_module modules/mod_proxy_html.so |
||||
# LoadModule xml2enc_module modules/mod_xml2enc.so |
||||
# |
||||
# All knowledge of HTML links has been removed from the mod_proxy_html |
||||
# code itself, and is instead read from httpd.conf (or included file) |
||||
# at server startup. So you MUST declare it. This will normally be |
||||
# at top level, but can also be used in a <Location>. |
||||
# |
||||
# Here's the declaration for W3C HTML 4.01 and XHTML 1.0 |
||||
|
||||
ProxyHTMLLinks a href |
||||
ProxyHTMLLinks area href |
||||
ProxyHTMLLinks link href |
||||
ProxyHTMLLinks img src longdesc usemap |
||||
ProxyHTMLLinks object classid codebase data usemap |
||||
ProxyHTMLLinks q cite |
||||
ProxyHTMLLinks blockquote cite |
||||
ProxyHTMLLinks ins cite |
||||
ProxyHTMLLinks del cite |
||||
ProxyHTMLLinks form action |
||||
ProxyHTMLLinks input src usemap |
||||
ProxyHTMLLinks head profile |
||||
ProxyHTMLLinks base href |
||||
ProxyHTMLLinks script src for |
||||
|
||||
# To support scripting events (with ProxyHTMLExtended On), |
||||
# you'll need to declare them too. |
||||
|
||||
ProxyHTMLEvents onclick ondblclick onmousedown onmouseup \ |
||||
onmouseover onmousemove onmouseout onkeypress \ |
||||
onkeydown onkeyup onfocus onblur onload \ |
||||
onunload onsubmit onreset onselect onchange |
||||
|
||||
# If you need to support legacy (pre-1998, aka "transitional") HTML or XHTML, |
||||
# you'll need to uncomment the following deprecated link attributes. |
||||
# Note that these are enabled in earlier mod_proxy_html versions |
||||
# |
||||
# ProxyHTMLLinks frame src longdesc |
||||
# ProxyHTMLLinks iframe src longdesc |
||||
# ProxyHTMLLinks body background |
||||
# ProxyHTMLLinks applet codebase |
||||
# |
||||
# If you're dealing with proprietary HTML variants, |
||||
# declare your own URL attributes here as required. |
||||
# |
||||
# ProxyHTMLLinks myelement myattr otherattr |
||||
# |
||||
########### |
||||
# EXAMPLE # |
||||
########### |
||||
# |
||||
# To define the URL /my-gateway/ as a gateway to an appserver with address |
||||
# http://some.app.intranet/ on a private network, after loading the |
||||
# modules and including this configuration file: |
||||
# |
||||
# ProxyRequests Off <-- this is an important security setting |
||||
# ProxyPass /my-gateway/ http://some.app.intranet/ |
||||
# <Location /my-gateway/> |
||||
# ProxyPassReverse / |
||||
# ProxyHTMLEnable On |
||||
# ProxyHTMLURLMap http://some.app.intranet/ /my-gateway/ |
||||
# ProxyHTMLURLMap / /my-gateway/ |
||||
# </Location> |
||||
# |
||||
# Many (though not all) real-life setups are more complex. |
||||
# |
||||
# See the documentation at |
||||
# http://apache.webthing.com/mod_proxy_html/ |
||||
# and the tutorial at |
||||
# http://www.apachetutor.org/admin/reverseproxies |
@ -0,0 +1,525 @@ |
||||
# |
||||
# This is the main Apache HTTP server configuration file. It contains the |
||||
# configuration directives that give the server its instructions. |
||||
# See <URL:http://httpd.apache.org/docs/trunk/> for detailed information. |
||||
# In particular, see |
||||
# <URL:http://httpd.apache.org/docs/trunk/mod/directives.html> |
||||
# for a discussion of each configuration directive. |
||||
# |
||||
# Do NOT simply read the instructions in here without understanding |
||||
# what they do. They're here only as hints or reminders. If you are unsure |
||||
# consult the online docs. You have been warned. |
||||
# |
||||
# Configuration and logfile names: If the filenames you specify for many |
||||
# of the server's control files begin with "/" (or "drive:/" for Win32), the |
||||
# server will use that explicit path. If the filenames do *not* begin |
||||
# with "/", the value of ServerRoot is prepended -- so 'log/access_log' |
||||
# with ServerRoot set to '/www' will be interpreted by the |
||||
# server as '/www/log/access_log', where as '/log/access_log' will be |
||||
# interpreted as '/log/access_log'. |
||||
|
||||
# |
||||
# ServerRoot: The top of the directory tree under which the server's |
||||
# configuration, error, and log files are kept. |
||||
# |
||||
# Do not add a slash at the end of the directory path. If you point |
||||
# ServerRoot at a non-local disk, be sure to specify a local disk on the |
||||
# Mutex directive, if file-based mutexes are used. If you wish to share the |
||||
# same ServerRoot for multiple httpd daemons, you will need to change at |
||||
# least PidFile. |
||||
# |
||||
ServerRoot "/opt/lampp" |
||||
|
||||
# |
||||
# Mutex: Allows you to set the mutex mechanism and mutex file directory |
||||
# for individual mutexes, or change the global defaults |
||||
# |
||||
# Uncomment and change the directory if mutexes are file-based and the default |
||||
# mutex file directory is not on a local disk or is not appropriate for some |
||||
# other reason. |
||||
# |
||||
# Mutex default:logs |
||||
|
||||
# |
||||
# Listen: Allows you to bind Apache to specific IP addresses and/or |
||||
# ports, instead of the default. See also the <VirtualHost> |
||||
# directive. |
||||
# |
||||
# Change this to Listen on specific IP addresses as shown below to |
||||
# prevent Apache from glomming onto all bound IP addresses. |
||||
# |
||||
#Listen 12.34.56.78:80 |
||||
Listen 80 |
||||
|
||||
# |
||||
# Dynamic Shared Object (DSO) Support |
||||
# |
||||
# To be able to use the functionality of a module which was built as a DSO you |
||||
# have to place corresponding `LoadModule' lines at this location so the |
||||
# directives contained in it are actually available _before_ they are used. |
||||
# Statically compiled modules (those listed by `httpd -l') do not need |
||||
# to be loaded here. |
||||
# |
||||
# Example: |
||||
# LoadModule foo_module modules/mod_foo.so |
||||
# |
||||
LoadModule authn_file_module modules/mod_authn_file.so |
||||
LoadModule authn_dbm_module modules/mod_authn_dbm.so |
||||
LoadModule authn_anon_module modules/mod_authn_anon.so |
||||
LoadModule authn_dbd_module modules/mod_authn_dbd.so |
||||
LoadModule authn_socache_module modules/mod_authn_socache.so |
||||
LoadModule authn_core_module modules/mod_authn_core.so |
||||
LoadModule authz_host_module modules/mod_authz_host.so |
||||
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so |
||||
LoadModule authz_user_module modules/mod_authz_user.so |
||||
LoadModule authz_dbm_module modules/mod_authz_dbm.so |
||||
LoadModule authz_owner_module modules/mod_authz_owner.so |
||||
LoadModule authz_dbd_module modules/mod_authz_dbd.so |
||||
LoadModule authz_core_module modules/mod_authz_core.so |
||||
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so |
||||
LoadModule access_compat_module modules/mod_access_compat.so |
||||
LoadModule auth_basic_module modules/mod_auth_basic.so |
||||
LoadModule auth_form_module modules/mod_auth_form.so |
||||
LoadModule auth_digest_module modules/mod_auth_digest.so |
||||
LoadModule allowmethods_module modules/mod_allowmethods.so |
||||
LoadModule file_cache_module modules/mod_file_cache.so |
||||
LoadModule cache_module modules/mod_cache.so |
||||
LoadModule cache_disk_module modules/mod_cache_disk.so |
||||
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so |
||||
LoadModule socache_dbm_module modules/mod_socache_dbm.so |
||||
LoadModule socache_memcache_module modules/mod_socache_memcache.so |
||||
LoadModule dbd_module modules/mod_dbd.so |
||||
LoadModule bucketeer_module modules/mod_bucketeer.so |
||||
LoadModule dumpio_module modules/mod_dumpio.so |
||||
LoadModule echo_module modules/mod_echo.so |
||||
LoadModule case_filter_module modules/mod_case_filter.so |
||||
LoadModule case_filter_in_module modules/mod_case_filter_in.so |
||||
LoadModule buffer_module modules/mod_buffer.so |
||||
LoadModule ratelimit_module modules/mod_ratelimit.so |
||||
LoadModule reqtimeout_module modules/mod_reqtimeout.so |
||||
LoadModule ext_filter_module modules/mod_ext_filter.so |
||||
LoadModule request_module modules/mod_request.so |
||||
LoadModule include_module modules/mod_include.so |
||||
LoadModule filter_module modules/mod_filter.so |
||||
LoadModule substitute_module modules/mod_substitute.so |
||||
LoadModule sed_module modules/mod_sed.so |
||||
LoadModule charset_lite_module modules/mod_charset_lite.so |
||||
LoadModule deflate_module modules/mod_deflate.so |
||||
LoadModule mime_module modules/mod_mime.so |
||||
LoadModule ldap_module modules/mod_ldap.so |
||||
LoadModule log_config_module modules/mod_log_config.so |
||||
LoadModule log_debug_module modules/mod_log_debug.so |
||||
LoadModule logio_module modules/mod_logio.so |
||||
LoadModule env_module modules/mod_env.so |
||||
LoadModule mime_magic_module modules/mod_mime_magic.so |
||||
LoadModule cern_meta_module modules/mod_cern_meta.so |
||||
LoadModule expires_module modules/mod_expires.so |
||||
LoadModule headers_module modules/mod_headers.so |
||||
LoadModule usertrack_module modules/mod_usertrack.so |
||||
LoadModule unique_id_module modules/mod_unique_id.so |
||||
LoadModule setenvif_module modules/mod_setenvif.so |
||||
LoadModule version_module modules/mod_version.so |
||||
LoadModule remoteip_module modules/mod_remoteip.so |
||||
LoadModule proxy_module modules/mod_proxy.so |
||||
LoadModule proxy_connect_module modules/mod_proxy_connect.so |
||||
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so |
||||
LoadModule proxy_http_module modules/mod_proxy_http.so |
||||
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so |
||||
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so |
||||
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so |
||||
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so |
||||
LoadModule proxy_express_module modules/mod_proxy_express.so |
||||
LoadModule session_module modules/mod_session.so |
||||
LoadModule session_cookie_module modules/mod_session_cookie.so |
||||
LoadModule session_dbd_module modules/mod_session_dbd.so |
||||
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so |
||||
LoadModule ssl_module modules/mod_ssl.so |
||||
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so |
||||
LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so |
||||
LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so |
||||
LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so |
||||
LoadModule unixd_module modules/mod_unixd.so |
||||
LoadModule dav_module modules/mod_dav.so |
||||
LoadModule status_module modules/mod_status.so |
||||
LoadModule autoindex_module modules/mod_autoindex.so |
||||
LoadModule info_module modules/mod_info.so |
||||
LoadModule suexec_module modules/mod_suexec.so |
||||
LoadModule cgi_module modules/mod_cgi.so |
||||
LoadModule cgid_module modules/mod_cgid.so |
||||
LoadModule dav_fs_module modules/mod_dav_fs.so |
||||
LoadModule vhost_alias_module modules/mod_vhost_alias.so |
||||
LoadModule negotiation_module modules/mod_negotiation.so |
||||
LoadModule dir_module modules/mod_dir.so |
||||
LoadModule actions_module modules/mod_actions.so |
||||
LoadModule speling_module modules/mod_speling.so |
||||
LoadModule userdir_module modules/mod_userdir.so |
||||
LoadModule alias_module modules/mod_alias.so |
||||
LoadModule rewrite_module modules/mod_rewrite.so |
||||
|
||||
<IfDefine JUSTTOMAKEAPXSHAPPY> |
||||
LoadModule php4_module modules/libphp4.so |
||||
LoadModule php5_module modules/libphp5.so |
||||
</IfDefine> |
||||
|
||||
<IfModule unixd_module> |
||||
# |
||||
# If you wish httpd to run as a different user or group, you must run |
||||
# httpd as root initially and it will switch. |
||||
# |
||||
# User/Group: The name (or #number) of the user/group to run httpd as. |
||||
# It is usually good practice to create a dedicated user and group for |
||||
# running httpd, as with most system services. |
||||
# |
||||
User http |
||||
Group http |
||||
</IfModule> |
||||
|
||||
# 'Main' server configuration |
||||
# |
||||
# The directives in this section set up the values used by the 'main' |
||||
# server, which responds to any requests that aren't handled by a |
||||
# <VirtualHost> definition. These values also provide defaults for |
||||
# any <VirtualHost> containers you may define later in the file. |
||||
# |
||||
# All of these directives may appear inside <VirtualHost> containers, |
||||
# in which case these default settings will be overridden for the |
||||
# virtual host being defined. |
||||
# |
||||
|
||||
# |
||||
# ServerAdmin: Your address, where problems with the server should be |
||||
# e-mailed. This address appears on some server-generated pages, such |
||||
# as error documents. e.g. admin@your-domain.com |
||||
# |
||||
ServerAdmin you@example.com |
||||
|
||||
# |
||||
# ServerName gives the name and port that the server uses to identify itself. |
||||
# This can often be determined automatically, but we recommend you specify |
||||
# it explicitly to prevent problems during startup. |
||||
# |
||||
# If your host doesn't have a registered DNS name, enter its IP address here. |
||||
# |
||||
#ServerName www.example.com:@@Port@@ |
||||
# XAMPP |
||||
ServerName localhost |
||||
|
||||
# |
||||
# Deny access to the entirety of your server's filesystem. You must |
||||
# explicitly permit access to web content directories in other |
||||
# <Directory> blocks below. |
||||
# |
||||
<Directory /> |
||||
AllowOverride none |
||||
Require all denied |
||||
</Directory> |
||||
|
||||
# |
||||
# Note that from this point forward you must specifically allow |
||||
# particular features to be enabled - so if something's not working as |
||||
# you might expect, make sure that you have specifically enabled it |
||||
# below. |
||||
# |
||||
|
||||
# |
||||
# DocumentRoot: The directory out of which you will serve your |
||||
# documents. By default, all requests are taken from this directory, but |
||||
# symbolic links and aliases may be used to point to other locations. |
||||
# |
||||
DocumentRoot "/opt/lampp/htdocs" |
||||
<Directory "/opt/lampp/htdocs"> |
||||
# |
||||
# Possible values for the Options directive are "None", "All", |
||||
# or any combination of: |
||||
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews |
||||
# |
||||
# Note that "MultiViews" must be named *explicitly* --- "Options All" |
||||
# doesn't give it to you. |
||||
# |
||||
# The Options directive is both complicated and important. Please see |
||||
# http://httpd.apache.org/docs/trunk/mod/core.html#options |
||||
# for more information. |
||||
# |
||||
#Options Indexes FollowSymLinks |
||||
# XAMPP |
||||
Options Indexes FollowSymLinks ExecCGI Includes |
||||
|
||||
# |
||||
# AllowOverride controls what directives may be placed in .htaccess files. |
||||
# It can be "All", "None", or any combination of the keywords: |
||||
# Options FileInfo AuthConfig Limit |
||||
# |
||||
#AllowOverride None |
||||
# since XAMPP 1.4: |
||||
AllowOverride All |
||||
|
||||
# |
||||
# Controls who can get stuff from this server. |
||||
# |
||||
Require all granted |
||||
</Directory> |
||||
|
||||
# |
||||
# DirectoryIndex: sets the file that Apache will serve if a directory |
||||
# is requested. |
||||
# |
||||
<IfModule dir_module> |
||||
#DirectoryIndex index.html |
||||
# XAMPP |
||||
DirectoryIndex index.html index.html.var index.php index.php3 index.php4 |
||||
</IfModule> |
||||
|
||||
# |
||||
# The following lines prevent .htaccess and .htpasswd files from being |
||||
# viewed by Web clients. |
||||
# |
||||
<Files ".ht*"> |
||||
Require all denied |
||||
</Files> |
||||
|
||||
# |
||||
# ErrorLog: The location of the error log file. |
||||
# If you do not specify an ErrorLog directive within a <VirtualHost> |
||||
# container, error messages relating to that virtual host will be |
||||
# logged here. If you *do* define an error logfile for a <VirtualHost> |
||||
# container, that host's errors will be logged there and not here. |
||||
# |
||||
ErrorLog "logs/error_log" |
||||
|
||||
# |
||||
# LogLevel: Control the number of messages logged to the error_log. |
||||
# Possible values include: debug, info, notice, warn, error, crit, |
||||
# alert, emerg. |
||||
# |
||||
LogLevel warn |
||||
|
||||
<IfModule log_config_module> |
||||
# |
||||
# The following directives define some format nicknames for use with |
||||
# a CustomLog directive (see below). |
||||
# |
||||
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined |
||||
LogFormat "%h %l %u %t \"%r\" %>s %b" common |
||||
|
||||
<IfModule logio_module> |
||||
# You need to enable mod_logio.c to use %I and %O |
||||
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio |
||||
</IfModule> |
||||
|
||||
# |
||||
# The location and format of the access logfile (Common Logfile Format). |
||||
# If you do not define any access logfiles within a <VirtualHost> |
||||
# container, they will be logged here. Contrariwise, if you *do* |
||||
# define per-<VirtualHost> access logfiles, transactions will be |
||||
# logged therein and *not* in this file. |
||||
# |
||||
CustomLog "logs/access_log" common |
||||
|
||||
# |
||||
# If you prefer a logfile with access, agent, and referer information |
||||
# (Combined Logfile Format) you can use the following directive. |
||||
# |
||||
#CustomLog "logs/access_log" combined |
||||
</IfModule> |
||||
|
||||
<IfModule alias_module> |
||||
# |
||||
# Redirect: Allows you to tell clients about documents that used to |
||||
# exist in your server's namespace, but do not anymore. The client |
||||
# will make a new request for the document at its new location. |
||||
# Example: |
||||
# Redirect permanent /foo http://www.example.com/bar |
||||
|
||||
# |
||||
# Alias: Maps web paths into filesystem paths and is used to |
||||
# access content that does not live under the DocumentRoot. |
||||
# Example: |
||||
# Alias /webpath /full/filesystem/path |
||||
# |
||||
# If you include a trailing / on /webpath then the server will |
||||
# require it to be present in the URL. You will also likely |
||||
# need to provide a <Directory> section to allow access to |
||||
# the filesystem path. |
||||
|
||||
# |
||||
# ScriptAlias: This controls which directories contain server scripts. |
||||
# ScriptAliases are essentially the same as Aliases, except that |
||||
# documents in the target directory are treated as applications and |
||||
# run by the server when requested rather than as documents sent to the |
||||
# client. The same rules about trailing "/" apply to ScriptAlias |
||||
# directives as to Alias. |
||||
# |
||||
ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/" |
||||
|
||||
Alias /Sites /home/jonathan/Sites |
||||
</IfModule> |
||||
|
||||
<IfModule cgid_module> |
||||
# |
||||
# ScriptSock: On threaded servers, designate the path to the UNIX |
||||
# socket used to communicate with the CGI daemon of mod_cgid. |
||||
# |
||||
#Scriptsock logs/cgisock |
||||
</IfModule> |
||||
|
||||
# |
||||
# "/opt/lampp/cgi-bin" should be changed to whatever your ScriptAliased |
||||
# CGI directory exists, if you have that configured. |
||||
# |
||||
<Directory "/opt/lampp/cgi-bin"> |
||||
AllowOverride None |
||||
Options None |
||||
Require all granted |
||||
</Directory> |
||||
|
||||
<IfModule mime_module> |
||||
# |
||||
# TypesConfig points to the file containing the list of mappings from |
||||
# filename extension to MIME-type. |
||||
# |
||||
TypesConfig etc/mime.types |
||||
|
||||
# |
||||
# AddType allows you to add to or override the MIME configuration |
||||
# file specified in TypesConfig for specific file types. |
||||
# |
||||
#AddType application/x-gzip .tgz |
||||
# |
||||
# AddEncoding allows you to have certain browsers uncompress |
||||
# information on the fly. Note: Not all browsers support this. |
||||
# |
||||
#AddEncoding x-compress .Z |
||||
#AddEncoding x-gzip .gz .tgz |
||||
# |
||||
# If the AddEncoding directives above are commented-out, then you |
||||
# probably should define those extensions to indicate media types: |
||||
# |
||||
AddType application/x-compress .Z |
||||
AddType application/x-gzip .gz .tgz |
||||
|
||||
# |
||||
# AddHandler allows you to map certain file extensions to "handlers": |
||||
# actions unrelated to filetype. These can be either built into the server |
||||
# or added with the Action directive (see below) |
||||
# |
||||
# To use CGI scripts outside of ScriptAliased directories: |
||||
# (You will also need to add "ExecCGI" to the "Options" directive.) |
||||
# |
||||
#AddHandler cgi-script .cgi |
||||
# XAMPP, since LAMPP 0.9.8: |
||||
AddHandler cgi-script .cgi .pl |
||||
|
||||
# For type maps (negotiated resources): |
||||
#AddHandler type-map var |
||||
|
||||
# |
||||
# Filters allow you to process content before it is sent to the client. |
||||
# |
||||
# To parse .shtml files for server-side includes (SSI): |
||||
# (You will also need to add "Includes" to the "Options" directive.) |
||||
# |
||||
# XAMPP |
||||
AddType text/html .shtml |
||||
AddOutputFilter INCLUDES .shtml |
||||
</IfModule> |
||||
|
||||
# |
||||
# The mod_mime_magic module allows the server to use various hints from the |
||||
# contents of the file itself to determine its type. The MIMEMagicFile |
||||
# directive tells the module where the hint definitions are located. |
||||
# |
||||
#MIMEMagicFile etc/magic |
||||
|
||||
# |
||||
# Customizable error responses come in three flavors: |
||||
# 1) plain text 2) local redirects 3) external redirects |
||||
# |
||||
# Some examples: |
||||
#ErrorDocument 500 "The server made a boo boo." |
||||
#ErrorDocument 404 /missing.html |
||||
#ErrorDocument 404 "/cgi-bin/missing_handler.pl" |
||||
#ErrorDocument 402 http://www.example.com/subscription_info.html |
||||
# |
||||
|
||||
# |
||||
# MaxRanges: Maximum number of Ranges in a request before |
||||
# returning the entire resource, or one of the special |
||||
# values 'default', 'none' or 'unlimited'. |
||||
# Default setting is to accept 200 Ranges. |
||||
#MaxRanges unlimited |
||||
|
||||
# |
||||
# EnableMMAP and EnableSendfile: On systems that support it, |
||||
# memory-mapping or the sendfile syscall may be used to deliver |
||||
# files. This usually improves server performance, but must |
||||
# be turned off when serving from networked-mounted |
||||
# filesystems or if support for these functions is otherwise |
||||
# broken on your system. |
||||
# Defaults: EnableMMAP On, EnableSendfile Off |
||||
# |
||||
EnableMMAP off |
||||
EnableSendfile off |
||||
|
||||
# Supplemental configuration |
||||
# |
||||
# The configuration files in the etc/extra/ directory can be |
||||
# included to add extra features or to modify the default configuration of |
||||
# the server, or you may simply copy their contents here and change as |
||||
# necessary. |
||||
|
||||
# Server-pool management (MPM specific) |
||||
#Include etc/extra/httpd-mpm.conf |
||||
|
||||
# Multi-language error messages |
||||
Include etc/extra/httpd-multilang-errordoc.conf |
||||
|
||||
# Fancy directory listings |
||||
Include etc/extra/httpd-autoindex.conf |
||||
|
||||
# Language settings |
||||
#Include etc/extra/httpd-languages.conf |
||||
|
||||
# User home directories |
||||
Include etc/extra/httpd-userdir.conf |
||||
|
||||
# Real-time info on requests and configuration |
||||
#Include etc/extra/httpd-info.conf |
||||
|
||||
# Virtual hosts |
||||
Include etc/extra/httpd-vhosts.conf |
||||
|
||||
# Local access to the Apache HTTP Server Manual |
||||
#Include etc/extra/httpd-manual.conf |
||||
|
||||
# Distributed authoring and versioning (WebDAV) |
||||
#Include etc/extra/httpd-dav.conf |
||||
|
||||
# Various default settings |
||||
Include etc/extra/httpd-default.conf |
||||
|
||||
# Configure mod_proxy_html to understand HTML4/XHTML1 |
||||
<IfModule proxy_html_module> |
||||
Include etc/extra/proxy-html.conf |
||||
</IfModule> |
||||
|
||||
# Secure (SSL/TLS) connections |
||||
<IfModule ssl_module> |
||||
# XAMPP |
||||
<IfDefine SSL> |
||||
Include etc/extra/httpd-ssl.conf |
||||
</IfDefine> |
||||
</IfModule> |
||||
# |
||||
# Note: The following must must be present to support |
||||
# starting without SSL on platforms with no /dev/random equivalent |
||||
# but a statically compiled-in mod_ssl. |
||||
# |
||||
<IfModule ssl_module> |
||||
SSLRandomSeed startup builtin |
||||
SSLRandomSeed connect builtin |
||||
</IfModule> |
||||
|
||||
# XAMPP |
||||
Include etc/extra/httpd-xampp.conf |
||||
Include "/opt/lampp/apache2/conf/httpd.conf" |
||||
|
Loading…
Reference in new issue