diff --git a/404.html b/404.html index fafa58e..6dcd211 100644 --- a/404.html +++ b/404.html @@ -23,6 +23,16 @@

Page not found!

+ + +

Hello!

@@ -35,7 +45,7 @@

Hosted on GitHub Pages. Authors

- + diff --git a/_config.yml b/_config.yml index f0391d6..80c2542 100644 --- a/_config.yml +++ b/_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 diff --git a/_layouts/default.html b/_layouts/default.html index 90f969d..cdd80a1 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -40,6 +40,8 @@ {% include footer_sharethis.html %} {% endif %} Hosted on GitHub Pages. Authors

+

+

diff --git a/_posts/2014-01-14-about-zshrc.html b/_posts/2014-01-14-about-zshrc.html index d2851fc..9472f9f 100644 --- a/_posts/2014-01-14-about-zshrc.html +++ b/_posts/2014-01-14-about-zshrc.html @@ -1,6 +1,5 @@ --- layout: paper -date: 14 January 2014 last: 14 January 2014 tags: zshrc, configuration, linux title: About zshrc diff --git a/_ruposts/.2011-01-14-about-zshrchtml b/_ruposts/.2011-01-14-about-zshrchtml new file mode 100644 index 0000000..d2851fc --- /dev/null +++ b/_ruposts/.2011-01-14-about-zshrchtml @@ -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 .zshrc and explain what it does and why it is needed. Also any comments or additions are welcome. It is a translated paper from Russian (original). +commentIssueId: 5 +--- +

Prepare

+

First install recommended minima:

+
pacman -Sy pkgfile zsh zsh-completions zsh-syntax-highlighting
+

pkgfile is a very useful utility. Alo this command will install shell, additional completion and syntax highlighting.

+ +

Shell configuration

+

All options are avaible here.

+ +

Set history file and number of commands in cache of the current session and in the history file:

+
# history
+HISTFILE=~/.zsh_history
+HISTSIZE=500000
+SAVEHIST=500000
+ +

I can not remember all Ctrl+ combinations so I bind keys to its default usages:

+
# 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
+

But in this case Up/Down arrows are used to navigate through the history based on already entered part of a command. And PgUp/PgDown will ignore already entered part of a command.

+ +

Command autocomplete:

+
# autocomplete
+autoload -U compinit
+compinit
+zstyle ':completion:*' insert-tab false
+zstyle ':completion:*' max-errors 2
+

Full command autocomplete will be enabled. insert-tab false will enable autocomplete for non-entered commands. max-errors sets maximum number of errors that could be corrected.

+ +

Prompt:

+
# promptinit
+autoload -U promptinit
+promptinit
+ +

Enable colors:

+
# colors
+autoload -U colors
+colors
+ +

Here are some other options.

+

Change directory without cd:

+
# autocd
+setopt autocd
+

Correcting of typos (and question template):

+
# correct
+setopt CORRECT_ALL
+SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) "
+

Disable f#$%ing beep:

+
# disable beeps
+unsetopt beep
+

Enable calculator:

+
# calc
+autoload zcalc
+

Append history (do not recreate the history file):

+
# append history
+setopt APPEND_HISTORY
+

Do not save dups to history file:

+
# ignore dups in history
+setopt HIST_IGNORE_ALL_DUPS
+

...and additional spaces:

+
# ignore dups in history
+setopt HIST_IGNORE_SPACE
+

...and blank lines too:

+
# reduce blanks in history
+setopt HIST_REDUCE_BLANKS
+

Enable pkgfile:

+
# pkgfile
+source /usr/share/doc/pkgfile/command-not-found.zsh
+ +

Syntax highlighting

+
# 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'
+

In first line highlighting is turned on. Next main, brackets and pattern highlighting are turned on. Patterns are set below (rm -rf * in the example). Also root and cursor highlighting may be turned on. Colors syntax is understandable, fg is font color, bg is background color.

+ +

$PROMPT and $RPROMPT

+

The general idea is the use single .zshrc for root and normal user:

+
# 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
+ +

fg is font color, bg is background color. \_bold and \_no_bold regulate the tint. Commands should be in %{ ... %} so they do not appear. Avaible colors are:

