вторник, 28 июля 2009 г.

Установка svn на Windows и конфигурирование для доступа через windows аутентификацию

Доп. литература: http://blog.pengoworks.com/index.cfm/2007/11/1/Configuring-Windows-Authentication-with-Apache-22x-and-Subversion

*
*
Установить
apache_2.2.11-win32-x86-openssl-0.9.8i.msi
настройки берем по умолчанию.

*
*
Установить в c:\InstalledApps\subversion\ (игнорируем точто в пути инсталяции по умолчанию прописано x86)
Setup-Subversion-1.6.2.msi


В c:\InstalledApps\subversion\bin\svn-book.chm лежит документация по настройке.

*
*
Остановим httpd
Скопируем c:\InstalledApps\subversion\bin\*.so в "c:\Program Files\Apache Software Foundation\Apache2.2\modules\"
Скопируем c:\InstalledApps\subversion\bin\*.dll в "c:\Program Files\Apache Software Foundation\Apache2.2\bin\" с заменой всех.


В "c:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf"
в конец секции загрузки модулей добавим

LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so

проверим что модули загрузились: запустим httpd - должен стартануть успешно.

*
*
Создадим директорию d:\svn\ и в ней репозиторий yenisei
svnadmin create --fs-type fsfs d:\svn\yenisei


*
*
Пропишем репозиторий в httpd.conf ("c:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf")
добавим в самом низу

DAV svn
SVNParentPath d:\svn



*
*
презапустим httpd, зайдем по адресу http://localhost/svn/yenisei/
должны видеть:
yenisei - Revision 0: /


* теперь нужно сделать чтобы репозиторий был доступен только по windows аутентификацией
*
делаем руководствуясь TortoiseSVN: 3.1.9. Securing the server with SSL:
В httpd.conf РАСКоментировать строки:
#LoadModule ssl_module modules/mod_ssl.so
#Include conf/extra/httpd-ssl.conf

Зайдем в "c:\Program Files\Apache Software Foundation\Apache2.2\" и создадим SSL сертификат, для сервера с именем melissa.
выполним:
bin\openssl req -config conf\openssl.cnf -new -out conf\melissa.csr
PEM prase, я указал свой доменный пароль

выполняем по порядку, по ходу дела отвечая на вопросы
bin\openssl rsa -in privkey.pem -out conf\server.key
bin\openssl req -new -key conf\server.key -out conf\server.csr -config conf\openssl.cnf
bin\openssl x509 -in conf\server.csr -out conf\server.crt -req -signkey conf\server.key -days 4000
bin\openssl x509 -in conf\server.crt -out conf\server.der.crt -outform DER

*
*
Перезапускаем httpd, Попробуем зайти на: https://localhost/svn/yenisei/
должны получить "yenisei - Revision 0: /" по протокулу https

Если сервер не стартует (на WinXP стартовал, на Win2000 нет): смотрим в журнал событий, там ошибка вида:
The Apache service named reported the following error:
>>> Syntax error on line 62 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/extra/httpd-ssl.conf
идем в этот файл и комментарим 62 строку, после чего сервер запускается.


