openbr @ docker

Hi,

just testing face recognition and face detection, so i came over openbr.

In order not to mess up my system i build it via docker, that what i like to share.

building:

docker build -t openbr openbr/.

running (enables webcam + xserver):

docker run -t -i --privileged -e DISPLAY=$DISPLAY -v /dev:/dev -v /tmp/.X11-unix:/tmp/.X11-unix openbr $SHELL

And last  but not least the docker file:

FROM ubuntu:16.04
RUN apt update && apt install -y git build-essential cmake cmake-curses-gui software-properties-common
RUN add-apt-repository --yes ppa:xqms/opencv-nonfree && apt update && apt install -y libopencv-dev qt5-default libqt5svg5-dev qtcreator libopencv-nonfree-dev
RUN cd && git clone https://github.com/biometrics/openbr.git && cd openbr && git checkout v1.1.0 && git submodule init && git submodule update
RUN apt upgrade -y
RUN cd && cd openbr && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/openbr_v1.1.0
RUN cd && cd openbr && make -j4
RUN cd && cd openbr && make install
# openbr installed under /opt/openbr_v1.1.0

Enjoy.

Advertisements
Posted in Docker, Uncategorized | Tagged , , , | Leave a comment

wtv2m2t – windows media center recordings to m2t format

Hi,

so i am on a journey from windows to linux an one of my encounters it the history of windows media center files, in my case wtv-files.

I would like to process them like all my DVB-T recordings with DVBCUT, therefore i need an m2t file to proceed.

Solution: wtv_2_m2t.sh (using ffmpeg)

#!/bin/bash

echo "WTV2M2T..."

[ -z "$1" ] && {

   echo "usage: $0 <wtv-inputfile> [<m2t-outpufile>|default:\$1.m2t]"
   exit 1
   
}

[ -z "$2" ] && OUTPUT="$1.m2t" || OUTPUT="$2"

ffmpeg -i "$1" -vcodec copy -acodec copy "${OUTPUT}"


Enjoy.
Posted in IT, Uncategorized, windows2linux | Tagged , , , | Leave a comment

Upgrade to from Windows 7 (with broken update) to Windows 10 – old school

Hi,

as most I was rushing this week to get my windows 7 (qemu instance) upgraded to windows 10, actually it was quite trouble some. Most pain gave me the broken update function in my windows 7 installation (which I use only for steam windows games via IOMMU GFX passthrough)

So how to solve, quite simple everything failed:

  • Windows 10 Upgrade Assistant
  • GWX – Tool (Systry-Icon)
  • BuildInstallationMedia Tool

So no way forward, because everything listed above would like to update during installation.

Solution (old school ;))

  • Download via the buildinstallationmedia tool the ISO (my case windows 10 – ger – 64bit)
  • mount the iso or burn it
  • in order to install (my case upgrade) use the setup.exe in the root of the ISO.
    • The first thing you will be ask if you would like to update during install/upgrade -> ANSWER: NO.

Yes so it was and it worked. 😉 Enjoy.

Posted in IT, Uncategorized, upgrade, windows 10 | Leave a comment

Cool down – Family Notebook

Hi,

something i would like to share is the familiy notebook story. Actually the problem is that we have a family notebook with 5-7 active users and the fan was loud.

So I decided to use a cpufreq governor “ondemand”, thermald and last but not least a fan notebook table for our setup. But the problem remains that the notebook which is only put to sleep over the weeks comes up with too much fan activities.

Why – quite simple some of my family member use the firefox – tab function instead of the bookmark system, so the running firefoxes of the none active users generate a significant base load.

Solution: A session script which puts all none active user session to STOP and reactivies them if they become active.

Here is a first version, if i find time i will provide a more safe to use version.

#!/bin/bash

declare -A SES
while [ 1 -eq 1 ]
do
date 
SES=()
for session in `loginctl list-sessions | grep -v SESSION | awk '{ print $1 }'`
do

   state=`loginctl session-status ${session} | grep State: | grep -v grep | awk '{ print $2 }'`
   suser=`loginctl | awk -v m=${session} ' $1 == m { print $3 }'` 
#   echo "$session:$state:$suser"
   if [ "$state" == "active" ]
   then
      SES[${suser}]="active"
   else
      if [ -z "${SES[$suser]}" ]
      then
         SES[$suser]="sleep"
      fi
   fi
done