+
black
+red
+green
+yellow
+blue
+magenta
+cyan
+white
+ +

Avaible variables are:

+
%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
+ +

RPROMPT (acpi package is necessary):

+
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%}"
+

My RPROMPT shows current time, battery change and last returned code. precmd() is necessary for automatic updating. The construct $(if.true.false) is conditional statement in zsh.

+ +

Aliases

+

Copy only those aliases that you need. If any alias uses application that is not installed it will leads to fail of loading of configuration file.

+ +

Small useful (or maybe not) function:

+
show_which() {
+  OUTPUT=$(which $1 | cut -d " " -f7-)
+  echo "Running '$OUTPUT'" 1>&2
+}
+ +

Here is the first group of aliases:

+
## 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'
+ +

Here are ls aliases (see man ls):

+
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'
+ +

Here are aliases to quick file view from console (just type a file name!):

+
# 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
+ +

Here are "sudo" aliases:

+
# 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
+ +

Here are global aliases. If they are enable the command cat foo g bar will be equivalent the command cat foo | grep bar:

+
# global alias
+alias -g g="| grep"
+alias -g l="| less"
+alias -g t="| tail"
+alias -g h="| head"
+alias -g dn="&> /dev/null &"
+ +

Functions

+

Here is a special function for xrandr:

+ +
# 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 +}
+ +

Unfortunately I can not remember tar flags thus I use special functions:

+
# 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 +}
+ +

Here is a special function for su:

+
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 +}
+ +

Functions with automatic rehash after installing/removing packages are:

+
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 +}
+

But autocomplete for yaourt -Ss will require root privileges.

+ +

Variables

+

It is recommended to set own variables in ~/.zshenv. But I have everything stored in the single file.

+ +

Here are path, mask of new files, editor and pager:

+
# path
+export PATH="$PATH:$HOME/.local/bin"
+# umask
+umask 022
+# editor
+export EDITOR="vim"
+export PAGER="vimpager"
+ +

Here is hashes. If they are enable the command ~global will be equivalent the command /mnt/global:

+
# 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
+ +

Screenshot

+

+ +

File

+

Here is my .zshrc.

diff --git a/_ruposts/2014-01-14-about-zshrc.html b/_ruposts/2014-01-14-about-zshrc.html new file mode 100644 index 0000000..b6ee7f0 --- /dev/null +++ b/_ruposts/2014-01-14-about-zshrc.html @@ -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 .zshrc and explain what it does and why it is needed. Also any comments or additions are welcome. It is a translated paper from Russian (original). +commentIssueId: 5 +--- +

Prepare

+

First install recommended minima:

+
pacman -Sy pkgfile zsh zsh-completions zsh-syntax-highlighting
+

pkgfile is a very useful utility. Alo this command will install shell, additional completion and syntax highlighting.

+ +

Shell configuration

+

All options are avaible here.

+ +

Set history file and number of commands in cache of the current session and in the history file:

+
# history
+HISTFILE=~/.zsh_history
+HISTSIZE=500000
+SAVEHIST=500000
+ +

I can not remember all Ctrl+ combinations so I bind keys to its default usages:

+
# 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
+

But in this case Up/Down arrows are used to navigate through the history based on already entered part of a command. And PgUp/PgDown will ignore already entered part of a command.

+ +

Command autocomplete:

+
# autocomplete
+autoload -U compinit
+compinit
+zstyle ':completion:*' insert-tab false
+zstyle ':completion:*' max-errors 2
+

Full command autocomplete will be enabled. insert-tab false will enable autocomplete for non-entered commands. max-errors sets maximum number of errors that could be corrected.

+ +

Prompt:

+
# promptinit
+autoload -U promptinit
+promptinit
+ +

Enable colors:

+
# colors
+autoload -U colors
+colors
+ +

Here are some other options.

+

Change directory without cd:

+
# autocd
+setopt autocd
+

Correcting of typos (and question template):

+
# correct
+setopt CORRECT_ALL
+SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) "
+

Disable f#$%ing beep:

+
# disable beeps
+unsetopt beep
+

Enable calculator:

+
# calc
+autoload zcalc
+

Append history (do not recreate the history file):

