Viewing posts for the category Omarine User's Manual
Making an Omarine installation USB stick
Random Number Generator is an important factor of security activity to create cryptographic keys and passwords.
I know among more than one thousand of our subscribers there are many webmasters, so I write this article to share an experience of sending emails automatically when a post is updated, using Python - Django for a multilingual site.
The key here is that with a large number of recipients, on the other hand the email content for each person is different, therefore it must be sent one by one and sending time lasts up to several minutes, so choosing a point of time to send the emails is important.
When you click the "Save" button in the admin page, a request chain starts with a POST request. We should not send emails during this time but need to wait for the entire request chain finishing and the response returns a successful save message.
But when the request finished, there is no information about the saved post. Therefore, have to retrieve the data in advance, in the operation phase "Save".
We need signals for activities. Usually Django provides the post_save signal, it is sent when a model is saved. But post_save is not suitable in this case because for multilingual model there will be multiple post_save signals sent.
We need to define a signal, for example:
This article is the last in 10 articles about security policy with detailed example programs. After reading these 10 articles, you have a basic knowledge to master your SELinux system. SELinux is still a tough topic in the open source community but now you find it not too complicated, right?
This article complements the previous article about the
audit2allow utility, applying audit2allow to practice adding rules to the policy for a required operation.
When you create a virtual environment for Python, you can add and remove modules (Python) at your discretion without having to be root. Currently we need to add a rule to uninstall the modules. The uninstall script will create a temporary file, which by default has the type
user_tmp_t and it needs to be changed to
user_home_t for processing (similar to the myapp program to be transitioned its temporary file to type myapp_tmp_t).
For example, when we uninstall the dnspython module, the operation is denied with the following Python message:
PermissionError: [Errno 13] Permission denied: '/tmp/pip-uninstall-7ehq5lz7/home/tuyen/python-env/mysite/lib/python3.7/site-packages/dns/__init__.py'
Assume the current user is staff_u with domain
staff_t. audit2allow will detect rule:
Using audit2allow to generate rules
audit2allow is a utility that generates rules from logs of denied operations. It suggests rules for those operations to succeed. To see the suggested rules, run the following command, as the
Can't see mail in Inbox? Check your Spam folder.