for suser in ${!SES[@]}
do
   [ "${suser}" = "lightdm" ] && continue
   [ "${suser}" = "root" ] && continue
   echo -n "$suser: ${SES[$suser]} - "
   if [ "${SES[$suser]}" == "sleep" ]
   then
      for s in `loginctl | awk -v u=${suser} ' $3 == u { print $1 }'`
      do
         echo -n "sleep[$s]"
         loginctl -s SIGSTOP kill-session ${s}
      done
   else
      for s in `loginctl | awk -v u=${suser} ' $3 == u { print $1 }'`
      do
         echo -n "awake:[$s]"
         loginctl -s SIGCONT kill-session ${s}
      done
   fi
   echo ""
done

sleep 2
done

Run as Root 🙂

So you end up with:

top – 15:23:56 up 1 day, 1:57, 2 users, load average: 0,69, 0,58, 0,46
Tasks: 340 total, 1 running, 268 sleeping, 71 stopped, 0 zombie
%Cpu(s): 4,0 us, 1,8 sy, 0,0 ni, 93,9 id, 0,1 wa, 0,0 hi, 0,1 si, 0,0 st
KiB Mem : 3899040 total, 306236 free, 2413236 used, 1179568 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 1106888 avail Mem

Enjoy.

Posted in IT, Notebook, Setup, ubuntu | Tagged , , , , , , | Leave a comment

Freetz @ docker

Hi,

as you may already notice I nowadays used to play with docker. Therefore I just tried to dockerize Freetz.

Dockerfile:

FROM ubuntu:vivid
#FROM ubuntu:trusty
RUN mkdir -p /opt /opt/home /opt/bin
RUN adduser --disabled-password --home /opt/home/freetz freetz
RUN apt-get install -y subversion build-essential  gcc g++ binutils autoconf automake automake1.9 libtool make bzip2 libncurses5-dev libreadline-dev zlib1g-dev flex bison patch texinfo tofrodos gettext pkg-config ecj fastjar realpath perl  ruby ruby1.8 gawk python libusb-dev unzip intltool libacl1-dev libcap-dev libc6-dev-i386 lib32ncurses5-dev gcc-multilib libc6-dev-i386 lib32ncurses5-dev gcc-multilib libtool git libtool-bin wget 
USER freetz
WORKDIR /opt/home/freetz  
RUN svn checkout http://svn.freetz.org/branches/freetz-stable-2.0

Container build-command:

#!/bin/bash

BASE="`dirname "$0"`"
[ "$BASE" = "." ] && BASE=`pwd`

cd ${BASE}/freetz

docker build -t freetz_org:2.0 --no-cache=false .

Container run-command:

#!/bin/bash

mkdir -p ~/freetz-stable-2.0/dl
mkdir -p ~/freetz-stable-2.0/images

docker run -t -i --rm=false -u freetz \
-v ~/freetz-stable-2.0/dl:/opt/home/freetz/freetz-stable-2.0/dl \
-v ~/freetz-stable-2.0/images:/opt/home/freetz/freetz-stable-2.0/images \
freetz_org:2.0

So you end up with a docker container for freetz builds and a

~/freetz-stable-2.0/

With all the downloaded and image stuff. (e.g.)

./dl
./dl/mipsel_gcc-4.6.4_uClibc-0.9.28-freetz-r10381-shared-glibc.tar.lzma
./dl/squashfs3.4.tar.gz
./dl/mips_gcc-4.6.4-freetz-r10381-shared-glibc.tar.lzma
./dl/haserl-0.9.29.tar.gz
./dl/mipsel_gcc-3.4.6-freetz-r10381-shared-glibc.tar.lzma
./dl/sfk165.zip
./dl/modcgi-0.3.tar.bz2
./dl/libtool-1.5.26.tar.gz
./dl/kconfig-v3.8.tar.xz
./dl/busybox-1.21.0.tar.bz2
./dl/lzma443.tar.bz2
./dl/mips_gcc-4.6.4_uClibc-0.9.32.1-freetz-r10381-shared-glibc.tar.lzma
./dl/squashfs2.2-r2.tar.gz
./dl/uClibc++-5976d7536d8c7a8d5a7f60fd2a3c34876a224f30.tar.bz2
./dl/fakeroot_1.18.4.orig.tar.bz2
./dl/fw
./dl/fw/7390_05.50-release_kernel.tar.xz
./dl/fw/FRITZ.Box_7390.84.05.54.image
./dl/fw/04.67-release_kernel.tar.xz
./dl/fw/FRITZ.Box_Fon_WLAN_7113.60.04.68.image
./images
./images/7113_04.68-freetz-2.0-13451.de_20151122-071604.image
./images/7390_05.54-freetz-2.0-13451.de_20151122-070947.image

So enjoy.

 

 