+
# append history
+setopt APPEND_HISTORY
+

Do not save dups to history file:

+
# ignore dups in history
+setopt HIST_IGNORE_ALL_DUPS
+

...and additional spaces:

+
# ignore dups in history
+setopt HIST_IGNORE_SPACE
+

...and blank lines too:

+
# reduce blanks in history
+setopt HIST_REDUCE_BLANKS
+

Enable pkgfile:

+
# pkgfile
+source /usr/share/doc/pkgfile/command-not-found.zsh
+ +

Syntax highlighting

+
# 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'
+

In first line highlighting is turned on. Next main, brackets and pattern highlighting are turned on. Patterns are set below (rm -rf * in the example). Also root and cursor highlighting may be turned on. Colors syntax is understandable, fg is font color, bg is background color.

+ +

$PROMPT and $RPROMPT

+

The general idea is the use single .zshrc for root and normal user:

+
# 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
+ +

fg is font color, bg is background color. \_bold and \_no_bold regulate the tint. Commands should be in %{ ... %} so they do not appear. Avaible colors are:

+
black
+red
+green
+yellow
+blue
+magenta
+cyan
+white
+ +

Avaible variables are:

+
%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
+ +

RPROMPT (acpi package is necessary):

+
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%}"
+

My RPROMPT shows current time, battery change and last returned code. precmd() is necessary for automatic updating. The construct $(if.true.false) is conditional statement in zsh.

+ +

Aliases

+

Copy only those aliases that you need. If any alias uses application that is not installed it will leads to fail of loading of configuration file.

+ +

Small useful (or maybe not) function:

+
show_which() {
+  OUTPUT=$(which $1 | cut -d " " -f7-)
+  echo "Running '$OUTPUT'" 1>&2
+}
+ +

Here is the first group of aliases:

+
## 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'
+ +

Here are ls aliases (see man ls):

+
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'
+ +

Here are aliases to quick file view from console (just type a file name!):

+
# 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
+ +

Here are "sudo" aliases:

+
# 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
+ +

Here are global aliases. If they are enable the command cat foo g bar will be equivalent the command cat foo | grep bar:

+
# global alias
+alias -g g="| grep"
+alias -g l="| less"
+alias -g t="| tail"
+alias -g h="| head"
+alias -g dn="&> /dev/null &"
+ +

Functions

+

Here is a special function for xrandr:

+ +
# 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 +}
+ +

Unfortunately I can not remember tar flags thus I use special functions:

+
# 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 +}
+ +

Here is a special function for su:

+
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 +}
+ +

Functions with automatic rehash after installing/removing packages are:

+
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 +}
+

But autocomplete for yaourt -Ss will require root privileges.

+ +

Variables

+

It is recommended to set own variables in ~/.zshenv. But I have everything stored in the single file.

+ +

Here are path, mask of new files, editor and pager:

+
# path
+export PATH="$PATH:$HOME/.local/bin"
+# umask
+umask 022
+# editor
+export EDITOR="vim"
+export PAGER="vimpager"
+ +

Here is hashes. If they are enable the command ~global will be equivalent the command /mnt/global:

+
# 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
+ +

Screenshot

+

+ +

File

+

Here is my .zshrc.

diff --git a/resources/en.png b/resources/en.png new file mode 100644 index 0000000..b92c6ab Binary files /dev/null and b/resources/en.png differ diff --git a/resources/ru.png b/resources/ru.png new file mode 100644 index 0000000..e2827bf Binary files /dev/null and b/resources/ru.png differ diff --git a/ru/404.html b/ru/404.html new file mode 100644 index 0000000..cecb3b8 --- /dev/null +++ b/ru/404.html @@ -0,0 +1,41 @@ + + + + + + Ошибка 404 + + + + + + + + + + + +
+
+

404

+

Страница не найдена!

+
+
+ +

Привет!

+ +pinkiepie + +

Я Пинки Пай. Ты видишь меня, потому что ты хочешь страницу, которую я не смогла найти. Мне жаль, нет, честно. Я постараюсь работать лучше. А сейчас я могу предложить тебе вернуться на домашнюю страницу или назад

+ +
+
+

