Автор: 500

Bash and JSON

Parsing JSON in Bash can be achieved using tools like ‘json.tool’, or ‘jq’ with the syntax, echo ‘{«key»:»value»}’ | jq ‘.key’ . These tools can interpret JSON data, making it easier to handle in your scripts. Here’s a simple example using ‘jq’: In this example, we’re using the ‘jq’ tool to parse a JSON string. The ‘jq’ command takes a […]

Enable DNSSEC support in systemd-resolved

I’m currently running Ubuntu 18.04 and I noticed that by default I was using systemd-resolved for DNS: Most of the recent systemd distributions use it, Ubuntu does since 16.10. It has the same role as dnsmasq. By playing around a bit with the service, I noticed DNSSEC checking was disabled: It was confirmed by the […]

Convert TIFF To PDF + optimizing PDF file sizes on Linux

How to convert TIFF files to PDF format on Linux TIFF (Tagged Image File Format) is a popular image file format. Unlike other types of image files, a single TIFF file can contain multiple images (e.g., multi-page document scan) in it. TIFF editor software such as GIMP is able to support such multi-page TIFF files. […]

Блокирование атак при помощи null route или blackhole

Null route или, как его ещё называют, blackhole route или просто blackhole — это запись в таблице маршрутизации, которая направляет трафик «в никуда» (аналог «ip route … null0» в Cisco). Пакеты с таким маршрутом будут удалены с причиной «No route to host». Причем в «черную дыру» можно перенаправлять трафик как с одного ip адреса, так […]

Настройка автозапуска скриптов в Linux Ubuntu/Mint в консольном режиме.

Создание скрипта в init.d для запуска во время инициализации системы Для начала нужно создать скрипт и скопировать его в  директорию /etc/init.d/ удобным для вас способом, а затем сделать его исполняемым командой: Теперь необходимо добавить его в автозагрузку: Скрипт запуститься во время инициализации системы. Удалить из автозагрузки можно так: Загрузка с помощью rc.local после загрузки системы Необходимо создать […]

grep без комментариев и пустых строк

Часто нужно посмотреть «активные» строчки в конфиге, т.е. исключить из него комментарии и пустые. Это просто делается грепом 1 grep-v’^$\|^\s*\#’some-config.conf Или более коротко, не учитывая комментариев, начинающихся не с начала строки: 1 grep-v’^$\|^#’some-config.conf

How to Fix “upstream timed out (110: Connection timed out) while reading response header from upstream” in NGINX

Expected Behavior NextCloud should install as expected on first run. Current Behavior Installation fails. Browser is posting: 504 Gateway Time-out. This is caused by the fact that the installation is very slow on some ARM devices so fastcgi/proxy times out. Steps to Reproduce Try to install NextCloud on a low-end ARM device. Environment OS: Debian 10CPU architecture: arm64How […]

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running. Step 1 — Enable NBD on the Host Step 2 — Connect the QCOW2 as network block device Step 3 — Find The Virtual […]

AppArmor with cupsd denied in logs

Workaround from https://wiki.ubuntu.com/DebuggingPrintingProblems#AppArmor_Protection_of_the_printing_system Make sure apparmor-utils is installed: apt-get install apparmor-utils If you have any problems with printing, try deactivating the AppArmor protection with sudo aa-complain cupsd. Note after doing this I had to unplug and replug the printer for it to work. You can re-activate AppArmor via sudo aa-enforce cupsd. If this helps, look for messages containing audit in the […]

Windows 10 x64 Ошибка 0x00000709 при добавлении расшаренного на другом компьютере принтера

Хочу поделиться решением ситуации с ошибкой (ошибка 0x00000709) при добавлении принтера по сети, т.к. не нашел ответа в просторах интернета. Дано:  Компьютер №1, к которому подключен принтер с ОС WIndows 10 x64 Home edition, принтер (Brother LCD2500) подключен по USB, принтер сделан общедоступным, драйверы установлены для x64 и x86;  Компьютер №2, на который необходимо подключить по […]