OpenWrt on TP-Link TL-WR941ND / TL-WR1043ND / TL-WDR3600 / TL-WDR4300

# 15.05
https://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/

# flash tl-wr1043nd
URL=http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/openwrt-15.05.1-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory.bin
wget ${URL} -P /tmp
scp /tmp/openwrt-15.05-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory.bin root@192.168.1.111:/tmp/
ssh root@192.168.1.111
echo 3 > /proc/sys/vm/drop_caches
mtd -r write /tmp/openwrt-15.05.1-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory.bin firmware

# flash tl-wdr4300

Linux Benchmark

# Linux kernel benchmark
http://panticz.de/Linux-Kernel-Benchmark

# sysbench
apt-get install -y sysbench

sysbench --test=cpu --num-threads=1 --cpu-max-prime=20000 run
sysbench --test=cpu --num-threads=$(cat /proc/cpuinfo | grep processor | wc -l) --cpu-max-prime=50000 run

sysbench --test=memory run
sysbench --test=memory --num-threads=$(cat /proc/cpuinfo | grep processor | wc -l) run

time sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=terceS prepare
sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=ro

Fix Apache2 "Could not reliably determine the server's fully qualified domain name" warning

# Apache2 warning:
"Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName"

# set FQDN in /etc/hosts like:
127.0.1.1 srv1.home srv1

# or
sed -i "s|$(hostname) $(hostname)|$(hostname -A)$(hostname)|g" /etc/hosts

# or set ServerName in Apache vHost config

# check
hostname --fqdn

# Info
# sysctl kernel.hostname=srv1

Install APT caching proxy

apt-get install -y apt-cacher-ng

# config
/etc/apt-cacher-ng/acng.conf

# restart service
/etc/init.d/apt-cacher-ng restart

# configure offline mode
echo "Offlinemode: 1" >> /etc/apt-cacher-ng/acng.conf
service apt-cacher-ng restart

# web interface
http://YOUR_IP:3142

# add to preseed config
d-i mirror/http/proxy string http://apt-cacher:3142/

# configure APT to use proxy
echo 'Acquire::http::Proxy "http://YOUR_IP:3142/";' >> /etc/apt/apt.conf.d/01proxy
apt-get update

# ssl
http://blog.packagecloud.io/eng/2015/05/05/using-apt-cacher-ng-with-ssl-tls/

# clear ?
/

Install IpFire on SheevaPlug

# check for last version:
http://downloads.ipfire.org/

# download IpFire image
URL=http://downloads.ipfire.org/releases/ipfire-2.x/2.15-core79/ipfire-2.15.1gb-ext4.armv5tel-full-core79.img.gz
wget ${URL} -P /tmp/

# copy image to USB pen (do NOT use sdcard, i´t will not boot)
sudo umount /dev/sde*
sudo zcat /tmp/ipfire-*.1gb-ext4.armv5tel-full-core*.img.gz > /dev/sde
sync

# configuring serial console
mount /dev/sde3 /mnt
echo "7:2345:respawn:/sbin/agetty ttyS0 115200 vt100" >> /mnt/etc/inittab
umount /mnt

# plug usb pen to SheevaPlug and connect power cable

# connect t

JavaScript / AJAX file upload

# add this code snipset to your homepage and customize path to upload.php

var myDropzone = new Dropzone("#dropzone", {url: "upload.php"});
myDropzone.on("success", function(file) {
location.reload();
});

# create upload.php on your webserver
<?php
$DIR = "upload";
if(!empty($_FILES)) {
// move file to upload direct

Adaptec RAID controller / arcconf

arcconf GETLOGS 1 DEVICE

# list logical devices
arcconf GETCONFIG 1 LD

# list phisical devices
arcconf GETCONFIG 1 PD

# start adaptec verifi
arcconf TASK START 1 DEVICE 0 0 VERIFY

arcconf GETSTATUS 1

# create JBOD on all devices
# get device count
COUNT=$(arcconf GETCONFIG 1 PD | grep "Hard drive" | wc -l)

# create JBOD on all devices
for CHANNEL in `echo $(seq 1 ${COUNT})`; do
CHANNEL=$((CHANNEL-1))
echo ${CHANNEL}

arcconf CREATE 1 JBOD 0 ${CHANNEL} noprompt
done

# delete devices
arcconf DELETE 1 LOGICALDRIVE ALL noprompt