Последние сообщения

Страницы: 1 2 3 [4] 5 6 ... 10
31
Не удаётся завершить защищённую транзакцию
\"Вы попытались получить доступ к адресу mail.yandex.ru/, который сейчас недоступен. Убедитесь, что веб-адрес (URL) введён правильно, и попытайтесь перезагрузить страницу.
Безопасное подключение: критическая ошибка (1066)
mail.yandex.ru/
Не удалось проверить подлинность веб-сайта (ошибка OCSP).
32
Курилка / Динамика цен от Яндекса
« Последний ответ от crazy_man 31 Март 2014, 02:47:31 »
Western Digital WD40EZRX

33
БД (SQL и пр.) / Mysql: восстановление одной таблицы из полного дампа
« Последний ответ от crazy_man 28 Январь 2014, 09:59:22 »
Ниже представленный скрипт позволяет из архива полного дампа вытащить одну таблицу.

Код
#!/bin/sh
 
DB=$1
TABLE=$2
PATH=/some/path/backup
 
if [ -f $PATH/$DB.sql.gz ]; then
    /bin/gunzip -c $PATH/$DB.sql.gz | /usr/bin/awk \'/CREATE TABLE `\'$TABLE\'`/,/UNLOCK TABLES/\' > /tmp/$DB.$TABLE.sql
    else
    echo \'FILE not found\'
fi

Небольшое пояснение по скрипту. В качестве параметров он принимает имя базы данных и имя таблицы, которую необходимо восстановить.

Имя архива состоит из имени базы с расширением sql.gz

Пример выполнения скрипта
Код
extract_table.sh filename table_name

Из архива базы filename извлечется таблица table_name

После этого, если необходимо, можно восстановить данную таблицу в базу.
Код
mysql -uusername -ppassword database_name < /tmp/database_name.table_name.sql
34
1. - Open the registry you type Win + R enter regedit
2. - \"Ctrl + F\" we all entries \"CustomHeidiDriverPath\" and remove the value
assigned to this entry
C: \\ Program Files \\ Autodesk \\ AutoCAD 2014 \\ Drv \\
35
Использование программ / Unix: Reclaim unused space on thin provisioned disk?
« Последний ответ от nlive 27 Декабрь 2013, 01:40:01 »
Hi Guys,

 

What you probably need to do first is to write zeros to the freespace on each of the Linux filesystems to make VMware or storage thin provisioning mechanism think the blocks were not touched and contain no data (all zeros).

 

1. Classic approach

I think, you might want to look at:

dd utility method decribed here:

http://www.michaelcole.com/node/13

the command you need is this one:

 

sudo dd if=/dev/zero of=/zerofile; sudo rm /zerofile

 

It created a file filled with zeros to make the filesystem full (out of space) and then deletes the file, resulting in a free space zeroed for you. Repeat for every filesystem.

 

 

2. Scrub

Please also look at the scrub utility (probably with -X option)  that is available on Linux:

Man pages and some examples:

http://linux.die.net/man/1/scrub

http://www.bgevolution.com/blog/scrub-file-shredding-for-linux/

 

 

3. Zerofree (Debian/Ubuntu)

Have also a try with zerofree utility that should be availalbe on Debian and Ubuntu based distros. Beware - it is slow.

http://manpages.ubuntu.com/manpages/natty/man8/zerofree.8.html

http://community.linuxmint.com/software/view/zerofree

http://maketecheasier.com/shrink-your-virtualbox-vm/2009/04/06

 

4. Shred

You may also want to look at shred command, but it may not be what you really needed.

http://linux.die.net/man/1/shred

 

All of these are not as straightforward as sdelete (-c) used on Windows, but you should be able to make the first step.

 

The second step should be trying to convince the thin provisioning mechanism to compact the zeros. EMC\'s block compression available on CX4/VNX storage arrays would surely do it when you enable compression on a thick or thin LUN, squeezing all zeros out of it.

 

Regards,

oczkov
36
При запуске автокада появляется ошибка

\"Файл драйвера монитора hdi отсутствует или поврежден\"