Posted in build-script, container-launcher, Docker, Dockerfile, freetz, Uncategorized | Leave a comment

Klett – Nusskacker 2 (school cdrom of my daughter)

Hi,

ok this time I share something I did to keep my spare time spare time,
these weeks school started again and my daughter arrived with a new book including a CD.

Long story short is it “nusskacker 2” from klett, which is some flash program to train math. In order to make it runable everywhere I build up a docker container. If you also would like to do so I share here “How to…”.

1) Dockerfile

FROM ubuntu:vivid
RUN mkdir -p /opt /opt/home
# cd.tgz is the tar czf of the cdrom
ADD cd.tgz /opt/nussknacker_2
RUN adduser --disabled-password --home /opt/home/klett klett
RUN chmod -R a+rx /opt/nussknacker_2
RUN dpkg --add-architecture i386 ; apt-get update ; apt-get install -y libc6:i386 libstdc++6:i386
RUN apt-get install -y libx11-6:i386 libxt6:i386 libgtk2.0-0:i386
RUN apt-get install -y libcurl3:i386 libsqlite3-0:i386 libidn11:i386 libxxf86vm1:i386 libssl0.9.8:i386 libnss3:i386
RUN apt-get install -y overlay-scrollbar-gtk2 gtk2-engines-murrine:i386 libcanberra-gtk-module:i386
USER klett
WORKDIR /opt/nussknacker_2/
ENTRYPOINT ./start

2) build command.

#!/bin/bash

BASE=”`dirname “$0″`”
[ “$BASE” = “.” ] && BASE=`pwd`

cd ${BASE}/nussknacker_2

docker build -t klett:nussknacker_2 –no-cache=false .

3) launch command for the container

#!/bin/bash

BASE=”`dirname “$0″`”
[ “$BASE” = “.” ] && BASE=`pwd`

xhost +si:localuser:`id -un`

docker run -t -i –rm=false \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/.macromedia:/opt/home/klett/.macromedia \
-e DISPLAY \
klett:nussknacker_2

Hope this also works for you :).

Enjoy.

Posted in build-script, container-launcher, Docker, Dockerfile, klett, linux, nussknacker 2, school, ubuntu | Leave a comment

Windows 10 ahead… so i have to change some things…

Ok what i mean with that, basically i get a little bit strange feelings when a major vendors starts to give one a main product for free in the future and as many i like windows 7, i was a little bit disappointed by 8.1 and 10 does not make me feel better. My personal assumption is that everybody will get something like “starter” or “home” for free and streams like “professional” and higher will be quite expensive or limited in features if anyway available for non volume licenses.

So what do I head for, quite simple for a back to the basics setup, with the answers to my it-questions: What i really want to do with my infrastructure at home?

  • Family stories:
    • Private Picture/Video stuff
    • Video on Demand services
    • Multiply Clients
      • Windows 7
      • I-Devices
      • Andorid-Devices
      • SmartTV
  • IT-Hobby stories
    • Play with virtualization
    • Play with containers
    • Play with infrastructure
    • Do not spend any minute for things a computer can do on his own.
    • Play some Steam based games

So what do I Need?

Basically I conclude on the following:

  • Infrastructure
    • Router + HDD -> OpenWrt in Place with WD3800 -> Done.
      • ISP-Connect
      • UPnP-NAS for Audio/Video on Demand @ Home
    • DVB-T Recorder -> Raspberry Pi with DVB-T Stick + tvheaded in place -> Done.
  • Servers
    • Storage
      • In Place my storage box which was in former times based on opensolaris, is now Ubuntu 14.04 LTS + zfsonlinux which works quite well for me. -> Done
    • Card/cal – Servers
      • Thats basically currently hosted @ my strato v-server -> Done
  • Clients
    • Laptops
      • Sony
        • Windows 7 Home -> Full of crapware
        • Re-Install to Linux Ubuntu 14.04 to be done.
        • For Windows Stories I will setup and VDI for my wife to connect with RDP.
          • By the way i recommend to setup, separated accounts for external tasks like kindergarden administration (connected to onedrive accounts) or other stories, so a activity end is easy to be clean up from the system.
      • Other
        • Stay at Windows 8.1 for support the children’s stories, like tiptoy etc..
    • Towers
      • Currently only one:
        • Now Windows 7, mainly for picture rework, gaming and printing

My conclusion is that i have to be more smart on the client side, doing VDI for windows on a server, so it is no longer linked to client failures, my picture stories other things can be moved to Linux and the gaming i head for in-house streaming.

Enjoy.

 

Posted in Uncategorized | Leave a comment