Skip to content

Instantly share code, notes, and snippets.

View mklooss's full-sized avatar

Mathis Klooß mklooss

View GitHub Profile
@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]
@mklooss
mklooss / pssh-sample.bash
Created April 16, 2018 13:42
pssh Samples
#!/bin/bash
parallel-ssh -i -h pssh.txt "sudo DEBIAN_FRONTEND=noninteractive apt-get update"
parallel-ssh -i -h pssh.txt "sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/nginx && sudo /etc/init.d/nginx restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php5-fpm && sudo /etc/init.d/php5-fpm restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php5.6-fpm && sudo /etc/init.d/php5.6-fpm restart"
@mklooss
mklooss / fixAttributes.php
Created February 26, 2018 10:27
An Extension f**ked up the Database Shema
<?php
$store_id = 4;
/*
Becarefull this Script will remove all other data only Store ID 0 and $store_id will be keep!
An Extension made changes direct in the Database but, GLOBAL Attributes has been unable to edit, yay!
Our sample store was an Sinlge Store System, so we could copy all Data from Store View to Base.
*/
require_once 'app/Mage.php';
@mklooss
mklooss / 1_database_export_import_readme.txt
Last active May 22, 2024 09:51
Export MySQL/MariaDB Database in Tables
Written on Debian Based Systems
usage: mysql_[import|export].sh DATABASENAME
Splits Database in to multplie files, based on Table Names
schema.sql will be also created!
i've an my_import.cnf / my_export.cnf or exists, this files will be used as Credentails, default is the debian default file.
Files: schema.sql, routines_triggers.sql
@mklooss
mklooss / 1_hhvm.md
Last active September 12, 2019 08:26
Build HHVM on Debian Stretch

INIT

rm -rf /opt/hhvm

apt-get build-dep uw-imap -y
apt-get -y install libssl1.0-dev
apt-get -y install libgd2-xpm-dev (or the next one!)
apt-get -y install libgd-dev
apt-get -y install autoconf automake binutils-dev bison build-essential \
    cmake debhelper g++ gawk git gperf libboost-context-dev \
@mklooss
mklooss / mainboard_info.sh
Created July 27, 2017 06:39
get mainboard info
# get Mainboard Info
dmidecode -t 2
# get Bios and Mainbord info
dmesg | grep DMI:
@mklooss
mklooss / compile.sh
Created July 4, 2017 05:40
Compile with different Libs
#!/bin/bash
C_DIR=/opt/app
PKG_CONFIG_PATH="${C_DIR}/lib/pkgconfig" \
LD_LIBRARY_PATH="${C_DIR}/lib" \
CPPFLAGS="-I${C_DIR}/include" \
LDFLAGS="-L${C_DIR}/lib" ./configure --prefix=$C_DIR