19.10.11

29 правил комбинирования шрифтов

Это перевод топика http://bonfx.com/29-principles-for-making-great-font-combinations/

Правила в порядке "как попало"
  1. Комбинируйте типы шрифтов с засечками и без засечек, чтобы создать "контраст", а не "согласие". Чем более далеки друг от друга стили шрифтов, тем более удачным может оказаться ваш выбор, используйте это правило как общее, но не как непогрешимое. Шрифты, которые слишком похожи вместе выглядят плохо. Выбирайте на согласие или контрастности, но избегайте темных золотых середин, где в итоге вы получите конфликт. Посмотрите Garamond и Sabon вместе, чтобы видеть то, что я подразумеваю под "темной золотой серединой". Или попробуйте Helvetica и Univers вместе, что выглядит так же плохо. 
  2. Не используйте два шрифта с засечками или два шрифта без засечек для создания комбинации, кроме случаев, когда они радикально различаются. 
  3. Избегайте выбора двух шрифтов из одной категории, как то Script или Slabs. Вы не будете иметь достаточного контраста, что в итоге приведет к конфликту. Например, использовать Clarendon и Rockwell вместе не сильно хорошая идея. 
  4. Создайте достаточную разницу в размерах между различными шрифтами для создания контраста. 
  5. Назначте шрифтам различные роли и не меняйте их местами. 
  6. Подбирате шрифты из разных категорий так, чтобы они имели похожую x-height ака высота строчных и glyph widths (лучше прочитать статью). Например, Futura с Times New Roman несовместимы из-за большого контраста x-heights и widths, в данном случае больше из-за ширины. Однако если вы собираетесь работать с condensed шрифтом, вы можете не обращать внимания на эту проблему тк в итоге получите суперконтраст.
  7. Ликбез вставка сперто тут
  8. Найдите некоторые связи между основными формами. Например, оцените букву О в верхнем и нижнем регистре. 
Find some kind of relationship between the basic shapes. For instance, look to the letter O in upper and lower case. Round letter O’s and taller oval O’s, in general don’t seem to like each other when creating pairs.



18.10.11

е-магазин, оплата visa/mastercard

Маленькая зарисовка, основанная на Х-топике + его кеш на всякий пожарный.
Внутри выжимка из топика и коментов.

31.07.11

Linux skype upside down/flipped webcam on Asus laptop

If running skype, the image coming out of the webcam of some of the asus laptops is upside down (flipped vertically). My camera USB information is the following:
~$ lsusb | grep Chicony
Bus 002 Device 003: ID 04f2:b106 Chicony Electronics Co., Ltd
A solution/fix is to use the libv4l library , courtesy of Hans de Goede, to call the executable. Since the available linux skype version at the moment is a 32bit executable, you will need to use the 32bit version of these libraries:
LD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so" /usr/bin/skype
or
LD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so /usr/lib32/libv4lconvert.so.0" /usr/bin/skype
On ubuntu the library can be installed by:
~$ sudo apt-get install lib32v4l-0
and on gentoo by:
~# emerge libv4l
and then as root (or sudo) do something like:
~# mv /usr/bin/skype /usr/bin/skype.real && \
echo -e '#!/bin/sh\nLD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so /usr/lib32/libv4lconvert.so.0" /usr/bin/skype.real "$@"' \
> /usr/bin/skype.wrapper && \
chmod 755 /usr/bin/skype.wrapper && \
ln -s /usr/bin/skype.wrapper /usr/bin/skype
which moves the original skype to skype.real and creates a wrapper file:
#!/bin/sh

LD_PRELOAD="/usr/lib32/libv4l/v4l1compat.so /usr/lib32/libv4lconvert.so.0" /usr/bin/skype.real "$@"

05.02.11

Check your site availability

http://just-ping.com

Hosts

