mirror of
https://github.com/arcan1s/arcanis.me.git
synced 2025-04-24 15:27:17 +00:00
tested ru map
This commit is contained in:
parent
ef61f4441c
commit
1c25bfbd40
12
404.html
12
404.html
@ -23,6 +23,16 @@
|
||||
<p class="view">Page not found!</p>
|
||||
</header>
|
||||
<section>
|
||||
<!-- redirection to russian page -->
|
||||
<script>
|
||||
var languageinfo=navigator.language? navigator.language : navigator.userLanguage
|
||||
function redirectpage(dest) {
|
||||
if (window.location.replace) window.location.replace(dest)
|
||||
else window.location=dest
|
||||
}
|
||||
if (languageinfo.substr(0,2) == "ru") redirectpage("/ru/404")
|
||||
</script>
|
||||
<!-- redirection to russian page -->
|
||||
|
||||
<h3>Hello!</h3>
|
||||
|
||||
@ -35,7 +45,7 @@
|
||||
<p><small>Hosted on GitHub Pages. <a href="/authors">Authors</a></small></p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/js/scale.fix.js"></script>
|
||||
<script src="/resources/js/scale.fix.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
63
_config.yml
63
_config.yml
@ -1,7 +1,64 @@
|
||||
exclude: ['.gitignore','Gemfile','Gemfile.lock','README.md','TODO']
|
||||
source: .
|
||||
destination: ./_site
|
||||
plugins: ./_plugins
|
||||
layouts: ./_layouts
|
||||
include: ['.htaccess']
|
||||
exclude: ['.gitignore','Gemfile','Gemfile.lock','README.md','TODO']
|
||||
keep_files: ['.git','.svn']
|
||||
gems: []
|
||||
|
||||
future: true
|
||||
limit_posts: 0
|
||||
pygments: true
|
||||
|
||||
relative_permalinks: true
|
||||
|
||||
permalink: pretty
|
||||
paginate: 10
|
||||
paginate_path: '/blog/:num'
|
||||
|
||||
markdown: rdiscount
|
||||
baseurl: http://arcan1s.github.io
|
||||
lsi: true
|
||||
markdown_ext: markdown,mkd,mkdn,md
|
||||
textile_ext: textile
|
||||
|
||||
excerpt_separator: "\n\n"
|
||||
|
||||
safe: false
|
||||
host: 0.0.0.0
|
||||
port: 4000
|
||||
baseurl: /
|
||||
url: http://localhost:4000
|
||||
lsi: true
|
||||
|
||||
maruku:
|
||||
use_tex: false
|
||||
use_divs: false
|
||||
png_engine: blahtex
|
||||
png_dir: images/latex
|
||||
png_url: /images/latex
|
||||
fenced_code_blocks: true
|
||||
|
||||
rdiscount:
|
||||
extensions: []
|
||||
|
||||
redcarpet:
|
||||
extensions: []
|
||||
|
||||
kramdown:
|
||||
auto_ids: true
|
||||
footnote_nr: 1
|
||||
entity_output: as_char
|
||||
toc_levels: 1..6
|
||||
smart_quotes: lsquo,rsquo,ldquo,rdquo
|
||||
use_coderay: false
|
||||
|
||||
coderay:
|
||||
coderay_wrap: div
|
||||
coderay_line_numbers: inline
|
||||
coderay_line_numbers_start: 1
|
||||
coderay_tab_width: 4
|
||||
coderay_bold_every: 10
|
||||
coderay_css: style
|
||||
|
||||
redcloth:
|
||||
hard_breaks: true
|
||||
|
@ -40,6 +40,8 @@
|
||||
{% include footer_sharethis.html %}
|
||||
{% endif %}
|
||||
<small>Hosted on GitHub Pages. <a href="/authors">Authors</a></small></p>
|
||||
<p><a href="{{ page.url }}"><img src="/resources/en.png"></a>
|
||||
<a href="/ru{{ page.url }}"><img src="/resources/ru.png"></a></p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/resources/js/scale.fix.js"></script>
|
||||
|
@ -1,6 +1,5 @@
|
||||
---
|
||||
layout: paper
|
||||
date: 14 January 2014
|
||||
last: 14 January 2014
|
||||
tags: zshrc, configuration, linux
|
||||
title: About zshrc
|
||||
|
406
_ruposts/.2011-01-14-about-zshrchtml
Normal file
406
_ruposts/.2011-01-14-about-zshrchtml
Normal file
@ -0,0 +1,406 @@
|
||||
---
|
||||
layout: paper
|
||||
date: 14 January 2014
|
||||
last: 14 January 2014
|
||||
tags: zshrc, configuration, linux
|
||||
title: About zshrc
|
||||
short: about-zshrc
|
||||
description: It is first paper in my blog (I think I need something here for tests =)). There are many similar articles, and I'll not be an exception. I just want to show my <code>.zshrc</code> and explain what it does and why it is needed. Also any comments or additions are welcome. It is a translated paper from Russian (<a href="http://archlinux.org.ru/forum/topic/12752/">original</a>).
|
||||
commentIssueId: 5
|
||||
---
|
||||
<h3><a name="prepare" class="anchor" href="#prepare"><span class="octicon octicon-link"></span></a>Prepare</h2>
|
||||
<p align="justify">First install recommended minima:</p>
|
||||
<pre>pacman -Sy pkgfile zsh zsh-completions zsh-syntax-highlighting</pre>
|
||||
<p align="justify"><a href="https://www.archlinux.org/packages/pkgfile/">pkgfile</a> is a very useful utility. Alo this command will install shell, additional completion and syntax highlighting.</p>
|
||||
|
||||
<h3><a name="configuration" class="anchor" href="#configuration"><span class="octicon octicon-link"></span></a>Shell configuration</h2>
|
||||
<p align="justify">All options are avaible <a href="http://zsh.sourceforge.net/Doc/Release/Options.html">here</a>.</p>
|
||||
|
||||
<p align="justify">Set history file and number of commands in cache of the current session and in the history file:</p>
|
||||
<pre># history
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTSIZE=500000
|
||||
SAVEHIST=500000</pre>
|
||||
|
||||
<p align="justify">I can not remember all <code>Ctrl+</code> combinations so I bind keys to its default usages:</p>
|
||||
<pre># bindkeys
|
||||
bindkey '^[[A' up-line-or-search # up arrow for back-history-search
|
||||
bindkey '^[[B' down-line-or-search # down arrow for fwd-history-search
|
||||
bindkey '\e[1~' beginning-of-line # home
|
||||
bindkey '\e[2~' overwrite-mode # insert
|
||||
bindkey '\e[3~' delete-char # del
|
||||
bindkey '\e[4~' end-of-line # end
|
||||
bindkey '\e[5~' up-line-or-history # page-up
|
||||
bindkey '\e[6~' down-line-or-history # page-down</pre>
|
||||
<p align="justify">But in this case <code>Up</code>/<code>Down</code> arrows are used to navigate through the history based on <b>already entered part</b> of a command. And <code>PgUp</code>/<code>PgDown</code> <b>will ignore</b> already entered part of a command.</p>
|
||||
|
||||
<p align="justify">Command autocomplete:</p>
|
||||
<pre># autocomplete
|
||||
autoload -U compinit
|
||||
compinit
|
||||
zstyle ':completion:*' insert-tab false
|
||||
zstyle ':completion:*' max-errors 2</pre>
|
||||
<p align="justify">Full command autocomplete will be enabled. <code>insert-tab false</code> will enable autocomplete for <b>non-entered</b> commands. <code>max-errors</code> sets maximum number of errors that could be corrected.</p>
|
||||
|
||||
<p align="justify">Prompt:</p>
|
||||
<pre># promptinit
|
||||
autoload -U promptinit
|
||||
promptinit</pre>
|
||||
|
||||
<p align="justify">Enable colors:</p>
|
||||
<pre># colors
|
||||
autoload -U colors
|
||||
colors</pre>
|
||||
|
||||
<p align="justify">Here are some other options.</p>
|
||||
<p align="justify">Change directory without <code>cd</code>:</p>
|
||||
<pre># autocd
|
||||
setopt autocd</pre>
|
||||
<p align="justify">Correcting of typos (and question template):</p>
|
||||
<pre># correct
|
||||
setopt CORRECT_ALL
|
||||
SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) "</pre>
|
||||
<p align="justify">Disable f#$%ing beep:</p>
|
||||
<pre># disable beeps
|
||||
unsetopt beep</pre>
|
||||
<p align="justify">Enable calculator:</p>
|
||||
<pre># calc
|
||||
autoload zcalc</pre>
|
||||
<p align="justify">Append history (<b>do not recreate</b> the history file):</p>
|
||||
<pre># append history
|
||||
setopt APPEND_HISTORY</pre>
|
||||
<p align="justify">Do not save dups to history file:</p>
|
||||
<pre># ignore dups in history
|
||||
setopt HIST_IGNORE_ALL_DUPS</pre>
|
||||
<p align="justify">...and additional spaces:</p>
|
||||
<pre># ignore dups in history
|
||||
setopt HIST_IGNORE_SPACE</pre>
|
||||
<p align="justify">...and blank lines too:</p>
|
||||
<pre># reduce blanks in history
|
||||
setopt HIST_REDUCE_BLANKS</pre>
|
||||
<p align="justify">Enable <code>pkgfile</code>:</p>
|
||||
<pre># pkgfile
|
||||
source /usr/share/doc/pkgfile/command-not-found.zsh</pre>
|
||||
|
||||
<h3><a name="highlighting" class="anchor" href="#highlighting"><span class="octicon octicon-link"></span></a>Syntax highlighting</h2>
|
||||
<div class="codeblock"># highlighting
|
||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
||||
# brackets
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
|
||||
# cursor
|
||||
#ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
||||
# main
|
||||
# default
|
||||
ZSH_HIGHLIGHT_STYLES[default]='none'
|
||||
# unknown
|
||||
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red'
|
||||
# command
|
||||
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=magenta,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=yellow,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[builtin]='fg=green,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[function]='fg=green,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[command]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[precommand]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=yellow'
|
||||
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue,bold'
|
||||
# path
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[path_approx]='fg=cyan'
|
||||
# shell
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=blue'
|
||||
ZSH_HIGHLIGHT_STYLES[assign]='fg=magenta'
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=blue'
|
||||
# quotes
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow'
|
||||
# pattern example
|
||||
#ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
# root example
|
||||
#ZSH_HIGHLIGHT_STYLES[root]='bg=red'</div>
|
||||
<p align="justify">In first line highlighting is turned on. Next main, brackets and pattern highlighting are turned on. Patterns are set below (<code>rm -rf *</code> in the example). Also <code>root</code> and <code>cursor</code> highlighting may be turned on. Colors syntax is understandable, <code>fg</code> is font color, <code>bg</code> is background color.</p>
|
||||
|
||||
<h3><a name="prompt" class="anchor" href="#prompt"><span class="octicon octicon-link"></span></a>$PROMPT and $RPROMPT</h2>
|
||||
<p align="justify">The general idea is the use single <code>.zshrc</code> for root and normal user:</p>
|
||||
<div class="codeblock"># PROMPT && RPROMPT
|
||||
if [[ $EUID == 0 ]]; then
|
||||
# [root@host dir]#
|
||||
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||
%{$fg_bold[red]%}%n%{$reset_color%}\
|
||||
%{$fg_bold[white]%}@%{$reset_color%}\
|
||||
%{$fg_no_bold[red]%}%m %{$reset_color%}\
|
||||
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
||||
%{$fg_bold[white]%}]# %{$reset_color%}"
|
||||
else
|
||||
# [user@host dir]$
|
||||
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||
%{$fg_bold[green]%}%n%{$reset_color%}\
|
||||
%{$fg_bold[white]%}@%{$reset_color%}\
|
||||
%{$fg_no_bold[green]%}%m %{$reset_color%}\
|
||||
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
||||
%{$fg_bold[white]%}]$ %{$reset_color%}"
|
||||
fi</div>
|
||||
|
||||
<p align="justify"><code>fg</code> is font color, <code>bg</code> is background color. <code>\_bold</code> and <code>\_no_bold</code> regulate the tint. Commands should be in <code>%{ ... %}</code> so they do not appear. Avaible colors are:</p>
|
||||
<pre>black
|
||||
red
|
||||
green
|
||||
yellow
|
||||
blue
|
||||
magenta
|
||||
cyan
|
||||
white</pre>
|
||||
|
||||
<p align="justify">Avaible variables are:</p>
|
||||
<div class="codeblock">%n - the username
|
||||
%m - the computer's hostname (truncated to the first period)
|
||||
%M - the computer's hostname
|
||||
%l - the current tty
|
||||
%? - the return code of the last-run application.
|
||||
%# - the prompt based on user privileges (# for root and % for the rest)
|
||||
%T - system time(HH:MM)
|
||||
%* - system time(HH:MM:SS)
|
||||
%D - system date(YY-MM-DD)
|
||||
%d - the current working directory
|
||||
%~ - the same as %d but if in $HOME, this will be replaced by ~
|
||||
%1/ - the same as %d but only last directory</div>
|
||||
|
||||
<p align="justify">RPROMPT (<code>acpi</code> package is necessary):</p>
|
||||
<div class="codeblock">precmd () {
|
||||
# battery charge
|
||||
function batcharge {
|
||||
bat_perc=`acpi | awk {'print $4;'} | sed -e "s/\s//" -e "s/%.*//"`
|
||||
if [[ $bat_perc < 15 ]]; then
|
||||
col="%{$fg_bold[red]%}"
|
||||
elif [[ $bat_perc < 50 ]]; then
|
||||
col="%{$fg_bold[yellow]%}"
|
||||
else
|
||||
col="%{$fg_bold[green]%}"
|
||||
fi
|
||||
echo "%{$fg_bold[white]%}["$col$bat_perc"%{$fg_bold[white]%}%%]%{$reset_color%}"
|
||||
}
|
||||
# last command
|
||||
returncode="%(?.%{$fg[green]%}.%{$fg[red]%})%?%{$resetcolor%}"
|
||||
RPROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||
%{$fg_bold[cyan]%}%T%{$reset_color%}\
|
||||
%{$fg_bold[white]%}] %{$reset_color%}"\
|
||||
$(batcharge)\
|
||||
"%{$fg_bold[white]%}[%{$reset_color%}"\
|
||||
$returncode\
|
||||
"%{$fg_bold[white]%}]%{$reset_color%}"</div>
|
||||
<p align="justify">My RPROMPT shows current time, battery change and last returned code. <code>precmd()</code> is necessary for automatic updating. The construct <code>$(if.true.false)</code> is conditional statement in <code>zsh</code>.</p>
|
||||
|
||||
<h3><a name="aliases" class="anchor" href="#aliases"><span class="octicon octicon-link"></span></a>Aliases</h2>
|
||||
<p align="justify"><b>Copy only those aliases that you need.</b> If any alias uses application that is not installed it will leads to fail of loading of configuration file.</p>
|
||||
|
||||
<p align="justify">Small useful (or maybe not) function:</p>
|
||||
<pre>show_which() {
|
||||
OUTPUT=$(which $1 | cut -d " " -f7-)
|
||||
echo "Running '$OUTPUT'" 1>&2
|
||||
}</pre>
|
||||
|
||||
<p align="justify">Here is the first group of aliases:</p>
|
||||
<div class="codeblock">## alias
|
||||
# colored grep
|
||||
alias grep='grep --colour=auto'
|
||||
# change top to htop
|
||||
alias top='show_which top && htop'
|
||||
# chromium with different proxy servers (i2p and tor included)
|
||||
alias chrommsu='show_which chrommsu && chromium --proxy-server=cache.msu:3128'
|
||||
alias chromtor='show_which chromtor && chromium --proxy-server="socks://localhost:9050" --incognito'
|
||||
alias chromi2p='show_which chromi2p && chromium --proxy-server="http=127.0.0.1:4444;https=127.0.0.1:4445" --incognito'
|
||||
# human-readable df and du
|
||||
alias df='show_which df && df -k --print-type --human-readable'
|
||||
alias du='show_which du && du -k --total --human-readable'
|
||||
# change less and zless to vimpager
|
||||
alias less='vimpager'
|
||||
alias zless='vimpager'
|
||||
# more interactive rm
|
||||
alias rm='show_which rm && rm -I'</div>
|
||||
|
||||
<p align="justify">Here are ls aliases (see <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?ls">man ls</a>):</p>
|
||||
<pre>alias ls='show_which ls && ls --color=auto'
|
||||
alias ll='show_which ll && ls --group-directories-first -l --human-readable'
|
||||
alias lr='show_which lr && ls --recursive'
|
||||
alias la='show_which la && ll --almost-all'
|
||||
alias lx='show_which lx && ll -X --ignore-backups'
|
||||
alias lz='show_which lz && ll -S --reverse'
|
||||
alias lt='show_which lt && ll -t --reverse'
|
||||
alias lm='show_which lm && la | more'</pre>
|
||||
|
||||
<p align="justify">Here are aliases to quick file view from console (just type a file name!):</p>
|
||||
<pre># alias -s
|
||||
alias -s {avi,mpeg,mpg,mov,m2v,mkv}=mpv
|
||||
alias -s {mp3,flac}=qmmp
|
||||
alias -s {odt,doc,xls,ppt,docx,xlsx,pptx,csv}=libreoffice
|
||||
alias -s {pdf}=okular
|
||||
autoload -U pick-web-browser
|
||||
alias -s {html,htm}=opera</pre>
|
||||
|
||||
<p align="justify">Here are "sudo" aliases:</p>
|
||||
<div class="codeblock"># sudo alias
|
||||
if [[ $EUID == 0 ]]; then
|
||||
alias fat32mnt='show_which fat32mnt && mount -t vfat -o codepage=866,iocharset=utf8,umask=000'
|
||||
alias synctime='show_which synctime && { ntpd -qg; hwclock -w; date; }'
|
||||
else
|
||||
alias fat32mnt='show_which fat32mnt && sudo mount -t vfat -o codepage=866,iocharset=utf8,umask=000'
|
||||
alias umount='show_which umount && sudo umount'
|
||||
alias mount='show_which mount && sudo mount'
|
||||
alias netctl='show_which netctl && sudo netctl'
|
||||
alias synctime='show_which synctime && { sudo ntpd -qg; sudo hwclock -w; date; }'
|
||||
alias wifi-menu='show_which wifi-menu && sudo wifi-menu'
|
||||
alias dhcpcd='show_which dhcpcd && sudo dhcpcd'
|
||||
alias journalctl='show_which journalctl && sudo journalctl'
|
||||
alias systemctl='show_which systemctl && sudo systemctl'
|
||||
alias modprobe='show_which modprobe && sudo modprobe'
|
||||
alias rmmod='show_which rmmod && sudo rmmod'
|
||||
alias staging-i686-build='show_which staging-i686-build && sudo staging-i686-build'
|
||||
alias staging-x86_64-build='show_which staging-x86_64-build && sudo staging-x86_64-build'
|
||||
fi</div>
|
||||
|
||||
<p align="justify">Here are global aliases. If they are enable the command <code>cat foo g bar</code> will be equivalent the command <code>cat foo | grep bar</code>:</p>
|
||||
<pre># global alias
|
||||
alias -g g="| grep"
|
||||
alias -g l="| less"
|
||||
alias -g t="| tail"
|
||||
alias -g h="| head"
|
||||
alias -g dn="&> /dev/null &"</pre>
|
||||
|
||||
<h3><a name="functions" class="anchor" href="#functions"><span class="octicon octicon-link"></span></a>Functions</h2>
|
||||
<p align="justify">Here is a special function for <code>xrandr</code>:</p>
|
||||
|
||||
<div class="codeblock"># function to contorl xrandr
|
||||
# EXAMPLE: projctl 1024x768
|
||||
projctl () {
|
||||
if [ $1 ] ; then
|
||||
if [ $1 = "-h" ]; then
|
||||
echo "Usage: projctl [ off/resolution ]"
|
||||
return
|
||||
fi
|
||||
if [ $1 = "off" ]; then
|
||||
echo "Disable VGA1"
|
||||
xrandr --output VGA1 --off --output LVDS1 --mode 1366x768
|
||||
else
|
||||
echo "Using resolution: $1"
|
||||
xrandr --output VGA1 --mode $1 --output LVDS1 --mode $1
|
||||
fi
|
||||
else
|
||||
echo "Using default resolution"
|
||||
xrandr --output VGA1 --mode 1366x768 --output LVDS1 --mode 1366x768
|
||||
fi
|
||||
}</div>
|
||||
|
||||
<p align="justify">Unfortunately I can not remember <code>tar</code> flags thus I use special functions:</p>
|
||||
<div class="codeblock"># function to extract archives
|
||||
# EXAMPLE: unpack file
|
||||
unpack () {
|
||||
if [[ -f $1 ]]; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjfv $1 ;;
|
||||
*.tar.gz) tar xzfv $1 ;;
|
||||
*.tar.xz) tar xvJf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz) tar xjvf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "I don't know how to extract '$1'" ;;
|
||||
esac
|
||||
else
|
||||
case $1 in
|
||||
*help) echo "Usage: unpack ARCHIVE_NAME" ;;
|
||||
*) echo "'$1' is not a valid file" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
# function to create archives
|
||||
# EXAMPLE: pack tar file
|
||||
pack () {
|
||||
if [ $1 ]; then
|
||||
case $1 in
|
||||
tar.bz2) tar -cjvf $2.tar.bz2 $2 ;;
|
||||
tar.gz) tar -czvf $2.tar.bz2 $2 ;;
|
||||
tar.xz) tar -cf - $2 | xz -9 -c - > $2.tar.xz ;;
|
||||
bz2) bzip $2 ;;
|
||||
gz) gzip -c -9 -n $2 > $2.gz ;;
|
||||
tar) tar cpvf $2.tar $2 ;;
|
||||
tbz) tar cjvf $2.tar.bz2 $2 ;;
|
||||
tgz) tar czvf $2.tar.gz $2 ;;
|
||||
zip) zip -r $2.zip $2 ;;
|
||||
7z) 7z a $2.7z $2 ;;
|
||||
*help) echo "Usage: pack TYPE FILES" ;;
|
||||
*) echo "'$1' cannot be packed via pack()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}</div>
|
||||
|
||||
<p align="justify">Here is a special function for <code>su</code>:</p>
|
||||
<div class="codeblock">su () {
|
||||
checksu=0
|
||||
for flags in $*; do
|
||||
if [[ $flags == "-" ]]; then
|
||||
checksu=1
|
||||
fi
|
||||
done
|
||||
if [[ $checksu == 0 ]]; then
|
||||
echo "Use 'su -', Luke"
|
||||
/usr/bin/su - $*
|
||||
else
|
||||
/usr/bin/su $*
|
||||
fi
|
||||
}</div>
|
||||
|
||||
<p align="justify">Functions with automatic rehash after installing/removing packages are:</p>
|
||||
<div class="codeblock">pacman () {
|
||||
/usr/bin/sudo /usr/bin/pacman $* && echo "$*" | grep -q "S\\|R\\|U" && rehash
|
||||
}
|
||||
yaourt () {
|
||||
/usr/bin/yaourt $* && echo "$*" | grep -q "S\\|R\\|U" && rehash
|
||||
}
|
||||
# for testing repo
|
||||
yatest () {
|
||||
/usr/bin/yaourt --config /etc/pactest.conf $* && echo "$*" | grep -q "S\\|R\\|U" && rehash
|
||||
}</div>
|
||||
<p align="justify">But autocomplete for <code>yaourt -Ss</code> <a href="https://github.com/zsh-users/zsh-completions/pull/205">will require</a> root privileges.</p>
|
||||
|
||||
<h3><a name="variables" class="anchor" href="#variables"><span class="octicon octicon-link"></span></a>Variables</h2>
|
||||
<p align="justify">It is recommended to set own variables in <code>~/.zshenv</code>. But I have everything stored in the single file.</p>
|
||||
|
||||
<p align="justify">Here are path, mask of new files, editor and pager:</p>
|
||||
<pre># path
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
# umask
|
||||
umask 022
|
||||
# editor
|
||||
export EDITOR="vim"
|
||||
export PAGER="vimpager"</pre>
|
||||
|
||||
<p align="justify">Here is hashes. If they are enable the command <code>~global</code> will be equivalent the command <code>/mnt/global</code>:</p>
|
||||
<pre># hash
|
||||
hash -d global=/mnt/global
|
||||
hash -d windows=/mnt/windows
|
||||
hash -d iso=/mnt/iso
|
||||
hash -d u1=/mnt/usbdev1
|
||||
hash -d u2=/mnt/usbdev2</pre>
|
||||
|
||||
<h3><a name="screenshot" class="anchor" href="#screenshot"><span class="octicon octicon-link"></span></a>Screenshot</h2>
|
||||
<p align="justify"><a href="/resources/screenshots/zshrc_demo.png"><img src="/resources/preview/zshrc_demo_prev.jpg"></a></p>
|
||||
|
||||
<h3><a name="file" class="anchor" href="#file"><span class="octicon octicon-link"></span></a>File</h2>
|
||||
<p align="justify"><a href="https://raw.github.com/arcan1s/dotfiles/master/zshrc">Here is</a> my <code>.zshrc</code>.</p>
|
406
_ruposts/2014-01-14-about-zshrc.html
Normal file
406
_ruposts/2014-01-14-about-zshrc.html
Normal file
@ -0,0 +1,406 @@
|
||||
---
|
||||
layout: paper
|
||||
categories: ru
|
||||
last: 14 January 2014
|
||||
tags: zshrc, configuration, linux
|
||||
title: About zshrc
|
||||
short: about-zshrc
|
||||
description: It is first paper in my blog (I think I need something here for tests =)). There are many similar articles, and I'll not be an exception. I just want to show my <code>.zshrc</code> and explain what it does and why it is needed. Also any comments or additions are welcome. It is a translated paper from Russian (<a href="http://archlinux.org.ru/forum/topic/12752/">original</a>).
|
||||
commentIssueId: 5
|
||||
---
|
||||
<h3><a name="prepare" class="anchor" href="#prepare"><span class="octicon octicon-link"></span></a>Prepare</h2>
|
||||
<p align="justify">First install recommended minima:</p>
|
||||
<pre>pacman -Sy pkgfile zsh zsh-completions zsh-syntax-highlighting</pre>
|
||||
<p align="justify"><a href="https://www.archlinux.org/packages/pkgfile/">pkgfile</a> is a very useful utility. Alo this command will install shell, additional completion and syntax highlighting.</p>
|
||||
|
||||
<h3><a name="configuration" class="anchor" href="#configuration"><span class="octicon octicon-link"></span></a>Shell configuration</h2>
|
||||
<p align="justify">All options are avaible <a href="http://zsh.sourceforge.net/Doc/Release/Options.html">here</a>.</p>
|
||||
|
||||
<p align="justify">Set history file and number of commands in cache of the current session and in the history file:</p>
|
||||
<pre># history
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTSIZE=500000
|
||||
SAVEHIST=500000</pre>
|
||||
|
||||
<p align="justify">I can not remember all <code>Ctrl+</code> combinations so I bind keys to its default usages:</p>
|
||||
<pre># bindkeys
|
||||
bindkey '^[[A' up-line-or-search # up arrow for back-history-search
|
||||
bindkey '^[[B' down-line-or-search # down arrow for fwd-history-search
|
||||
bindkey '\e[1~' beginning-of-line # home
|
||||
bindkey '\e[2~' overwrite-mode # insert
|
||||
bindkey '\e[3~' delete-char # del
|
||||
bindkey '\e[4~' end-of-line # end
|
||||
bindkey '\e[5~' up-line-or-history # page-up
|
||||
bindkey '\e[6~' down-line-or-history # page-down</pre>
|
||||
<p align="justify">But in this case <code>Up</code>/<code>Down</code> arrows are used to navigate through the history based on <b>already entered part</b> of a command. And <code>PgUp</code>/<code>PgDown</code> <b>will ignore</b> already entered part of a command.</p>
|
||||
|
||||
<p align="justify">Command autocomplete:</p>
|
||||
<pre># autocomplete
|
||||
autoload -U compinit
|
||||
compinit
|
||||
zstyle ':completion:*' insert-tab false
|
||||
zstyle ':completion:*' max-errors 2</pre>
|
||||
<p align="justify">Full command autocomplete will be enabled. <code>insert-tab false</code> will enable autocomplete for <b>non-entered</b> commands. <code>max-errors</code> sets maximum number of errors that could be corrected.</p>
|
||||
|
||||
<p align="justify">Prompt:</p>
|
||||
<pre># promptinit
|
||||
autoload -U promptinit
|
||||
promptinit</pre>
|
||||
|
||||
<p align="justify">Enable colors:</p>
|
||||
<pre># colors
|
||||
autoload -U colors
|
||||
colors</pre>
|
||||
|
||||
<p align="justify">Here are some other options.</p>
|
||||
<p align="justify">Change directory without <code>cd</code>:</p>
|
||||
<pre># autocd
|
||||
setopt autocd</pre>
|
||||
<p align="justify">Correcting of typos (and question template):</p>
|
||||
<pre># correct
|
||||
setopt CORRECT_ALL
|
||||
SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) "</pre>
|
||||
<p align="justify">Disable f#$%ing beep:</p>
|
||||
<pre># disable beeps
|
||||
unsetopt beep</pre>
|
||||
<p align="justify">Enable calculator:</p>
|
||||
<pre># calc
|
||||
autoload zcalc</pre>
|
||||
<p align="justify">Append history (<b>do not recreate</b> the history file):</p>
|
||||
<pre># append history
|
||||
setopt APPEND_HISTORY</pre>
|
||||
<p align="justify">Do not save dups to history file:</p>
|
||||
<pre># ignore dups in history
|
||||
setopt HIST_IGNORE_ALL_DUPS</pre>
|
||||
<p align="justify">...and additional spaces:</p>
|
||||
<pre># ignore dups in history
|
||||
setopt HIST_IGNORE_SPACE</pre>
|
||||
<p align="justify">...and blank lines too:</p>
|
||||
<pre># reduce blanks in history
|
||||
setopt HIST_REDUCE_BLANKS</pre>
|
||||
<p align="justify">Enable <code>pkgfile</code>:</p>
|
||||
<pre># pkgfile
|
||||
source /usr/share/doc/pkgfile/command-not-found.zsh</pre>
|
||||
|
||||
<h3><a name="highlighting" class="anchor" href="#highlighting"><span class="octicon octicon-link"></span></a>Syntax highlighting</h2>
|
||||
<div class="codeblock"># highlighting
|
||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
||||
# brackets
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
|
||||
# cursor
|
||||
#ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
||||
# main
|
||||
# default
|
||||
ZSH_HIGHLIGHT_STYLES[default]='none'
|
||||
# unknown
|
||||
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red'
|
||||
# command
|
||||
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=magenta,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=yellow,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[builtin]='fg=green,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[function]='fg=green,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[command]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[precommand]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=yellow'
|
||||
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
|
||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue,bold'
|
||||
# path
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[path_approx]='fg=cyan'
|
||||
# shell
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=blue'
|
||||
ZSH_HIGHLIGHT_STYLES[assign]='fg=magenta'
|
||||
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan'
|
||||
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=blue'
|
||||
# quotes
|
||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow,underline'
|
||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow'
|
||||
# pattern example
|
||||
#ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
# root example
|
||||
#ZSH_HIGHLIGHT_STYLES[root]='bg=red'</div>
|
||||
<p align="justify">In first line highlighting is turned on. Next main, brackets and pattern highlighting are turned on. Patterns are set below (<code>rm -rf *</code> in the example). Also <code>root</code> and <code>cursor</code> highlighting may be turned on. Colors syntax is understandable, <code>fg</code> is font color, <code>bg</code> is background color.</p>
|
||||
|
||||
<h3><a name="prompt" class="anchor" href="#prompt"><span class="octicon octicon-link"></span></a>$PROMPT and $RPROMPT</h2>
|
||||
<p align="justify">The general idea is the use single <code>.zshrc</code> for root and normal user:</p>
|
||||
<div class="codeblock"># PROMPT && RPROMPT
|
||||
if [[ $EUID == 0 ]]; then
|
||||
# [root@host dir]#
|
||||
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||
%{$fg_bold[red]%}%n%{$reset_color%}\
|
||||
%{$fg_bold[white]%}@%{$reset_color%}\
|
||||
%{$fg_no_bold[red]%}%m %{$reset_color%}\
|
||||
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
||||
%{$fg_bold[white]%}]# %{$reset_color%}"
|
||||
else
|
||||
# [user@host dir]$
|
||||
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||
%{$fg_bold[green]%}%n%{$reset_color%}\
|
||||
%{$fg_bold[white]%}@%{$reset_color%}\
|
||||
%{$fg_no_bold[green]%}%m %{$reset_color%}\
|
||||
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
||||
%{$fg_bold[white]%}]$ %{$reset_color%}"
|
||||
fi</div>
|
||||
|
||||
<p align="justify"><code>fg</code> is font color, <code>bg</code> is background color. <code>\_bold</code> and <code>\_no_bold</code> regulate the tint. Commands should be in <code>%{ ... %}</code> so they do not appear. Avaible colors are:</p>
|
||||
<pre>black
|
||||
red
|
||||
green
|
||||
yellow
|
||||
blue
|
||||
magenta
|
||||
cyan
|
||||
white</pre>
|
||||
|
||||
<p align="justify">Avaible variables are:</p>
|
||||
<div class="codeblock">%n - the username
|
||||
%m - the computer's hostname (truncated to the first period)
|
||||
%M - the computer's hostname
|
||||
%l - the current tty
|
||||
%? - the return code of the last-run application.
|
||||
%# - the prompt based on user privileges (# for root and % for the rest)
|
||||
%T - system time(HH:MM)
|
||||
%* - system time(HH:MM:SS)
|
||||
%D - system date(YY-MM-DD)
|
||||
%d - the current working directory
|
||||
%~ - the same as %d but if in $HOME, this will be replaced by ~
|
||||
%1/ - the same as %d but only last directory</div>
|
||||
|
||||
<p align="justify">RPROMPT (<code>acpi</code> package is necessary):</p>
|
||||
<div class="codeblock">precmd () {
|
||||
# battery charge
|
||||
function batcharge {
|
||||
bat_perc=`acpi | awk {'print $4;'} | sed -e "s/\s//" -e "s/%.*//"`
|
||||
if [[ $bat_perc < 15 ]]; then
|
||||
col="%{$fg_bold[red]%}"
|
||||
elif [[ $bat_perc < 50 ]]; then
|
||||
col="%{$fg_bold[yellow]%}"
|
||||
else
|
||||
col="%{$fg_bold[green]%}"
|
||||
fi
|
||||
echo "%{$fg_bold[white]%}["$col$bat_perc"%{$fg_bold[white]%}%%]%{$reset_color%}"
|
||||
}
|
||||
# last command
|
||||
returncode="%(?.%{$fg[green]%}.%{$fg[red]%})%?%{$resetcolor%}"
|
||||
RPROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||
%{$fg_bold[cyan]%}%T%{$reset_color%}\
|
||||
%{$fg_bold[white]%}] %{$reset_color%}"\
|
||||
$(batcharge)\
|
||||
"%{$fg_bold[white]%}[%{$reset_color%}"\
|
||||
$returncode\
|
||||
"%{$fg_bold[white]%}]%{$reset_color%}"</div>
|
||||
<p align="justify">My RPROMPT shows current time, battery change and last returned code. <code>precmd()</code> is necessary for automatic updating. The construct <code>$(if.true.false)</code> is conditional statement in <code>zsh</code>.</p>
|
||||
|
||||
<h3><a name="aliases" class="anchor" href="#aliases"><span class="octicon octicon-link"></span></a>Aliases</h2>
|
||||
<p align="justify"><b>Copy only those aliases that you need.</b> If any alias uses application that is not installed it will leads to fail of loading of configuration file.</p>
|
||||
|
||||
<p align="justify">Small useful (or maybe not) function:</p>
|
||||
<pre>show_which() {
|
||||
OUTPUT=$(which $1 | cut -d " " -f7-)
|
||||
echo "Running '$OUTPUT'" 1>&2
|
||||
}</pre>
|
||||
|
||||
<p align="justify">Here is the first group of aliases:</p>
|
||||
<div class="codeblock">## alias
|
||||
# colored grep
|
||||
alias grep='grep --colour=auto'
|
||||
# change top to htop
|
||||
alias top='show_which top && htop'
|
||||
# chromium with different proxy servers (i2p and tor included)
|
||||
alias chrommsu='show_which chrommsu && chromium --proxy-server=cache.msu:3128'
|
||||
alias chromtor='show_which chromtor && chromium --proxy-server="socks://localhost:9050" --incognito'
|
||||
alias chromi2p='show_which chromi2p && chromium --proxy-server="http=127.0.0.1:4444;https=127.0.0.1:4445" --incognito'
|
||||
# human-readable df and du
|
||||
alias df='show_which df && df -k --print-type --human-readable'
|
||||
alias du='show_which du && du -k --total --human-readable'
|
||||
# change less and zless to vimpager
|
||||
alias less='vimpager'
|
||||
alias zless='vimpager'
|
||||
# more interactive rm
|
||||
alias rm='show_which rm && rm -I'</div>
|
||||
|
||||
<p align="justify">Here are ls aliases (see <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?ls">man ls</a>):</p>
|
||||
<pre>alias ls='show_which ls && ls --color=auto'
|
||||
alias ll='show_which ll && ls --group-directories-first -l --human-readable'
|
||||
alias lr='show_which lr && ls --recursive'
|
||||
alias la='show_which la && ll --almost-all'
|
||||
alias lx='show_which lx && ll -X --ignore-backups'
|
||||
alias lz='show_which lz && ll -S --reverse'
|
||||
alias lt='show_which lt && ll -t --reverse'
|
||||
alias lm='show_which lm && la | more'</pre>
|
||||
|
||||
<p align="justify">Here are aliases to quick file view from console (just type a file name!):</p>
|
||||
<pre># alias -s
|
||||
alias -s {avi,mpeg,mpg,mov,m2v,mkv}=mpv
|
||||
alias -s {mp3,flac}=qmmp
|
||||
alias -s {odt,doc,xls,ppt,docx,xlsx,pptx,csv}=libreoffice
|
||||
alias -s {pdf}=okular
|
||||
autoload -U pick-web-browser
|
||||
alias -s {html,htm}=opera</pre>
|
||||
|
||||
<p align="justify">Here are "sudo" aliases:</p>
|
||||
<div class="codeblock"># sudo alias
|
||||
if [[ $EUID == 0 ]]; then
|
||||
alias fat32mnt='show_which fat32mnt && mount -t vfat -o codepage=866,iocharset=utf8,umask=000'
|
||||
alias synctime='show_which synctime && { ntpd -qg; hwclock -w; date; }'
|
||||
else
|
||||
alias fat32mnt='show_which fat32mnt && sudo mount -t vfat -o codepage=866,iocharset=utf8,umask=000'
|
||||
alias umount='show_which umount && sudo umount'
|
||||
alias mount='show_which mount && sudo mount'
|
||||
alias netctl='show_which netctl && sudo netctl'
|
||||
alias synctime='show_which synctime && { sudo ntpd -qg; sudo hwclock -w; date; }'
|
||||
alias wifi-menu='show_which wifi-menu && sudo wifi-menu'
|
||||
alias dhcpcd='show_which dhcpcd && sudo dhcpcd'
|
||||
alias journalctl='show_which journalctl && sudo journalctl'
|
||||
alias systemctl='show_which systemctl && sudo systemctl'
|
||||
alias modprobe='show_which modprobe && sudo modprobe'
|
||||
alias rmmod='show_which rmmod && sudo rmmod'
|
||||
alias staging-i686-build='show_which staging-i686-build && sudo staging-i686-build'
|
||||
alias staging-x86_64-build='show_which staging-x86_64-build && sudo staging-x86_64-build'
|
||||
fi</div>
|
||||
|
||||
<p align="justify">Here are global aliases. If they are enable the command <code>cat foo g bar</code> will be equivalent the command <code>cat foo | grep bar</code>:</p>
|
||||
<pre># global alias
|
||||
alias -g g="| grep"
|
||||
alias -g l="| less"
|
||||
alias -g t="| tail"
|
||||
alias -g h="| head"
|
||||
alias -g dn="&> /dev/null &"</pre>
|
||||
|
||||
<h3><a name="functions" class="anchor" href="#functions"><span class="octicon octicon-link"></span></a>Functions</h2>
|
||||
<p align="justify">Here is a special function for <code>xrandr</code>:</p>
|
||||
|
||||
<div class="codeblock"># function to contorl xrandr
|
||||
# EXAMPLE: projctl 1024x768
|
||||
projctl () {
|
||||
if [ $1 ] ; then
|
||||
if [ $1 = "-h" ]; then
|
||||
echo "Usage: projctl [ off/resolution ]"
|
||||
return
|
||||
fi
|
||||
if [ $1 = "off" ]; then
|
||||
echo "Disable VGA1"
|
||||
xrandr --output VGA1 --off --output LVDS1 --mode 1366x768
|
||||
else
|
||||
echo "Using resolution: $1"
|
||||
xrandr --output VGA1 --mode $1 --output LVDS1 --mode $1
|
||||
fi
|
||||
else
|
||||
echo "Using default resolution"
|
||||
xrandr --output VGA1 --mode 1366x768 --output LVDS1 --mode 1366x768
|
||||
fi
|
||||
}</div>
|
||||
|
||||
<p align="justify">Unfortunately I can not remember <code>tar</code> flags thus I use special functions:</p>
|
||||
<div class="codeblock"># function to extract archives
|
||||
# EXAMPLE: unpack file
|
||||
unpack () {
|
||||
if [[ -f $1 ]]; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjfv $1 ;;
|
||||
*.tar.gz) tar xzfv $1 ;;
|
||||
*.tar.xz) tar xvJf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz) tar xjvf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "I don't know how to extract '$1'" ;;
|
||||
esac
|
||||
else
|
||||
case $1 in
|
||||
*help) echo "Usage: unpack ARCHIVE_NAME" ;;
|
||||
*) echo "'$1' is not a valid file" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
# function to create archives
|
||||
# EXAMPLE: pack tar file
|
||||
pack () {
|
||||
if [ $1 ]; then
|
||||
case $1 in
|
||||
tar.bz2) tar -cjvf $2.tar.bz2 $2 ;;
|
||||
tar.gz) tar -czvf $2.tar.bz2 $2 ;;
|
||||
tar.xz) tar -cf - $2 | xz -9 -c - > $2.tar.xz ;;
|
||||
bz2) bzip $2 ;;
|
||||
gz) gzip -c -9 -n $2 > $2.gz ;;
|
||||
tar) tar cpvf $2.tar $2 ;;
|
||||
tbz) tar cjvf $2.tar.bz2 $2 ;;
|
||||
tgz) tar czvf $2.tar.gz $2 ;;
|
||||
zip) zip -r $2.zip $2 ;;
|
||||
7z) 7z a $2.7z $2 ;;
|
||||
*help) echo "Usage: pack TYPE FILES" ;;
|
||||
*) echo "'$1' cannot be packed via pack()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}</div>
|
||||
|
||||
<p align="justify">Here is a special function for <code>su</code>:</p>
|
||||
<div class="codeblock">su () {
|
||||
checksu=0
|
||||
for flags in $*; do
|
||||
if [[ $flags == "-" ]]; then
|
||||
checksu=1
|
||||
fi
|
||||
done
|
||||
if [[ $checksu == 0 ]]; then
|
||||
echo "Use 'su -', Luke"
|
||||
/usr/bin/su - $*
|
||||
else
|
||||
/usr/bin/su $*
|
||||
fi
|
||||
}</div>
|
||||
|
||||
<p align="justify">Functions with automatic rehash after installing/removing packages are:</p>
|
||||
<div class="codeblock">pacman () {
|
||||
/usr/bin/sudo /usr/bin/pacman $* && echo "$*" | grep -q "S\\|R\\|U" && rehash
|
||||
}
|
||||
yaourt () {
|
||||
/usr/bin/yaourt $* && echo "$*" | grep -q "S\\|R\\|U" && rehash
|
||||
}
|
||||
# for testing repo
|
||||
yatest () {
|
||||
/usr/bin/yaourt --config /etc/pactest.conf $* && echo "$*" | grep -q "S\\|R\\|U" && rehash
|
||||
}</div>
|
||||
<p align="justify">But autocomplete for <code>yaourt -Ss</code> <a href="https://github.com/zsh-users/zsh-completions/pull/205">will require</a> root privileges.</p>
|
||||
|
||||
<h3><a name="variables" class="anchor" href="#variables"><span class="octicon octicon-link"></span></a>Variables</h2>
|
||||
<p align="justify">It is recommended to set own variables in <code>~/.zshenv</code>. But I have everything stored in the single file.</p>
|
||||
|
||||
<p align="justify">Here are path, mask of new files, editor and pager:</p>
|
||||
<pre># path
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
# umask
|
||||
umask 022
|
||||
# editor
|
||||
export EDITOR="vim"
|
||||
export PAGER="vimpager"</pre>
|
||||
|
||||
<p align="justify">Here is hashes. If they are enable the command <code>~global</code> will be equivalent the command <code>/mnt/global</code>:</p>
|
||||
<pre># hash
|
||||
hash -d global=/mnt/global
|
||||
hash -d windows=/mnt/windows
|
||||
hash -d iso=/mnt/iso
|
||||
hash -d u1=/mnt/usbdev1
|
||||
hash -d u2=/mnt/usbdev2</pre>
|
||||
|
||||
<h3><a name="screenshot" class="anchor" href="#screenshot"><span class="octicon octicon-link"></span></a>Screenshot</h2>
|
||||
<p align="justify"><a href="/resources/screenshots/zshrc_demo.png"><img src="/resources/preview/zshrc_demo_prev.jpg"></a></p>
|
||||
|
||||
<h3><a name="file" class="anchor" href="#file"><span class="octicon octicon-link"></span></a>File</h2>
|
||||
<p align="justify"><a href="https://raw.github.com/arcan1s/dotfiles/master/zshrc">Here is</a> my <code>.zshrc</code>.</p>
|
BIN
resources/en.png
Normal file
BIN
resources/en.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 911 B |
BIN
resources/ru.png
Normal file
BIN
resources/ru.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 163 B |
41
ru/404.html
Normal file
41
ru/404.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<title>Ошибка 404</title>
|
||||
<meta name="author" content="Evgeniy Alekseev" />
|
||||
<meta name="description" content="arcanis' homepage" />
|
||||
<link rel="license" type="text/html" href="/authors" />
|
||||
|
||||
<link rel="stylesheet" href="/resources/styles.css">
|
||||
<link rel="stylesheet" href="/resources/pygment_trac.css">
|
||||
<link rel="shortcut icon" href="/resources/icon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<h1>404</h1>
|
||||
<p class="view">Страница не найдена!</p>
|
||||
</header>
|
||||
<section>
|
||||
|
||||
<h3>Привет!</h3>
|
||||
|
||||
<img src="/resources/pinkiepie.png" alt="pinkiepie">
|
||||
|
||||
<p align="justify">Я Пинки Пай. Ты видишь меня, потому что ты хочешь страницу, которую я не смогла найти. Мне жаль, нет, честно. Я постараюсь работать лучше. А сейчас я могу предложить тебе вернуться на <a href="/ru">домашнюю страницу</a> или <a href="javascript:history.back()">назад</a></p>
|
||||
|
||||
</section>
|
||||
<footer>
|
||||
<p><small>Расположено на GitHub Pages. <a href="/ru/authors">Авторы</a></small></p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="/resources/js/scale.fix.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
41
ru/about.html
Normal file
41
ru/about.html
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
layout: default
|
||||
comment: false
|
||||
share: true
|
||||
back: 1
|
||||
title: About me
|
||||
---
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<h1>About me</h1>
|
||||
|
||||
<p class="view"><a href="https://github.com/arcan1s">GitHub Profile</a><br>
|
||||
<a href="https://www.archlinux.org/trustedusers/#arcanis">TU Profile on <code>archlinux.org</code></a><br>
|
||||
<a href="http://istina.msu.ru/profile/arcanis">Some of my publications</a><br>
|
||||
PGP signature: <a href="http://pgp.mit.edu:11371/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x779CD2942629B7FA04AB8F172E89012331361F01">0x31361F01</a></p>
|
||||
|
||||
<h2>Contacts</h2>
|
||||
<p class="view">Alias: arcanis/arcan1s<br>
|
||||
IRC: <a href="irc://irc.freenode.net/arcan1s">arcan1s</a> <br>
|
||||
ICQ: 407-398-235<br>
|
||||
Jabber: arcanis (at) jabber (dot) org<br>
|
||||
E-mail: <a href="mailto:darkarcanis@mail.ru">darkarcanis (at) mail (dot) ru</a></p>
|
||||
|
||||
</header>
|
||||
<section>
|
||||
|
||||
<p align="justify">My name is Evgeniy Alekseev and I'm from Siberia (seriously, I was born in <a href="https://maps.google.com/maps?f=q&source=s_q&hl=ru&geocode=&q=russia,+Krasnoyarskiy+kray,+Sosnovoborsk&aq=&sll=56.133333,93.366667&sspn=0.100635,0.326843&vpsrc=6&g=%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F,+Krasnoyarskiy+kray,+Sosnovoborsk&ie=UTF8&hq=&hnear=%D0%A1%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BE%D0%B1%D0%BE%D1%80%D1%81%D0%BA,+%D0%B3%D0%BE%D1%80%D0%BE%D0%B4+%D0%A1%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BE%D0%B1%D0%BE%D1%80%D1%81%D0%BA,+%D0%9A%D1%80%D0%B0%D1%81%D0%BD%D0%BE%D1%8F%D1%80%D1%81%D0%BA%D0%B8%D0%B9+%D0%BA%D1%80%D0%B0%D0%B9,+%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F&ll=56.316537,95.712891&spn=25.891057,83.671875&t=m&z=4&iwloc=A">Siberia</a>). In the global Internet I have usually nickname <code>arcan1s</code>, but in the Russian segment it is usually <code>arcanis</code>. I'm a graduate of <a href="http://www.chem.msu.ru/">the Department of Chemistry</a>, Moscow State University and now I'm a PhD student and working in my University. My speciality is a theoretical chemistry (like molecular physics and some of quantum chemistry).</p>
|
||||
|
||||
<p align="justify">At leisure I write small applications on C, C++ and Python (and some application scripts on Shell). In order not to seem like a bearded nerd sometimes I listen music and read <a href="http://en.wikipedia.org/wiki/Robert_Jordan">Robert Jordan's</a> or <a href="http://en.wikipedia.org/wiki/George_R.R._Martin">George R.R. Martin's</a> books (or other similar). (But my friends tell me that I still look like a bearded nerd.) Music that I usually listen may be found on <a href="smb://89.249.170.38/Music/">my home computer</a>. I just want to notice that I am <b>NOT A FREELANCER</b>. But you can suggest me some project (<b>not money</b>) and if I'll like it I'll do it.</p>
|
||||
|
||||
<p align="justify">Also I'm an <a href="https://www.archlinux.org/">Archlinux</a> user (maybe that's why I look like a bearded nerd). And in October 2013 I became an Archlinux Trusted User:</p>
|
||||
<blockquote cite="https://wiki.archlinux.org/index.php/AUR_Trusted_User_Guidelines/">
|
||||
The Trusted User (TU) is a member of the community charged with keeping the AUR in working order. He/she maintains popular packages (communicating with and sending patches upstream as needed), and votes in administrative matters. A TU is elected from active community members by current TUs in a democratic process. TUs are the only members who have a final say in the direction of the AUR.</blockquote>
|
||||
<p align="right">© <a href="https://wiki.archlinux.org/index.php/AUR_Trusted_User_Guidelines/">ArchWiki</a></p>
|
||||
|
||||
<p align="justify">All contact information can be found on the left. Feel free to contact me with any questions. Oh, wait! If you will write me to ICQ or jabber you must correctly answer antispam bot's question first. The question is:</p>
|
||||
<pre><code>int i = 1;
|
||||
i = ++i + ++i;
|
||||
return i;</code></pre>
|
||||
<p align="justify">And the correct answer is <code>5</code> (or <code>6</code>, as you wish).</p>
|
36
ru/authors.html
Normal file
36
ru/authors.html
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
layout: default
|
||||
comment: false
|
||||
share: false
|
||||
back: 2
|
||||
title: Authors
|
||||
---
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<h1>Authors</h1>
|
||||
</header>
|
||||
<section>
|
||||
|
||||
<p align="justify">The code and content of this site is licensed under <a href="http://people.freebsd.org/~phk">Beerware</a> license:</p>
|
||||
<blockquote><p align="justify">"THE BEER-WARE LICENSE" (Revision 42):<br>
|
||||
Evgeniy Alekseev wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return</p></blockquote>
|
||||
|
||||
<p align="justify">The source theme was created by <a href="https://github.com/orderedlist/minimal">Steve Smith</a> and licensed under <a href="http://creativecommons.org/licenses/by/3.0">Creative Commons Attribution-ShareAlike 3.0 Unported</a> License.</p>
|
||||
|
||||
<p align="justify">The comment block was created by <a href="https://github.com/izuzak/izuzak.github.com">Ivan Žužak</a> and licensed under <a href="http://opensource.org/licenses/MIT">MIT</a> License.</p>
|
||||
|
||||
<p align="justify">This site uses:
|
||||
<ul>
|
||||
<li><a href="http://jekyllrb.com/">Jekyll</a> that licensed under <a href="http://opensource.org/licenses/MIT">MIT</a> License</li>
|
||||
</ul></p>
|
||||
|
||||
<p align="justify">Google Custom Search is licensed under own custom <a href="https://support.google.com/customsearch/answer/1714300">license</a>.</p>
|
||||
|
||||
<p align="justify">Sharethis have own custom <a href="http://www.sharethis.com/legal/publisher-terms-of-use">license</a> too.</p>
|
||||
|
||||
<p align="justify"><a href="https://www.redhat.com/promo/fonts/">Liberation font</a> is licensed under <a href="http://scripts.sil.org/OFL">The SIL Open Font</a> License.</p>
|
||||
|
||||
<p align="justify">Special thanks to <a href="http://monztruo.deviantart.com/">Monztruo</a>, I borrowed <a href="http://monztruo.deviantart.com/art/Zalgo-Pacman-v1-194649946">his icon</a>.</p>
|
||||
|
||||
<p align="center">© Evgeniy Alekseev, 2014</p>
|
46
ru/blog/index.html
Normal file
46
ru/blog/index.html
Normal file
@ -0,0 +1,46 @@
|
||||
---
|
||||
layout: default
|
||||
title: arcanis' blog
|
||||
comment: false
|
||||
share: false
|
||||
back: 1
|
||||
---
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<h1>arcanis' blog</h1>
|
||||
</header>
|
||||
<section>
|
||||
|
||||
{% for post in paginator.ruposts %}
|
||||
<h1><a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a></h1>
|
||||
<p align="justify"><i>{{ post.date | date_to_string}}</i></p>
|
||||
<p align="justify">{{ post.description }}</p>
|
||||
<p align="justify"><b>Tags</b>: {{ post.tags }}</p>
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.total_pages > 1 %}
|
||||
{% if paginator.previous_page %}
|
||||
<a href="{{ paginator.previous_page_path }}">« Prev</a>
|
||||
{% else %}
|
||||
<span>« Prev</span>
|
||||
{% endif %}
|
||||
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
{% if page == paginator.page %}
|
||||
<em>{{ page }}</em>
|
||||
{% elsif page == 1 %}
|
||||
<a href="{{ '/blog' }}">{{ page }}</a>
|
||||
{% else %}
|
||||
<a href="{{ site.paginate_path | replace: ':num', page }}">{{ page }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<a href="{{ paginator.next_page_path }}">Next »</a>
|
||||
{% else %}
|
||||
<span>Next »</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script>
|
49
ru/index.html
Normal file
49
ru/index.html
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
layout: default
|
||||
comment: false
|
||||
share: true
|
||||
back: 0
|
||||
title: arcanis' homepage
|
||||
---
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<h1>arcanis' homepage</h1>
|
||||
|
||||
<p class="view"><a href="/blog/">My blog</a><br>
|
||||
<a href="/projects/">My projects</a></p>
|
||||
<p class="view"><a href="/about">About me</a></p>
|
||||
|
||||
</header>
|
||||
<section>
|
||||
<!-- redirection to russian page -->
|
||||
<!-- <script>
|
||||
var languageinfo=navigator.language? navigator.language : navigator.userLanguage
|
||||
function redirectpage(dest) {
|
||||
if (window.location.replace) window.location.replace(dest)
|
||||
else window.location=dest
|
||||
}
|
||||
if (languageinfo.substr(0,2) == "ru") redirectpage("ru")
|
||||
</script>-->
|
||||
<!-- redirection to russian page -->
|
||||
|
||||
<h3><a name="welcome" class="anchor" href="#welcome"><span class="octicon octicon-link"></span></a>Welcome</h3>
|
||||
<p align="justify">Welcome to my homepage, <code>`echo $USERNAME`</code>. About me you may read on <a href="/about">the link</a>. I'm sorry I don't know html/php/etc (but I know GoogleFOO! At least, I think so), therefore this page may not look very pretty. But I tried (or may be not). In the blog I will write some papers about programming, living in Archlinux system and may be package maintaining. Also I will create pages for some of <a href="https://github.com/arcan1s">my projects</a>. Unfortunately, sometimes I'm too lazy to write in English, thus some of my papers will be in Russian.</p>
|
||||
|
||||
<h3><a name="contact" class="anchor" href="#contact"><span class="octicon octicon-link"></span></a>Contact me</h3>
|
||||
<p align="justify">If you have a question or something else you may <a href="/about">contact me</a>. If you want to suggest a pull request or to create a bug report for these pages (or may be for some other projects) feel free to visit <a href="https://github.com/arcan1s">my Github profile</a> and do it.</p>
|
||||
|
||||
<h3><a name="search" class="anchor" href="#search"><span class="octicon octicon-link"></span></a>Site search</h3>
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '000833618047197874644:rilf4jpvgyo';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||
'//www.google.com/cse/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
<gcse:search></gcse:search>
|
139
ru/projects/git-etc.html
Normal file
139
ru/projects/git-etc.html
Normal file
@ -0,0 +1,139 @@
|
||||
---
|
||||
layout: project
|
||||
title: git-etc
|
||||
short: git-etc
|
||||
commentIssueId: 1
|
||||
description: Simple daemon for monitoring changes in files
|
||||
hasgui: true
|
||||
developers:
|
||||
- Evgeniy Alelseev
|
||||
license: GPLv3
|
||||
links:
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/git-etc">AUR package</a>
|
||||
---
|
||||
<!-- info block -->
|
||||
<h2><a name="info" class="anchor" href="#info"><span class="octicon octicon-link"></span></a>Information</h2>
|
||||
<p align="justify">Simple daemon that automatically creates git repository in the given directory and creates commit at the specified time interval.</p>
|
||||
<pre>$ git-etc --help
|
||||
Simple daemon written on BASH for monitoring changes in files
|
||||
|
||||
Usage: git-etc [ -c | --config /etc/git-etc.conf ] [ -h | --help ] [ -v | --version ]
|
||||
|
||||
Parametrs:
|
||||
-c --config - path to configuration file
|
||||
-h --help - show this help and exit
|
||||
-v --version - show version and exit
|
||||
|
||||
See "man 1 git-etc" for more details</pre>
|
||||
<pre>$ ctrlconf --help
|
||||
GUI for git-etc daemon
|
||||
|
||||
Usage: ctrlconf [ --default ] [ -h | --help ] [ -v | --version ]
|
||||
|
||||
Additional parametrs:
|
||||
--default - create default configuration file
|
||||
-h --help - show this help and exit
|
||||
-v --version - show version and exit
|
||||
|
||||
See "man 1 ctrlconf" for more details</pre>
|
||||
|
||||
<h3><a name="devel" class="anchor" href="#devel"><span class="octicon octicon-link"></span></a>Developers and contributors</h3>
|
||||
<ul>
|
||||
{% for devel in page.developers %}
|
||||
<li>{{ devel }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3><a name="license" class="anchor" href="#license"><span class="octicon octicon-link"></span></a>License</h3>
|
||||
<ul>
|
||||
<li>{{ page.license }}</li>
|
||||
</ul>
|
||||
<!-- end of info block -->
|
||||
|
||||
<!-- install block -->
|
||||
<h2><a name="install" class="anchor" href="#install"><span class="octicon octicon-link"></span></a>Installation</h2>
|
||||
|
||||
<h3><a name="instruction" class="anchor" href="#instruction"><span class="octicon octicon-link"></span></a>Instruction</h3>
|
||||
<ul>
|
||||
<li><p align="justify">Download an <a href="https://github.com/arcan1s/git-etc/releases">archive</a> with latest version of source files.</p></li>
|
||||
<li><p align="justify">Extract it and install the application:</p>
|
||||
<pre>./install.sh "/path/to/root/package"</pre>
|
||||
<p align="justify">If you want install it to <code>/</code> you must run it as root, e.g.:</p>
|
||||
<pre>sudo ./install.sh "/path/to/root/package"</pre>
|
||||
<p align="justify">If no path is specified it will be installed to <code>/</code> by default.</p></li>
|
||||
</ul>
|
||||
|
||||
<h3><a name="dependencies" class="anchor" href="#dependencies"><span class="octicon octicon-link"></span></a>Dependencies</h3>
|
||||
<p align="justify">I want note that all were tested on latest version of dependencies.</p>
|
||||
<ul>
|
||||
<li>Bash (including awk, grep, sed)</li>
|
||||
<li>git</li>
|
||||
<li>python2 <i>(make)</i></li>
|
||||
<li>systemd <i>(optional, service file)</i></li>
|
||||
<li>python2-pyqt4 <i>(optional, GUI)</i></li>
|
||||
<li>xterm <i>(optional, GUI)</i></li>
|
||||
</ul>
|
||||
<!-- end of install block -->
|
||||
|
||||
<!-- howto block -->
|
||||
<h2><a name="howto" class="anchor" href="#howto"><span class="octicon octicon-link"></span></a>How to use</h2>
|
||||
<p align="justify">If you want to start the daemon into <code>/etc</code> just run</p>
|
||||
<pre>systemctl start git-etc</pre>
|
||||
<p align="justify">If you want to enable daemon autoload run</p>
|
||||
<pre>systemctl enable git-etc</pre>
|
||||
<p align="justify">But you may change path to configuration file or change parameters. To do it just copy (recommended) the source configuration file to new path</p>
|
||||
<pre>cp /etc/git-etc.conf /new/path/to/file/git-etc.conf</pre>
|
||||
<p align="justify">and edit it. Then copy the source service file to <code>/etc</code>:</p>
|
||||
<pre>cp /usr/lib/systemd/system/git-etc.service /etc/systemd/system/git-etc-my-profile.service</pre>
|
||||
<p align="justify">Replace following string in the file:</p>
|
||||
<pre>ExecStart=/usr/bin/git-etc -c /etc/git-etc.conf</pre>
|
||||
<p align="justify">to</p>
|
||||
<pre>ExecStart=/usr/bin/git-etc -c /new/path/to/file/git-etc.conf</pre>
|
||||
<!-- end of howto block -->
|
||||
|
||||
<!-- config block -->
|
||||
<h2><a name="config" class="anchor" href="#config"><span class="octicon octicon-link"></span></a>Configuration</h2>
|
||||
<p align="justify">All settings are stored in <code>/etc/git-etc.conf</code>. After edit them you must restart daemon</p>
|
||||
<pre>systemctl restart git-etc</pre>
|
||||
|
||||
<h3><a name="options" class="anchor" href="#options"><span class="octicon octicon-link"></span></a>Options</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>DIRECTORY</th>
|
||||
<td><p align="justify">Full path to working directory with observed files. Default is <code>/etc</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TIMESLEEP</th>
|
||||
<td><p align="justify">Time interval between updates. It must be integer and >= 1. Default is <code>12</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>IGNORELIST</th>
|
||||
<td><p align="justify">List of files that will not be observed. Separator is ";;". May be empty.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>FORALL</th>
|
||||
<td><p align="justify"><code>1</code> will enable access for normal user. Default is <code>1</code>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- end of config block -->
|
||||
|
||||
<!-- gui block -->
|
||||
<h2><a name="gui" class="anchor" href="#gui"><span class="octicon octicon-link"></span></a>Graphical user interface</h2>
|
||||
<p align="justify">Control Config (<code>ctrlconf</code>) is GUI for <code>git-etc</code> daemon written on <code>Python2/PyQt4</code>. This application allows you to view a list of commits and changes in files recorded in commit messages. Also, this application allows you to roll back to a specific commit all files (<code>git reset --hard</code>) or individual files (<code>git diff && git apply</code>). And you may merge old and new configuration files (used two branches repository - master and experimental). The application may need root privileges. Make sure that <code>sudo</code> package is installed.</p>
|
||||
|
||||
<h3><a name="gui_configuration" class="anchor" href="#gui_configuration"><span class="octicon octicon-link"></span></a>Configuration</h3>
|
||||
<p align="justify">Just run the application and open the settings window from menu!</p>
|
||||
|
||||
<h3><a name="screenshots" class="anchor" href="#screenshots"><span class="octicon octicon-link"></span></a>Screenshots</h3>
|
||||
<p align="justify">(Screenshots in Russian, but GUI has English translation.)</p>
|
||||
<p align="justify">Main window:<br>
|
||||
<a href="/resources/screenshots/git-etc_mainwindow.png"><img src="/resources/preview/git-etc_mainwindow_prev.jpg"></a><br>
|
||||
About window:<br>
|
||||
<a href="/resources/screenshots/git-etc_aboutwindow.png"><img src="/resources/preview/git-etc_aboutwindow_prev.jpg"></a><br>
|
||||
Commit changes window:<br>
|
||||
<a href="/resources/screenshots/git-etc_commitwindow.png"><img src="/resources/preview/git-etc_commitwindow_prev.jpg"></a><br>
|
||||
Merging window:<br>
|
||||
<a href="/resources/screenshots/git-etc_mergingwindow.png"><img src="/resources/preview/git-etc_mergingwindow_prev.jpg"></a><br>
|
||||
Roll back window:<br>
|
||||
<a href="/resources/screenshots/git-etc_rollbackwindow.png"><img src="/resources/preview/git-etc_rollbackwindow_prev.jpg"></a></p>
|
||||
<!-- end of gui block -->
|
113
ru/projects/index.html
Normal file
113
ru/projects/index.html
Normal file
@ -0,0 +1,113 @@
|
||||
---
|
||||
layout: default
|
||||
title: arcanis' projects
|
||||
comment: false
|
||||
share: true
|
||||
back: 1
|
||||
groups:
|
||||
- title: Linux daemons
|
||||
short: daemons
|
||||
projects:
|
||||
- title: git-etc
|
||||
short: git-etc
|
||||
description: <code>git-etc</code> is a simple daemon that automatically creates git repository in the given directory and creates commit at the specified time interval. It is written on <code>Bash</code>. It is also has a simple Graphical user interface written on <code>Python2</code> (<code>pyqt4</code>) for work with the created repository.
|
||||
links:
|
||||
- <a href="/projects/git-etc">Homepage</a>
|
||||
- <a href="https://github.com/arcan1s/git-etc">GitHub repo</a>
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/git-etc">AUR package</a>
|
||||
- title: queued
|
||||
short: queued
|
||||
description: <code>queued</code> is daemon for starting jobs to queue of calculations. It was written on <code>Bash</code> created as proof-of-concept.
|
||||
links:
|
||||
- <a href="/projects/queued">Homepage</a>
|
||||
- <a href="https://github.com/arcan1s/queued">GitHub repo</a>
|
||||
- title: KDE widgets
|
||||
short: widgets
|
||||
projects:
|
||||
- title: DeadLine widget
|
||||
short: deadline
|
||||
description: <code>DeadLine widget</code> is a Plasmoid script written on <code>Python2</code>. It is able to create jobs, and add reminders to them. Now this project has a pre-alpha stage. Someday maybe I will complete it.
|
||||
links:
|
||||
- <a href="https://github.com/arcan1s/deadlinewidget">GitHub repo</a>
|
||||
- title: Oblikue strategies
|
||||
short: oblikuestrategies
|
||||
description: <code>oblikue-strategies</code> is a plasmoid written on <code>CPP</code> that displays a random draw from Brian Eno and Peter Schmidt's <a href="http://en.wikipedia.org/wiki/Oblique_strategies">Oblique Strategies</a>. It is <a href="http://gnome-look.org/content/show.php/Oblique+Strategies?content=78405">GNOME applet</a> fork with some of special features.
|
||||
links:
|
||||
- <a href="/projects/oblikuestrategies">Homepage</a>
|
||||
- <a href="https://github.com/arcan1s/oblikuestrategies">GitHub repo</a>
|
||||
- Page on <a href="http://kde-look.org/content/show.php/oblikue-strategies?content=160503">kde-look.org</a>
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/kdeplasma-applets-oblikuestrategies">AUR package</a>
|
||||
- title: Open on desktop
|
||||
short: openondesktop
|
||||
description: <code>Open on desktop</code> is a dropbox menu for <a href="http://dolphin.kde.org">Dolhpin</a>. It creates a group in the context menu, which opens a file to the specified desktop when clicked. It has an install script written on <code>Bash</code>.
|
||||
links:
|
||||
- <a href="https://github.com/arcan1s/openondesktop">GitHub repo</a>
|
||||
- title: py-text-monitor
|
||||
short: pytextmonitor
|
||||
description: <code>py-text-monitor</code> is a minimalistic Plasmoid script written on <code>Python2</code>. It looks like widgets in <a href="http://awesome.naquadah.org/">Awesome WM</a>. My plasmoid is highly and easily configurable and does not clutter your KDE system. Also this packages has an additional <a href="http://techbase.kde.org/Development/Tutorials/Plasma/DataEngines">DataEngine</a> written on <code>CPP</code> (old version was written on <code>Python2</code>).
|
||||
links:
|
||||
- <a href="/projects/pytextmonitor">Homepage</a>
|
||||
- <a href="https://github.com/arcan1s/pytextmonitor">GitHub repo</a>
|
||||
- Plasmoid page on <a href="http://kde-look.org/content/show.php/Py+Text+Monitor?content=157124">kde-look.org</a>
|
||||
- DataEngine page on <a href="http://kde-look.org/content/show.php/Extended+Systemmonitor+DataEngine?content=158773">kde-look.org</a>
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/kdeplasma-applets-pytextmonitor">AUR package</a>
|
||||
- title: Kit system monitor
|
||||
short: sysmon
|
||||
description: <code>Kit System Monitor</code> is a system information and hardware monitor based on EG Sysmon. It is written on HTML-like language for <a href="http://netdragon.sourceforge.ne/">SuperKaramba</a> and has simple install script written on <code>Python2</code>. It is my first Open Source Project.
|
||||
links:
|
||||
- <a href="https://github.com/arcan1s/sysmon">GitHub repo</a>
|
||||
- Page on <a href="http://kde-look.org/content/show.php/Kit+System+Monitor?content=155246">kde-look.org</a>
|
||||
- title: Scientific programs
|
||||
short: science
|
||||
projects:
|
||||
- title: Molecular dynamic
|
||||
short: moldyn
|
||||
description: They are represented by a single repository. It contains some programs for analysis of molecular dynamic trajectories using statistical mechanics and some of maths methods (e.g. graph theory). Usualy backend programs are written on <code>C</code>, but sometimes on <code>Python2</code>. Some of these have a Graphical user interface written on <code>CPP</code>.
|
||||
links:
|
||||
- <a href="/projects/moldyn">Homepage</a>
|
||||
- <a href="https://github.com/arcan1s/moldyn">GitHub repo</a>
|
||||
- title: Utilities
|
||||
short: utilities
|
||||
projects:
|
||||
- title: extract_pkglist
|
||||
short: extpkg
|
||||
description: <code>extract_pkglist</code> a simple script written on <code>Python2</code> for creating list of installed packages in ArchLinux.
|
||||
links:
|
||||
- <a href="https://github.com/arcan1s/extract_pkglist">GitHub repo</a>
|
||||
- title: Food GUI
|
||||
short: foodgui
|
||||
description: <code>Food GUI</code> is a simple program-calculator that uses own database and written on <code>Python2</code>. It calculates proteins, fats, carbohydrates, food energy and glycemic index of eaten food. It is my first project with GUI and was made just-for-fun (and for my ex-girlfriend). It also has a binary version for Win64.
|
||||
links:
|
||||
- <a href="https://github.com/arcan1s/food_gui">GitHub repo</a>
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/food_gui">AUR package</a>
|
||||
- title: julius-actions
|
||||
short: julius-actions
|
||||
description: <code>julius-actions</code> is a script written on <code>Python2</code> for work with <a href="http://julius.sourceforge.jp/en_index.php">julius</a>. It was made just-for-fun too in my spare time. Works normally, but I don't use it.
|
||||
links:
|
||||
- <a href="https://github.com/arcan1s/julius-actions">GitHub repo</a>
|
||||
---
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<h1>arcanis' projects</h1>
|
||||
<p class="view">The list of some of my projects</p>
|
||||
<p class="view">
|
||||
{% for group in page.groups %}
|
||||
<a href="#{{ group.short }}">{{ group.title }}</a><br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</header>
|
||||
<section>
|
||||
|
||||
{% for group in page.groups %}
|
||||
<h1><a name="{{ group.short }}" class="anchor" href="#{{ group.short }}"><span class="octicon octicon-link"></span></a>{{ group.title }}</a></h1>
|
||||
{% for project in group.projects %}
|
||||
<h2><a name="{{ project.short }}" class="anchor" href="#{{ project.short }}"><span class="octicon octicon-link"></span></a>{{ project.title }}</h2>
|
||||
<p align="justify">{{ project.description }}</p>
|
||||
<p align="justify"><ul>
|
||||
{% for link in project.links %}
|
||||
<li>{{ link }}</li>
|
||||
{% endfor %}
|
||||
</ul></p>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
83
ru/projects/oblikuestrategies.html
Normal file
83
ru/projects/oblikuestrategies.html
Normal file
@ -0,0 +1,83 @@
|
||||
---
|
||||
layout: project
|
||||
title: Oblikue strategies
|
||||
short: oblikuestrategies
|
||||
commentIssueId: 2
|
||||
description: Plasmoid that displays a random draw Oblique Strategies
|
||||
hasgui: true
|
||||
developers:
|
||||
- Evgeniy Alelseev
|
||||
license: GPL
|
||||
links:
|
||||
- Page on <a href="http://kde-look.org/content/show.php/oblikue-strategies?content=160503">kde-look.org</a>
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/kdeplasma-applets-oblikuestrategies">AUR package</a>
|
||||
---
|
||||
<!-- info block -->
|
||||
<h2><a name="info" class="anchor" href="#info"><span class="octicon octicon-link"></span></a>Information</h2>
|
||||
<p align="justify">Plasmoid written on <code>CPP</code> that displays a random draw from Brian Eno and Peter Schmidt's <a href="http://en.wikipedia.org/wiki/Oblique_strategies">Oblique Strategies</a>. It is <a href="http://gnome-look.org/content/show.php/Oblique+Strategies?content=78405">GNOME applet</a> fork with some of special features.</p>
|
||||
|
||||
<h3><a name="devel" class="anchor" href="#devel"><span class="octicon octicon-link"></span></a>Developers and contributors</h3>
|
||||
<ul>
|
||||
{% for devel in page.developers %}
|
||||
<li>{{ devel }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3><a name="license" class="anchor" href="#license"><span class="octicon octicon-link"></span></a>License</h3>
|
||||
<ul>
|
||||
<li>{{ page.license }}</li>
|
||||
</ul>
|
||||
<!-- end of info block -->
|
||||
|
||||
<!-- install block -->
|
||||
<h2><a name="install" class="anchor" href="#install"><span class="octicon octicon-link"></span></a>Installation</h2>
|
||||
|
||||
<h3><a name="instruction" class="anchor" href="#instruction"><span class="octicon octicon-link"></span></a>Instruction</h3>
|
||||
<ul>
|
||||
<li><p align="justify">Download an <a href="https://github.com/arcan1s/oblikuestrategies/releases">archive</a> with latest version of source files.</p></li>
|
||||
<li><p align="justify">Extract it and install the application. For global isntallation type:</p>
|
||||
<pre>cd /where/your/applet/is/installed
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release ../
|
||||
make
|
||||
sudo make install</pre>
|
||||
<p align="justify">For local isntallation type:</p>
|
||||
<pre>cd /where/your/applet/is/installed
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=Release ../
|
||||
make
|
||||
make install</pre></li>
|
||||
<li><p align="justify">Restart plasma to load the applet:</p>
|
||||
<pre>kquitapp plasma-desktop && sleep 2 && plasma-desktop</pre>
|
||||
<p align="justify">Also you might need to run <code>kbuildsycoca4</code> in order to get the <code>*.desktop</code> file recognized:</p>
|
||||
<pre>kbuildsycoca4 &> /dev/null</pre></li>
|
||||
</ul>
|
||||
|
||||
<h3><a name="dependencies" class="anchor" href="#dependencies"><span class="octicon octicon-link"></span></a>Dependencies</h3>
|
||||
<p align="justify">I want note that all were tested on latest version of dependencies.</p>
|
||||
<ul>
|
||||
<li>kdebase-workspace</li>
|
||||
<li>automoc4 <i>(make)</i></li>
|
||||
<li>cmake <i>(make)</i></li>
|
||||
</ul>
|
||||
<!-- end of install block -->
|
||||
|
||||
<!-- howto block -->
|
||||
<h2><a name="howto" class="anchor" href="#howto"><span class="octicon octicon-link"></span></a>How to use</h2>
|
||||
<p align="justify">Open your Plasma widgetes and select <code>Oblikue strategies</code>.</p>
|
||||
<!-- end of howto block -->
|
||||
|
||||
<!-- config block -->
|
||||
<h2><a name="config" class="anchor" href="#config"><span class="octicon octicon-link"></span></a>Configuration</h2>
|
||||
<p align="justify">Right click on widget.</p>
|
||||
<!-- end of config block -->
|
||||
|
||||
<!-- gui block -->
|
||||
<h2><a name="gui" class="anchor" href="#gui"><span class="octicon octicon-link"></span></a>Graphical user interface</h2>
|
||||
|
||||
<h3><a name="screenshots" class="anchor" href="#screenshots"><span class="octicon octicon-link"></span></a>Screenshots</h3>
|
||||
<p align="justify">Widget:<br>
|
||||
<a href="/resources/screenshots/oblikuestrategies_widget.png"><img src="/resources/preview/oblikuestrategies_widget_prev.jpg"></a><br>
|
||||
Configuration window:<br>
|
||||
<a href="/resources/screenshots/oblikuestrategies_config.png"><img src="/resources/preview/oblikuestrategies_config_prev.jpg"></a></p>
|
||||
<!-- end of gui block -->
|
234
ru/projects/pytextmonitor.html
Normal file
234
ru/projects/pytextmonitor.html
Normal file
@ -0,0 +1,234 @@
|
||||
---
|
||||
layout: project
|
||||
title: py-text-monitor
|
||||
short: pytextmonitor
|
||||
commentIssueId: 3
|
||||
description: Minimalistic Plasmoid script that looks like widgets in Awesome WM
|
||||
hasgui: true
|
||||
developers:
|
||||
- Evgeniy Alelseev
|
||||
license: GPL
|
||||
links:
|
||||
- Plasmoid page on <a href="http://kde-look.org/content/show.php/Py+Text+Monitor?content=157124">kde-look.org</a>
|
||||
- DataEngine page on <a href="http://kde-look.org/content/show.php/Extended+Systemmonitor+DataEngine?content=158773">kde-look.org</a>
|
||||
- Archlinux <a href="https://aur.archlinux.org/packages/kdeplasma-applets-pytextmonitor">AUR package</a>
|
||||
---
|
||||
<!-- info block -->
|
||||
<h2><a name="info" class="anchor" href="#information"><span class="octicon octicon-link"></span></a>Information</h2>
|
||||
<p align="justify">A minimalistic Plasmoid script written on <code>Python2</code>. It looks like widgets in <a href="http://awesome.naquadah.org/">Awesome WM</a>. My plasmoid is highly and easily configurable and does not clutter your KDE system. Also this packages has an additional <a href="http://techbase.kde.org/Development/Tutorials/Plasma/DataEngines">DataEngine</a> written on <code>CPP</code> (old version was written on <code>Python2</code>).</p>
|
||||
|
||||
<h3><a name="devel" class="anchor" href="#devel"><span class="octicon octicon-link"></span></a>Developers and contributors</h3>
|
||||
<ul>
|
||||
{% for devel in page.developers %}
|
||||
<li>{{ devel }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3><a name="license" class="anchor" href="#license"><span class="octicon octicon-link"></span></a>License</h3>
|
||||
<ul>
|
||||
<li>{{ page.license }}</li>
|
||||
</ul>
|
||||
<!-- end of info block -->
|
||||
|
||||
<!-- install block -->
|
||||
<h2><a name="install" class="anchor" href="#install"><span class="octicon octicon-link"></span></a>Installation</h2>
|
||||
|
||||
<h3><a name="instruction" class="anchor" href="#instruction"><span class="octicon octicon-link"></span></a>Instruction</h3>
|
||||
<ul>
|
||||
<li><p align="justify">Download an <a href="https://github.com/arcan1s/pytextmonitor/releases">archive</a> with latest version of source files.</p></li>
|
||||
<li><p align="justify">Extract it and install the DataEngine:</p>
|
||||
<pre>cd /where/your/applet/is/installed
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=Release ../
|
||||
make
|
||||
make install</pre>
|
||||
<p align="justify">For global isntallation type:</p>
|
||||
<pre>cd /where/your/applet/is/installed
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=Release ../
|
||||
make
|
||||
make install</pre></li>
|
||||
<li><p align="justify">Install the Plasmoid:</p>
|
||||
<pre>plasmapkg -i py-text-monitor-1.5.0.plasmoid</pre>
|
||||
<p align="justify">For global isntallation type:</p>
|
||||
<pre>plasmapkg -g -i py-text-monitor-1.5.0.plasmoid</pre></li>
|
||||
</ul>
|
||||
|
||||
<h3><a name="dependencies" class="anchor" href="#dependencies"><span class="octicon octicon-link"></span></a>Dependencies</h3>
|
||||
<p align="justify">I want note that all were tested on latest version of dependencies.</p>
|
||||
<ul>
|
||||
<li>kdebase-workspace</li>
|
||||
<li>kdebindings-python2</li>
|
||||
<li>automoc4 <i>(make)</i></li>
|
||||
<li>cmake <i>(make)</i></li>
|
||||
<li>kdebase-runtime <i>(make)</i></li>
|
||||
<li>lm_sensors <i>(optional, for definition temperature device)</i></li>
|
||||
<li>net-tools <i>(optional, for definition network device)</i></li>
|
||||
<li>sysstat <i>(optional, for notification)</i></li>
|
||||
<li>hddtemp <i>(optional, for HDD temperature monitor)</i></li>
|
||||
<li>one of supported music player - <a href="http://amarok.kde.org/">amarok</a>, <a href="http://www.musicpd.org/">mtd</a> or <a href="http://qmmp.ylsoftware.com/">qmmp</a> <i>(optional, for music player monitor)</i>
|
||||
<li>proprietary video driver <i>(optional, for GPU monitor)</i></li></li>
|
||||
</ul>
|
||||
<!-- end of install block -->
|
||||
|
||||
<!-- howto block -->
|
||||
<h2><a name="howto" class="anchor" href="#howto"><span class="octicon octicon-link"></span></a>How to use</h2>
|
||||
<p align="justify">Open your Plasma widgetes and select <code>Py Text Monitor</code>.</p>
|
||||
<!-- end of howto block -->
|
||||
|
||||
<!-- config block -->
|
||||
<h2><a name="config" class="anchor" href="#config"><span class="octicon octicon-link"></span></a>Configuration</h2>
|
||||
|
||||
<h3><a name="deconf" class="anchor" href="#deconf"><span class="octicon octicon-link"></span></a>DataEngine configuration</h3>
|
||||
<p align="justify">You may edit DataEngine configuration. It is <code>/usr/share/config/extsysmon.conf</code> or <code>$HOME/.kde4/share/config/extsysmon.conf</code> depending on the type of installation. Uncomment needed line and edit it.</p>
|
||||
|
||||
<h4><a name="deoptions" class="anchor" href="#deoptions"><span class="octicon octicon-link"></span></a>DataEngine options</h4>
|
||||
<table>
|
||||
<tr>
|
||||
<th>GPUDEV</th>
|
||||
<td><p align="justify">Set GPU device. May be <code>nvidia</code> (for nVidia), <code>ati</code> (for ATI Radeon), <code>ignore</code> or <code>auto</code>. Default is <code>auto</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>HDDDEV</th>
|
||||
<td><p align="justify">Set block device for <code>hddtemp</code> comma separated or use <code>all</code>. Default is <code>all</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MPDADDRESS</th>
|
||||
<td><p align="justify">MPD host address. Default is <code>localhost</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MPDPORT</th>
|
||||
<td><p align="justify">MPD host port. Default is <code>6600</code>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3><a name="widconf" class="anchor" href="#widconf"><span class="octicon octicon-link"></span></a>Widget configuration</h3>
|
||||
<p align="justify">For edited output you must open Settings window and setup output format in lines. Label order will changed if you change slider position. HTML tags in label work normally.<br>
|
||||
<b>NOTE</b> you do not may set to show <code>$cpu</code> in swap label for example. <b><code>$cpu</code> will work only in cpu label.</b></p>
|
||||
<p align="justify">Available flags are in the table below.</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th rowspan="4">Time label</th>
|
||||
<td><code>$time</code></td>
|
||||
<td><p align="justify">Time in default format. For example, <code>fri Nov 6 04:48:01 2013</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$isotime</code></td>
|
||||
<td><p align="justify">Time in ISO format.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$shorttime</code></td>
|
||||
<td><p align="justify">Time in short locale format.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$longtime</code></td>
|
||||
<td><p align="justify">Time in long locale format.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1">Uptime label</th>
|
||||
<td><code>$uptime</code></td>
|
||||
<td><p align="justify">System uptime, <code>---d--h--m</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">CPU label</th>
|
||||
<td><code>$cpu</code></td>
|
||||
<td><p align="justify">Total load CPU, %, <code>-----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$ccpu</code></td>
|
||||
<td><p align="justify">Load CPU for each core, %, <code>-----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">CPU clock label</th>
|
||||
<td><code>$cpucl</code></td>
|
||||
<td><p align="justify">Average CPU clock, MHz, <code>----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$ccpucl</code></td>
|
||||
<td><p align="justify">CPU clock for each core, MHz, <code>----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1">Temperature label</th>
|
||||
<td><code>$temp</code></td>
|
||||
<td><p align="justify">Average temperature in system, °C, <code>----</code>. Temperature device must be specified.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1">GPU label</th>
|
||||
<td><code>$gpu</code></td>
|
||||
<td><p align="justify">GPU usage, %, <code>-----</code>. <code>aticonfig</code> or <code>nvidia-smi</code> must be installed.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1">GPU temperature label</th>
|
||||
<td><code>$gputemp</code></td>
|
||||
<td><p align="justify">GPU temperature, °C, <code>----</code>. <code>aticonfig</code> or <code>nvidia-smi</code> must be installed.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">Memory label</th>
|
||||
<td><code>$mem</code></td>
|
||||
<td><p align="justify">Memory usage, %, <code>-----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$memmb</code></td>
|
||||
<td><p align="justify">Memory usage, MB, <code>-----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">Swap label</th>
|
||||
<td><code>$swap</code></td>
|
||||
<td><p align="justify">Swap usage, %, <code>-----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$swapmb</code></td>
|
||||
<td><p align="justify">Swap usage, MB, <code>-----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1">HDD usage label</th>
|
||||
<td><code>@@/@@</code></td>
|
||||
<td><p align="justify">mount point (<code>/</code> in example) usage, %, <code>-----</code>. Separator for mount points list is <code>;</code>, for example <code>@@/;/home;/mnt/global@@</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1">HDD temperature label</th>
|
||||
<td><code>@@/dev/sda@@</code></td>
|
||||
<td><p align="justify">HDD (<code>/dev/sda</code> in example) temperature, °C, <code>----</code>. <code>hddtemp</code> must be installed.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3">Network label</th>
|
||||
<td><code>$net</code></td>
|
||||
<td><p align="justify">Download and upload speed, KB/s, <code>----/----</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>@@eth0@@</code></td>
|
||||
<td><p align="justify">Do not use automatic device definition, show only specified device (<code>eth0</code> in example).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$netdev</code></td>
|
||||
<td><p align="justify">Current network device.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">Battery label</th>
|
||||
<td><code>$bat</code></td>
|
||||
<td><p align="justify">Battery charge, %, <code>---</code>. Battery device may be set below. File (<code>/sys/class/power_supply/BAT0/capacity</code> by default) must contain only battery charge in percent.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$ac</code></td>
|
||||
<td><p align="justify">Status of AC device. Returns <code>(*)</code> if AC device is online or <code>( )</code> if offline. AC device may be set below. File (<code>/sys/class/power_supply/AC/online</code> by default) must contain <code>1</code> if AC is online.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">Music player label</th>
|
||||
<td><code>$artist</code></td>
|
||||
<td><p align="justify">Current song artist. One of supported music players must be installed.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>$title</code></td>
|
||||
<td><p align="justify">Current song title. One of supported music players must be installed.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- end of config block -->
|
||||
|
||||
<!-- gui block -->
|
||||
<h2><a name="gui" class="anchor" href="#gui"><span class="octicon octicon-link"></span></a>Graphical user interface</h2>
|
||||
|
||||
<h2><a name="screenshots" class="anchor" href="#screenshots"><span class="octicon octicon-link"></span></a>Screenshots</h2>
|
||||
<p align="justify">Widget (clickable):<br>
|
||||
<a href="/resources/screenshots/pytextmonitor_widget.png"><img src="/resources/preview/pytextmonitor_widget_prev.jpg"></a><br>
|
||||
Configuration window::<br>
|
||||
<a href="/resources/screenshots/pytextmonitor_config.png"><img src="/resources/preview/pytextmonitor_config_prev.jpg"></a></p>
|
128
ru/projects/queued.html
Normal file
128
ru/projects/queued.html
Normal file
@ -0,0 +1,128 @@
|
||||
---
|
||||
layout: project
|
||||
title: queued
|
||||
short: queued
|
||||
commentIssueId: 4
|
||||
description: Daemon for starting jobs to queue of calculations
|
||||
hasgui: false
|
||||
developers:
|
||||
- Evgeniy Alelseev
|
||||
license: GPLv3
|
||||
links:
|
||||
---
|
||||
<!-- info block -->
|
||||
<h2><a name="info" class="anchor" href="#info"><span class="octicon octicon-link"></span></a>Information</h2>
|
||||
<p align="justify">Daemon for starting jobs to queue of calculations. It was written as proof-of-concept.</p>
|
||||
<pre>$ queued --help
|
||||
Simple daemon written on BASH for starting jobs to queue of calculations
|
||||
|
||||
Usage: queued [ -c /etc/queued.conf ] [ -v | --version ] [ -h | --help ]
|
||||
Parametrs:
|
||||
-c PATH - path to configuration file. Default is '/etc/queued.conf'
|
||||
|
||||
-v --version - show version and exit
|
||||
-h --help - show this help and exit</pre>
|
||||
<pre>$ add_queued --help
|
||||
add_queued [ -c /etc/queued.conf ] [ -p NUM ] [ -u USER ] [ -h | --help ] /path/to/script
|
||||
|
||||
Parameters:
|
||||
-c PATH - path to configuration file. Default is '/etc/queued.conf'
|
||||
-p NUM - job priority
|
||||
-u USER - username
|
||||
-h --help - show this help and exit</pre>
|
||||
|
||||
<h3><a name="devel" class="anchor" href="#devel"><span class="octicon octicon-link"></span></a>Developers and contributors</h3>
|
||||
<ul>
|
||||
{% for devel in page.developers %}
|
||||
<li>{{ devel }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3><a name="license" class="anchor" href="#license"><span class="octicon octicon-link"></span></a>License</h3>
|
||||
<ul>
|
||||
<li>{{ page.license }}</li>
|
||||
</ul>
|
||||
<!-- end of info block -->
|
||||
|
||||
<!-- install block -->
|
||||
<h2><a name="install" class="anchor" href="#install"><span class="octicon octicon-link"></span></a>Installation</h2>
|
||||
|
||||
<h3><a name="instruction" class="anchor" href="#instruction"><span class="octicon octicon-link"></span></a>Instruction</h3>
|
||||
<ul>
|
||||
<li><p align="justify">Download an <a href="https://github.com/arcan1s/queued/releases">archive</a> with latest version of source files.</p></li>
|
||||
<li><p align="justify">Extract it and install the application:</p>
|
||||
<pre>./install.sh "/path/to/root/package"</pre>
|
||||
<p align="justify">If you want install it to <code>/</code> you must run it as root, e.g.:</p>
|
||||
<pre>sudo ./install.sh "/path/to/root/package"</pre>
|
||||
<p align="justify">If no path is specified it will be installed to <code>/</code> by default.</p></li>
|
||||
</ul>
|
||||
|
||||
<h3><a name="dependencies" class="anchor" href="#dependencies"><span class="octicon octicon-link"></span></a>Dependencies</h3>
|
||||
<p align="justify">I want note that all were tested on latest version of dependencies.</p>
|
||||
<ul>
|
||||
<li>Bash (including awk, grep, sed)</li>
|
||||
<li>systemd <i>(optional, service file)</i></li>
|
||||
</ul>
|
||||
<!-- end of install block -->
|
||||
|
||||
<!-- howto block -->
|
||||
<h2><a name="howto" class="anchor" href="#howto"><span class="octicon octicon-link"></span></a>How to use</h2>
|
||||
<p align="justify">If you want to start the daemon just run</p>
|
||||
<pre>systemctl start queued</pre>
|
||||
<p align="justify">If you want to enable daemon autoload run</p>
|
||||
<pre>systemctl enable queued</pre>
|
||||
<p align="justify">But you may change path to configuration file or change parameters. To do it just copy (recommended) the source configuration file to new path</p>
|
||||
<pre>cp /etc/queued.conf /path/to/new/queued.conf</pre>
|
||||
<p align="justify">and edit it. Then copy the source service file to <code>/etc</code>:</p>
|
||||
<pre>cp /usr/lib/systemd/system/queued.service /etc/systemd/system/queued-my-profile.service</pre>
|
||||
<p align="justify">Replace following string in the file:</p>
|
||||
<pre>ExecStart=/usr/bin/queued</pre>
|
||||
<p align="justify">to</p>
|
||||
<pre>ExecStart=/usr/bin/queued -c /path/to/new/queued.conf</pre>
|
||||
|
||||
<h3><a name="adding" class="anchor" href="#adding"><span class="octicon octicon-link"></span></a>Adding a job</h3>
|
||||
<ol>
|
||||
<li>Create shell script with the command (e.g. it have a name <code>script.sh</code>)</li>
|
||||
<li>Create priority file (<code>script.sh.pr</code>) with the job priority if it is needed</li>
|
||||
<li>Create user file (<code>script.sh.user</code>) with the job username if it is needed</li>
|
||||
<li>Copy files to <code>$WORKDIR</code></li>
|
||||
</ol>
|
||||
<p align="justify">Also you may use <code>add_queued</code>.</p>
|
||||
|
||||
<h2><a name="configuration" class="anchor" href="#configuration"><span class="octicon octicon-link"></span></a>Configuration</h2>
|
||||
<p align="justify">All settings are stored in <code>/etc/queued.conf</code>. After edit them you must restart daemon</p>
|
||||
<pre>systemctl restart queued</pre>
|
||||
<!-- end of howto block -->
|
||||
|
||||
<!-- config block -->
|
||||
<h3><a name="options" class="anchor" href="#options"><span class="octicon octicon-link"></span></a>Options</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>WORKDIR</th>
|
||||
<td><p align="justify">Full path to directory with source jobs. Default is <code>/var/lib/queued/work</code>. This directory must contain source scripts <code>script-name</code>, a priority file (it is not necessary) <code>script-name.pr</code> and a file with username (it is not necessary too) <code>script-name.user</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>JOBDIR</th>
|
||||
<td><p align="justify">Full path to directory with running jobs. Default is <code>/var/lib/queued/job</code>. All job files will be moved here.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>QUEUEFILE</th>
|
||||
<td><p align="justify">Full path to file with queue list. Default is <code>/var/lib/queued/queue</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PRIORITY</th>
|
||||
<td><p align="justify">Default priority. Default is <code>0</code>. The higher the value, the higher the priority of the task.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>SLEEPTIME</th>
|
||||
<td><p align="justify">Time interval in minutes. Default is <code>5</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>STARTASUSER</th>
|
||||
<td><p align="justify">Default user. Default is <code>root</code>. This user will own created files.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- end of config block -->
|
||||
|
||||
<!-- gui block -->
|
||||
<!-- end of gui block -->
|
12
sitemap.xml
12
sitemap.xml
@ -8,25 +8,25 @@ projects:
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>{{ site.baseurl }}/</loc>
|
||||
<loc>http://arcan1s.github.io/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{ site.baseurl }}/about/</loc>
|
||||
<loc>http://arcan1s.github.io/about/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{ site.baseurl }}/authors/</loc>
|
||||
<loc>http://arcan1s.github.io/authors/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{ site.baseurl }}/blog/</loc>
|
||||
<loc>http://arcan1s.github.io/blog/</loc>
|
||||
</url>
|
||||
{% for post in site.posts %}
|
||||
<url>
|
||||
<loc>{{ site.baseurl }}{{ post.url }}</loc>
|
||||
<loc>http://arcan1s.github.io{{ post.url }}</loc>
|
||||
</url>
|
||||
{% endfor %}
|
||||
{% for proj in page.projects %}
|
||||
<url>
|
||||
<loc>{{ site.baseurl }}/projects/{{ proj }}/</loc>
|
||||
<loc>http://arcan1s.github.io/projects/{{ proj }}/</loc>
|
||||
</url>
|
||||
{% endfor %}
|
||||
</urlset>
|
Loading…
Reference in New Issue
Block a user