Расположено на GitHub Pages. Авторы

+
+
+ + + + diff --git a/ru/about.html b/ru/about.html new file mode 100644 index 0000000..70b1155 --- /dev/null +++ b/ru/about.html @@ -0,0 +1,41 @@ +--- +layout: default +comment: false +share: true +back: 1 +title: About me +--- + +
+
+

About me

+ +

GitHub Profile
+ TU Profile on archlinux.org
+ Some of my publications
+ PGP signature: 0x31361F01

+ +

Contacts

+

Alias: arcanis/arcan1s
+ IRC: arcan1s
+ ICQ: 407-398-235
+ Jabber: arcanis (at) jabber (dot) org
+ E-mail: darkarcanis (at) mail (dot) ru

+ +
+
+ +

My name is Evgeniy Alekseev and I'm from Siberia (seriously, I was born in Siberia). In the global Internet I have usually nickname arcan1s, but in the Russian segment it is usually arcanis. I'm a graduate of the Department of Chemistry, 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).

+ +

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 Robert Jordan's or George R.R. Martin's 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 my home computer. I just want to notice that I am NOT A FREELANCER. But you can suggest me some project (not money) and if I'll like it I'll do it.

+ +

Also I'm an Archlinux user (maybe that's why I look like a bearded nerd). And in October 2013 I became an Archlinux Trusted User:

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

© ArchWiki

+ +

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:

+
int i = 1;
+i = ++i + ++i;
+return i;
+

And the correct answer is 5 (or 6, as you wish).

diff --git a/ru/authors.html b/ru/authors.html new file mode 100644 index 0000000..1625256 --- /dev/null +++ b/ru/authors.html @@ -0,0 +1,36 @@ +--- +layout: default +comment: false +share: false +back: 2 +title: Authors +--- + +
+
+

Authors

+
+
+ +

The code and content of this site is licensed under Beerware license:

+

"THE BEER-WARE LICENSE" (Revision 42):
+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

+ +

The source theme was created by Steve Smith and licensed under Creative Commons Attribution-ShareAlike 3.0 Unported License.

+ +

The comment block was created by Ivan Žužak and licensed under MIT License.

+ +

This site uses: +

+ +

Google Custom Search is licensed under own custom license.

+ +

Sharethis have own custom license too.

+ +

Liberation font is licensed under The SIL Open Font License.

+ +

Special thanks to Monztruo, I borrowed his icon.

+ +

© Evgeniy Alekseev, 2014

diff --git a/ru/blog/index.html b/ru/blog/index.html new file mode 100644 index 0000000..7b3ec25 --- /dev/null +++ b/ru/blog/index.html @@ -0,0 +1,46 @@ +--- +layout: default +title: arcanis' blog +comment: false +share: false +back: 1 +--- + +
+
+

arcanis' blog

+
+
+ + {% for post in paginator.ruposts %} +

{{ post.title }}

+

{{ post.date | date_to_string}}

+

{{ post.description }}

+

Tags: {{ post.tags }}

+ {% endfor %} + + {% if paginator.total_pages > 1 %} + {% if paginator.previous_page %} + « Prev + {% else %} + « Prev + {% endif %} + + {% for page in (1..paginator.total_pages) %} + {% if page == paginator.page %} + {{ page }} + {% elsif page == 1 %} + {{ page }} + {% else %} + {{ page }} + {% endif %} + {% endfor %} + + {% if paginator.next_page %} + Next » + {% else %} + Next » + {% endif %} + {% endif %} + + diff --git a/ru/index.html b/ru/index.html new file mode 100644 index 0000000..b082297 --- /dev/null +++ b/ru/index.html @@ -0,0 +1,49 @@ +--- +layout: default +comment: false +share: true +back: 0 +title: arcanis' homepage +--- + +
+
+

arcanis' homepage

+ +

My blog
+ My projects

+

About me

+ +
+
+ + + + +

Welcome

+

Welcome to my homepage, `echo $USERNAME`. About me you may read on the link. 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 my projects. Unfortunately, sometimes I'm too lazy to write in English, thus some of my papers will be in Russian.

+ +

Contact me

+

If you have a question or something else you may contact me. 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 my Github profile and do it.

