iSCSI (Test)

apt-get install open-iscsi
iscsiadm -m discovery -t sendtargets -p 192.168.254.227:3260
iscsiadm -m node -T iqn.2014-07.com.raidix:target0 -p 192.168.254.227:3260 --login
iscsiadm --mode session
fdisk -l /dev/sdd

iscsiadm -m node -T iqn.2014-07.com.raidix:target0 -p 192.168.254.227:3260 --logout

iscsit# server
apt-get install -y iscsitarget

sed -i 's|ISCSITARGET_ENABLE=false|ISCSITARGET_ENABLE=true|g' /etc/default/iscsitarget

mkdir /media/storage
dd if=/dev/zero of=/media/storage/lun1.img bs=1M count=512

cat <> /etc/ietd.conf
Target iqn.2001-04.com.example:stora

Install gopenvpn

# add repository
cat < /etc/apt/sources.list.d/gopenvpn.list
deb http://mirror.sifnt.net.au/linux jaunty main
deb-src http://mirror.sifnt.net.au/linux jaunty main
EOF

# update repository list
apt-get update -qq

# install gopenvpn
apt-get install -y gopenvpn

# configuration
copy your *.conf and *.pem files to /etc/openvpn/

# nm-applet config files
# ~/.gconf/system/networking/connections

# Links
http://gopenvpn.sourceforge.net/

Remove Add to compare

mkdir -p app/code/local/BlueAcorn/Catalog/Helper/Product/
cat < app/code/local/BlueAcorn/Catalog/Helper/Product/Compare.php
<?php
class BlueAcorn_Catalog_Helper_Product_Compare extends Mage_Catalog_Helper_Product_Compare {
public function getAddUrl($product) {
return false;
}
}
?>
EOF

mkdir app/code/local/BlueAcorn/Catalog/etc/
cat < app/code/local/BlueAcorn/Catalog/etc/config.xml
<?xml version="1.0"?>

1.0

Install Magento EasyFlags

cd /var/www/
./pear install magento-community/magento_easy_flags

# enable by sql
INSERT INTO core_config_data (scope, scope_id, path,value)
VALUES ('default', 0 ,'easy_flags/general/enabled', '1')
ON DUPLICATE KEY UPDATE value = '1';

Optional, disable css
cd /var/www/
mv ./skin/frontend/default/default/css/easyflags.css ./skin/frontend/default/default/css/easyflags.css.old

# clear cache
rm -r var/cache/

# enable in admin menu
change settings > Preferred State: "beta"
magento-community/magento_easy_flags

first LOGOUT and LOGIN again!

Admin > Templates-master >Eas

Magento SQLs

-- update magento directory path
UPDATE core_config_data SET value = 'http://www.example.com/' WHERE path = 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://www.example.com/' WHERE path = 'web/secure/base_url';

-- enable ssl on fronted and backend
USE magento;
UPDATE core_config_data SET value = 1 WHERE path = 'web/secure/use_in_frontend';
UPDATE core_config_data SET value = 1 WHERE path = 'web/secure/use_in_adminhtml';

-- clear cache
rm -r /var/www/var/cache/ /var/www/var/session/

-- disable cache
UPDATE core_cache_option SET value = 0;

-- disable redir

Magento tax creation SQL

-- delete all tax definitions
DELETE FROM tax_calculation_rule;
DELETE FROM tax_class;
DELETE FROM tax_calculation_rate;
DELETE FROM tax_calculation;

-- create tax_class
INSERT INTO tax_class(class_name, class_type) VALUES
('Umsatzsteuerpfichtige Güter 19%','PRODUCT'),
('Umsatzsteuerpfichtige Güter 7%','PRODUCT'),
('Umsatzsteuerfreie Güter','PRODUCT'),
('inkl.

Install nullmailer (very simple mail transport agent)

# preconfigure nullmailer
debconf-set-selections <<\EOF
nullmailer shared/mailname string $(hostname)
nullmailer nullmailer/relayhost string YOUR_SMTP_HOST smtp --auth-login --user=YOUR_SMTP_USER --pass=YOUR_SMTP_PASS
EOF

# install nullmailer
apt-get install -y nullmailer

# configure mailname
echo "YOUR_DOMAIN" > /etc/mailname

# send test email
echo "This is a test message from ${USER}@${HOSTNAME} at $(date)" | sendmail -f SENDER@YOUR_MAIL.COM RECIPIENT@YOUR_MAIL.COM

# change from / sender address
NULLMAILER_USER=info
# broken?

MysqlTest.java

import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;

public class MysqlTest {

private final static String dbUser = "dbo_java";
private final static String dbPass = "java_test";
private final static String dbHost = "192.168.1.111";
private final static String dbName = "java";

public static void main(String[] args) {
Connection conn = null;

try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://" + dbHos