Порядок обработки пакетов ядром FreeBSD

27 Январь 2010

pf, ipfw и ipfilter вкомпилены в ядро

ipfw -> pf -> ipfilter -> stack	 - для входящего
stack -> ipfilter -> pf -> ipfw  - для исходящего

pf загружен как модуль ядра

pf -> ipfw -> ipfilter -> stack - для входящего
stack -> ipfilter -> ipfw -> pf - для исходящего

(с) http://paix.org.ua/freebsd/fwpackets.html

vovan Работа ,

CentOS MS Fonts

25 Декабрь 2009

FreeBSD gstripe md

20 Декабрь 2009

создаем 3 файла по 10Г на разных дисках

vsc# dd if=/dev/zero of=/mnt/ar2/10g bs=1g count=10
10+0 records in
10+0 records out
10737418240 bytes transferred in 166.144035 secs (64627167 bytes/sec)
vsc# dd if=/dev/zero of=/mnt/ar3/10g bs=1g count=10
10+0 records in
10+0 records out
10737418240 bytes transferred in 167.428852 secs (64131230 bytes/sec)
vsc# dd if=/dev/zero of=/mnt/ar1/10g bs=1g count=10
10+0 records in
10+0 records out
10737418240 bytes transferred in 181.370582 secs (59201543 bytes/sec)

Создание нового диска в файле

vsc# mdconfig -a -t vnode -f /mnt/ar1/10g -u 1
vsc# mdconfig -a -t vnode -f /mnt/ar2/10g -u 2
vsc# mdconfig -a -t vnode -f /mnt/ar3/10g -u 3
vsc# ls -la /dev |grep md
crw-r-----   1 root   operator    0, 157 29 ноя 23:28 md1
crw-r-----   1 root   operator    0, 158 29 ноя 23:28 md2
crw-r-----   1 root   operator    0, 165 29 ноя 23:28 md3
crw-------   1 root   wheel       0,  83 29 ноя 23:28 mdctl

Создаем RAID0 из 3х дисков с размером блока 128к

vsc# gstripe create -v -s 131072 arrays /dev/md1 /dev/md2 /dev/md3
Done.
vsc# gstripe list
Geom name: arrays
State: UP
Status: Total=3, Online=3
Type: MANUAL
Stripesize: 131072
ID: 2521786165
Providers:
1. Name: stripe/arrays
 Mediasize: 32212254720 (30G)
 Sectorsize: 512
 Mode: r0w0e0
Consumers:
1. Name: md1
 Mediasize: 10737418240 (10G)
 Sectorsize: 512
 Mode: r0w0e0
 Number: 0
2. Name: md2
 Mediasize: 10737418240 (10G)
 Sectorsize: 512
 Mode: r0w0e0
 Number: 1
3. Name: md3
 Mediasize: 10737418240 (10G)
 Sectorsize: 512
 Mode: r0w0e0
 Number: 2

Форматим

vsc# newfs /dev/stripe/arrays
/dev/stripe/arrays: 30720.0MB (62914560 sectors) block size 16384, fragment size 2048
 using 168 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440, 2257696, 2633952, 3010208, 3386464, 3762720, 4138976, 4515232, 4891488, 5267744, 5644000, 6020256, 6396512,
 6772768, 7149024, 7525280, 7901536, 8277792, 8654048, 9030304, 9406560, 9782816, 10159072, 10535328, 10911584, 11287840, 11664096, 12040352, 12416608,
 12792864, 13169120, 13545376, 13921632, 14297888, 14674144, 15050400, 15426656, 15802912, 16179168, 16555424, 16931680, 17307936, 17684192, 18060448,
 18436704, 18812960, 19189216, 19565472, 19941728, 20317984, 20694240, 21070496, 21446752, 21823008, 22199264, 22575520, 22951776, 23328032, 23704288,
 24080544, 24456800, 24833056, 25209312, 25585568, 25961824, 26338080, 26714336, 27090592, 27466848, 27843104, 28219360, 28595616, 28971872, 29348128,
 29724384, 30100640, 30476896, 30853152, 31229408, 31605664, 31981920, 32358176, 32734432, 33110688, 33486944, 33863200, 34239456, 34615712, 34991968,
 35368224, 35744480, 36120736, 36496992, 36873248, 37249504, 37625760, 38002016, 38378272, 38754528, 39130784, 39507040, 39883296, 40259552, 40635808,
 41012064, 41388320, 41764576, 42140832, 42517088, 42893344, 43269600, 43645856, 44022112, 44398368, 44774624, 45150880, 45527136, 45903392, 46279648,
 46655904, 47032160, 47408416, 47784672, 48160928, 48537184, 48913440, 49289696, 49665952, 50042208, 50418464, 50794720, 51170976, 51547232, 51923488,
 52299744, 52676000, 53052256, 53428512, 53804768, 54181024, 54557280, 54933536, 55309792, 55686048, 56062304, 56438560, 56814816, 57191072, 57567328,
 57943584, 58319840, 58696096, 59072352, 59448608, 59824864, 60201120, 60577376, 60953632, 61329888, 61706144, 62082400, 62458656, 62834912

