selinux unter CentOS deaktivieren / Disable selinux on CentOS (solution)

31. Januar 2022 at 13:18
banner

selinux unter centos deaktivieren

$ sudo yum install nano -y ; sudo nano /etc/selinux/config
Suchen Sie die Zeile SELINUX=enforcing
This file controls the state of SELinux on the system.
SELINUX= can take one of these three values:
enforcing – SELinux security policy is enforced.
permissive – SELinux prints warnings instead of enforcing.
disabled – No SELinux policy is loaded.
SELINUX=enforcing
SELINUXTYPE= can take one of three two values:
targeted – Targeted processes are protected,
minimum – Modification of targeted policy. Only selected processes are protected.
mls – Multi Level Security protection.
SELINUXTYPE=targeted

und ändern Sie den Wert auf “disabled”.

SELINUX=disabled
Starten Sie Linux anschließend neu.

$ sudo shutdown -r now
Um zu prüfen, ob SELinux erfolgreich deaktiviert wurde, geben Sie folgenden Befehl in die Kommandozeile ein:

$ getenforce
Wenn die Einstellung erfolgreich übernommen wurde, erhalten Sie die Ausgabe: “Disabled”.

how do I import an sql file using the command line in mysql

27. Juli 2021 at 18:35

A common use of mysqldump is for making a backup of an entire database:

shell> mysqldump db_name > backup-file.sql

You can load the dump file back into the server like this:

UNIX

shell> mysql db_name < backup-file.sql shell> zcat myfile.sql.gz | mysql -u root -ppassword mydb

The same in Windows command prompt:

mysql -p -u [user] [database] < backup-file.sql

Windows PowerShell

C:> cmd.exe /c "mysql -u root -p db_name < backup-file.sql"

MySQL command line

mysql> use db_name;
mysql> source backup-file.sql;

Please share this article von facebook & google plus or where you want, thank you!

(Solution) xampp apche access error: „Apache2: ‚AH01630: client denied by server configuration'“

2. Mai 2017 at 19:16

If you are using Apache 2.4

You have to check allow and deny rules

Check out http://httpd.apache.org/docs/2.4/upgrading.html#access

In 2.2, access control based on client hostname, IP address, and other characteristics of client requests was done using the directives Order, Allow, Deny, and Satisfy.

In 2.4, such access control is done in the same way as other authorization checks, using the new module mod_authz_host.

The new directive is Require:

2.2 configuration:

Order allow,deny
Allow from all

2.4 configuration:

Require all granted

Also don’t forget to restart the apache server after these changes (# service httpd restart)

Please share this article von facebook & google plus or where you want, thank you!

Lösung: desinfect 2016 / 2017 – AVIRA key expired | ERROR apt-get update – apt-transport-https benötigt

5. Januar 2017 at 18:20

Solltet ihr die desinfect cd/dvd oder usb-stick von heise verwenden zwecks Trojan, Spyware, Virus, etc. scans und Avira euch melden dass der update key für die signatur-updates veraltet oder ungültig ist … hier die Lösung:

Anleitung bei heise:
https://www.heise.de/forum/heise-Security/Themen-Hilfe/Desinfect/Re-Generelle-Probleme/posting-29580220/show/

Alternative Anleitung apt-transport-https direkt aus „deb http://archive.ubuntu.com/…“ installieren

Steps:
sudo vi /etc/apt/source.list
mit # deaktivieren > #deb http://www.heise.de/...
ohne # aktivieren > deb http://archive.ubuntu.com/...
mit :wq speichern
sudo apt-get update
sudo apt-get install apt-transport-https
sudo vi /etc/apt/source.list
ohne # aktivieren > deb http://www.heise.de/...
mit # deaktivieren > # deb http://archive.ubuntu.com/...
mit :wq speichern
sudo apt-get update
sudo apt-get -y dist-upgrade
prüfe ob update installiert mit
sudo dpkg -l desinfect-meta
> checke version 20160919-2
sudo /AntiVir/scancl --version
> checke key expieres Jul 31 2017

Please share this article von facebook & google plus or where you want, thank you!

WordPress: Remove IP-Logging on WordPress Comments (Solution)

12. Dezember 2016 at 13:39

Wordpress logo

Add this to your functions.php:

add_filter('pre_comment_user_ip', 'no_ips');
function no_ips($comment_author_ip){
    return '';
}

You’ll still have the comment_author_IP field in the db, but it will be empty…

And to remove existing IP records from the db run this query:

UPDATE `wp_comments` SET `comment_author_IP` = ''

Please share this article von facebook & google plus or where you want, thank you!

 

Magento Connect Error: „Access is locked. Please try again in a few minutes.“ (solution)

25. Oktober 2016 at 15:37

magento-connect-login-error

First Solution

Check the file var/brute-force.ini in the Magento-Root-Folder. The Content is like this:

brute-force-bad-attempts-count = 0
brute-force-diff-time-to-attempt = 180

Set the content to this and try again. If it not work check the second solution now!

Second Solution

A other reason behind that is that the Magento Connect Manager has not been initiated by a previous install/upgrade. It could be because this store has been installed by transferring files via FTP.

Thus, the only method to upgrade you’ve got is by the CLI.

First, you need to ensure the permissions are right:

chmod 550 ./mage

Then you’ve got to initiate the mage:

./mage mage-setup .

And set your preferred state for the configuration:

./mage config-set preferred_state stable

Now, with a previously setup mage you could have run the following:

./mage list-installed
./mage list-upgrades

And then upgrade like this:

./mage upgrade-all

But in your case this won’t list nor upgrade and you’ll have to force the install of the upgrade by doing the following:

./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force

Once the upgrade is done, don’t forget to reindex:

php shell/indexer.php reindexall

NB: after this upgrade, you’ll be able to see the list of packages in the connect manager.

 

Please share this article von facebook & google plus or where you want, thank you!

Data Migration from SEOShop to Magento – Migration Tool for SEOShop to Magento available

23. August 2016 at 18:48

magento ecommerce logo

I’m developed a SEOShop to Magento Migration Tool now for a customer.

If anyone searching a migration-tool which migrate all data (orders, products, categories, media-data, invoices, etc. pp.) feel free to connect me by email and I can offer you an fair offer! 🙂

It is also possible to use this SEOShop to Magento as Sync-Connector which transfer data automatically …

(Solution): MDN CrmTicket Bug when searching for a name and go back to Grid View

23. August 2016 at 18:18

firebug

In function „getCondition“ in der class
app/code/community/MDN/CrmTicket/Block/Admin/Widget/Grid/Column/Filter/CustomerName.php

change this buggy part

        if ($customerIdsSelected && sizeof($customerIdsSelected)>0) {
            if((count($customerIdsSelected) == 1) && count($customerIdsSelected[0] > 0)) {
                return array('in' => $customerIdsSelected);
            } else {
                return null;
            }
        }
        else
          return null;
      }