+ +

Site search

+ + diff --git a/ru/projects/git-etc.html b/ru/projects/git-etc.html new file mode 100644 index 0000000..382cc15 --- /dev/null +++ b/ru/projects/git-etc.html @@ -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 AUR package +--- + +

Information

+

Simple daemon that automatically creates git repository in the given directory and creates commit at the specified time interval.

+
$ 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
+
$ 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
+ +

Developers and contributors

+
    + {% for devel in page.developers %} +
  • {{ devel }}
  • + {% endfor %} +
+ +

License

+
    +
  • {{ page.license }}
  • +
+ + + +

Installation

+ +

Instruction

+
    +
  • Download an archive with latest version of source files.

  • +
  • Extract it and install the application:

    +
    ./install.sh "/path/to/root/package"
    +

    If you want install it to / you must run it as root, e.g.:

    +
    sudo ./install.sh "/path/to/root/package"
    +

    If no path is specified it will be installed to / by default.

  • +
+ +

Dependencies

+

I want note that all were tested on latest version of dependencies.

+
    +
  • Bash (including awk, grep, sed)
  • +
  • git
  • +
  • python2 (make)
  • +
  • systemd (optional, service file)
  • +
  • python2-pyqt4 (optional, GUI)
  • +
  • xterm (optional, GUI)
  • +
+ + + +

How to use

+

If you want to start the daemon into /etc just run

+
systemctl start git-etc
+

If you want to enable daemon autoload run

+
systemctl enable git-etc
+

But you may change path to configuration file or change parameters. To do it just copy (recommended) the source configuration file to new path

+
cp /etc/git-etc.conf /new/path/to/file/git-etc.conf
+

and edit it. Then copy the source service file to /etc:

+
cp /usr/lib/systemd/system/git-etc.service /etc/systemd/system/git-etc-my-profile.service
+

Replace following string in the file:

+
ExecStart=/usr/bin/git-etc -c /etc/git-etc.conf
+

to

+
ExecStart=/usr/bin/git-etc -c /new/path/to/file/git-etc.conf
+ + + +

Configuration

+

All settings are stored in /etc/git-etc.conf. After edit them you must restart daemon

+
systemctl restart git-etc
+ +

Options

+ + + + + + + + + + + + + + + + + +
DIRECTORY

Full path to working directory with observed files. Default is /etc.

TIMESLEEP

Time interval between updates. It must be integer and >= 1. Default is 12.

IGNORELIST

List of files that will not be observed. Separator is ";;". May be empty.

FORALL

1 will enable access for normal user. Default is 1.

+ + + +

Graphical user interface

+

Control Config (ctrlconf) is GUI for git-etc daemon written on Python2/PyQt4. 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 (git reset --hard) or individual files (git diff && git apply). 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 sudo package is installed.

+ +

Configuration

+

Just run the application and open the settings window from menu!

+ +

Screenshots

+

(Screenshots in Russian, but GUI has English translation.)

+

Main window:
+
+About window:
+
+Commit changes window:
+
+Merging window:
+
+Roll back window:
+

