Create UEFI disc

# create disc image
mkfs.msdos -C /tmp/uefi.iso 2880
sudo mount /tmp/uefi.iso /mnt
sudo cp /tmp/your_uefi_files/* /mnt/
sudo umount /mnt
# boot to UEFI shell
press F11 on boot
# go to UEFI filesystem
# Links

Debian: Install Cacti

# create container
export CONTAINER=cacti
wget -q --no-check-certificate -O - | bash -s -- -f
sudo lxc-attach -n ${CONTAINER} -- sed -i 's|PermitRootLogin without-password|PermitRootLogin yes|' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- service ssh restart

# fix dns
echo nameserver > /var/lib/lxc/${CONTAINER}/rootfs/etc/resolv.conf

# install applications
lxc-attach -n ${CONTAINER} --

apt-get update

# server
debconf-set-selections <<\EOF

Install LXD

wget -O - | bash -


sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-lxc/lxd-stable

# use Ubunut Trusty repository on Utopic
sed -i 's|utopic|trusty|g' /etc/apt/sources.list.d/ubuntu-lxc-ubuntu-lxd-stable-utopic.list

sudo apt-get update
sudo apt-get install -y lxd lxc lxcfs


Compare zones between two Nameserver

for TYPE in A CNAME MX TXT; do
    for i in $(cat /tmp/ | grep ${TYPE} | cut  -f1); do
        OLD=$(dig @${OLD_NS} +short ${TYPE} ${i}
        NEW=$(dig @${NEW_NS} +short ${TYPE} ${i}
        if [ "${NEW}" != "${OLD}" ]; then
            echo ${TYPE} ${i}
            echo OLD: ${OLD}
            echo NEW: ${NEW}


-- enable formated output
\x on
-- show tables
-- exit

Compile lshw

# install required applications
apt-get -y install build-essential
# download and extract
wget -P /tmp
tar xzf /tmp/lshw-B.02.17.tar.gz -C /tmp/
# compile
cd /tmp/lshw-*/
# install (optional)
make install
# test
lshw -version
# executable
# Links

Debian: Install MariaDB

wget -O - | bash -


apt-get install python-software-properties

apt-key adv --recv-keys --keyserver 0xcbcb082a1bb943db
add-apt-repository 'deb wheezy main'
apt-get update

apt-get install -y mariadb-server

Debian Wheezy: Install PHP 5.6

apt-get install -y wget

# install PHP 5.6
echo "deb wheezy-php56 all" > /etc/apt/sources.list.d/
echo "deb-src wheezy-php56 all" >> /etc/apt/sources.list.d/
wget -O - | apt-key add -

apt-get update

apt-get install php5

a2enmod php5
service apache2 restart



export CONTAINER=wordpress

wget -q --no-check-certificate -O - | bash -s -- -f

sudo lxc-attach -n ${CONTAINER} -- sed -i 's|PermitRootLogin without-password|PermitRootLogin yes|' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- service ssh restart = veth = up = lxcbr0 = eth0 = 00:16:3e:f9:d3:03 = 1500

apt-get install -y apache2 mysql-server php5-mysql wget vi php5
# libapache2-mod-auth-mysql

cd /var/www/html
tar -xzvf latest.tar.gz

# create database
echo "CREATE DATABASE wordpress;" | mysql -u root -proot
echo "CREATE USER wordpressuser@localhost;" | mysql -u root -proot
echo "SET PASSWORD FOR wordpressuser@localhost= PASSWORD('password');" | mysql -u root -proot
echo "GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';" | mysql -u root -proot
echo "FLUSH PRIVILEGES;" | mysql -u root -proot

cp wordpress/wp-config-sample.php wordpress/wp-config.php

sed -i 's|database_name_here|wordpress|' wordpress/wp-config.php
sed -i 's|username_here|wordpressuser|' wordpress/wp-config.php
sed -i 's|password_here|password|' wordpress/wp-config.php

vi wordpress/wp-config.php

#define('WP_ALLOW_REPAIR', true);
#define('DB_CHARSET', 'utf8');

define('DB_CHARSET', 'latin1');
define('FS_METHOD', 'direct');
define( 'WP_MEMORY_LIMIT', '96M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

chown www-data:www-data /var/www/html/wordpress/ -R

# show errors
# wp-config.php
define('WP_DEBUG', true);

# configuration
UPDATE wp_options
SET option_value = REPLACE(option_value, '', '')
WHERE option_value LIKE ''

#UPDATE wp_options SET `option_value` = '' WHERE `wp_options`.`option_id` = 5;
#UPDATE wp_users SET user_email = '' WHERE ID = 1;

# reset password
UPDATE wp_users SET user_pass = MD5('new_pass') WHERE ID = 1;

# wordpress extract script
# wi.php

# fix URL
UPDATE wp_posts
SET post_content = REPLACE(post_content, '', '')
WHERE post_content LIKE ''

UPDATE wp_posts
SET guid = REPLACE(guid, '', '')
WHERE guid LIKE ''

# Links

DMA (Dragonfly Mail Agent)

# ansible role

# preconfigure
echo "dma dma/relayhost string" | debconf-set-selections
echo "ddm dma/mailname string $(hostname -A)" | debconf-set-selections

# install
apt-get install -y dma

# configure relayhost
echo "foo|" >> /etc/dma/auth.conf

# send testmail
echo "This is a test message from ${USER}@${HOSTNAME} at $(date)" | /usr/sbin/sendmail

Configuration files
# /etc/dma/dma.conf
AUTHPATH /etc/dma/auth.conf

Syndicate content