А. Троицкий, 1935
Белые начинают (это очевидно!) и делают ничью (а вот это не очень очевидно :-)).
Дерзайте!

- apache2 2.2.9-10 Apache HTTP Server metapackage
- mysql-server 5.0.51a-15 MySQL database server (metapackage depending on the latest version)
- mysql-client 5.0.51a-15 MySQL database client (metapackage depending on the latest version)
- php5-mysql 5.2.6-5 MySQL module for php5
- libapache2-mod-php5 5.2.6-5 server-side, HTML-embedded scripting language (Apache 2 module)
chown -R www-data:www-data /issue-tracker-4.0.4
mv config.php-default config.php
$db = array(
"type" => "mysql",
"host" => "localhost",
"port" => "3306",
"name" => "issue-tracker",
"user" => "issue",
"pass" => "password"
);
./includes/functions/time.func.php
./includes/functions/errors.func.php
./includes/functions/file.func.php
./includes/functions/render.func.php
./includes/functions/debug.func.php
./modules/issues/hooks/funcs.php
./modules/issues/email.issues.php
apt-get install ssh
apt-get install openssh-client
mkdir ~/.ssh
chmod 700 ~/.ssh
cd ~/.ssh
ssh-keygen -t rsa -C "A comment... usually an email is enough here..."
scp -p id_rsa.pub remoteuser@remotehost:
ssh remoteuser@remotehost
mkdir ~/.ssh
chmod 700 ~/.ssh
cat id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
mv id_rsa.pub ~/.ssh
logout
rm id_rsa.pub
ssh remoteuser@remotehost
cd /etc/ssh
cp sshd_config sshd_config.orig
nano sshd_config
PermitRootLogin yes
PasswordAuthentication yes
UsePAM yes
PermitRootLogin no
PasswordAuthentication no
UsePAM no
/etc/init.d/ssh restart
sudo apt-get install debmirror
debmirror --nosource -m --passive --host=archive.ubuntulinux.org --root=ubuntu/ --method=ftp --progress --dist=dapper --section=main,multiverse,universe --arch=i386 ubuntu/ --ignore-release-gpg
sudo apt-get install debpartial
mkdir ubuntu-dvd
debpartial --nosource --dirprefix=ubuntu --section=main,universe,multiverse --dist=dapper --size=DVD ubuntu/ ubuntu-dvd/
sudo apt-get install ruby
ruby debcopy ubuntu/ ubuntu-dvd/ubuntu0
ruby debcopy ubuntu/ ubuntu-dvd/ubuntu1
ruby debcopy ubuntu/ ubuntu-dvd/ubuntu2
mkisofs -f -J -r -o ubuntu-dvd-0.iso ubuntu-dvd/ubuntu0
mkisofs -f -J -r -o ubuntu-dvd-1.iso ubuntu-dvd/ubuntu1
mkisofs -f -J -r -o ubuntu-dvd-2.iso ubuntu-dvd/ubuntu2
sudo apt-cdrom add
sudo apt-get update
sudo apt-get upgrade
gedit /your_path_to/debcopy
#!/usr/bin/ruby
#
# debcopy - Debian Packages/Sources partial copy tool
#
# Usage: debcopy [-l]
#
# where is a top directory of a debian archive,
# and is a top directory of a new debian partial archive.
#
# debcopy searches all Packages.gz and Sources.gz under /dists
# and copies all files listed in the Packages.gz and Sources.gz
# files into from . -l creates symbolic links
# instead of copying files.
#
# Copyright (C) 2002 Masato Taruishi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
# if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
require 'getoptlong'
require 'zlib'
require 'ftools'
$link = false
def usage
$stderr.puts "Usage: #{__FILE__} [-l] "
exit 1
end
def each (file, &block)
fin = Zlib::GzipReader.open(file)
fin.each do |line|
yield line
end
fin.close
end
def each_file (file, &block)
each(file) do |line|
if /Filename: (.*)/ =~ line
yield $1
end
end
end
def each_sourcefile (file, &block)
dir = nil
each(file) do |line|
case line
when /^Directory: (.*)$/
dir = $1
when /^ \S+ \d+ (\S+)$/
yield dir + "/" + $1
end
end
end
def calc_relpath (source, dest)
pwd = Dir::pwd
Dir::chdir source
source = Dir::pwd
Dir::chdir pwd
Dir::chdir dest
dest = Dir::pwd
Dir::chdir pwd
src_ary = source.split("/")
src_ary.shift
dest_ary = dest.split("/")
dest_ary.shift
return dest if src_ary[0] != dest_ary[0]
src_ary.clone.each_index do |i|
break if src_ary[0] != dest_ary[0]
src_ary.shift
dest_ary.shift
end
src_ary.size.times do |i|
dest_ary.unshift("..")
end
dest_ary.join("/")
end
def do_copy(path)
if $link
pwd=calc_relpath(File.dirname($dest_dir + "/" + path), $source_dir)
File.symlink(pwd + "/" + path, $dest_dir + "/" + path)
else
File.copy($source_dir + "/" + path, $dest_dir + "/" + path)
end
end
def copy(path)
s=$source_dir + "/" + path
d=$dest_dir + "/" + path
if FileTest.exist?(d)
$stats["ignore"] += 1
return
end
if FileTest.exist?(s)
File.mkpath(File.dirname(d))
do_copy(path)
$stats["copy"] += 1
else
$stats["notfound"] += 1
$stderr.puts s + " not found."
end
end
opts = GetoptLong.new(["--symlink", "-l", GetoptLong::NO_ARGUMENT],
["--help", "-h", GetoptLong::NO_ARGUMENT])
opts.each do |opt,arg|
case opt
when "--symlink"
$link = true
when "--help"
usage
end
end
usage if ARGV.size != 2
$source_dir = ARGV.shift
$dest_dir = ARGV.shift
if $link
$source_dir = Dir::pwd + "/" + $source_dir unless $source_dir =~ /\A\//
$dest_dir = Dir::pwd + "/" + $dest_dir unless $dest_dir =~ /\A\//
end
$stats = {}
$stats["ignore"] = 0
$stats["copy"] = 0
$stats["notfound"] = 0
open("|find #{$dest_dir}/dists -name Packages.gz") do |o|
o.each_line do |file|
file.chomp!
print "Processing #{file}... "
$stdout.flush
each_file(file) do |path|
copy(path)
end
puts "done"
end
end
open("|find #{$dest_dir}/dists -name Sources.gz") do |o|
o.each_line do |file|
file.chomp!
print "Processing #{file}... "
$stdout.flush
each_sourcefile(file.chomp) do |path|
copy(path)
end
puts "done"
end
end
puts "Number of Copied Files: " + $stats["copy"].to_s
puts "Number of Ignored Files: " + $stats["ignore"].to_s
puts "Number of Non-existence File: " + $stats["notfound"].to_s
auth_param basic program /usr/libexec/squid/ncsa_auth \ /etc/squid/squid.passwd
acl password proxy_auth REQUIRED
http_access allow password
src department1 {
user maria josef susanna micheal george1
}
src department1 {
userlist dep1users
}
user1
user2
user3
user4
user5
acl {
department1 {
pass !porn !hacking !warez all
redirect http://localhost/cgi/blocked?clientaddr=%a&clientuser=%i&clientgroup=%s&url=%u
}
default {
pass white none
redirect http://localhost/cgi/blocked?clientaddr=%a&clientuser=%i&clientgroup=%s&url=%u
}
}
ldapbinddn cn=root, dc=example, dc=com
ldapbindpass myultrasecretpassword
# ldap cache time in seconds
ldapcachetime 300
src my_users {
ldapusersearch ldap://ldap.example.com/cn=squidguardusers,ou=groups,dc=example,dc=com?memberUid?sub?(&(objectclass=posixGroup)(memberUid=%s))
}
dest porn {
domainlist porn/domains
urllist porn/urls
expressionlist porn/expressions
}
. - Совпадает с каким-либо одиночным символом (используйте "\." для соответствия "."
[abc] - Совпадает с одним из символов ("[abc]" совпадает с одиночным символом "a" или "b" или "с")
[c-g] - Совпадает с одним из символов в диапазоне ("[c-g]" совпадает с одиночным символом "c" или "d" или "e" или "f" или "g"
"[a-z0-9]" совпадает с любой одиночной буквой или цифрой.
"[-/.:?]" совпадает с любым одиночным "-" или "/" или "." или ":" или "?").
? - Ни одного или один из предшествующего символов ("words?" совпадет с "word" или "words".
"[abc]?" совпадает с одиночным "a" или "b" или "c" или ничего (т.е. "").
* - Ни одного или более из предшествующего ("words*" совпадет с "word","words" и "wordsssssss".
".*" совпадет со всем, что угодно, включая пустую строку).
+ - Один или более символов из предыдущих ("xxx+" совпадет с последовательностью из трех и более символов "x").
(expr1|expr2) - Одно из выражений, которые, в свою очередь, может содержать в себе похожие конструкции ("(foo|bar)" совпадет с "foo" или "bar".
"(foo|bar)? совпадет с "foo" или "bar" или ни с чем (т.е. "").
$ - Конец строки ("(foo|bar)$" совпадет с "foo" или "bar", находящимися только в конце строки).
\x - Игнорировать специальное значение x, когда x - один из специальных символов регулярных выражений ".?*+()^$[]{}\" ("\." совпадет с одиночным ".", "\\" - с одиночным "\" и т.д.)
(^|[-\?+=/_])(bondage|boobs?|busty?|hardcore|porno?|sex|xxx+)([-\?+=/_]|$)
squid -k reconfigure
chmod 640 /wherever/filter/db/dest/adult/*
chown cache_effective_user /wherever/filter/db/dest/adult/*
chgrp cache_effective_group /wherever/filter/db/dest/adult/*
acl {
default {
pass !in-addr all
redirect http://localhost/block.html
}
}
time afterwork {
weekly * 17:00-24:00 # After work
weekly fridays 16:00-17:00 # On friday we close earlier
date *.01.01 # New Year's Day
date *.12.24 12:00-24:00 # Christmas Eve
date 2006.04.14-2006.04.17 # Easter 2006
date 2006.05.01 # Maifeiertag
}
acl {
all within afterwork {
pass all
}
else {
pass !adv !porn !warez all
}
default {
pass none
redirect http://localhost/block.html
}
}
src admins {
ip 192.168.2.0-192.168.2.255
ip 172.16.12.0/255.255.255.0
ip 10.5.3.1/28
}
src admins {
iplist adminlist
}
192.168.2.0-192.168.2.255
172.16.12.0/255.255.255.0
10.5.3.1/28
dest porn {
domainlist porn/domains
urllist porn/urls
log pornaccesses
}
-v -- Установка этого параметра выведет на экран номер версии.
-d -- Установка этого параметра направляет все ошибки в стандартный поток ошибок (обычно терминал, в котором вы запустили squidGuard). Это чрезвычайно полезно, либокогда идет тестируется новая установка либо для целей диагностики проблем.
-с файл -- Этот параметр разрешает вам определить другой конфигурационный файл. Используйте его, когда тестируете новые конфигурации до установки их в качестве основных.
-t время -- Этот параметр разрешает вам установить формат времени запуска в виде yyyy-mm-ddTHH:MM:SS. Это особенно интересно, если вы тестируете acl, основанные на времени.
-u файл -- Обновление файлов всех доменов и url может потребовать значительного времени. Намного быстрее работать с .diff-файлами и просто включить изменения в db-файлы. Используя этот параметр, squidGuard посмотрит в каталогах категорий для .diff-файлов и, таким образом, подготовит изменения. Изменения вступят в силу в случае, когда squid перечитает свой конфигурационный файл (squid -k reconfigure).
-С файл|all -- Используя -C all, будет созданы db-файлы для всех сконфигурированных категорий заново. Если вы хотите обновить только определенный файл, вы можете ввести прямо его имя, например -C porn/domains.
#
# CONFIG FILE FOR SQUIDGUARD
#
dbhome /usr/local/squidGuard/db
logdir /usr/local/squidGuard/logs
dest porn {
domainlist porn/domains
urllist porn/urls
}
acl {
default {
pass !porn all
redirect http://localhost/block.html
}
}
dest adv {
domainlist adv/domains
urllist adv/urls
}
dest porn {
domainlist porn/domains
urllist porn/urls
}
dest warez {
domainlist warez/domains
urllist warez/urls
}
Теперь ваш acl должен выглядеть так:
acl {
default {
pass !adv !porn !warez all
redirect http://localhost/block.html
}
}
dest white {
domainlist white/domains
urllist white/urls
}
acl {
default {
pass white !adv !porn !warez all
redirect http://localhost/block.html
}
}
squidGuard -C all
chown -Rsquiduser /usr/local/squidGuard/db/*
2006-01-29 12:16:14 [31977] squidGuard 1.2.0p2 started (1138533256.959)
2006-01-29 12:16:14 [31977] db update done
2006-01-29 12:16:14 [31977] squidGuard stopped (1138533374.571)
acl {
default {
pass !porn all
redirect http://www.foo.bar/blocked.html
}
}
acl {
group1 within workhours {
pass !tracker !adv !spyware !hacking !porn all
redirect http://www.foo.bar/allblocked.html
}
default {
pass !porn all
redirect http://www.foo.bar/defaultblocked.html
}
}
%а — переменная, которая содержит IP-адрес клиента
%i - переменная, которая содержит идентификатор пользователя (UID) (см. RFC 931 или LDAP) или «unknown», если UID не доступен.
%n - переменная, которая содержит доменное имя клиента или «unknown», если оно не доступно
%p - переменная, которая содержит REQUEST_URI, т.е. путь и, опционально, запрос переменной %u, но помните, что для удобства без промежуточных «/»
%s - переменная, которая содержит соответствующую исходную группу (source group) или «unknown», если нет соответствующих групп.
%t - переменная, которая содержит соответствующую группу назначения(target group) или «unknown», если нет соответствующих групп.
%u - переменная, которая содержит запрошенный URL.
redirect
http://www.foo.bar/blocked.cgi?caddr=%a&cname=%n&user=
%i&group=%s&url=%u&target=%t