Singapore, Singapore;  Amsterdam2, Netherlands;  Florida, U.S.A.;  Amsterdam3, Netherlands;  Hong Kong, China;  Sydney, Australia;  Munchen, Germany;  Cologne, Germany;  New York, U.S.A.;  Cairo, Egypt;  Amsterdam, Netherlands;  Stockholm, Sweden;  Santa Clara, U.S.A.;  Vancouver, Canada;  Krakow, Poland;  London, United Kingdom;  Madrid, Spain;  Padova, Italy;  Austin, U.S.A.;  Amsterdam, Netherlands;  Paris, France;  Melbourne, Australia;  Shanghai, China;  Copenhagen, Denmark;  Lille, France;  Zurich, Switzerland;  Mumbai, India;  Chicago, U.S.A.;  Nagano, Japan;  Haifa, Israel;  Auckland, New Zealand;  Antwerp, Belgium;  Groningen, Netherlands;  Moscow, Russia;  Dublin, Ireland;  Oslo, Norway;  Kharkov, Ukraine;  Manchester, United Kingdom;  Vilnius, Lithuania;  Ashburn, U.S.A.;  Bucharest, Romania;  Bangkok, Thailand;  Kuala Lumpur, Malaysia;  Jakarta, Indonesia;  Cape Town, South Africa;  Glasgow, United Kingdom;  Lisbon, Portugal;  Chicago, U.S.A.;  Dallas, U.S.A.;  Buenos Aires, Argentina;  Istanbul, Turkey;  Gdansk, Poland;  Beijing, China

http://just-ping.com
http://pr-cy.ru/speed_test
http://webo.in
http://Site-Perf.com/
http://tools.pingdom.com/fpt/
host-tracker.com
http://ping-admin.ru/free_test

http://pingup.ru/

http://www.pingplotter.com/

http://downforeveryoneorjustme.com/

Check  host in black lists
http://www.dnsbl.info/dnsbl-database-check.php

26.01.11

Code Conventions for the JavaScript Programming Language

copypaste
This is a set of coding conventions and rules for use in JavaScript programming. It is inspired by the Sun document Code Conventions for the Java Programming Language. It is heavily modified of course because JavaScript is not Java.
The long-term value of software to an organization is in direct proportion to the quality of the codebase. Over its lifetime, a program will be handled by many pairs of hands and eyes. If a program is able to clearly communicate its structure and characteristics, it is less likely that it will break when modified in the never-too-distant future.
Code conventions can help in reducing the brittleness of programs.
All of our JavaScript code is sent directly to the public. It should always be of publication quality.
Neatness counts.

JavaScript Files

JavaScript programs should be stored in and delivered as .js files.
JavaScript code should not be embedded in HTML files unless the code is specific to a single session. Code in HTML adds significantly to pageweight with no opportunity for mitigation by caching and compression.

08.12.10

адепты иконостороения

http://iconwerk.de/
http://dlanham.com/
http://iconfactory.com/

Просто статья об тенденциях развития иконок
http://habrahabr.ru/company/turbomilk/blog/109511/

24.10.10

morning allarm for admins

sleep 5h && cat /dev/urandom >> /dev/dsp

01.10.10

Прототипирование сайтов и интерфейсов

Задача: показать заказчику как будет выглядеть интерфейс сайта за 10-30 минут, поменять что-то и занести скриншот всего этого в ТЗ.
В источнике http://habrahabr.ru/blogs/ui_design_and_usability/70001/ вы найдете кучу платных прог, я их не тестил ибо влом искать альтернативы или форки под линух, потому выбирал или полностью онлайновые инструменты или те которые писались для открытых систем.

15.09.10

Проблемы с vga в win xp в KVM на Ubuntu

После установки Винды в KVM система все время ругается что у нее нет дров на видео.
Собственно решается это копированием дров от VMware.

исошники для 32-бит винды
для 64

дропбокс
32
64

ссылка на решение

09.09.10

Network problem after cloning system on KVM

After cloning eth0 disappear from output ifconfig.
Resolve
sudo rm /etc/udev/rules.d/70-persistent-net.rules && sudo reboot

08.09.10

Решено. Проблема с nm-applet в ubuntu

Вот намедни решил отойти погрется в постели с ноутом не отрываясь от инета, но вот незадача - пропал из области уведомлений nm-applet.
После возни с его включением-выключением подумал приконнектится через консоль, но не судьба с wpa2-personal это сделать без акробатики.

Гугл помог найти вот такое решение для востановления аплета

System - Preferences - Network Connections
редактируем свойства все существующих сетей= убираем галочку "Available to all users" и применяем настройки.
Это надо проделать у всех пользователей.
Если сетей в настройках небыло, создайте сеть, потом поставьте галочку, сохраните настройки, потом опять зайдите и снимите галочку.

После всех манипуляций перелогиньтесь.
Источник вдохновения

Это может не помочь, когда то что написано выше мне не помогло, я просто прописал свою сеть. И ОН появился )))

09.08.10

Nice Munin

munin-monitoring

