linux

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

IpFire

http://wiki.ipfire.org/de/addons/net-snmp/start - SNMP Daemon for IpFire

Edit Cron jobs on IpFire
fcrontab -e
/etc/init.d/fcron restart

# force update dyndns every day
#9 2 * * 0 [ -f "/var/ipfire/red/active" ] && /usr/local/bin/setddns.pl -f
0 19 * * * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/setddns.pl -f

Upgrade
pakfire update
pakfire upgrade

Install Addons
pakfire install -y iftop

Update XEN VM
mount /dev/vg1/fw-boot /mnt/

# add XEN boot entry in GRUB configuration

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

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

Install Jameica + Hibiscus online banking

wget https://raw.githubusercontent.com/panticz/installit/master/install.hibiscus.sh -O - | bash -

#!/bin/bash

# install Java
wget https://raw.githubusercontent.com/panticz/installit/master/install.java-jdk.sh -O - | bash -

# download Jameica
if [ "$(uname -m)" == "x86_64" ]; then
  # 64 bit
  URL=http://www.willuhn.de/products/jameica/releases/current/jameica/jameica-linux64.zip
else
  # 32 bit
  URL=http://www.willuhn.de/products/jameica/releases/current/jameica/jameica-linux.zip
fi
wget ${URL} -P /tmp

# install Jameica
sudo unzip /tmp/jameica-linux*.zip -d /opt/

# download Hibiscus
wget http://www.willuhn.de/products/hibiscus/releases/current/hibiscus.zip -P /tmp

# install Hibiscus
sudo unzip /tmp/hibiscus.zip -d /opt/jameica/plugins/

# create start entry
cat << EOF | sudo tee /usr/share/applications/Hibiscus.desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Hibiscus
Type=Application
Terminal=false
Exec=/opt/jameica/jameica.sh
Icon=/opt/jameica/jameica-icon.png
Categories=Office;Finance;
EOF

Links
https://launchpad.net/~dennis-benndorf/+archive/ubuntu/ppa - PPA
https://www.willuhn.de/wiki/doku.php?id=support:bezugsquellen
http://wiki.ubuntuusers.de/Hibiscus
http://www.willuhn.de/products/jameica/download.php
http://www.willuhn.de/products/hibiscus/download.php
http://www.heise.de/download/linux/office/finanzsoftware/homebanking-50003505037/

Linpack under Ubuntu / Linux

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/installit/master/install.linpack.sh -O - | bash -

#!/bin/bash

URL=http://registrationcenter.intel.com/irc_nas/3914/l_lpk_p_11.1.2.005.tgz

# download
wget ${URL} -O /tmp/l_lpk.tgz

# extract
tar -xzf /tmp/l_lpk.tgz -C /tmp/

# copy linpack to /usr/share directory
cp -a /tmp/linpack_11.1.2/benchmarks/linpack/ /usr/share/

# create soft links to executables
ln -sf /usr/share/linpack/runme_xeon64 /usr/sbin/
ln -sf /usr/share/linpack/xlinpack_xeon64 /usr/sbin/

# adjust path in runme_xeon64
sed -i s'|./xlinpack_$arch lininput_$arch|/usr/sbin/xlinpack_$arch /usr/share/linpack/lininput_$arch|g' /usr/sbin/runme_xeon64

# get CPU info
CPU=$(cat /proc/cpuinfo | grep "model name" | tail -1)
COUNT=$(cat /proc/cpuinfo | grep processor | wc -l)
echo "CPU : $CPU"
echo "COUNT : $COUNT"

# OPTIONAL: configure parameter
# export MKL_DYNAMIC=false
# export OMP_NUM_THREADS=4

# run
runme_xeon64

Links
http://software.intel.com/en-us/articles/intel-math-kernel-library-linpack-download - Intel LINPACK Download
http://www.roylongbottom.org.uk/linpack%20results.htm

Pogoplug: Install Debian

Install Debian
# connect to PogoPlug
ssh root@192.168.2.155
ceadmin

# prepare USB flash (1GB root, 256MB swap)
printf "o\nn\np\n1\n\n+1G\nn\np\n2\n\n+256M\nt\n2\n82\nw\n" | fdisk /dev/sda

# download and execute debian installation script
cd /tmp
wget http://projects.doozan.com/debian/dockstar.debian-squeeze.sh
chmod +x dockstar.debian-squeeze.sh
export PATH=$PATH:/usr/sbin:/sbin
./dockstar.debian-squeeze.sh
ok

# login to new debian intallation
ssh root@192.168.1.X
pass: root

# change root password
passwd

Configure netconsole

Crosscompile OpenWRT

# installing required libraries 
apt-get install -y subversion build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl unzip

# create user for compile process
useradd -m openwrt

# login as openwrt
su openwrt

# download OpenWrt
svn co svn://svn.openwrt.org/openwrt/trunk/
cd trunk
./scripts/feeds update -a
./scripts/feeds install -a

# configure OpenWRT
make defconfig

# compile OpenWRT
make -j$(cat /proc/cpuinfo | grep processor | wc -l)

# download lyc
wget -q https://github.com/panticz/lyc/archive/master.zip -O /tmp/master.zip
unzip -q /tmp/master.zip -d ~/trunk/staging_dir

# compile lyc
cd ~/trunk/staging_dir/lyc-master
make mips

# copy file to router
scp ./lyc root@openwrt:/root

Compile for x86
sudo apt-get install -y --force-yes subversion libncurses5-dev libghc6-zlib-dev flex build-essential
cd /tmp
svn checkout svn://svn.openwrt.org/openwrt/trunk
make menuconfig