+ diff --git a/ru/projects/index.html b/ru/projects/index.html new file mode 100644 index 0000000..a40de91 --- /dev/null +++ b/ru/projects/index.html @@ -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: git-etc 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 Bash. It is also has a simple Graphical user interface written on Python2 (pyqt4) for work with the created repository. + links: + - Homepage + - GitHub repo + - Archlinux AUR package + - title: queued + short: queued + description: queued is daemon for starting jobs to queue of calculations. It was written on Bash created as proof-of-concept. + links: + - Homepage + - GitHub repo + - title: KDE widgets + short: widgets + projects: + - title: DeadLine widget + short: deadline + description: DeadLine widget is a Plasmoid script written on Python2. 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: + - GitHub repo + - title: Oblikue strategies + short: oblikuestrategies + description: oblikue-strategies is a plasmoid written on CPP that displays a random draw from Brian Eno and Peter Schmidt's Oblique Strategies. It is GNOME applet fork with some of special features. + links: + - Homepage + - GitHub repo + - Page on kde-look.org + - Archlinux AUR package + - title: Open on desktop + short: openondesktop + description: Open on desktop is a dropbox menu for Dolhpin. 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 Bash. + links: + - GitHub repo + - title: py-text-monitor + short: pytextmonitor + description: py-text-monitor is a minimalistic Plasmoid script written on Python2. It looks like widgets in Awesome WM. My plasmoid is highly and easily configurable and does not clutter your KDE system. Also this packages has an additional DataEngine written on CPP (old version was written on Python2). + links: + - Homepage + - GitHub repo + - Plasmoid page on kde-look.org + - DataEngine page on kde-look.org + - Archlinux AUR package + - title: Kit system monitor + short: sysmon + description: Kit System Monitor is a system information and hardware monitor based on EG Sysmon. It is written on HTML-like language for SuperKaramba and has simple install script written on Python2. It is my first Open Source Project. + links: + - GitHub repo + - Page on kde-look.org + - 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 C, but sometimes on Python2. Some of these have a Graphical user interface written on CPP. + links: + - Homepage + - GitHub repo + - title: Utilities + short: utilities + projects: + - title: extract_pkglist + short: extpkg + description: extract_pkglist a simple script written on Python2 for creating list of installed packages in ArchLinux. + links: + - GitHub repo + - title: Food GUI + short: foodgui + description: Food GUI is a simple program-calculator that uses own database and written on Python2. 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: + - GitHub repo + - Archlinux AUR package + - title: julius-actions + short: julius-actions + description: julius-actions is a script written on Python2 for work with julius. It was made just-for-fun too in my spare time. Works normally, but I don't use it. + links: + - GitHub repo +--- + +
+
+

arcanis' projects

+

The list of some of my projects

+

+ {% for group in page.groups %} + {{ group.title }}
+ {% endfor %} +

+
+
+ + {% for group in page.groups %} +

{{ group.title }}

+ {% for project in group.projects %} +

{{ project.title }}

+

{{ project.description }}

+

    + {% for link in project.links %} +
  • {{ link }}
  • + {% endfor %} +

+ {% endfor %} + {% endfor %} diff --git a/ru/projects/oblikuestrategies.html b/ru/projects/oblikuestrategies.html new file mode 100644 index 0000000..4f861f1 --- /dev/null +++ b/ru/projects/oblikuestrategies.html @@ -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 kde-look.org + - Archlinux AUR package +--- + +

Information

+

Plasmoid written on CPP that displays a random draw from Brian Eno and Peter Schmidt's Oblique Strategies. It is GNOME applet fork with some of special features.

+ +

Developers and contributors

+
    + {% for devel in page.developers %} +
  • {{ devel }}
  • + {% endfor %} +
+ +

License

+
    +
  • {{ page.license }}
  • +
+ + + +

Installation

+ +

Instruction

+
    +
  • Download an archive with latest version of source files.

  • +
  • Extract it and install the application. For global isntallation type:

    +
    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
    +

    For local isntallation type:

    +
    cd /where/your/applet/is/installed
    +mkdir build && cd build
    +cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=Release ../
    +make
    +make install
  • +
  • Restart plasma to load the applet:

    +
    kquitapp plasma-desktop && sleep 2 && plasma-desktop
    +

    Also you might need to run kbuildsycoca4 in order to get the *.desktop file recognized:

    +
    kbuildsycoca4 &> /dev/null
  • +
+ +

Dependencies

+

I want note that all were tested on latest version of dependencies.

+
    +
  • kdebase-workspace
  • +
  • automoc4 (make)
  • +
  • cmake (make)
  • +
+ + + +

How to use

+

Open your Plasma widgetes and select Oblikue strategies.

+ + + +

Configuration

+

Right click on widget.

+ + + +

Graphical user interface

+ +

Screenshots

+

Widget:
+
+Configuration window:
+

+ diff --git a/ru/projects/pytextmonitor.html b/ru/projects/pytextmonitor.html new file mode 100644 index 0000000..916acf6 --- /dev/null +++ b/ru/projects/pytextmonitor.html @@ -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 kde-look.org + - DataEngine page on kde-look.org + - Archlinux AUR package +--- + +

Information

+