sudo wget -O mysql_report http://exchange.munin-monitoring.org/plugins/mysql_report/version/3/download
sudo wget -O mongo_lock http://exchange.munin-monitoring.org/plugins/mongo_lock/version/1/download
sudo wget -O mongo_conn http://exchange.munin-monitoring.org/plugins/mongo_conn/version/1/download
sudo wget -O mongo_btree http://exchange.munin-monitoring.org/plugins/mongo_btree/version/1/download
sudo wget -O mongo_mem http://exchange.munin-monitoring.org/plugins/mongo_mem/version/1/download
sudo wget -O mongo_ops http://exchange.munin-monitoring.org/plugins/mongo_ops/version/1/download

sudo wget -O nginx_vhost_traffic http://exchange.munin-monitoring.org/plugins/nginx_vhost_traffic/version/1/download
sudo wget -O ngnix_memory http://exchange.munin-monitoring.org/plugins/ngnix_memory/version/1/download

sudo wget -O multimemory http://exchange.munin-monitoring.org/plugins/multimemory/version/1/download
sudo wget -O linux_diskstat_ http://exchange.munin-monitoring.org/plugins/linux_diskstat_/version/1/download
sudo wget -O coretemp http://exchange.munin-monitoring.org/plugins/coretemp/version/1/download
sudo wget -O linux_diskstats_ http://exchange.munin-monitoring.org/plugins/linux_diskstats_/version/1/download

sudo wget -O network-usage http://exchange.munin-monitoring.org/plugins/network-usage/version/1/download

sudo wget -O openssh-denyhosts http://exchange.munin-monitoring.org/plugins/openssh-denyhosts/version/1/download

sudo wget -O raid http://exchange.munin-monitoring.org/plugins/raid/version/3/download


sudo chmod +x mysql_report
sudo chmod +x mongo_lock
sudo chmod +x mongo_conn
sudo chmod +x mongo_btree
sudo chmod +x mongo_mem
sudo chmod +x mongo_ops

sudo chmod +x nginx_vhost_traffic
sudo chmod +x ngnix_memory

sudo chmod +x multimemory
sudo chmod +x linux_diskstat_
sudo chmod +x coretemp
sudo chmod +x linux_diskstats_

sudo chmod +x network-usage

sudo chmod +x openssh-denyhosts

sudo chmod +x raid

sudo ln -s /usr/share/munin/plugins/nginx_memory /etc/munin/plugins/nginx_memory


sudo ln -s /usr/share/munin/plugins/mysql_report /etc/munin/plugins/mysql_report
sudo ln -s /usr/share/munin/plugins/mongo_lock /etc/munin/plugins/mongo_lock
sudo ln -s /usr/share/munin/plugins/mongo_conn /etc/munin/plugins/mongo_conn
sudo ln -s /usr/share/munin/plugins/mongo_btree /etc/munin/plugins/mongo_btree
sudo ln -s /usr/share/munin/plugins/mongo_mem /etc/munin/plugins/mongo_mem
sudo ln -s /usr/share/munin/plugins/mongo_ops /etc/munin/plugins/mongo_ops

sudo ln -s /usr/share/munin/plugins/nginx_vhost_traffic /etc/munin/plugins/nginx_vhost_traffic
sudo ln -s /usr/share/munin/plugins/ngnix_memory /etc/munin/plugins/ngnix_memory

sudo ln -s /usr/share/munin/plugins/multimemory /etc/munin/plugins/multimemory
sudo ln -s /usr/share/munin/plugins/linux_diskstat_ /etc/munin/plugins/linux_diskstat_
sudo ln -s /usr/share/munin/plugins/coretemp /etc/munin/plugins/coretemp
sudo ln -s /usr/share/munin/plugins/linux_diskstats_ /etc/munin/plugins/linux_diskstats_

sudo ln -s /usr/share/munin/plugins/network-usage /etc/munin/plugins/network-usage

sudo ln -s /usr/share/munin/plugins/openssh-denyhosts /etc/munin/plugins/openssh-denyhosts

sudo ln -s /usr/share/munin/plugins/raid /etc/munin/plugins/raid

CS

A "Hello World!" Genetic Algorithm Example
Что такое генетический алгоритм?
css

nlp, marketing etc in ecommerce

http://www.youtube.com/watch?v=vMV4PIEIKY4

06.08.10

10.4 + nginx + php on socket

Scource
This procedure explains how to enable Nginx PHP services (php-cgi) in Ubuntu (>=9.10), by using a simple upstart file to start and keep up php-cgi support (runing in external FASTCGI Mode).
Tested on Ubuntu 10.4

Creating link to "web programm" like Google Tasks

Юзабилити магазина

5 галочек: чеклист юзабилити

http://habrahabr.ru/company/webprojects/blog/101061/

повествование об идеальном магазине в плане использования

