{{ page.description }}
s/$USER/user name/
):
+
+{% highlight bash %}
+mv /home/{$USER,$USER-org}
+mkdir /home/$USER
+chmod 700 /home/$USER
+chown $USER:users /home/$USER
+{% endhighlight %}
+
+ The widespread solution in the Internet is to use automatic utilities to do it. However in our case they are not suitable, since we need to import key / password signature, which is not possible in this case.
+ +The encryption can be done by the following command (lol):
+ +{% highlight bash %} +mount -t ecryptfs /home/$USER /home/$USER +{% endhighlight %} + +While process it asks some question (I suggest to do first mounting in the interactive mode). The answers may be like following (see the comments), +please note that if you change something, it will be changed in some lines below too:
+ +{% highlight bash %} +# key or certificate. The second one is more reliable while you don't lose it %) +Select key type to use for newly created files: + 1) passphrase + 2) openssl +Selection: 1 +# password +Passphrase: +# cipher, select default +Select cipher: + 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 + 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56 + 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 + 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32 + 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32 + 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 +Selection [aes]: 1 +# key size, select default +Select key bytes: + 1) 16 + 2) 32 + 3) 24 +Selection [16]: 1 +# enable reading/writing to the non-encrypted files +Enable plaintext passthrough (y/n) [n]: n +# enable filename encryption +Enable filename encryption (y/n) [n]: y +Filename Encryption Key (FNEK) Signature [XXXXX]: +# toolongdontread +Attempting to mount with the following options: + ecryptfs_unlink_sigs + ecryptfs_fnek_sig=XXXXX + ecryptfs_key_bytes=16 + ecryptfs_cipher=aes + ecryptfs_sig=XXXXX +WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt], +it looks like you have never mounted with this key +before. This could mean that you have typed your +passphrase wrong. + +# accept, quit +Would you like to proceed with the mount (yes/no)? : yes +Would you like to append sig [XXXXX] to +[/root/.ecryptfs/sig-cache.txt] +in order to avoid this warning in the future (yes/no)? : yes +Successfully appended new sig to user sig cache file +Mounted eCryptfs +{% endhighlight %} + +Then copy files from home directory to encrypted one:
+ +{% highlight bash %} +cp -a /home/$USER-org/. /home/$USER +{% endhighlight %} + +Create file on flash card (I've used microSD) with the following text (you should insert your password):
+ +{% highlight bash %} +passphrase_passwd=someverystronguniqpassword +{% endhighlight %} + +Add card automount (mount point is /mnt/key
) to fstab
with option ro
, for example:
Let's configure home directory mounting. The mount options can be found in the following output:
+ +{% highlight bash %} +mount | grep ecryptfs +{% endhighlight %} + +I should note that there are not all options there, you need add key
, no_sig_cache
, ecryptfs_passthrough
too. Thus systemd mount-unit should be like the following (if you are systemd-hater you can write the own daemon, because it doesn't work over fstab
without modification (see below)).
XXXXX
should be replaced to signature from options with which directory are currently mounting. Also you need to insert user name and edit path to file with password (and unit name) if it is needed. Autoload:
Here is a service to unmount flash card when it will be unneeded:
+ +{% highlight bash %} +# cat /etc/systemd/system/umount-key.service +[Unit] +Description=Unmount key card +Before=local-fs.target +After=home-arcanis.mount + +[Service] +Type=oneshot +ExecStart=/usr/bin/umount /mnt/key + +[Install] +WantedBy=local-fs.target +{% endhighlight %} + +Enable:
+ +{% highlight bash %} +systemctl enable umount-key.service +{% endhighlight %} + +Reboot. Remove backups if all is ok. If not then you did a mistake, resurrect system from emergency mode.
+ +In my case I could not to make flash mounting before home decryption. Thus I saw emergency mode on load in which I should just continue loading. There are two solutions in the Internet:
+ +rc.local
.rc.local
.In my opinion both of them are workarounds too much.
+ +Other solution is to mount using pam entry. In my case I have authentication without password on fingerprint so it doesn't work for me.
\ No newline at end of file diff --git a/_posts/2014-12-19-aw-v21-bells-and-whistles.html b/_posts/2014-12-19-aw-v21-bells-and-whistles.html new file mode 100644 index 0000000..4426c46 --- /dev/null +++ b/_posts/2014-12-19-aw-v21-bells-and-whistles.html @@ -0,0 +1,138 @@ +--- +category: en +type: paper +hastr: true +layout: paper +tags: awesome-widgets, pytextmonitor +title: Awesome Widgets 2.1 - bells and whistles +short: aw-v21-bells-and-whistles +description: The paper deals with settings of a custom scripts and graphical bars in the new version of Awesome Widgets (2.1). +--- +For a start it is highly recommended copy file $HOME/.kde4/share/config/extsysmon.conf
after widget update before you open widget settings, because old and new script settings are incompatible. Also I should note that these features can be configured from graphical interface, but I will describe how it can be done by simply editing the desktop file.
Bars are stored in the two directories: /usr/share/apps/plasma_applet_awesome-widget/desktops/
and $HOME/.kde4/share/apps/plasma_applet_awesome-widget/desktops/
(path may be differ in depend from your distro). Settings in the home directory have a higher priority that global ones. Configuration files have the following fields:
Field | +Required | +Value | +Default | +
---|---|---|---|
Name | +yes | +bar name. It should be as barN and should be unique |
+ none | +
Comment | +no | +comment | +empty | +
X-AW-Value | +yes | +bar value. The following tags are available cpu* , gpu , mem , swap , hdd* , bat |
+ cpu | +
X-AW-ActiveColor | +yes | +active part fill in format R,G,B,A |
+ 0,0,0,130 | +
X-AW-InactiveColor | +yes | +inactive part fill in format R,G,B,A |
+ 255,255,255,130 | +
X-AW-Type | +yes | +bar type. The following types are supported Horizontal , Vertical , Circle |
+ Horizontal | +
X-AW-Direction | +yes | +the fill direction. The following variants are supported LeftToRight , RightToLeft |
+ LeftToRight | +
X-AW-Height | +yes | +height, pixels | +100 | +
X-AW-Width | +yes | +width, pixels | +100 | +
Scripts are stored in the two directories: /usr/share/apps/plasma_engine_extsysmon/scripts/
and $HOME/.kde4/share/apps/plasma_engine_extsysmon/scripts/
(path may be differ in depend from your distro). Settings in the home directory have a higher priority that global ones. To enable script you should type it on the output field. Configuration files have the following fields:
Field | +Required | +Value | +Default | +
---|---|---|---|
Name | +yes | +script name | +none | +
Comment | +no | +comment | +empty | +
Exec | +yes | +path to executable file | +/usr/bin/true | +
X-AW-Prefix | +no | +prefix to executable file. Usually it's not required, but in other you may want to specify interpretor for example. | ++ |
X-AW-Active | +no | +whether or not the script is active | +true | +
X-AW-Output | +no | +whether or not the script has output to console. You may set it to false if you want use the script as cron jobs |
+ true | +
X-AW-Redirect | +no | +stream redirection. The following variants are available stderr2stdout , nothing , stdout2stderr . stderr will be enabled, if you run application with DEBUG=yes |
+ nothing | +
X-AW-Interval | +no | +update interval in standard widget intervals | +1 | +
{{ post.date | date_to_string }}
-{{ post.description }} +{{ post.description }}
Tags: {{ post.tags }}
{% endfor %} diff --git a/projects/awesome-widgets.html b/projects/awesome-widgets.html index 5a1e179..81e5320 100644 --- a/projects/awesome-widgets.html +++ b/projects/awesome-widgets.html @@ -87,7 +87,7 @@ sudo make installOpen your Plasma widgetes and select Awesome Widget
.
Open your Plasma widgets and select Awesome Widget
.
You may use different colors for labels. Just put label text into html code. See issue for more details.
@@ -107,14 +107,6 @@ sudo make install/sys/class/power_supply/
.wget -qO- http://ifconfig.me/ip
. Separator is @@
.qdbus org.kde.kwin /KWin currentDesktop
.nvidia
(for nVidia), ati
(for ATI Radeon), disable
or auto
. Default is auto
.AC offline tag: Line which will be shown when AC is offline. Default is ( )
.
Check updates: Check updates on load. Default is true
.
Since version 1.7.0 CPU, CPU clock, memory, swap, network and battery support graphical tooltip. To enable them just make the needed checkboxes a fully checked. The number of stored values can be set in the tab. Colors of graphs are configurable too.
ACPI path: Path to ACPI devices. The file /sys/class/power_supply/
.
Custom command: Commands, which will be run for custom label. For example, wget -qO- http://ifconfig.me/ip
will return external IP.
Desktop cmd: Type a command which will be run for desktop DataEngine. Default is qdbus org.kde.kwin /KWin currentDesktop
.
GPU device: Select one of supported GPU devices. auto
will enable auto selection, disable
will disable all GPU monitors. Default is auto
.
HDD: Select one of HDDs for HDD temperature monitor. all
will enable monitor for all devices, disable
will disable HDD temperature monitor. Default is all
.
Vertical layout: Use vertical layout instead of horizontal one.
-Add stretch: Add stretch (spacer) to the selected side of the widget.
+Enable tooltip: Check to enable preview on selected destkop. Default is true
. Also you show specify type of preview, default is Windows
.
Tooltip width: Using tooltip width in px. Default is 200px
.
Color of window borders: Color of window contours which are used in "Contours preview". Default is #ffffff
.
Mark: Type symbol (or string) which will be shown if this desktop is active now.
@@ -615,6 +609,10 @@ sudo make install$mark
$fullmark
$mark
, but shows empty space too.$name
Command: Type command which will be run on left click on the selected desktop. Available variables are same as for pattern. Default is dbus org.kde.kwin /KWin setCurrentDesktop $number
.
Panel toggle: Select panels which will be set hidden on hotkey.
diff --git a/resources/papers/single-door.jpg b/resources/papers/single-door.jpg new file mode 100644 index 0000000..850e953 Binary files /dev/null and b/resources/papers/single-door.jpg differ diff --git a/ru/_posts/2014-12-12-encryption-home-directory.html b/ru/_posts/2014-12-12-encryption-home-directory.html new file mode 100644 index 0000000..0afda3f --- /dev/null +++ b/ru/_posts/2014-12-12-encryption-home-directory.html @@ -0,0 +1,172 @@ +--- +category: ru +type: paper +hastr: true +layout: paper +tags: linux, systemd, ecryptfs +title: Как зашифровать хомяк и не об%$#аться. For dummies +short: ecnryption-home-directory +description:s/$USER/имя пользователя/
):
+
+{% highlight bash %}
+mv /home/{$USER,$USER-org}
+mkdir /home/$USER
+chmod 700 /home/$USER
+chown $USER:users /home/$USER
+{% endhighlight %}
+
+ Самое распространенное решение в интернетах - воспользоваться автоматическими тулзами. Однако в нашем случае они не подходят, так как нам необходимо импортировать сигнатуру ключа / пароля, что при данном решении невозможно (или у автора руки кривые).
+ +Делается шифрование следующим образом (lol):
+ +{% highlight bash %} +mount -t ecryptfs /home/$USER /home/$USER +{% endhighlight %} + +В процессе он у нас задаст несколько вопросов (я предлагаю первое монтирование делать в интерактивном режиме). Ответы можно взять примерно такие (в комментариях показано, что эти опции делают), обратите внимание, что если вы что то измените, то изменится и некоторые строчки далее:
+ +{% highlight bash %} +# ключ или сертификат. Второе надежнее, но до тех пор пока не потеряете %) +Select key type to use for newly created files: + 1) passphrase + 2) openssl +Selection: 1 +# пароль +Passphrase: +# шифрование, ставим берем дефолт +Select cipher: + 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 + 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56 + 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 + 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32 + 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32 + 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 +Selection [aes]: 1 +# размер ключа, берем дефолт +Select key bytes: + 1) 16 + 2) 32 + 3) 24 +Selection [16]: 1 +# разрешать читать/писать в нешифрованные файлы в точке монтирования +Enable plaintext passthrough (y/n) [n]: n +# включить шифрование имен файлов +Enable filename encryption (y/n) [n]: y +Filename Encryption Key (FNEK) Signature [360d0573e701851e]: +# многабукафниасилил +Attempting to mount with the following options: + ecryptfs_unlink_sigs + ecryptfs_fnek_sig=360d0573e701851e + ecryptfs_key_bytes=16 + ecryptfs_cipher=aes + ecryptfs_sig=360d0573e701851e +WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt], +it looks like you have never mounted with this key +before. This could mean that you have typed your +passphrase wrong. + +# подтверждаем, выходим +Would you like to proceed with the mount (yes/no)? : yes +Would you like to append sig [360d0573e701851e] to +[/root/.ecryptfs/sig-cache.txt] +in order to avoid this warning in the future (yes/no)? : yes +Successfully appended new sig to user sig cache file +Mounted eCryptfs +{% endhighlight %} + +Далее просто копируем файлы из родного хомяка:
+ +{% highlight bash %} +cp -a /home/$USER-org/. /home/$USER +{% endhighlight %} + +Создадим файл на флешке (я использовал microSD) со следующим содержанием (пароль только поставьте свой):
+ +{% highlight bash %} +passphrase_passwd=someverystronguniqpassword +{% endhighlight %} + +Добавим автомонтирование флешки (направление /mnt/key
) в fstab
с опцией ro
, например так:
Теперь настроим монтирование хомяка. Опции монтирования можно подглядеть как то так:
+ +{% highlight bash %} +mount | grep ecryptfs +{% endhighlight %} + +Однако замечу, что там указаны не все опции, необходимо добавить также key
, no_sig_cache
, ecryptfs_passthrough
. Таким образом, для systemd mount-юнит выглядит примерно так (любители shell-простыней смогут написать свой демон, потому что через fstab
не сработает просто так (см. ниже)).
XXXXX
нужно заменить на сигнатуру из опций, с которыми сейчас смонтирована директория. Также нужно вставить имя пользователя и отредактировать путь к файлу с паролем (и имя mount-юнита), если это необходимо. Автозагрука:
Сервис для отмонтирования флешки, когда она не нужна будет:
+ +{% highlight bash %} +# cat /etc/systemd/system/umount-key.service +[Unit] +Description=Unmount key card +Before=local-fs.target +After=home-arcanis.mount + +[Service] +Type=oneshot +ExecStart=/usr/bin/umount /mnt/key + +[Install] +WantedBy=local-fs.target +{% endhighlight %} + +Включаем:
+ +{% highlight bash %} +systemctl enable umount-key.service +{% endhighlight %} + +Перезагружаемся, если все ок, удаляем бекап. Если нет - значит что то где то неправильно сделали, восстанавливаем из режима восстановления.
+ +В моем случае, мне не получилось заставить флешку монтироваться раньше. Таким образом на загрузке я попадал в консоль восстановления из которой нужно было просто продолжить загрузку. Существующие в интернете методы предлагают два возможных варианта:
+ +rc.local
.rc.local
.Оба варианта меня не устроили в виду их костыльности.
+ +Другое распространенное предложение - монтировать через запись в настройках pam. Мне этот вариант не подходит, так как у меня авторизация беспарольная по отпечатку пальца.
\ No newline at end of file diff --git a/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html b/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html new file mode 100644 index 0000000..edecc73 --- /dev/null +++ b/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html @@ -0,0 +1,138 @@ +--- +category: ru +type: paper +hastr: true +layout: paper +tags: awesome-widgets, pytextmonitor +title: Awesome Widgets 2.1 - свистелки и перделки +short: aw-v21-bells-and-whistles +description: Данная статья посвящена обсуждению настройки своих скриптов и графических баров в новой версии Awesome Widgets (2.1). +--- +Для начала, я настоятельно рекомендую для после обновления не открывая настроек виджета скопировать в безопасное место файл $HOME/.kde4/share/config/extsysmon.conf
, так как старые настройки кастомных скриптов теперь несовместимы. Вообще, следует заметить, что обе новых фичи можно настраивать и из графического интерфейса, однако я опишу, как это делается простым редактированием desktop файлов.
Бары хранятся в двух директориях: /usr/share/apps/plasma_applet_awesome-widget/desktops/
и $HOME/.kde4/share/apps/plasma_applet_awesome-widget/desktops/
(пути могут немного отличаться в зависимости от используемого дистрибутива). Настройки в домашней директории перезаписывают глобальные настройки. Файлы настроек имеют следующие поля:
Поле | +Обязательное | +Значение | +По-умолчанию | +
---|---|---|---|
Name | +да | +имя бара. Должно иметь вид barN и быть уникальным |
+ none | +
Comment | +нет | +комментарий | +empty | +
X-AW-Value | +да | +значение бара. Доступны теги cpu* , gpu , mem , swap , hdd* , bat |
+ cpu | +
X-AW-ActiveColor | +да | +заполнение активной части в формате R,G,B,A |
+ 0,0,0,130 | +
X-AW-InactiveColor | +да | +заполнение неактивной части в формате R,G,B,A |
+ 255,255,255,130 | +
X-AW-Type | +да | +тип бара. Поддерживаемые типы Horizontal , Vertical , Circle |
+ Horizontal | +
X-AW-Direction | +да | +направление заполнения. Доступны варианты LeftToRight , RightToLeft |
+ LeftToRight | +
X-AW-Height | +да | +высота в пикселях | +100 | +
X-AW-Width | +да | +ширина в пикселях | +100 | +
Скрипты хранятся в двух директориях: /usr/share/apps/plasma_engine_extsysmon/scripts/
и $HOME/.kde4/share/apps/pplasma_engine_extsysmon/scripts/
(пути могут немного отличаться в зависимости от используемого дистрибутива). Настройки в домашней директории перезаписывают глобальные настройки. Для того, чтобы активировать скрипт необходимо прописать нужный тег в поле вывода. Файлы настроек имеют следующие поля:
Поле | +Обязательное | +Значение | +По-умолчанию | +
---|---|---|---|
Name | +да | +имя скрипта | +none | +
Comment | +нет | +комментарий | +empty | +
Exec | +да | +путь к исполняемому файлу | +/usr/bin/true | +
X-AW-Prefix | +нет | +префикс к исполняемому файлу. Обычно не требуется, однако в отдельных случаях может потребоваться явно указать путь, например, к используемому интерпретатору | ++ |
X-AW-Active | +нет | +активен или нет данный скрипт | +true | +
X-AW-Output | +нет | +имеет ли данный скрипт сообщения в консоль. Полезно выставить в false , если вы хотите использовать скрипт, как аналог задач в cron |
+ true | +
X-AW-Redirect | +нет | +перенаправление потоков сообщений. Доступны варианты stderr2stdout , nothing , stdout2stderr . stderr доступен, если запустить с DEBUG=yes |
+ nothing | +
X-AW-Interval | +да | +интервал запуска скрипта в стандартных интервалах обновления виджета | +1 | +
{% include shortdate_to_ru.html %}
-{{ post.description }} +{{ post.description }}
Тэги: {{ post.tags }}
{% endfor %} diff --git a/ru/projects/awesome-widgets.html b/ru/projects/awesome-widgets.html index 5a1fdb3..2357f20 100644 --- a/ru/projects/awesome-widgets.html +++ b/ru/projects/awesome-widgets.html @@ -108,14 +108,6 @@ sudo make install/sys/class/power_supply/
.wget -qO- http://ifconfig.me/ip
. Разделитель @@
.qdbus org.kde.kwin /KWin currentDesktop
.nvidia
(для nVidia), ati
(для ATI Radeon), disable
или auto
. По умолчанию auto
.AC offline тег: Строка, которая будет показана, когда AC оффлайн. По умолчанию ( )
.
Проверять обновления: Проверять или нет обновления при запуске. По умолчанию проверять
.
Начиная с версии 1.7.0, поля CPU, частота CPU, память, swap, сеть и батарея поддерживают графический тултип (всплывающая подсказка). Чтобы включить их, просто сделайте требуемые чекбоксы полностью чекнутыми. Число хранимых значений может быть установленно во вкладке. Цвета графиков настраиваются тоже.
+Начиная с версии 1.7.0, поля CPU, частота CPU, память, swap, сеть и батарея поддерживают графический тултип (всплывающая подсказка). Чтобы включить их, просто сделайте требуемые чекбоксы полностью чекнутыми. Число хранимых значений может быть установлено во вкладке. Цвета графиков настраиваются тоже.
Устройства ACPI: Путь к устройствам ACPI. По умолчанию /sys/class/power_supply/
.
Своя команда: Команды, которые будут запущены для соответствующего поля. Например, wget -qO- http://ifconfig.me/ip
вернет внешний IP.
Комадна для определения рабочего стола Введите команду, которая будет запущеная для desktop DataEngine. По умолчанию qdbus org.kde.kwin /KWin currentDesktop
.
Устройство GPU: Выберете одно из поддерживаемых устройств GPU. auto
включит автоматическое определение устройства, disable
отключит все мониторы GPU. По умолчанию auto
.
HDD: Выберете один из HDD для монитора температуры HDD. all
включит монитор для всех доступных устройств, disable
отключит монитор температуры HDD. По умолчанию all
.
Вертикальная разметка: Использовать вертикальную разметку вместо горизонтальной.
-Добавить пустое пространство: Добавить пустое пространство в указанное место виджета.
+Включить тултип: Включать или нет графическое превью выбранного рабочего стола. Вы также должны указать тип превью, по умолчанию Окна
.
Ширина тултипа: Ширина тултипа в пикселях. По умолчанию 200px
.
Цвет границ окна: Цвет рамок окон в тултипе "Контуры". По умолчанию #ffffff
.
Метка Введите символ (или строку), которая будет показана, если данный рабочий стол сейчас активен.
@@ -616,6 +610,10 @@ sudo make install$mark
$fullmark
$mark
, но показывать пустое место.$name
Команда: Введите команду, которая будет запущена по клику левой кнопкой мыши на выбранном рабочем столе. Доступны те же переменные, что и для шаблонов. По умолчанию dbus org.kde.kwin /KWin setCurrentDesktop $number
.
Скрытие панелей: Выберите панели, которые будут скрыты при нажатии на горячую клавишу.