A minimalistic Plasmoid script written on Python2. It looks like widgets in Awesome WM. My plasmoid is highly and easily configurable and does not clutter your KDE system. Also this packages has an additional DataEngine written on CPP (old version was written on Python2).

+ +

Developers and contributors

+
    + {% for devel in page.developers %} +
  • {{ devel }}
  • + {% endfor %} +
+ +

License

+
    +
  • {{ page.license }}
  • +
+ + + +

Installation

+ +

Instruction

+
    +
  • Download an archive with latest version of source files.

  • +
  • Extract it and install the DataEngine:

    +
    cd /where/your/applet/is/installed
    +mkdir build && cd build
    +cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=Release ../
    +make
    +make install
    +

    For global isntallation type:

    +
    cd /where/your/applet/is/installed
    +mkdir build && cd build
    +cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=Release ../
    +make
    +make install
  • +
  • Install the Plasmoid:

    +
    plasmapkg -i py-text-monitor-1.5.0.plasmoid
    +

    For global isntallation type:

    +
    plasmapkg -g -i py-text-monitor-1.5.0.plasmoid
  • +
+ +

Dependencies

+

I want note that all were tested on latest version of dependencies.

+
    +
  • kdebase-workspace
  • +
  • kdebindings-python2
  • +
  • automoc4 (make)
  • +
  • cmake (make)
  • +
  • kdebase-runtime (make)
  • +
  • lm_sensors (optional, for definition temperature device)
  • +
  • net-tools (optional, for definition network device)
  • +
  • sysstat (optional, for notification)
  • +
  • hddtemp (optional, for HDD temperature monitor)
  • +
  • one of supported music player - amarok, mtd or qmmp (optional, for music player monitor) +
  • proprietary video driver (optional, for GPU monitor)
  • +
+ + + +

How to use

+

Open your Plasma widgetes and select Py Text Monitor.

+ + + +

Configuration

+ +

DataEngine configuration

+

You may edit DataEngine configuration. It is /usr/share/config/extsysmon.conf or $HOME/.kde4/share/config/extsysmon.conf depending on the type of installation. Uncomment needed line and edit it.

+ +

DataEngine options

+ + + + + + + + + + + + + + + + + +
GPUDEV

Set GPU device. May be nvidia (for nVidia), ati (for ATI Radeon), ignore or auto. Default is auto.

HDDDEV

Set block device for hddtemp comma separated or use all. Default is all.

MPDADDRESS

MPD host address. Default is localhost.

MPDPORT

MPD host port. Default is 6600.

+ +

Widget configuration

+

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.
+NOTE you do not may set to show $cpu in swap label for example. $cpu will work only in cpu label.

+

Available flags are in the table below.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Time label$time

Time in default format. For example, fri Nov 6 04:48:01 2013.

$isotime

Time in ISO format.

$shorttime

Time in short locale format.

$longtime

Time in long locale format.

Uptime label$uptime

System uptime, ---d--h--m.

CPU label$cpu

Total load CPU, %, -----.

$ccpu

Load CPU for each core, %, -----.

CPU clock label$cpucl

Average CPU clock, MHz, ----.

$ccpucl

CPU clock for each core, MHz, ----.

Temperature label$temp

Average temperature in system, °C, ----. Temperature device must be specified.

GPU label$gpu

GPU usage, %, -----. aticonfig or nvidia-smi must be installed.

GPU temperature label$gputemp

GPU temperature, °C, ----. aticonfig or nvidia-smi must be installed.

Memory label$mem

Memory usage, %, -----.

$memmb

Memory usage, MB, -----.

Swap label$swap

Swap usage, %, -----.

$swapmb

Swap usage, MB, -----.

HDD usage label@@/@@

mount point (/ in example) usage, %, -----. Separator for mount points list is ;, for example @@/;/home;/mnt/global@@

HDD temperature label@@/dev/sda@@

HDD (/dev/sda in example) temperature, °C, ----. hddtemp must be installed.

Network label$net

Download and upload speed, KB/s, ----/----.

@@eth0@@

Do not use automatic device definition, show only specified device (eth0 in example).

$netdev

Current network device.

Battery label$bat

Battery charge, %, ---. Battery device may be set below. File (/sys/class/power_supply/BAT0/capacity by default) must contain only battery charge in percent.