Как настроить в MySQL Server после установки

Мой любимые вопросы в ходе собеседования, для работы в качестве MySQL DBA или связанных с производительностью MySQL это вопросы о настройках MySQL Server сразу после установки, полагая, он был установлен с настройками по умолчанию.

Я удивлен, как много людей не дают какого-либо разумного ответа на этот вопрос, и сколько серверов, впринципе, работают с настройками по умолчанию.

Даже если вы сможете настроить довольно много переменных в MySQL сервера, лишь немногие из них действительно важны для наиболее распространенных видов нагрузок. После того как вы правильно настроите эти параметры остальные изменения настроек дадут только легкие улучшения производительности.

03.08.10

rebuild site immediately

http://www.hius.com.ua хороший ассортимент товаров для пайки, но магазин разваливается на глазах

02.08.10

Python. Полное покрытие кода

копипаста с хабра
автор nuald



kvm на ubuntu 10.4 без головной боли

проверили есть ли поддержка виртуализации у проца
egrep-С "(VMX | SVM) '/ Proc / cpuinfo

нужен ответ 1 или больше

потом проверить включена ли виртуализация в БИОСе

устанавливаемся
sudo apt-get install kvm virt-manager && sudo adduser `id -un` libvirtd

разлогиниваемся

и проверяем что получилось
virsh -c qemu:///system list

ответ такой
Id Name State
----------------------------------

если нет необходимости показывать виртуалки миру - это последнее действие. если же нам надо показать это во внешний мир, то необходимо провести изменения в нашей сети и настройках созданных вирт машин, то меняем
/etc/network/interfaces

в зависимости от того как нам необходимо есть варианты с созданием бриджа с автоопределением IP для вирт машин или со статическим
авто
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0


статическое
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0

перезагружаем сеть

sudo /etc/init.d/networking restart

теперь лезем к каждой машине которую мы создали через virt-manager
cd /etc/libvirt/qemu
для каждого проводим замену в конфигах

было
<interface type="network">
................... 
<source network="default" />
...................
</interface>

надо
<interface type="bridge">
.........
<source bridge="br0" />
</interface>




Источники

https://help.ubuntu.com/community/KVM/Installation
https://help.ubuntu.com/community/KVM/Networking

Проблемы и решения

При клонировании системы пропадал сетевой интерефейс.
Варварское удаление /etc/udev/rules.d/70-persistent-net.rules помогло )

Проблема сетевых интерфейсов

31.07.10

nginx rewrite rules делаем их правильно

Так как мы боремся за высокую производительность на чудесном веб сервере nginx, то мы не должны забывать про то, чтобы сделать наши конфиги еще чудеснне, в особенности в этом аспекте...

25.07.10

Известные ньюансы SEO для электронных магазинов

Надоело держать кучу вкладок в фоксе о разных аспектах развития магазинов и их "раскрутки" - решил собрать все дурные советы это в статье и давать линку тем кто любит задавать вопрос, а как мне продавать в своем магазине так, чтобы не работать.
Начнемс...

08.07.10

Установка MongoDB на Ubuntu


Процесс проверен на 10.4.
В конце статьи скрипт для быстрой установки.

01.07.10

Подсветка кода на blogger.com

Отечественный вариант подсветки highlight.js

Делается так
<script src="http://softwaremaniacs.org/js/highlight.js" type="text/javascript">
</script>
<script type="text/javascript">
initHighlightingOnLoad();
</script>

Стили можно подсмотреть в архиве, если лень, то вот минимальный набор для подсветки

.comment {
color: gray;
}

.keyword {
font-weight: bold;
}

.html .atribute .value {
color: green;
}

Свой код надо вставить вот в такое

<pre><code>...</code></pre>


Гугловский вариант
ссылка на проект google-code-prettify
посмотреть как работает можно тут

В head необходимо включить следующий код

<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js">  </script>

Дописать следующее в body
...
<body onload='prettyPrint()'>
...

Ну и собственно оформить код в таком стиле

<pre class="prettyprint">
... # Your code goes here
</pre>

В ходе написания выяснилось, что парсер неверно истолковывает html-теги, и единственным найденным способом есть только преобразование в esc-последовательность данным парсером