Links
http://wiki.openwrt.org/doc/howto/build
http://wiki.openwrt.org/doc/devel/crosscompile
http://wiki.openwrt.org/doc/howto/buildroot.exigence
http://www.ffnn.nl/pages/articles/linux/cgi-scripting-tips-for-bash-or-sh.php

Brother MFC 7320

Install printer
wget https://raw.githubusercontent.com/panticz/installit/master/hardware/install.brother-mfc-7320.printer.sh -O - | bash -

#!/bin/bash

# enable multiverse repository
cat <<EOF> /etc/apt/sources.list.d/extra-repository.list
deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs) universe
deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs) multiverse
EOF
apt-get update -qq

# install printer driver
apt-get install -y brother-cups-wrapper-laser

# remove multiverse repository
rm /etc/apt/sources.list.d/extra-repository.list
apt-get update -qq

# create printer
lpadmin -p Brother-MFC-7320 -E -v usb://Brother/MFC-7320 -P /usr/share/ppd/Brother/MFC7220.ppd -o PageSize=A4

# FIXME: set resolution to 1200
# -o Resolution=1200x600dp

Install scanner
wget https://raw.githubusercontent.com/panticz/installit/master/hardware/install.brother-mfc-7320.scanner.sh -O - | bash -

#!/bin/bash

# patch udev rules
cat <<EOF>> /lib/udev/rules.d/40-libsane.rules
ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"
EOF

# restart udev
sudo service udev restart

# download driver
wget http://pub.brother.com/pub/com/bsc/linux/dlf/brscan3-0.2.11-4.i386.deb -P /tmp

# install driver
sudo dpkg -i /tmp/brscan3-0.2.11-4.i386.deb

wlyc - Linux Yamaha Receiver Webcontrol

GitHub repository
https://github.com/panticz/wlyc
Demo
http://dl.panticz.de/wlyc/wlyc3900.html

https://raw.githubusercontent.com/panticz/wlyc/master/wlyc

#!/bin/sh

URL="http://cdn1.iconfinder.com/data/icons/super-mono-basic/blue"

# get parameter
p1=`echo "$QUERY_STRING" | cut -d"&" -f1 | cut -d"=" -f2`
case "$QUERY_STRING" in
   *\&*)
   p2=`echo "$QUERY_STRING" | cut -d"&" -f2 | cut -d"=" -f2`
   ;;
esac

# parameter
# cmd 1
# cmd 2
# image url
# alt and title text
# short description
# accesskey
link() {
    echo "<div class='l'><a href='?p1=$1&p2=$2' accesskey='$6'><img src='$URL/$3' alt='$4' title='$4'>$5</a></div>"
}

# run command
/root/lyc $p1 $p2





# head
echo "Content-type: text/html"
echo ""

echo "<html>"
echo "<head>"
echo "<link href='http://dl.panticz.de/wlyc/wlyc.css' rel='stylesheet' type='text/css'>"
echo "</head>"
echo "<body>"

# print command
echo "<div class='cmd'>$p1 $p2</div>"

# control
echo "<div class='title'>Power</div>"
link power off button-cross_basic_blue.png "Power Off" OFF
link power on button-power_basic_blue.png "Power On" ON

echo "<div class='title'>Input</div>"
link input dvd disc_basic_blue.png DVD DVD
link input net music_basic_blue.png "Internet Radio" NET
link input usb usb-stick_basic_blue.png USB USB
link input pc computer_basic_blue.png PC PC

echo "<div class='title'>Volume</div>"
link mute on speaker-mute_basic_blue.png Mute "MUTE" m 
link volume down button-remove_basic_blue.png Display "VOL-" -
link volume up button-add_basic_blue.png Display "VOL+" +
link volume -70 speaker_basic_blue.png "Volume -70 dB" -70
link volume -65 speaker_basic_blue.png "Volume -65 dB" -65
link volume -60 speaker_basic_blue.png "Volume -60 dB" -60
link volume -55 speaker_basic_blue.png "Volume -55 dB" -55
link volume -50 speaker_basic_blue.png "Volume -50 dB" -50
link volume -45 speaker_basic_blue.png "Volume -45 dB" -45
link volume -40 speaker_basic_blue.png "Volume -40 dB" -40
link volume -35 speaker_basic_blue.png "Volume -35 dB" -35
link volume -30 speaker_basic_blue.png "Volume -30 dB" -30


echo "<div class='title'>OSD</div>"
link osd display desktop_basic_blue.png Display DISP
link osd menu site-map_basic_blue.png Menu MENU
link osd left navigation-left_basic_blue.png Left LEFT
link osd up navigation-up_basic_blue.png Up UP
link osd enter button-check_basic_blue.png Enter ENTER
link osd down navigation-down_basic_blue.png Down DOWN
link osd right navigation-right_basic_blue.png Right RIGHT

echo "<div class='title'>DSP</div>"
link dsp 2ch equalizer_basic_blue.png 2ch 2ch
link dsp 7ch equalizer_basic_blue.png "7ch Stereo" 7ch

echo "<div class='title'>Memory</div>"
link memory 1 inbox_basic_blue.png "Memory 1" 1
link memory 2 inbox_basic_blue.png "Memory 2" 2
link memory 3 inbox_basic_blue.png "Memory 3" 3
link memory 4 inbox_basic_blue.png "Memory 4" 4
link memory 5 inbox_basic_blue.png "Memory 5" 5
link memory 6 inbox_basic_blue.png "Memory 6" 6

echo "<div class='title'>Media</div>"
link prev "" button-rew_basic_blue.png Previous PREV
link stop "" button-stop_basic_blue.png Stop STOP
link play "" button-play_basic_blue.png Play PLAY
link next "" button-ff_basic_blue.png Next NEXT

echo "</body>"
echo "</html>"

Links
http://your.recier.ip/YamahaRemoteControl/UnitDesc.xml

Syndicate content