Запись образа на флешку для ленивых

Частенько приходится записывать образ на флешку, бэкап на диск, диск в бэкап.
Родил для себя скрипт на три строчки которым и с вами делюсь:

Заменить один текст на другой в куче файлов

Маленький помощник. Ч.001 пингует и отвечает


Warning: Illegal string offset 'width' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'height' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'autoplay' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'theme' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 63

Warning: Illegal string offset 'loop_video' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'enable_fullscreen' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_title' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_youtube_icon' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_annotations' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_progress_bar_color' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'autohide_parameters' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'set_initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'disable_keyboard' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'set_initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 68

Warning: Illegal string offset 'set_initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 68

Warning: Illegal string offset 'enable_fullscreen' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 70

Warning: Illegal string offset 'autoplay' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 73

Warning: Illegal string offset 'loop_video' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 75

Warning: Illegal string offset 'enable_fullscreen' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 76

Warning: Illegal string offset 'show_title' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 77

Warning: Illegal string offset 'show_youtube_icon' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 78

Warning: Illegal string offset 'show_annotations' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 79

Warning: Illegal string offset 'show_progress_bar_color' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 80

Warning: Illegal string offset 'autohide_parameters' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 81

Warning: Illegal string offset 'disable_keyboard' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 82

Warning: Illegal string offset 'width' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 90

Warning: Illegal string offset 'height' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 90

Warning: Illegal string offset 'width' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'height' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'autoplay' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'theme' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 63

Warning: Illegal string offset 'loop_video' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'enable_fullscreen' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_title' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_youtube_icon' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_annotations' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'show_progress_bar_color' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'autohide_parameters' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'set_initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'disable_keyboard' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 57

Warning: Illegal string offset 'set_initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 68

Warning: Illegal string offset 'set_initial_volume' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 68

Warning: Illegal string offset 'enable_fullscreen' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 70

Warning: Illegal string offset 'autoplay' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 73

Warning: Illegal string offset 'loop_video' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 75

Warning: Illegal string offset 'enable_fullscreen' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 76

Warning: Illegal string offset 'show_title' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 77

Warning: Illegal string offset 'show_youtube_icon' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 78

Warning: Illegal string offset 'show_annotations' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 79

Warning: Illegal string offset 'show_progress_bar_color' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 80

Warning: Illegal string offset 'autohide_parameters' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 81

Warning: Illegal string offset 'disable_keyboard' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 82

Warning: Illegal string offset 'width' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 90

Warning: Illegal string offset 'height' in /srv/www/htdocs/itrus.su/wp-content/plugins/youtube-video-player/fornt_end/front_end.php on line 90

Завалялась у меня raspberry pi первой модели, и решил я научить её говорить со мной а за одно и помогать мне в работе.

Я не буду писать про то как включить и настроить малину, таких статей полным полно, вот например.

Для начала стоит поставить python и pyTelegramBotAPI

т.к. у меня установлена raspbian выглядит это так:

Можно приступить к написанию скрипта благодаря которому малинка будет отвечать мне в телеграм по запросу живы ли мои сервера.

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

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

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

Теперь остаётся только запустить скрипт и поставить его на автозапуск.

2016-03-15 14-15-12 Telegram (92)

В дальнейшем я научу бота кидать аллерты при падении сервака даже если я его об этом не просил, сообщать мне о присутствии рабочей почты и кто его знает чему ещё, следите за обновлениями на этом блоге а так же код доступен на github.