czwartek, 30 marca 2023

ElasticSearch / OpenSearch: Could not initialize class com.sun.jna.Native

 ElasticSearch or OpenSearch error: 

 fatal error in thread [main], 

exiting

java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native

        at org.opensearch.systemd.Libsystemd.lambda$static$0(Libsystemd.java:47) ~[?:?]


Solution:

mkdir -p /var/lib/opensearch/tmp
chmod 777 /var/lib/opensearch/tmp

edit file: /etc/opensearch/jvm.options

-Djava.io.tmpdir=${OPENSEARCH_TMPDIR}
to
-Djava.io.tmpdir=/var/lib/opensearch/tmp

piątek, 25 lutego 2022

du -sh only given parition (ex root)

 du -h -x -d 1 /


-x = --one-file-system skip directories on different file system

-d = maximum depth

-h = human readable 

/ = partition

środa, 9 lutego 2022

OpenSSL check SSL cli

 OpenSSL check SSL: 

openssl s_client -showcerts -connect server.domain.com:465 smtp


OpenSSL check SSL expiration etc:

openssl s_client -showcerts -connect server.domain.com:465 | openssl x509 

ś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>