монтируем

vsc# mkdir /mnt/arrays
vsc# mount /dev/stripe/arrays /mnt/arrays/
vsc# df -h
Filesystem             Size    Used   Avail Capacity  Mounted on
/dev/stripe/arrays      29G    4.0K     27G     0%    /mnt/arrays

Скорость линейной записи на диск

vsc# dd if=/dev/zero of=/mnt/arrays/10g bs=1g count=10
10+0 records in
10+0 records out
10737418240 bytes transferred in 143.736474 secs (74702112 bytes/sec)

не ахти как шустро =(

(c)
http://www.freebsd.org/doc/ru/books/handbook/disks-virtual.html
http://www.freebsd.org/doc/ru/books/handbook/geom.html

vovan Работа , ,

Сервер на стероидах: FreeBSD, nginx, MySQL, PostgreSQL, PHP и многое другое

20 Декабрь 2009

quagga fullview in my AS

17 Декабрь 2009

neighbor x.x.x.x allowas-in

Accept as-path with my AS present in it

vovan Работа ,

Ограничение скорости на 2960

16 Декабрь 2009
class-map match-all vsc
 match access-group 111
 !
 !
 policy-map vsc
 class vsc
  police 10000000 200000 exceed-action drop
 !
 !
 interface FastEthernet0/24
 description VoVaN-PC
 switchport mode access
 service-policy input vsc
 !
 access-list 111 permit ip any any

жаль только на вход можно =(

vovan Работа

Панели управления хостингом

16 Декабрь 2009

read (subshell_pty…): No such file or directory (2)

12 Декабрь 2009
#mc
 read (subshell_pty...): No such file or directory (2)
 #killall -CONT csh

vovan Работа ,

Thunderbird Smart Folders

11 Декабрь 2009

Smart Folders (Advanced)

Nightly builds of Shredder, the unreleased next version of Thunderbird 3, has an additional choice in the advanced folder views called Smart Folders. It creates what looks like an Inbox account that transparently merges the contents of all the inbox folders (both POP, IMAP and local folders). It moves the inbox from each account to a child folder in the Inbox account. Any messages in an inbox show up in both the root of the Inbox account plus the child folder for that account.

Each account still displays any child folders of the inbox, only its inbox folder was «moved». However, Shredder doesn’t actually change where/how the messages are stored, its just another way to view your folders, similar to what you can do with a saved search (a type of virtual folder).

See Testing pre-release versions if you are interested in running Shredder. Beta builds are available from the Mozilla Messaging web site. Beta 3 added support for Smart Folders.

Its recommended you don’t share profiles if you want to check out Shredder. However, if you do that don’t select Smart Folders in Shredder. That will create a «Smart Folders» account in Thunderbird 2 the next time you run it. Unfortunately its not harmless, it occasionally displays duplicate messages or message fragments that don’t exist in various accounts folders. They go away if you rebuild the index. You can’t remove the Smart Folders account using Tools -> Account Settings. You need to either edit prefs.js with a text editor or use the Config editor to delete the account from mail.accountmanager.accounts.

Читать далее…

vovan Работа

qmailanalog

3 Декабрь 2009


To list general details:

  1. awk '{$1="";$2="";$3="";$4="";$5="";print}' /var/log/maillog | cat |
  2. /usr/local/qmailanalog/bin/matchup | /usr/local/qmailanalog/bin/zoverall

To list the details of all the users ont he system:

  1. awk '{$1="";$2="";$3="";$4="";$5="";print}' /var/log/maillog | cat |
  2. /usr/local/qmailanalog/bin/matchup | /usr/local/qmailanalog/bin/zrecipients

To list all the people who have sent emails to our customers:

  1. awk '{$1="";$2="";$3="";$4="";$5="";print}' /var/log/maillog | cat |
  2. /usr/local/qmailanalog/bin/matchup | /usr/local/qmailanalog/bin/zsenders

vovan Работа , ,