Ну и обычные приколы, когда код не влазит по ширине (((
UPD
вселенсокое зло побеждено )
теперь усе взлазит.
перед </head> вставляем

<style>pre.prettyprint{width:494px;white-space:pre-wrap}  </style>

24.01.10

по мотивам
http://www.howtoforge.org/davfs_ubuntu
http://linux.die.net/man/8/mount.davfs

Get DAVfs working on (X)ubuntu


What is DAVfs? DAVfs is a program that can mount a WebDAV location to your filesystem. You can then access it as if it were just another partition on your hard disk. WebDAV is an extension to the http protocol to allow other file operations than just GET and POST. As WebDAV can run with https, it can be used as a secure way to access the files of your homepage or even as a remote hard disk.

I struggled way too long to get DAVfs to work on Xubuntu 7.04. My provider offers a so-called "virtual harddisk", and even after following all documentation on the net, I could not write to it. In solving the problem, I did not encounter any Xfce-dependent actions, so it probably holds for other ubuntu distros as well. Probably even for Debian.
Here's how I did it:

First, install the davfs2 package using synaptic

Next, determine which group of users is allowed to mount the WebDAV locations. By default, this is the group users. Make sure your normal linux user is a member of this group. At the command line (yes, open a terminal window), type:

sudo dpkg-reconfigure davfs2

Answer Yes if you want to be able to mount the location as an ordinary user. Next, you have to state which group is allowed to do so. As we have just decided that, fill it in here.

Now create a mount point in /etc/fstab:

sudo nano /etc/fstab

Add a line to state where you want to mount what location. If the location is https://dav.example.com/vdrive and you want to mount it to ~/mnt/vdrive, add the following line:

https://dav.example.com/vdrive /home//mnt/vdrive davfs rw,user,noauto 0 0
Repairing things that could be wrong
Missing template files

This should be enough to be able to mount the location. However, it is probably not. The first thing that can go wrong is the wrong location of the template files. Let's check it. The files davfs2.conf.template and secrets.template should exist in the directory /usr/share/doc/davfs2

If they don't, they are one directory deeper: in /usr/share/doc/davfs2/examples. The configuration file is also zipped. To correct this situation, type at the command line:

cd /usr/share/doc/davfs2/examples/
sudo cp * ..
cd ..
sudo gunzip davfs2.conf.template.gz
The above entered group is not configured

Before we continue, check if the file /etc/davfs2/davfs2.conf contains the right group:

sudo nano /etc/davfs2/davfs2.conf

The line we are looking for looks like:

dav_group users

If the wrong group name is given here, or even "$group", correct it here.
I/O Errors on writing

Now, try to mount the WebDAV location. Type:

cd
mount mnt/vdrive

After having typed your username and password of the WebDAV service, the WebDAV location should now be mounted. Try to get a directory listing and see if it works. If all works well, try to create a file (with the touch command or with nano). You may now get an I/O Error without further explanation. This can be solved by switching off file locking.

To do this, first unmount the location again:

umount ~/mnt/vdrive

Because we repaired the templates, there should be a directory .davfs2 in your home directory. It contains davfs2.conf. Edit it and change the line #use_locks 1 to use_locks 0 and save the file.

Now you should be able to mount it again and save files.



mount.davfs(8) - Linux man page
Name

mount.davfs - Mount a WebDAV resource in a directory
Synopsis

mount.davfs [-h | --help] [-V | --version]
mount {dir | webdavserver}
SYNOPSIS (root only)

mount -t davfs [-o option[,...]]webdavserver dir
mount.davfs [-o option[,...]] webdavserver dir
Description

mount.davfs allows you to mount the WebDAV resource identified by webdavserver into the local filesystem at dir. WebDAV is an extension to HTTP that allows remote, collaborative authoring of Web resources, defined in RFC 2518. mount.davfs is part of davfs2.

davfs2 allows documents on a remote Web server to be edited using standard applications. For example, a remote Web site could be updated in-place using the same development tools that initially created the site. Or you may use a WebDAV resource for documents you want to access and edited from different locations.

davfs2 supports TLS/SSL (if the neon library supports it) and proxies. mount.davfs runs as a daemon in userspace. It integrates into the virtual file system by either the coda or the fuse kernel files system. Currently CODA_KERNEL_VERSION 2, CODA_KERNEL_VERSION 3, FUSE_KERNEL_VERSION 5 and FUSE_KERNEL_VERSION 7 are supported.

mount.davfs is usually invoked by the mount(8) command when using the -t davfs option. After mounting it runs as a daemon. To unmount the umount(8) command is used.

webdavserver must be a complete url, including scheme, fully qualified domain name and path. Scheme may be http or https. If the path contains spaces or other characters, that might be interpreted by the shell, the url must be enclosed in double quotes (e.g. "http://foo.bar/name with spaces"). See URLS AND MOUNT POINTS WITH SPACES.

dir is the mountpoint where the WebDAV resource is mounted on. It may be an absolute or relative path.

fstab may be used to define mounts and mount options as usual. In place of the device the url of the WebDAV server must be given. There must not be more than one entry in fstab for every mountpoint.
Options

-V --version
Output version.
-h --help
Print a help message.
-o
A comma-separated list defines mount options to be used. Available options are:
[no]askauth
(Do not) ask interactivly for creditentials for the WebDAV server or the proxy if they are not found in the secrets file.
Default: askauth.
Deprecated: This option may be removed in future versions. Use option ask_auth in the /etc/davfs2/davfs2.conf or ~/.davfs2/davfs2.conf instead.
[no]auto
Can (not) be mounted with mount -a.
Default: auto.
conf=absolute path
An alternative user configuration file. This option is intended for cases where the default user configuration file in the users home directory can not be used.
Default: ~/.davfs2/davfs2.conf
[no]dev
(Do not) interpret character or block special devices on the file system. This option is only included for compatibility with the mount(8) program. It will allways be set to nodev
dir_mode=mode
The default mode bits for directories in the mounted file system. Value given in octal. s-bits for user and group are allways silently ignored.
Default: calculated from the umask of the mounting user; an x-bit is associated to every r-bit in u-g-o.
[no]exec
(Do not) allow execution of any binaries on the mounted file system.
Default: exec. (When mounting as an ordinary user, the mount(8) program will set the default to noexec.)
file_mode=mode
The default mode bits for files in the mounted file system. Value given in octal. s-bits for user and group are allways silently ignored.
Default: calculated from the umask of the mounting user; no x-bits are set for files.
gid=group
The group the mounted file system belongs to. It may be a numeric ID or a group name. The mounting user, if not root, must be member of this group.
Default: the primary group of the mounting user.
[no]locks
(Do not) lock files on the WebDAV server.
Default: locks.
Deprecated: This option may be removed in future versions. Use option use_locks in the /etc/davfs2/davfs2.conf or ~/.davfs2/davfs2.conf instead.
[no]_netdev
The file system needs a network connection for operation. This information allows the operating system to handle the file system properly at system start and when the network is shut down.
Default: _netdev
ro
Mount the file system read-only.
Default: rw.
rw
Mount the file system read-write.
Default: rw.
[no]suid
Do not allow set-user-identifier or set-group-identifier bits to take effect. This option is only included for compatibility with the mount program. It will allways be set to nosuid.
[no]user
(Do not) allow an ordinary user to mount the file system. The name of the mounting user is written to mtab so that he can unmount the file system again. Option user implies the options noexec, nosuid and nodev (unless overridden by subsequent options). This option makes only sense when set in fstab.
Default: ordinary users are not allowed to mount.
[no]useproxy
(Do not) use a proxy.
Default: useproxy, if a proxy is specified.
Deprecated: This option may be removed in future versions. Use option ask_proxy in the /etc/davfs2/davfs2.conf or ~/.davfs2/davfs2.conf instead.
uid=user
The owner of the mounted file system. It may be a numeric ID or a user name. Only when mounted by root, this may be different from the mounting user.
Default: ID of the mounting user.

Security Policy

mount.davfs needs root privileges for mounting. But running a daemon, that is connected to the internet, with root privileges is a security risk. So mount.davfs will change its uid and gid when entering daemon mode.

When invoked by root mount.davfs will run as user davfs2 and group davfs2.

When invoked by an ordinary user it will run with the id of this user and with group davfs2.

As the file system may be mounted over an insecure internet connection, this increases the risk that malicious content may be included in the file system. So mount.davfs is slightly more restrictive than mount(8).

Options nosuid and nodev will always be set; even root can not change this.

For ordinary users to be able to mount, they must be member of group davfs2 and there must be an entry in fstab.

When mounted by an ordinary user, the mount point must not lie within the home directory of another user.

If in fstab option uid and/or gid are given, an ordinary user can only mount, if her uid is the one given in option uid and he belongs to the group given in option gid.

WARNING: If root allows an ordinary user to mount a file system (using fstab) this includes the permission to read the associated credentials from /etc/davfs2/secrets as well as the private key of the associated client certificate and the mounting user may get access to this information. You should only do this, if you might as well give this information to the user directly.
Urls and Mount Points with Spaces

Special characters like spaces in pathnames are a mess. They are interpreted differently by different programs and protocols, and there are different rules for escaping.

In fstab spaces must be replaced by a three digit octal escape sequence. Write http://foo.bar/pathrs040withrs040spaces instead of http://foo.bar/path with spaces. It might also be necessary to replace the '#'-character by rs043. Note: In earlier versions of davfs2, HTTP-escaping was suggested. This is no longer valid.

For the davfs2.conf and the secrets files please see the escape and quotation rules described in the davfs2.conf man page.

On command line you must obey the escaping rules of the shell.

After escaping and quotation have been removed by the respective program, the url and mount point must resolve to exactly the same string, whether they are taken from fstab, davfs2.conf, secrets or the command line.
Caching

mount.davfs tries to reduce HTTP-trafic by caching and reusing data. Information about direcotries and files are held in memory, while downloaded files are cached on disk.

mount.davfs will consider cached information about directories and file attributes valid for a configurable time and look up this information on the server only after this time has expired (or there is other evidence that this information is stale). So if somebody else creates or deletes files on the server it may take some time before the local file system reflects this.

This will not affect the content of files and directory listings. Whenever a file is opened, the server is looked up for a newer version of the file. Please consult the manual davfs2.conf(5) to see how can you configure this according your needs.
Locks, Lost Update Problem and Backup Files

WebDAV introduced locks and mount.davfs uses them by default. This will in most cases prevent two people from changing the same file in parallel. But not allways:

You might have disabled locks in /etc/davfs2/davfs2.conf or ~/.davfs2/davfs2.conf.

The server might not support locks (they are not mandatory).

A bad connection might prevent mount.davfs from refreshing the lock in time.

Another WebDAV-client might use your lock (that is not too difficult and might even happen without intention).

mount.davfs will therefore allways check if the file has been changed on the the server before it uploads a new version. Unfortunately it has to do this in two separate HTTP requests, as not all servers support conditional PUT. If it finds it impossible to upload the locally changed file, it will store it in the local backup direcotry (lost+found). You should check this directory from time to time and decide what to do with this files.

Sometimes locks held by some client on the server will not be released. Maybe the client crashes or the network connection fails. When mount.davfs finds a file locked on the server, it will check whether the lock is held by mount.davfs and the current user, and if so tries to reuse and release it. But this will not allways succeed. So servers should automatically release locks after some time, when they are not refreshed by the client.

WebDAV allows to lock files that don't exist (to pretect the name when a client intends to create a new file). This locks will be displayed as files with size 0 and last modified date of 1970-01-01. If this locks are not released properly mount.davfs may not be able to access this files. You can use cadaver(1) to remove this locks.
File Owner and Permissions

davfs2 implements Unix permissions for access control. But changing owner and permissions of a file is only local. It is intended as a means for the owner of the file system, to controll whether other local users may acces this file system.

The server does not know about this. From the servers point of view there is just one user (identified by the credentials) connected. Another WebDAV-client, connected to the same server, is not affected by this local changes.

There is one exeption: The execute bit on files is stored as a property on the sever. You may think of this property as an information about the type of file rather than a permission. Whether the file is executable on the local system is still controlled by mount options and local permissions.

When the file system is unmounted, attributes of cached files (including owner and permissions) are stored in cache, as well as the attributs of the direcotries they are in. But there is no information stored about directories that do not contain cached files.
Files

/etc/davfs2/davfs2.conf
System wide configuration file.
~/.davfs2/davfs2.conf
Configuration file in the users home directory.The user configuration takes precedence over the system wide configuration. If it does not exist, mount.davfs will will create a template file.
/etc/davfs2/secrets
Holds the credentials for WebDAV servers and the proxy, as well as decryption passwords for client certificates. The file must be read-writable by root only.
~/.davfs2/secrets
Holds credentials for WebDAV servers and proxy, as well as decryption passwords for client certificates. The file must be read-writable by the owner only. Credentials are allways first looked up in the home directory of the mounting user. If not found there the system wide secrets file is consulted. If no creditentials and passwords are found they are asked from the user interactively (if not disabled). If the file does not exist, mount.davfs will will create a template file.
/etc/davfs2/certs
You may store trusted server certificates here, that can not be verified by use of the system wide CA-Certificates. This is useful when your server uses a selfmade certificate. You must configure the servercert option in /etc/davfs2/davfs2.conf or ~/.davfs2/davfs2.conf to use it. Certificates must be in PEM format.
Be sure to verify the certificate.
~/.davfs2/certs
You may store trusted server certificates here, that can not be verified by use of the system wide CA-Certificates. This is useful when your server uses a selfmade certificate. You must configure the servercert option in ~/.davfs2/davfs2.conf to use it. Certificates must be in PEM format.
Be sure to verify the certificate.
/etc/davfs2/certs/private
To store client certificates. Certificates must be in PKCS#12 format. You must configure the clientcert option in /etc/davfs2/davfs2.conf or ~/.davfs2/davfs2.conf to use it. This directory must be rwx by root only.
~/.davfs2/certs/private
To store client certificates. Certificates must be in PKCS#12 format. You must configure the clientcert option in ~/.davfs2/davfs2.conf to use it. This directory must be rwx by the owner only.
/var/run/mount.davfs
PID-files of running mount.davfs processes are stored there. This directory must belong to group davfs2 with write permissions for the group and the sticky-bit set (mode 1775). The PID-files are named after the mount point of the file system.
/var/cache/davfs2
System wide directory for cached files. Used when the file system is mounted by root. It must belong do group davfs2 and read, write and execute bits for group must be set. There is a subdirectory for every mounted file system. The names of this subdirectories are created from url, mount point and user name.
~/.davfs2/cache
Cache directory in the mounting users home directory. For every mounted WebDAV resource a subdirectory is created.

mount.davfs will try to create missing directories, but it will not touch /etc/davfs2.
Environment

http_proxy
If no proxy is defined in the configuration files the value of this environment variable is used.

Examples

Non root user (e.g. filomena):

To allow an ordinary user to mount there must be an entry in fstab

http://webdav.org/dav /media/dav davfs noauto,user 0 0

If a proxy must be used this should be configured in /etc/davfs2/davfs2.conf or /home/filomena/.davfs2/davfs2.conf

proxy proxy.mycompany.com:8080

Credentials are stored in /home/filomena/.davfs2/secrets

proxy.mycompany.com filomena "my secret"
http://webdav.org/dav webdav-username password

Now the WebDAV resource may be mounted by user filomena invoking

mount /media/dav

and unmounted by user filomena invoking

umount /media/dav

Root user only:

Mounts the resource https://asciigirl.com/webdav at mount point /mount/site, encrypting all traffic with SSL. Credentials for http://webdav.org/dav will be looked up in /etc/davfs2/secrets, if not found there the user will be asked.

mount -t davfs -o uid=otto,gid=users,mode=775 https://asciigirl.com/webdav /mount/site

Mounts the resource http://linux.org.ar/repos at /dav.

mount.davfs -o uid=otto,gid=users,mode=775 http://linux.org.ar/repos/ /dav

14.12.09

Стучимся к LiqPay

Форма запросов

<form action="https://liqpay.com/?do=clickNbuy" method="POST" />

<input type="hidden" name="operation_xml" value="PHJlcXVlc3Q+PHZlcnNpb24+MS4yPC92ZXJ=" />

<input type="hidden" name="signature" value="6aogGWpJar6EVQ6AKTktJClt8gw=" />

</form>

Запрос к liqpay

<request>

<version>1.2</version>



result_url страница на которую вернется ответ для клиента text http://
server_url страница на которую прийдет ответ от сервера texthttp://
merchant_id ид продавца varchar(12)
order_id ид списка покупок, исходит от магазина varchar(127)
not "|" symbol
amount сумма покупки float(10.2)
currency валюта покупки char(3)EUR EUR UAH RUR USD
description коментарий, приходит не только в систему, но и на мобильный клиента.
если быть совсем культурным то:
70 кирилица
160 латиница
text
default_phone телефон, предположительно мерчанта varchar(13)
/^[+]\d{12}$/
+380001234567
pay_way способ которым по умолчанию должен платить человек varchar(10) [liqpay,card] def = null


</request>



Ответ отliqpay

<response>

<version>1.2</version>


action способ ответа textresult_url, server_url
merchant_id ид продавца varchar(12)
order_idид списка покупокVarchar(127) not «|» symbol
amount сумма покупки float(10.2)
currency валюта покупки char(3)EUR EUR UAH RUR USD
description коментарий, приходит не только в систему, но и на мобильный клиента.
если быть совсем культурным то:
70 кирилица
160 латиница
text
status статус транзакции varchar(10)success
failure — покупка отклонена
wait_secure — платеж находится на проверке
codeкод ошибки, уточняющий код ответа, пока не используется.varchar(20)
transaction_id ид транзакции в системе LiqPay, тип неизвестен varchar(15)
pay_way способ которым оплатил покупатель varchar(10)[card, liqpay] NOT NULL
sender_phone телефон оплативший заказ varchar(13)
/^[+]\d{12}$/
+380001234567


</request>


для распарсивания приходящих сообщений товарищи из "системы" создали свю функцию хз зачем,хотя можно было использовать simplexml-load-string