FastNetMon

Tuesday 31 May 2011

Активация write-cache на Adaptec 5405

Имеем изнчачально:
arcconf getconfig 1 ld
Controllers found: 1
----------------------------------------------------------------------
Logical device information
----------------------------------------------------------------------
Logical device number 0
Logical device name : Device 0
RAID level : 10
Status of logical device : Optimal
Size : 571382 MB
Stripe-unit size : 256 KB
Read-cache mode : Enabled
MaxIQ preferred cache setting : Disabled
MaxIQ cache setting : Disabled
Write-cache mode : Disabled (write-through)
Write-cache setting : Enabled (write-back) when protected by battery/ZMM
Partitioned : Yes
Protected by Hot-Spare : No
Bootable : Yes
Failed stripes : No
Power settings : Disabled
--------------------------------------------------------
Logical device segment information
--------------------------------------------------------
Group 0, Segment 0 : Present (0,0) 3SJ262RY00009107YURG
Group 0, Segment 1 : Present (0,1) 3SJ23Z2800009107YUZ7
Group 1, Segment 0 : Present (0,2) 3SJ262YX00009107XUQ6
Group 1, Segment 1 : Present (0,3) 3SJ261VB00009107XUQP

arcconf SETCACHE 1 LOGICALDRIVE 0 wb
Controllers found: 1
WARNING: Power failure without battery/ZMM support will lead to data loss.
Do you wish to continue?
Press y, then ENTER to continue or press ENTER to abort: y

Command completed successfully.

В результате включается кэш:
arcconf getconfig 1 ld
Controllers found: 1
----------------------------------------------------------------------
Logical device information
----------------------------------------------------------------------
Logical device number 0
Logical device name : Device 0
RAID level : 10
Status of logical device : Optimal
Size : 571382 MB
Stripe-unit size : 256 KB
Read-cache mode : Enabled
MaxIQ preferred cache setting : Disabled
MaxIQ cache setting : Disabled
Write-cache mode : Enabled (write-back)
Write-cache setting : Enabled (write-back)
Partitioned : Yes
Protected by Hot-Spare : No
Bootable : Yes
Failed stripes : No
Power settings : Disabled
--------------------------------------------------------
Logical device segment information
--------------------------------------------------------
Group 0, Segment 0 : Present (0,0) 3SJ262RY00009107YURG
Group 0, Segment 1 : Present (0,1) 3SJ23Z2800009107YUZ7
Group 1, Segment 0 : Present (0,2) 3SJ262YX00009107XUQ6
Group 1, Segment 1 : Present (0,3) 3SJ261VB00009107XUQP



Command completed successfully.

Обращаю внимание, что без наличия UPS кэш записи включать нельзя!

Что означает worker process 4664 exited on signal 9?

Вот такая запись означает:
2011/05/31 10:54:38 [alert] 4089#0: worker process 4664 exited on signal 9

Что кто-то убил рабочий процесс Nginx по kill -9:
Posted by Igor Sysoev (Guest) on 2008-07-08 14:10
On Tue, Jul 08, 2008 at 02:55:08PM +0300, Athan Dimoy wrote:

> Just a question according the new build. What this error really means
> "worker process 94184 exited on signal 9"?

This means that someone kills -9 worker process.

Включить отображение столбца WCHAN в top

Запускаем top:
top

Выполняем комбинацию:
f -> y -> Esc.

После этого появится столбце WCHAN, но скорее всего, он будет пустой. Как с этми бороться, я пока не знаю.

Анализ числовых данных в Linux посредством num-utils

Довольно часто у меня рождались вот такие скрипты (ниже приведен пример скрипта для подсчета среднего арифметического) для анализа каких-либо чиловых данных:
cat file | perl -e 'for(<>){$a+=$_; $b++}; print $a/$b'

И таких скриптов было множество, найти среднее, найти наибольшее, найти наименьшее среди строк поданных на стандартный ввод - крайне типовая задача.

