Архив за месяц: Январь 2018

фотография с веб-камеры через ffmpeg

ffmpeg -t 1 -f video4linux2 -s 640x480 -r 1 -i /dev/video0 foto.jpeg

если снимки будут тёмные, то –r 20

-r[:stream_specifier] fps (input/output,per-stream)

Set frame rate (Hz value, fraction or abbreviation).

-t duration (input/output)

When used as an input option (before -i), limit the duration of data read from the input file.

Как войти в командную строку при установке Windows 7

При установке windows 7 во время открытого окна разметки диска можно нажать Shift + F10 и откроется окно с командной строкой

Сброс пароля Windows из-под Linux

спасибо http://4tux.ru/blog/sbros_parolya_windows_iz_pod_linux

Необходимо установить утилиту chntpw:

sudo apt-get install chntpw

Далее нужно примонтировать раздел с Windows, и перейти в него из консоли. Например, раздел с Windows мы примонтировали по адресу /media/win. Таким образом, в консоли переходим в данную директорию:

cd /media/win/Windows/system32/config

Обратите внимание, регистр символов имеет значение, «WINDOWS», «Windows» и «windows» — не одно и то же.

Если нам нужно сбросить пароль системной учетной записи Администратора, запускаем:

sudo chntpw SAM

Если же нужно сбросить пароль пользователя (администратора) vasya, то пишем:

sudo chntpw –u vasya SAM

После выполнения команды вам будет предложено несколько вариантов: сбросить пароль, установить новый, сделать пользователя администратором, разблокировать пользователя.

 

В тему:
Список стандартных паролей для intel iPOS
Пароль по умолчанию для принтеров и МФУ Brother
RaspberryPi логин и пароль по умолчанию

md5deep

md5deep — программа для массового подсчёта контрольных сумм файлов
Самое полезное:
md5deep -r -e -t -z -o f ./ >> ~/computer.md5sums

-r     Enables recursive mode. All subdirectories are traversed. Please note that recursive mode cannot be used to examine all files
of a given file extension. For example, calling md5deep -r *.txt will examine all files in directories that end in .txt.

-e     Displays a progress indicator and estimate of time remaining for each file being processed. Time estimates for  files larger
than 4GB are not available on Windows. This mode may not be used with th -p mode.

-t     Display a timestamp in GMT with each result. On Windows this timestamp will be the file’s creation time. On all other systems
it should be the file’s change time.

-z     Enables  file  size  mode.  Prepends the hash with a ten digit representation of the size of each file processed. If the file
size is greater than 9999999999 bytes (about 9.3GB) the program displays 9999999999 for the size.

-o <bcpflsd>
Enables  expert  mode.  Allows  the user specify which (and only which) types of files are processed. Directory processing is
still controlled with the -r flag. The expert mode options allowed are:
f — Regular files
b — Block Devices
c — Character Devices
p — Named Pipes
l — Symbolic Links
s — Sockets
d — Solaris Doors
e — Windows PE executables

MS SQL Умножение Numeric без округлений

Более-менее рабочий пример, чтоб например 4.5 не превратилось в 5

DECLARE @tmp_cnt Numeric (18,10)

DECLARE @tmp_uet Numeric (18,10)

…

@tmp_cnt = 1.0

@tmp_uet = 4.5

…

CAST (

      @tmp_cnt * @tmp_uet

AS Numeric(18,10))

Всё работает из-за (18,10) (precision, scale)

Ещё подробности здесь:

https://habrahabr.ru/post/205938/

Использование smartmontools для диагностики дисков в Ubuntu

Smartmontools — программа для диагностики SMART на жестких дисках в Linux.

Установка:

sudo apt-get install smartmontools

Просмотр списка доступных дисков:

~ > smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device

Диагностика диска:

~ > sudo smartctl -s on -x /dev/sda

Результат диагностики:

находим в результатах

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

Если PASSED, то всё хорошо, а если FAILED, то данные с диска пора спасать.