*
* Оставим доступ только по ssl и добавим возможность windows аутентификации
*
Скачаем (http://sourceforge.net/projects/mod-auth-sspi) или возмем в инсталлах (\\heracle\Install\ASU\SoftwareDev\Web server and environment\SetupSVN\mod_auth_sspi-1.0.4)
Копируем mod_auth_sspi.so добавляем
LoadModule sspi_auth_module modules/mod_auth_sspi.so
ДО !!! LoadModule dav_module modules/mod_dav.so
т.е. получается:
LoadModule sspi_auth_module modules/mod_auth_sspi.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so

*
*
Изменяем в httpd.conf


DAV svn
SVNListParentPath on
SVNParentPath d:\svn

AuthName "Subversion Authentication"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
# set the domain to authorize against
SSPIDomain Домен
SSPIOmitDomain On # keep domain name in userid string
SSPIOfferBasic On # let non-IE clients authenticate
SSPIBasicPreferred Off # should basic authentication have higher priority
SSPIUsernameCase lower

# require the SVN Users group
Require group "Домен\группа"

среда, 22 июля 2009 г.

Установка МФУ Canon i-SENSYS MF4018 на Ubuntu

=== Update 2010, 14 августа
В Ubuntu 10.04 LTS - Lucid Lyn драйвера из deb пакетов перестали ставиться из-за переименования в системе libcupsys2 в libcups2.
Поэтому делаем финт как описано в http://forum.lafox.net/index.php?showtopic=21464,
Конвертируем из rpm и устанавливаем deb:

В скачанном архиве с дровами
cd RPM
sudo apt-get install alien
sudo alien *.rpm
sudo dpkg -i cndrvcups-common_1.90-2_i386.deb
sudo dpkg -i cndrvcups-ufr2-uk_1.90-2_i386.deb


===
Ставим драйвер "UFRII/UFRII LT Printer Driver for Linux"
Как заявлено на сайте Canon для i-SENSYS MF4018 и для i-SENSYS MF4020 нужно ставить его, поэтому для i-SENSYS MF4018 ставим его же.

Скачаем его с сайта Canon.
Заходим на http://software.canon-europe.com/
там в "Multifunctionals" выбираем нашу модель, затем выбираем OS, и язык (русского языку нет, довольствуемся английским).

На момент написания была версия
Version 1.90
Released on 12-10-2009
доступная по ссылке:
http://software.canon-europe.com/software/0035665.asp

$ tar -xf Canon_UFRII_Linux_V1.90_EN.tar.gz
$ cd Canon_UFRII_Linux_V1.90_EN/64-bit_Driver/RPM
$ sudo apt-get install -y alien

$ sudo alien -k cndrvcups-common-1.90-1.x86_64.rpm
$ sudo dpkg -i cndrvcups-common_1.90-1_amd64.deb

$ sudo alien -k cndrvcups-ufr2-uk-1.90-1.x86_64.rpm
$ sudo dpkg -i cndrvcups-ufr2-uk_1.90-1_amd64.deb

После этого подключить принтер. Проверить, распечатав страницу из gedit.

P.S.
Если принтер подключался до установки драйверов, то могут быть траблы.
Лечит как описано здесь: http://ubuntuforums.org/showthread.php?p=7654198

=== +++thanks+++ Onopoc
8. On Ubuntu panel/menu. Click on SYSTEM > ADMINISTRATION > PRINTING
On the left side under LOCAL PRINTERS delete any already existing Canon printer.

9. Click on NEW PRINTER button.

10. Select CANON MF4200 SERIES USB #1

11. Click on FORWARD button

12. Select radio button PROVIDE PDD FILE

13. Click on (NONE) drop down menu.

14. A new window will open.
In the left side column click on FILE SYSTEM
In the right side column navigate to USR > SHARE > CUPS > MODEL > Scroll down and select 'CNCUPSMF4200ZK.ppd'

15. Click on OPEN button

16. Click on FORWARD button

17. Leave the PRINTER NAME as is.
Type in a DESCRIPTION. Such as 'Canon ImageCLASS MF4270 Multifunction'.
Leave the LOCATION as is.

18. Click on APPLY button.

19. Make sure the printer is connected via a USB cable.
Make sure the printer is power up.
Under the SETTINGS tab click on PRINT TEST page.

20.
That's it. You're done. Enjoy

вторник, 19 мая 2009 г.

Setup developer toolbox on Linux

####
# Komodo IDE
####

# in /tmp
tar -xvzf Komodo-IDE-5.1.3-28369-linux-libcpp6-x86.tar.gz
cd Komodo-IDE-5.1.3-28369-linux-libcpp6-x86
./install.sh -I /usr/local/Komodo-IDE-5

четверг, 14 мая 2009 г.

Ubuntu on external usb hdd

http://ubuntufriends.wordpress.com/2007/03/05/install-ubuntu-on-external-usb-hard-disk/

понедельник, 11 мая 2009 г.

Adm tasks on CentOS

To create a user account from a shell prompt:
1. Open a shell prompt.
2. If you are not logged in as root, type the command su - and enter the root password.
3. Type useradd followed by a space and the username for the new account you are creating at the command line (for example, useradd jsmith). Press [Enter]. Often, usernames are variations on the user's name, such as jsmith for John Smith. User account names can be anything from the user's name, initials, or birthplace to something more creative.
4. Type passwd followed by a space and the username again (for example, passwd jsmith).
5. At the New password: prompt enter a password for the new user and press [Enter].
6. At the Retype new password: prompt, enter the same password to confirm your selection.

###
## Apache
###
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch20_:_The_Apache_Web_Server
seLinux, new VirtualHost


###
# New user and web sites
# % - under root
# $ - under newuser
###

% useradd newuser
% passwd newuser
% mkdir /var/www/newuser
% chown newuser /var/www/newuser

$ cd /var/www/newuser
$ mkdir site1
$ echo "test content" > site1/index.html

in httpd conf

DocumentRoot /var/www/newuser/site1

If "access denied" check: The directories (all of them) must be rwxr-xr-x (readable and executable by everyone), this apply to all the subdirectories and the parent directories in the path, the files have to be rw-r--r--

воскресенье, 10 мая 2009 г.

Setup all needed for server CentOS

# setup-base-centos.sh

yum -y install gcc
yum -y install python-setuptools

yum -y install mc
yum -y install subversion

yum -y install python-devel # needed for:sqlite, PIL

yum -y install postgresql postgresql-server
# for ilike lower etc. on russian (see: http://habrahabr.ru/blogs/postgresql/55620/)
su postgres
initdb --locale=ru_RU.utf8 /var/lib/pgsql/data

# можем проверить командой
#psql -c "show lc_ctype"
# должно быть ru_RU.utf8

# on autostart
# http://www.cyberciti.biz/faq/howto-fedora-linux-install-postgresql-server/
chkconfig postgresql on
# start
service postgresql start


# create user for postgre
# su - postgres
# createuser -P -s -e username;
# Modify /var/lib/pgsql/data/pg_hba.conf to require password authentication for local connections:
# (for firstvds.ru hosting is /var/lib/pgsql/data/pg_hba.conf)
# Comment or remove any existing lines at the end of the file, then append this:
# local all all password
# restart service:
service postgresql restart
# create database:
createdb --encoding=UTF-8 --username=user_name --password db_name


# sqlite
yum -y install sqlite-devel
easy_install pysqlite

# setup PIL
easy_install --find-links http://www.pythonware.com/products/pil/ Imaging # if not work "from PIL import *" rename dir to "PIL"

# alt setup PIL
yum -y install python-imaging

# setup EPIL (http://fedoraproject.org/wiki/EPEL) for psycopg2
# fine howto: http://damntechnology.blogspot.com/2008/01/django-with-postgresql-on-centosrhel-5.html
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm

yum -y install postgresql-python python-psycopg2 # for use psycopg2 specify in config: postgresql_psycopg2

###
# setup django and related
###
svn co http://code.djangoproject.com/svn/django/trunk /usr/local/src/apps/django-trunk
cd /usr/local/src/apps/django-trunk
python setup.py intall
# as variant use:
# ln -s /usr/local/src/apps/django-trunk/django /usr/lib/python2.4/site-packages/django
# but this - problem with SELinux context ("ImportError: No module named django" under apache)
# See also about apache and SELinux:
# http://www.nabble.com/%22ImportError:-No-module-named-django%22-persists...-td14857086.html
# http://www.packtpub.com/article/selinux-secured-web-hosting-python-based-web-applications


svn co http://django-evolution.googlecode.com/svn/trunk/ /usr/local/src/apps/django-evolution
ln -s /usr/local/src/apps/django-evolution/django_evolution /usr/lib/python2.4/site-packages/django_evolution

easy_install django-dbtemplates

svn co http://django-filebrowser.googlecode.com/svn/trunk/filebrowser/ /usr/local/src/apps/filebrowser
ln -s /usr/local/src/apps/filebrowser /usr/lib/python2.4/site-packages/filebrowser


###
# check out project from flash
###
svn co file:///media/disk/Projects/svn/django_root/trunk /home/web-root
ln -s /home/web-root/shared/showcase /usr/lib/python2.4/site-packages/showcase
ln -s /home/web-root/shared/snippets /usr/lib/python2.4/site-packages/snippets #todo: remove snippets

###
# Set SELinux context for you django/python project directory
# if you plan create your projects in /home/sites
###
chcon -R -t httpd_user_content_t /home/sites
chcon -R -t httpd_user_content_t /home/apps


# hints
# show releases: rpm -q centos-release (rpm -q python)
# erase (uninstall) package: rpm -e package-name (rpm -e python-2.4.3-21.el5)

вторник, 28 апреля 2009 г.

Занятие 28 апреля

"Раскрытие на лево", партнер за обе руки "тянет" партнершу к своей правой ноге, и разворачивает ее на одной ноге боком к себе (ноги у него вместе). Затем проводит партнершу на два шага в лево, заворачивает ее левой рукой и отталкивает

"Обратный батман" из раскрытия, и из обратной смены