$ac

Status of AC device. Returns (*) if AC device is online or ( ) if offline. AC device may be set below. File (/sys/class/power_supply/AC/online by default) must contain 1 if AC is online.

Music player label$artist

Current song artist. One of supported music players must be installed.

$title

Current song title. One of supported music players must be installed.

+ + + +

Graphical user interface

+ +

Screenshots

+

Widget (clickable):
+
+Configuration window::
+

diff --git a/ru/projects/queued.html b/ru/projects/queued.html new file mode 100644 index 0000000..b2bf299 --- /dev/null +++ b/ru/projects/queued.html @@ -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: +--- + +

Information

+

Daemon for starting jobs to queue of calculations. It was written as proof-of-concept.

+
$ 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
+
$ 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
+ +

Developers and contributors

+
    + {% for devel in page.developers %} +
  • {{ devel }}
  • + {% endfor %} +
+ +

License

+
    +
  • {{ page.license }}
  • +
+ + + +

Installation

+ +

Instruction

+
    +
  • Download an archive with latest version of source files.

  • +
  • Extract it and install the application:

    +
    ./install.sh "/path/to/root/package"
    +

    If you want install it to / you must run it as root, e.g.:

    +
    sudo ./install.sh "/path/to/root/package"
    +

    If no path is specified it will be installed to / by default.

  • +
+ +

Dependencies

+

I want note that all were tested on latest version of dependencies.

+
    +
  • Bash (including awk, grep, sed)
  • +
  • systemd (optional, service file)
  • +
+ + + +

How to use

+

If you want to start the daemon just run

+
systemctl start queued
+

If you want to enable daemon autoload run

+
systemctl enable queued
+

But you may change path to configuration file or change parameters. To do it just copy (recommended) the source configuration file to new path

+
cp /etc/queued.conf /path/to/new/queued.conf
+

and edit it. Then copy the source service file to /etc:

+
cp /usr/lib/systemd/system/queued.service /etc/systemd/system/queued-my-profile.service
+

Replace following string in the file:

+
ExecStart=/usr/bin/queued
+

to

+
ExecStart=/usr/bin/queued -c /path/to/new/queued.conf
+ +

Adding a job

+
    +
  1. Create shell script with the command (e.g. it have a name script.sh)
  2. +
  3. Create priority file (script.sh.pr) with the job priority if it is needed
  4. +
  5. Create user file (script.sh.user) with the job username if it is needed
  6. +
  7. Copy files to $WORKDIR
  8. +
+

Also you may use add_queued.

+ +

Configuration

+

All settings are stored in /etc/queued.conf. After edit them you must restart daemon

+
systemctl restart queued
+ + + +

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + +
WORKDIR

Full path to directory with source jobs. Default is /var/lib/queued/work. This directory must contain source scripts script-name, a priority file (it is not necessary) script-name.pr and a file with username (it is not necessary too) script-name.user.

JOBDIR

Full path to directory with running jobs. Default is /var/lib/queued/job. All job files will be moved here.

QUEUEFILE

Full path to file with queue list. Default is /var/lib/queued/queue.

PRIORITY

Default priority. Default is 0. The higher the value, the higher the priority of the task.

SLEEPTIME

Time interval in minutes. Default is 5.

STARTASUSER

Default user. Default is root. This user will own created files.

+ + + + diff --git a/sitemap.xml b/sitemap.xml index 89abb5b..04a91c5 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -8,25 +8,25 @@ projects: - {{ site.baseurl }}/ + http://arcan1s.github.io/ - {{ site.baseurl }}/about/ + http://arcan1s.github.io/about/ - {{ site.baseurl }}/authors/ + http://arcan1s.github.io/authors/ - {{ site.baseurl }}/blog/ + http://arcan1s.github.io/blog/ {% for post in site.posts %} - {{ site.baseurl }}{{ post.url }} + http://arcan1s.github.io{{ post.url }} {% endfor %} {% for proj in page.projects %} - {{ site.baseurl }}/projects/{{ proj }}/ + http://arcan1s.github.io/projects/{{ proj }}/ {% endfor %} \ No newline at end of file