journalctl --no-pager --unit=nginx
poniedziałek, 7 lutego 2022
środa, 21 kwietnia 2021
cPanel: An error occurred while attempting to unsuspend “USER”. The user “USER” is not in a suspended state.
cPanel: An error occurred while attempting to unsuspend “USER”. The user “USER” is not in a suspended state.
Remove broken tasks from:
rm /var/cpanel/taskqueue/*.json
and
/usr/local/cpanel/scripts/suspendacct USER
/usr/local/cpanel/scripts/unsuspendacct USER
wtorek, 9 marca 2021
myisamchk: error: 140 when opening MyISAM-table 'mysql/user.MYI'
myisamchk: error: 140 when opening MyISAM-table 'mysql/user.MYI'
Solution:
myisamchk -r -v -f mysql/user WITHOUT EXTENSION
czwartek, 4 lutego 2021
Elasticsearch tmp noexec - change tmp location
Edit
/etc/sysconfig/elasticsearch
put
echo ES_TMPDIR=/var/lib/elasticsearch/tmp
chmod 777 /var/lib/elasticsearch/tmp
wtorek, 26 stycznia 2021
.htaccess limit access to given resource
RewriteCond %{REQUEST_URI} ^(/file/path/file.php).*$
RewriteCond %{REMOTE_ADDR} !=192.168.1.0/24
RewriteCond %{REMOTE_ADDR} !=192.168.*
RewriteRule ^.*$ / [F]
środa, 20 stycznia 2021
Azure App Service + .well-known 404 error
- create directory .well-known with dot
- create web.config inside of .well-known with
<?xml version="1.0"?>
<configuration>
<system.web>
<!-- Make directory public. Allow anonymous users access to everything in this directory. -->
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<system.webServer>
<!-- Directory only contains plain text files. -->
<staticContent>
<mimeMap fileExtension=".*" mimeType="text/plain" />
</staticContent>
<!-- Only static files are allowed, so remove everything but the StaticFile handler. This also solves the issue with extensionless files returning a 404 Page Not Found. -->
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*" type="" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
</handlers>
</system.webServer>
</configuration>
Ubuntu force dhcp
wtorek, 14 lipca 2020
Docker container skip entrypoint
docker run -it --entrypoint="" NAME bash
czwartek, 5 marca 2020
wtorek, 3 marca 2020
Lock python-requests and other bots in htaccess
## Automated HTTP libraries
RewriteCond %{HTTP_USER_AGENT} ^.*(dav.pm/v|libwww-perl|urllib|python-requests|python-httplib2|winhttp.winhttprequest|lwp-request|lwp-trivial|fasthttp|Go-http-client|Java|httplib|httpclient|Zend_Http_Client).*$ [NC]
RewriteRule .* - [F,L]
## Commonly seen in DDoS attacks
RewriteCond %{HTTP_USER_AGENT} ^.*(CtrlFunc|w00tw00t|Apachebench).*$ [NC]
RewriteRule .* - [F,L]