Разумеется, можно ее решить в лоб, например, найти наибольшее число в массиве можно следующим образом:
sort -g | tail -1
Наименьшее
sort -g | head -1
А вот со средним и суммой - сложности, тут в любом случае придется писать скрипт на каком-либо языке программирования. Либо... воспользоваться num-utils, которая предоставляет ряд чудесных утилит.

Устанавливаем:
apt-get install -y num-utils
Как результат мы получим целый комплкект отменных утилит для работы с числами:
dpkg -L num-utils | grep '/usr/bin/'
/usr/bin/numaverage
/usr/bin/numbound
/usr/bin/numinterval
/usr/bin/numnormalize
/usr/bin/numgrep
/usr/bin/numprocess
/usr/bin/numsum
/usr/bin/numrandom
/usr/bin/numrange
/usr/bin/numround

Сумма:
cat | numsum
1
2
3
6

12

Среднее арифметическое:
cat | numaverage
1
2
3

2

Наибольшее значение:
cat | numbound
1
4
6
1
444
5

444

Наименьшее значение:
4
1
0
1
3
444

0


Я привел лишь часть примеров, на самом деле, утилит больше, изучайте! :)

Monday 30 May 2011

Debian, MySQL 5.1 Perocna и работа с СУБД по tcp/ip сети: увеличивается Aborted_Connects

Имеем вот такой тестовый скрипт, запущенный на машине, которая подключается к удаленному MySQL серверу mysqlremoteserver.ru по сети:
for i in `seq 1 1000`; do echo -n "try $i"; mysqladmin ping -h mysqlremoteserver.ru -uv1 -pqwerty; if [ $? -ne 0 ]; then echo "not ok" ; fi ; done | grep -v 'alive'

И при запуске имеем следующие ошибки:
mysqladmin: connect to server at 'hostingmysqlserver' failed
error: 'Can't connect to MySQL server on 'hostingmysqlserver' (4)'
Check that mysqld is running on hostingmysqlserver and that the port is 3306.
You can check this by doing 'telnet hostingmysqlserver 3306'
try 12not ok
mysqladmin: connect to server at 'hostingmysqlserver' failed
error: 'Can't connect to MySQL server on 'hostingmysqlserver' (4)'
Check that mysqld is running on hostingmysqlserver and that the port is 3306.
You can check this by doing 'telnet hostingmysqlserver 3306'
try 199not ok
mysqladmin: connect to server at 'hostingmysqlserver' failed
error: 'Can't connect to MySQL server on 'hostingmysqlserver' (4)'
Check that mysqld is running on hostingmysqlserver and that the port is 3306.
You can check this by doing 'telnet hostingmysqlserver 3306'
try 201not ok
^Cmysqladmin: connect to server at 'hostingmysqlserver' failed
error: 'Can't connect to MySQL server on 'hostingmysqlserver' (4)'
Check that mysqld is running on hostingmysqlserver and that the port is 3306.
You can check this by doing 'telnet hostingmysqlserver 3306'


При этом увеличивается счетчик Aborted_connects:
show global status like 'Aborted%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| Aborted_clients | 4 |
| Aborted_connects | 113 |
+------------------+-------+
2 rows in set (0.00 sec)

Как отладить данную проблему и понять, почему происходит сброс коннекта?

В первую очередь стоит включить лог предупреждений, это делается путем добавления в блок [mysqld] файла /etc/mysql/my.cnf ниже указанного параметра и последующей перезагрузки mysql демона:
log-warnings

После этого открываем лог mysql демона и ждем появления ошибок про Abort_connect:
tail -f /var/log/daemon.log -n 1000

Со временем должны появится примерно такие записи:
May 30 12:32:55 mysql1 mysqld: 110530 12:32:55 [Warning] Aborted connection 87982 to db: 'dbsome' user: 'tesuser' host: 'domain.ru' (Got an error reading communication packets)

По которым можно будет сделать хоть какие-то выводы о том, где источник проблемы.

Saturday 28 May 2011

Копирование данных из одного svn репо в другое

http://code.google.com/p/svn2svn/