to

        if ($customerIdsSelected && sizeof($customerIdsSelected)>0) {
            if(count($customerIdsSelected) == 1 && count($customerIdsSelected[0]) > 0) {
                return array('in' => $customerIdsSelected);
            } else {
                return null;
            }
        }
        else
          return null;
      }

BTW: The programmer from MDN-CrmTicket unfortunately disregard both Zend and Magento Coding Style Guide! 🙁

 

Please share this article von facebook & google plus or where you want, thank you!

Odoo / python: Install pysftp from source under linux

18. August 2016 at 10:46

python-logo-web

If you get the following error when you install the odoo backup plugin:

Odoo Server Error

‚This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)‘)
ImportError: This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)

You need to manually install pysftp module.

First download the module:

wget https://pypi.python.org/packages/36/60/45f30390a38b1f92e0a8cf4de178cd7c2bc3f874c85430e40ccf99df8fe7/pysftp-0.2.9.tar.gz
tar xvzf pysftp-0.2.9.tar.gz
rm pysftp-0.2.9.tar.gz

Then install libffi:

sudo apt-get install libffi-dev

move into the exctracted pysftp-0.2.9 directory and run:

sudo python setup.py install

and finally restart odoo:

sudo service odoo-server restart

That should fix the issue

Please share this article von facebook & google plus or where you want, thank you!

Sending json data to a remote server – howto

21. April 2016 at 14:00

firebug

If you’re sending json requests there are different possible solutions on programming with php. Here some different explained:

1. Using Streams

‚method‘ => ‚POST‘,
‚content‘ => json_encode( $data ),
‚header’=> „Content-Type: application/json\r\n“ .
„Accept: application/json\r\n“
)
);

$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$response = json_decode($result);
var_dump($response);

2. Raw HTTP Post

Using Zend Framework’s HTTP client: http://framework.zend.com/manual/en/zend.http.client.advanced.html#zend.http.client.raw_post_data

$json = json_encode($data);
$client = new Zend_Http_Client($url);
$client->setRawData($json, ‚application/json‘)->request(‚POST‘);
var_dump($client->request()->getBody());

3. Using Curl

<?php
$content = json_encode($data);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
        array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //curl error SSL certificate problem, verify that the CA cert is OK
$result     = curl_exec($curl);
$response   = json_decode($result);
var_dump($response);
curl_close($curl);
?>

4. Using Ajax

var data = <?php echo json_encode($data) ?>;
var url  = '<?php echo $url ?>';
jQuery.ajax({
    type: "POST",
    url: url,
    data: JSON.stringify(data),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(data){
        var jsonObj = jQuery.parseJSON(data);
        alert(jsonObj.encPassword);
    },
    failure: function(errorMsg) {
        alert(errorMsg);
    }
});

Please share this article von facebook & google plus or where you want, thank you!