Puppet

Installation
1. Install and configure Puppet on server (/etc/puppet/fileserver.conf)
http://www.panticz.de/install-puppet-server-puppetmaster
2. On client: Install Puppet client
http://www.panticz.de/install-puppet-client
3. On client: apply for certificate (puppet agent --test)
4. On server: confirm certificate (puppet cert sign dev2.lab)
5. On server: configure modules (/etc/puppet/modules/MODULE_NAME/manifests/init.pp)
6. On server: prepare files (/etc/puppet/modules/MODULE_NAME/files)
7. Configure clients (/etc/puppet/manifests/site.pp)

Magento: Create top category offer box

Create a top category offer box on Magento front page linked to a category and filled with one of selected products from a hidden category.

/var/www/app/design/frontend/default/default/template/catalog/product/top-category.phtml
<?php
$URL="http://www.panticz.de/sites/default/files/magento/home/top-category.phtml";
echo "Download: $URL";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

debian_xen_host.cfg

# /etc/icinga/objects/debian_xen_host.cfg

define host {
host_name srv1
address 192.168.1.1
use generic-host
hostgroups raid1, debian
}

define service {
use generic-service
host_name srv1
service_description ssh_check_mem
check_command ssh_check_mem!20!10
}

define service {
use generic-service
host_name srv1
service_description ssh_check_load
check_command ssh_check_load!15!10!5!30!25!20
}

define service {
use generic-service
host_name srv1
service_description ssh_check_procs
check_command ssh_check_p

extinfo_icinga.cfg

# /etc/icinga/objects/extinfo_icinga.cfg

# icon path
# /usr/share/icinga/htdocs/images/logos/base/

define hostextinfo{
hostgroup_name snom
icon_image base/phone.png
icon_image_alt VoIP phone
}

define hostextinfo{
hostgroup_name mx
icon_image base/mail.png
icon_image_alt Mailserver
}

define hostextinfo{
hostgroup_name printer
icon_image base/printer.png
icon_image_alt Printer
}

define hostextinfo{
hostgroup_name debian
icon_image base/debi

SSH server enable / disable password authentication

Enable
sed -i 's|[#]*PasswordAuthentication no|PasswordAuthentication yes|g' /etc/ssh/sshd_config
sed -i 's|UsePAM no|UsePAM yes|g' /etc/ssh/sshd_config
service ssh restart

Disable (don´t forget to install pre-shared-key first: http://www.panticz.de/ssh_pre-shared-key_authentication)
<?php
$URL="https://raw.githubusercontent.com/panticz/scripts/master/disable_ssh_password_authentication.sh";
echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

# LXC
# disable login without password
lxc-attach -n ${CONTAINER} -- sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
lxc-attach -n ${CONTAINER} -- sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
lxc-attach -n ${CONTAINER} -- service ssh restart

# generate SSH key for root
lxc-attach -n ${CONTAINER} -- ssh-keygen -q -f /root/.ssh/id_rsa -N ''