Как от нее избавится ?? Не могу работать в Автокаде!!!!
37
UNIX / Как в никсах редактировать огромные файлы???
« Последний ответ от nlive 19 Декабрь 2013, 01:49:46 »
Если gui - то есть классная тулза (специально для просмотра логов)
glogg - http://glogg.bonnefon.org/description.html
38
UNIX / Как в никсах редактировать огромные файлы???
« Последний ответ от nlive 19 Декабрь 2013, 01:48:29 »
Можно воспользоватся регулярными выражениями , благо линукс это тебе не винда
Код
sed \'s#\\(,\\)\\([^.,]\\+\\.\\(jpg\\|png\\|gif\\)\\)#\\1+\\2#g\' infile

Explanation:
s#...#...#g             # Substitute command. \'#\' is separator and \'g\' is to apply it many times for
                        # each line.
\\(,\\)                   # Match a comma, and save it as \'\\1\'
[^.,]\\+\\.               # Match any characters until a \'.\' or \',\' found.
\\(jpg\\|png\\|gif\\)       # Match extension.
\\1+\\2                   # Replace with: Comma, plus sign and the image name.

Если не регулярка, то
Код
Sed has several commands, but most people only learn the substitute command: s. The substitute command changes all occurrences of the regular expression into a new value. A simple example is changing \"day\" in the \"old\" file to \"night\" in the \"new\" file: 

sed s/day/night/ new
Ну а если редактироваать именно хочешь, то такое файло надо сначало разбить на мого мелких. Отредактироавать и  потом склеить назад
Нашел на одном из форумов
Код
I had a 12GB file to edit today. The vim LargeFile plugin did not work for me. It still used up all my memory and then printed an error message :-(. I could not use hexedit for either, as it cannot insert anything, just overwrite. Here is an alternative approach:

You split the file, edit the parts and then recombine it. You still need twice the disk space though.


Grep for something surrounding the line you would like to edit:
grep -n \'something\' HUGEFILE | head -n 1


Extract that range of the file:
sed -n -e \'4,5p\' -e \'5q\' HUGEFILE > SMALLPART
The -n option is required to suppress the default behaviour of sed to print everything
4,5p prints lines 4 and 5
5q aborts sed after processing line 5


Edit SMALLPART using your favourite editor.


Combine the file:
(head -n 3 HUGEFILE; cat SMALLPART; sed -e \'1,5d\' HUGEFILE) > HUGEFILE.new

HUGEFILE.new will now be your edited file, you can delete the original HUGEFILE.
39
UNIX / Как в никсах редактировать огромные файлы???
« Последний ответ от crazy_man 19 Декабрь 2013, 01:40:05 »
Еслть файлик 18  гигов, каким боком можно его отредактировать ? Нужно изменить одну строчку
40
БД (SQL и пр.) / pgsql: Как изменить пароль пользователя postgres
« Последний ответ от nlive 19 Декабрь 2013, 01:36:11 »
Тут есть несколько вариантов:
1. Можно сделать чтоб и дальше пароль постгреса не спрашивался. Для этого нужно изменить файлик /etc/postgresql/9.1/main/pg_hba.conf (путь в centos  - /var/lib/pgsql/data/pg_hba.conf) , поставив там значение автоидентификации (ident)

2. Можно изменить пароль postgres на свой:

Для этого нужна войти под postgres-ом в бд (если не пущает - см.1 - на время делаем аутентификация ident, потом после всех манипуляций ставим md5):
sudo -u postgres psql

Затем
\\password postgres

Тут надо 2 раза ввести новый пароль
Выходим

\\q

Как я и говорил, если не пускает - меняем аутентификацию:

Edit /etc/postgresql/9.1/main/pg_hba.conf (path will differ) and change:
    local   all             all                                     md5

to:
    local   all             all                                     ident

Рестартим сервер, пробуем
sudo service postgresql restart

3. Через SQL это можно сделать так:
alter user postgres with password \'new_password\'

вроде бы так...
Страницы: 1 2 3 [4] 5 6 ... 10