Как посмотреть значения лимитов ulimit для конкретного процесса?

Вот так:
cat /proc/21231/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 10485760 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 193185 193185 processes
Max open files 1000000 1000000 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 193185 193185 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us

Где 21231 - это pid процесса, для которого нужно посмотреть лимит.

Thursday 26 May 2011

Установка 32 гб памяти на процессоры серии i7 2600

Похоже, пока невозможна: http://forums.bit-tech.net/showthread.php?t=205314

Хотя вот есть вот такие блоки памяти по 8Gb: Samsung 8GB PC3-8500 DDR3-1066MHz non-ECC Unbuffered CL7 240-Pin DIMM Dual Rank Original Memory Module Mfr P/N M378B1G73AH0-CF8, но стоят они очень дорого :(

Несколько слов о write cache в контроллерах Adaptec

http://ask.adaptec.com/scripts/adaptec_tic.cfg/php.exe/enduser/std_adp.php?p_faqid=8971&p_created=1056105282&p_topview=1

Технология ZMCP от Adaptec - сохранение кэша RAID контроллера без батарейки BBU

Zero-Maintenance cache Protection

Если вкратце, то эта технология заменяет собой функцию батарейки на RAID контроллере обычной флешкой. Если ранее для сохранения содержимого кэша (хранимого в энергозависимой микросхеме) контроллера использовалась батарейка (блок BBU, который, к слову, стоит весьма немало - для контроллера Adaptec 5405 стоящего 13 т.р. BBU модуль обойдется в 4.5 т.р.), то сейчас технология изменилась. Теперь при потере питания специальная схема фикисрует этот факт и посредством энергии суперконденсатора переносит данные из энергозависимого кэша на Nэнергонезависимый NAND флеш. После восстановления питания содержимое кэша переносится с флеш-карты непосредственно в кэш и все операции ввода-вывода завершаются успешно, без потери данных.

Новые контроллеры с поддержкой технологии ZMCP: 5405Z, 5805Z, 5445Z.

Вот сраница описания технологии: http://www.adaptec.com/ru-ru/_common/zmcp/

А вот презенатция в PDF (положил в репо, так как Adaptec регулярно ломает ссылки на своем сайте): http://fastvps.googlecode.com/files/ru_6514_series5z_17.pdf

Почему Скайп (Skype) не работает?

Что со Skype?

Сейчас как на Windows, так и на Linux, так и на Mac OS проявляются следующие проблемы - Skype не включается и не выдает никаких ошибок, в логе ошибок Windows имеется информация о неожиданном завершении программы. Официальной информации пока нет. Сайт Skype также работает крайне нестабильно. Есть подозрения, что проблема в серверах авторизации. Связано ли это с покупкой компании Skype Майкрософтом?

ВНИМАНИЕ! Фиксы указанные ниже удалят всю хистори!

Фикс для Mac OS:
cd '/Users/имя_вашего_пользователя/Library/Application Support/Skype/'
rm -rf *

После этого потребуется запустить Скайп заново и ввести пароль.

Фикс для Windows XP/Windows 7: http://tresnet.ru/archives/658

Xeon E3-1275 - серверный брат-близнец семейства Intel i7 2600

Отчличный процессор с поддержкой ECC памяти и не сильно отличающейся от i7 2600 ценой: http://www.thg.ru/cpu/intel_xeon_e3_1275/index.html

Чиспсеты для процессоров этой серии используются серии Intel C200: Intel C202, C204, C206.

Обзоры Intel i7 2600

http://www.overclockers.ru/lab/39981/Vstrechaem_Sandy_Bridge_Intel_Core_i7-2600_i_Core_i5-2400.html

http://www.u-sm.ru/index.php/obzoryi-i-stati/nebolshoy-kitayskiy-test-intel-core-i7-2600-sandy-bridge.html

http://www.thg.ru/cpu/sandy_bridge/sandy_bridge-01.html

Что обозначают префиксы W, E, X, L процессоров Xeon и суффиксы K, S, T у Core i7 2 поколения?

Xeon: http://www.intel.com/products/processor_number/about/xeon_itanium.htm

Остался лишь загадкой префикс W. Про него я нашел лишь следующее:
The W prefix is only used for the single socket Xeon W3500 series and Xeon W3600 series, which are often used in workstations. I have not found any official documention for what the W stands for, or means. It could be Workstation.

Источник: http://sqlserverperformance.wordpress.com/2011/04/10/a-sql-server-hardware-nugget-a-day-day-10/

Core: http://www.intel.com/products/processor_number/about/core.htm

Wednesday 25 May 2011

Thursday 19 May 2011

Жесткие диски - CHS (Cylinder Head Sector)

http://en.wikipedia.org/wiki/Cylinder-head-sector

Создание полноценной таблицы разделов в файле

Очевидный подход - создать файл, заполненный нулями, и попробовать создать в нем таблицу разделов. Итак, платформа: Debian 6 Squeeze.

Пробуем:
dd if=/dev/zero of=whole_disk.img bs=512 count=10000000
10000000+0 records in
10000000+0 records out
5120000000 bytes (5.1 GB) copied, 34.7126 s, 147 MB/s

Создаем таблицу разделов:
parted whole_disk.img mklabel msdos

Создаем 1 раздела:
parted whole_disk.img mkpart primary ext3 1 1024
parted whole_disk.img mkpart primary ext3 1024 100%

И в результате получили два аккуратненьких раздела:
parted whole_disk.img
GNU Parted 2.3
Using /root/whole_disk.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: (file)
Disk /root/whole_disk.img: 5161MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 1024MB 1023MB primary
2 1024MB 5160MB 4136MB primary

(parted)

Но fdisk на них орет благим матом:
fdisk -l whole_disk.img
You must set cylinders.
You can do this from the extra functions menu.

Disk whole_disk.img: 0 MB, 0 bytes
4 heads, 32 sectors/track, 0 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003e6d7

Device Boot Start End Blocks Id System
whole_disk.img1 17 15632 999424 83 Linux
Partition 1 has different physical/logical endings:
phys=(1023, 3, 32) logical=(15631, 3, 32)
whole_disk.img2 15633 78736 4038656 83 Linux
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(1023, 3, 32) logical=(15632, 0, 1)
Partition 2 has different physical/logical endings:
phys=(1023, 3, 32) logical=(78735, 3, 32)

Но если файл смонтировать как диск:
losetup /dev/loop0 whole_disk.img

То с выдачей fdisk станет все ок:
fdisk -l /dev/loop0

Disk /dev/loop0: 5120 MB, 5120000000 bytes
4 heads, 32 sectors/track, 78125 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a619a

Device Boot Start End Blocks Id System
/dev/loop0p1 17 15632 999424 83 Linux
/dev/loop0p2 15633 78112 3998720 83 Linux

Теперь нам нужно каким-то образом подключить массивы на этом диске к системе. Для этого установим kpartx:
apt-get install kpartx

Для начала получим список имеющихся массивов:
kpartx -l /dev/loop0
loop0p1 : 0 1998848 /dev/loop0 2048
loop0p2 : 0 7997440 /dev/loop0 2000896

Отлично, теперь подключим их к системе через device mapper:
kpartx -a /dev/loop0

После этого у нас появятся два раздела в системе:
ls -al /dev/mapper/
total 0
drwxr-xr-x 2 root root 100 May 20 01:17 .
drwxr-xr-x 18 root root 3.2K May 20 01:17 ..
crw------- 1 root root 10, 59 May 19 21:41 control
lrwxrwxrwx 1 root root 7 May 20 01:17 loop0p1 -> ../dm-0
lrwxrwxrwx 1 root root 7 May 20 01:17 loop0p2 -> ../dm-1

Это как раз разделы с нашего виртуального жесткого диска. Все, теперь с ними можно работать как угодно!

После окончания работ отмонтируем все:
kpartx -d /dev/loop0

Все ок:
ls -al /dev/mapper/
total 0
drwxr-xr-x 2 root root 60 May 20 01:19 .
drwxr-xr-x 18 root root 3.1K May 20 01:19 ..
crw------- 1 root root 10, 59 May 19 21:41 control

Неизвестный losetup и создание дискового раздела в файле

О том, что можно создать дисковое устройство в файле, уверен, знают многие. Сделать это несложно, смотрим пример ниже.


Создаем пустой файл заполненный нулями:
dd if=/dev/zero of=partition.img bs=512 count=1000000
1000000+0 records in
1000000+0 records out
512000000 bytes (512 MB) copied, 1.6735 s, 306 MB/s

Теперь совершенно стандартным способом создаем файловую систему в файле:
mkfs.ext3 partition.img
mke2fs 1.41.12 (17-May-2010)
partition.img is not a block special device.
Proceed anyway? (y,n) y
warning: 287 blocks unused.

Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
125416 inodes, 499713 blocks
25000 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
61 block groups
8192 blocks per group, 8192 fragments per group
2056 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Утилита file подтверждает наличие файловой системы в файле:
file partition.img
partition.img: Linux rev 1.0 ext3 filesystem data, UUID=9b90cdcd-967c-452c-baa4-e1ac839f6bde

А утилита mount его прекрасно монтирует:
{code}mount -o loop partition.img /mnt
{code}

df -h | egrep 'File|loop'
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 473M 11M 438M 3% /mnt

Отмонтируем:
umount /dev/loop0

Но как представить обычный файл как полноценное блочное устройство без создания на нем какой-либо файловой системы? Тут нам на помощь приходит losetup!

Создаем пустой бинарный файл как и в предыдущий раз:
dd if=/dev/zero of=partition.img bs=512 count=1000000
1000000+0 records in
1000000+0 records out
512000000 bytes (512 MB) copied, 1.66248 s, 308 MB/s

И подключаем его как полноценное блочное устройство:
losetup /dev/loop0 partition.img

Вуаля, теперь с содержимым файла можно работать как с обычным блочным устрйоством:
file /dev/loop0
/dev/loop0: block special

Создаем файловую систему:
mkfs.ext3 /dev/loop0
mke2fs 1.41.12 (17-May-2010)
warning: 287 blocks unused.

Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
125416 inodes, 499713 blocks
25000 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
61 block groups
8192 blocks per group, 8192 fragments per group
2056 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.


Монтируем:
mount /dev/loop0 /mnt

И получаем тот же самый эффект, что и при прямом монтировании файла:
df -h | grep loop
/dev/loop0 473M 11M 438M 3% /mnt

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

Теперь пришел черед отмонтировать файл от блочного устройства, получаем список всех файлов, подключенных таким образом:
losetup -a
/dev/loop0: [0902]:4358159 (/root/partition.img)

Отключаем:
losetup -d /dev/loop0

Самый простой способ выполнить команду в chroot

chroot /mnt /bin/bash -c 'ls -la /dev'
total 8
drwxr-xr-x 2 root root 4096 Mar 25 12:13 .
drwxr-xr-x 21 root root 4096 May 19 15:59 ..

Вот честно - стыдно, что сам до такого не додумался :(

RHEL 6 + software RAID из SSD дисков

Такая связка крайне не рекомендуется. Так как программный RAID в Linux не поддерживает команду TRIM. Если же RAID требуется, то, например, для замены RAID-1 (зеркало) можно использовать LVM mirror, так как он поддерживает команду TRIM.

In addition, keep in mind that MD (software raid) does not support discards. In contrast, the logical volume manager (LVM) and the device-mapper (DM) targets that LVM uses do support discards. The only DM targets that do not support discards are dm-snapshot, dm-crypt, and dm-raid45. Discard support for the dm-mirror was added in Red Hat Enterprise Linux 6.1.
Red Hat also warns that software RAID levels 1, 4, 5, and 6 are not recommended for use on SSDs. During the initialization stage of these RAID levels, some RAID management utilities (such as mdadm) write to all of the blocks on the storage device to ensure that checksums operate properly. This will cause the performance of the SSD to degrade quickly.

Источник: RHEL 6 Storage Guide

Какая файловая система наиболее предпочтительна для SSD дисков?

ext4, потому что поддерживает команду TRIM (опция монтирования discard).

At present, ext4 is the only fully-supported file system that supports discard. To enable discard commands on a device, use the mount option discard. For example, to mount /dev/sda2 to /mnt with discard enabled, run:
mount -t ext4 -o discard /dev/sda2 /mnt
By default, ext4 does not issue the discard command. This is mostly to avoid problems on devices which may not properly implement the discard command. The Linux swap code will issue discard commands to discard-enabled devices, and there is no option to control this behavior.

(с) RHEL 6 Storage Guide

Какой интерфейс для подключения SSD предпочтителен?

PCI-Express!

The first class of SSDs use a PCI-Express connection, which offers the fastest I/O throughput compared to other classes. This class also has a very low latency for random access.

(с) RHEL 6 Storage Guide

Tuesday 17 May 2011

Ext4 production ready!

С момента выхода RHEL 6.1 (а это в буквально ближайшие недели) по всем канонам инженерного искусства ext4 можно считать готовой к продакшену! Ура, товарищи, ура!

Monday 16 May 2011

RIPE страны

https://www.arin.net/knowledge/rirs/RIPEcountries.html

Кэш диски на ZFS

Для начала создадим RAID-Z массив из 3х дисков (в моем случае это
SATA): http://phpsuxx.blogspot.com/2010/09/raid-z-freebsd-81.html

Итак, имеем обычный RAID-Z массив:
zpool status
pool: backup
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
backup ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4 ONLINE 0 0 0
ad6 ONLINE 0 0 0
ad10 ONLINE 0 0 0
errors: No known data errors


Теперь подключим к массиву очередное дисковое устройство (в моем
случае это 128GB SSD) как L2ARC кэш:
zpool add backup cache ad14

В документации о роли "cache" сказано следующее (но я не думаю, что
кто-то сочтет это за существенные ограничения):
cache A device used to cache storage pool data. A cache
device cannot be mirrored or part of a raidz or raidz2
configuration.For more information, see the "Cache Devices"
section.

В итоге оно у нас добавится и будет упомянуто в статусе:
zpool status
pool: backup
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
backup ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ad4 ONLINE 0 0 0
ad6 ONLINE 0 0 0
ad10 ONLINE 0 0 0
cache
ad14 ONLINE 0 0 0

errors: No known data errors

Как продавать свои Cloud ресурсы и зарабатывать на этом?

http://www.spotcloud.com/

Saturday 14 May 2011

Платна ли отправка книг на email name@kindle.com при доступе по Wi-Fi?

Нет, плата взимается только при доступе по 3G:
Send the e-mail to your Kindle e-mail address for wireless delivery directly to your Kindle; If your Kindle has Wi-Fi enabled, it will be delivered to your Kindle at no charge. A small fee will be charged for the wireless delivery over 3G.

Wednesday 11 May 2011

Экспорт заданной ревизии SVN репозитория в заданную папку

svn export https://svn.domain.ru/reponame/trunk /root/target_dir/ --username=имя_пользователя

Обращаю внимание, что target_dir не должна сущестсовать. Как результат работы команды будет копия иерархии файлов HEAD ревизии репозитория (все, что находится в рабочей копии и не закоммичено будет отброшено).

Vim (Mac, Linux): как избавиться от ^M в файле?

Легко:
:%s/C-vC-m//g

Где С-v - это CTRL + v, C-m - это CTRL + m.

Tuesday 10 May 2011

RHEL 6.1 beta!

Вуаля!
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.1 Beta (Santiago)

Monday 9 May 2011

Как быстро узнать число ядер в Linux системе?

grep -c '^processor' /proc/cpuinfo
12

Debian: как избавиться от You have new mail in /var/mail/root ?

Поиски свои я начал с man bash:

MAILCHECK Specifies how often (in seconds) bash checks for mail. The default is 60 seconds. When it is time to check for mail, the shell does so before displaying the primary prompt. If this variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking.

MAIL If this parameter is set to a file name and the MAILPATH variable is not set, bash informs the user of the arrival of mail in the specified file.

Итого, на мой взгляд самый правильный путь обнулить переменную MAIL.

Открываем конфиг файл:
vi /etc/profile

И добавляем там следующее:
# Disable You have new mail in /var/mail/root
unset MAIL

После этого потребуется закрыть ssh сессию и запустить заново.

CentOS: Waiting for driver initialization почему так долго?

Это не более чем баг: http://murty4all.wordpress.com/2010/09/29/fixing-waiting-for-driver-initialization-on-rhel-5-4-while-booting/

Почему sort так тормозит?

Дано - файл на 300 мб с кучей абсолютных путей в Linux, каждый на отдельной строке, присутствует юникод, задача - отсортировать как можно быстрее:

Стандартный подход
time sort -u /var/log/backup/2011-05-09.log > sort_standard

real 2m4.258s
user 2m3.716s
sys 0m0.344s

Хитрый вариант:
time LC_ALL=C sort -u /var/log/backup/2011-05-09.log > sort_fast

real 0m10.781s
user 0m8.965s
sys 0m0.548s

Результаты:
md5sum sort_fast
a1a339709059142d8700a2314481544b sort_fast

md5sum sort_standard
7a8ea0f6f1bdccc6fd0551b49aa3c99c sort_standard

wc -l sort_fast
295038 sort_fast

wc -l sort_standard
291784 sort_standard


ls -alh | grep sort
-rw-r--r-- 1 root root 30M 2011-05-09 02:55 sort_fast
-rw-r--r-- 1 root root 30M 2011-05-09 02:55 sort_standard

Подозрения, что побились имена в UTF-8 в результате такой сортировки, но не уверен, у кого идеи, как быстро это узнать?

Источник: http://ranadip.wordpress.com/2010/03/12/tech-trivia-linux-unusually-slow-performance-of-grepsortother-text-processing-commands/

Thursday 5 May 2011

Про Red Hat RHEV по-русски, отличный обзор от Андрея Маркелова

Текст статьи: http://samag.ru/archive/article/1219

Лично для меня знакомство с технологией закончилось словами:
Red Hat Enterprise Virtualization Manager (RHEV-M)

Представляет собой единую платформу управления виртуальными серверами и рабочими местами. Текущая реализация основана на решении SolidICE, доставшемся компании Red Hat при покупке Qumranet. В настоящий момент сервисы работают только на платформе Windows Server 2003 R2 (RHEV 2.1) и Windows Server 2008 R2 (RHEV 2.2). Доступ к интерфейсу управления (веб-приложение ASP.NET) возможен только из браузера Internet Explorer. Для работы сервера требуются .NET Framework, Windows PowerShell, WPF, IIS и Microsoft SQL Server. В настоящее время код менеджера закрыт, однако ведется работа по реинженирингу кода с целью обеспечения кросcплатформенности и поддержки различных СУБД. Код переводится на Java, и в дальнейшем менеджер должен будет работать как веб-приложение на платформе JBoss. Начиная с версии 2.2 RHEV-M, менеджер может работать в кластере MSCS, однако и до этого высокую доступность можно было обеспечить при помощи продуктов третьих компаний. В настоящий момент RHEV-M может использовать как локальную аутентификацию, так и аутентификацию посредством Active Directory. В дальнейшем, вероятно, стоит ожидать официальную поддержку возможности работы с другими серверами каталогов, в первую очередь Red Hat Directory Server/Red Hat IPA.

И

Консоль управления

Как уже было сказано ранее, доступ к веб-порталу управления в настоящий момент возможен только из браузера Internet Explorer 6 и выше. В качестве ОС рабочего места администратора необходимо использовать Microsoft Windows XP SP3 и выше. Внешний вид консоли приведен на рис. 3.

Вот чего, чего, а "ядра" решения на Windows от Red Hat никак не ожидал. Кому как, а для меня это решение (если, конечно, Red Hat не одумается) не интересно вообще и дело тут не в предвзятости к определенным ОС, а исключительно в конструктивной целостности, о возможности надежной работы такой вот солянки у меня огромные сомнения.

Debian 6 в OpenVZ screen "Sorry, could not find a PTY."

Фиксится легко:
mknod --mode 666 /dev/ptmx c 5 2

Wednesday 4 May 2011

OpenSource аналог Google Code

http://projects.ceondo.com/p/indefero/page/Features/

Видеокурсы информационных технологий от Яндекса

http://company.yandex.ru/academic/kit/

Intel AMT - ревлюционная технология удаленного управления сервером, KVM в прошлом!

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

За наводу спасибо: http://tresnet.ru/ :)

warning: You have configuration parameter $server specified in [puppetd], which is a deprecated section. I'm assuming you meant [agent]

Ошибка исправляется очень просто, нужно переименовать название блока (оно в квадратных кавычках) в файле конфигурации с [puppetd] в [agent].

Файл конфигурации:
vim /etc/puppet/puppet.conf

Monday 2 May 2011

Отличная статья про Мосад на Википедии

http://ru.wikipedia.org/wiki/%D0%9C%D0%BE%D1%81%D1%81%D0%B0%D0%B4

Debian 6 в OpenVZ: insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!

apt-get install -y puppet
Reading package lists... Done
Building dependency tree
Reading state information... Done
puppet is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up puppet (2.6.2-4) ...
insserv: warning: script 'S10vzquota' missing LSB tags and overrides
insserv: warning: script 'vzquota' missing LSB tags and overrides
insserv: There is a loop between service vzquota and single if started
insserv: loop involving service single at depth 11
insserv: loop involving service vzquota at depth 10
insserv: loop involving service mountnfs at depth 8
insserv: There is a loop between service vzquota and single if started
insserv: loop involving service sysklogd at depth 14
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on single and therefore on system facility `$all' which can not be true!
insserv: Max recursions depth 99 reached
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing puppet (--configure):
subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
puppet
E: Sub-process /usr/bin/dpkg returned an error code (1)

Фикс:
vi /etc/init.d/vzquota

и под строкой "#!/bin/sh" добавляем:
### BEGIN INIT INFO
# Provides: vzquota
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start vzquota at the end of boot
# Description: This command is used to configure and see disk quota statistics for Containers.
### END INIT INFO

После этого повторяем предыдущую команду ( apt-get ).

Источник: http://www.mail-archive.com/debian-bugs-rc@lists.debian.org/msg230965.html

The Airline Business in the Twenty-First Century

Вот такая вот замечательная книжка про авиаперевозки в 21 веке, прошу: http://s7-direct-line.livejournal.com/162080.html :)

Sunday 1 May 2011

Первый 737-800NG во флоте S7 Airlines

http://s7-direct-line.livejournal.com/168946.html

Активация расширенного Bash completion в Debian

С тем, что Bash дополняет имя команды знаком каждый, например, написав apt-и нажав tab мы получим ряд вариантов:
apt-[TAB]
apt-cache apt-config apt-ftparchive apt-key apt-sortpkgs
apt-cdrom apt-extracttemplates apt-get apt-mark

Но кроме этого есть крайне удобная возможность - дополнение еще и аргументов команд. Но стандартно она не активна, поэтому активируем ее.

Устанавливаем нужный пакет:
apt-get install -y bash-completion

Активируем возможность автокомплита для всех пользователей системы глобально, добавляем строки перед строкой export PATH:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi


После этого отключаемся от ssh, подключаемся заново и пробуем новую функцию в деле:

test:~# apt-get up[TAB]
update upgrade
test:~# apt-get[TAB]
autoclean build-dep clean dselect-upgrade purge source upgrade
autoremove check dist-upgrade install remove update

Не правда ли, прекрасная фича? :)

Источники: http://www.howtoforge.com/how-to-add-bash-completion-in-debian и http://habrahabr.ru/blogs/sysadm/71525/