Skip to content

Instantly share code, notes, and snippets.

View mklooss's full-sized avatar

Mathis Klooß mklooss

View GitHub Profile
@mklooss
mklooss / gist:4528773
Last active March 12, 2019 19:46
Magento - Delete in Collection in one request
<?php
class Something_Asdf_Model_Resource_Halma_Collection
extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
/**
* delete all the entities in the collection
*
* @return $this
*/
public function delete()
@mklooss
mklooss / php-tools-with-mysql-ssl-connection.txt
Created February 8, 2019 07:11
PHP - MySQL or MariaDB SSL
Magento 1.x
> https://github.com/kschroeder/Magento_Mysql_SSL ( https://github.com/mklooss/Magento_Mysql_SSL )
Wordpress
> https://wordpress.org/plugins/secure-db-connection/
Shopware
> TBD
@mklooss
mklooss / pingdom_create.php
Created November 14, 2018 15:16
just an small script to add an host
<?php
$check = 'https://www.example.asdf/';
$login = 'asdf@xyz:P4ssw0rd';
$apiKey = '';
$checkType = parse_url($check, PHP_URL_SCHEME);
$checkHost = parse_url($check, PHP_URL_HOST);
$checkUrl = parse_url($check, PHP_URL_PATH);
@mklooss
mklooss / letsencrypt-update-failed.sh
Last active November 8, 2018 06:50
nginx / letsencrypt check
#!/bin/bash
sleep 10
PSAUX=$(ps aux | grep nginx | grep -v grep)
if [ -z "$PSAUX" ]; then
/etc/init.d/nginx stop
PID=$(netstat -tulnop | grep 443 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs)
for p in $PID; do
echo $p
@mklooss
mklooss / magento_remove_some_data.sql
Last active October 18, 2018 08:00
remove some Magento Data for Development Systems
--
-- Remove Orders
--
DELETE FROM sales_flat_order;
DELETE FROM sales_flat_creditmemo_comment;
DELETE FROM sales_flat_creditmemo_item;
DELETE FROM sales_flat_creditmemo;
DELETE FROM sales_flat_creditmemo_grid;
DELETE FROM sales_flat_invoice_comment;
@mklooss
mklooss / shopware-config.php
Last active October 16, 2018 06:47
Shopware REDIS
<?php return array (
'db' => [
'host' => '127.0.0.1',
'port' => '3306',
'username' => 'xxxxxxx',
'password' => 'xxxxxxx',
'dbname' => 'xxxxxxx',
],
'model' => [
'redisHost' => '127.0.0.1',
@mklooss
mklooss / logrotate.sh
Created September 7, 2018 06:39
change values of logroate
sed -i 's/rotate 52/rotate 14/g' /etc/logrotate.d/nginx
sed -i 's/rotate 7/rotate 2/g' /etc/logrotate.d/proftpd-basic
sed -i 's/monthly/weekly/g' /etc/logrotate.d/proftpd-basic
sed -i 's/rotate 4/rotate 2/g' /etc/logrotate.d/rsyslog
sed -i 's/rotate 12/rotate 2/g' /etc/logrotate.d/php5.6-fpm
sed -i 's/rotate 12/rotate 2/g' /etc/logrotate.d/php7.0-fpm
sed -i 's/rotate 12/rotate 2/g' /etc/logrotate.d/php7.1-fpm
sed -i 's/rotate 12/rotate 2/g' /etc/logrotate.d/php7.2-fpm
sed -i 's/rotate 4/rotate 2/g' /etc/logrotate.d/fail2ban
sed -i 's/rotate 30/rotate 14/g' /etc/logrotate.d/*
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.18.5 Kernel Configuration
#
#
# Compiler: arm-linux-gnueabihf-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
@mklooss
mklooss / --etc--dnsmasq.d--trust-anchror.conf
Last active July 26, 2018 06:57
/etc/dnsmasq.d/trust-anchror.conf
# ~ /etc/dnsmasq.d/trust-anchror.conf
# from 2018-07-26
# https://data.iana.org/root-anchors/root-anchors.xml
trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
@mklooss
mklooss / .htaccess redirect
Created July 19, 2018 12:02
no one use apache http anymore
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.Domain\.de$ [NC]
RewriteRule ^(.*)$ https://www.Domain.de/$1 [L,R=301]