Planet DokuWiki



January 27, 2012

Deutsches Museum

Nach einem langen Spaziergang durch einen Schneesturm in Bayern entschied ich mich zu einem kulturellen Nachmittag im Deutschen Museum in München. Wikipedia wusste, dass es da eine grosse Ausstellung zum Thema Fotografie gäbe und ich verbrachte einen vergnüglichen Nachmittag in diesem Raum. Ich hatte zu etwa einem Drittel der Exponate eine persönliche Geschichte - bin ich bald selbst einen Fall fürs Museum? ;-) Leider keine Bilder hier, das Kleingedruckte des Museums verbietet mir die Veröffentl…

22012012_002_.jpg 22012012_003_.jpg img_1549.jpg

by Administrator at January 27, 2012 08:45 PM

January 24, 2012

Spiel mit dem Tod

Plot:
Oleg sucht den ultimativen Kick, das Spiel mit dem eigenen Leben. In einer verlassenen Kaserne treffen sich ein paar Maenner, um wie in einer Kriegssituation mit scharfen Waffen aufeinander zu schiessen.

Bitte nicht vom Titel oder Plot abschrecken lassen! Spiel mit dem Tod ist eine absolut empfehlenswerte Doku mit interessanten Aspekten1).

1) Unbedingt komplett anschauen

This blog post was created on 2012-01-24 at 20:22 and last modified on 2012-01-24 at 20:31 by Heiko. It is tagged with doku, spiel, tod.

by Heiko at January 24, 2012 07:22 PM

January 23, 2012

Select all files in Linux Midnight Commander

It's been a while since I bought my own VPS so I've had time to play around. I said to myself that I wouldn't use any file managers and I will learn linux command line. But one day I had to do something and I found out, Midnight commander is still there.

 Midnight Commander

Since I use Total Commander as my main operating system, I have a lot of its shortcuts in my mind. One of them is to select all files Ctrl+A and I was wondering, whether there is a shortcut for Midnight Commander doing exactly same thing.

I searched on internet and what I have found - there is :)

Command is: Alt+Shift+=

This command allows you to specify mask for files you want to select. Default one is * to select all of them.

This blogs post was created on 2012-01-23 at 19:27 by Tomas Pavlatka. It is tagged with linux, midnight commander, shortcut, total commander.

by Tomas Pavlatka at January 23, 2012 05:27 PM

Ubuntu吐嘈

回家怕麻烦,没带自己的电脑。家里一个旧电脑,本来装的Ubuntu,妈妈说了她要用,XP+MS Office 2003必须,要我重装。完成任务后就打算再装上Ubuntu 12.04。反正只用几天,不怕当小白。

先是装了desktop版,unity实在不想用,装了gnome-shell后删除unity。然后……lightdm进不去了,Orz…好吧,我还是换gdm。

因为依赖关系删掉了一些软件,又重新装回来,发现nautilus竟然非要依赖libunity9。这什么啊。

我绑定了快捷键打开xterm,结果发现没图标,overview里明明有啊。好吧,其实这样做就有了

sudo mv /usr/share/applications/debian-xterm.desktop /usr/share/applications/xterm.desktop

by lainme at January 23, 2012 03:57 AM

January 20, 2012

7zip and Command Line

Today I've started to play with 7zip. I had to make archive from one of our CakePHP project, but I had following requirements.

  • .svn folder(s) should not be part of my archive
  • /app/tmp/cache/images/ should not contain any file
  • /app/tmp/cache/thumbs/ should not contain any file
  • /app/tmp/cache/models/ should not contain any file
  • /app/tmp/cache/persistent/ should not contain any file

I found out that 7zip is very powerful tool, but you must know how to use it exactly. But because I'm a PHP developer, I used my favorite method - try and failure.

c:\>7z.exe a -mx9 -tzip {archive_name}.zip -ir!{folder_name}\* -xr!.svn -xr!*.tmp -xr!cake_model_* -xr!cake_core_*
archive_name name of result file with archive
folder_name name of folder which should be archived

What is remaining - Resolved

I've met 4 of my 5 requirements with command mentioned above. I have to find solution for the last one /app/tmp/cache/thumbs/ should not contain any file. This folder holds all thumbs files created by phpThumb and they do not have any extension.

So I need to find formula what to specify -xr! parameter.

Name of all files inside this folder is md5 hash - so it means 32 random characters.

-x!{folder_name}\app\tmp\cache\thumbs\*

Problem with empty folders

I spent maybe one hour with this problem. Archive file did not contain folders which were empty or contained only empty files. But finally I found the solution. If you have same problem, do not use *.* but only *

-ir!{folder_name}\*.* will not include empty folders
-ir!{folder_name}\* will include empty folders

This blogs post was created on 2012-01-20 at 14:39 and last modified on 2012-01-20 at 18:07 by Tomas Pavlatka. It is tagged with 7zip, archive, command line, empty folders, problem solution.

by Tomas Pavlatka at January 20, 2012 12:39 PM

Synchronized browsing in Total Commander

It's been a while since I installed FileZilla as my main FTP client. And it's been a while since I found out, there's an option for synchronized browsing. This is a tool which you try once and you cannot live without.

I was wondering if there's something similar in Total Commander - my main file manager. I searched on Internet and I found it.

Command: cm_SyncChangeDir

This blogs post was created on 2012-01-20 at 11:03 and last modified on 2012-01-20 at 11:06 by Tomas Pavlatka. It is tagged with browsing, command, filezilla, synchronized browsing, total commander.

by Tomas Pavlatka at January 20, 2012 09:03 AM

January 17, 2012

Spambots

Spam

Ich habe mich ehrlich gesagt schon länger gefragt, warum bisher der Daily-Shit nicht von unseriösen Bots heimgesucht wurde. Naja, gestern war es jedenfalls soweit :-\ Von DNS-Blacklisten, Fingerprinting des HTTP-Header und Keyword-Matching mal abgesehen, funktionieren nur Captchas zuverlässig gegen Spam. Wer sie kennt weiß, sie nerven! Ich bin zum Glück über ein DokuWiki Plugin (captcha) gestolpert, dass das Thema Captcha sehr elegant löst:

Es wird ein Textfeld generiert, in dass man eine Zeichenkette eingeben muss. Beim Absenden eines Formulars wird das Textfeld allerdings automatisch per Java-Script befüllt. Außerdem ist das Textfeld „unsichtbar“. Somit läuft der Captcha-Prozess komplett im Hintergrund ohne Zutun des Benutzers ab. Da Spambots normalerweise kein Java-Script ausführen, können sie so erkannt und geblockt werden. Den Daily-Shit habe ich nun um dieses „Feature“ erweitert. Und was soll ich sagen? Es funktioniert prächtig! Seit gestern wurden 43 Spam-Versuche vereitelt 8-)

This blog post was created on 2012-01-18 at 00:09 and last modified on 2012-01-18 at 19:34 by Heiko. It is tagged with badbehaviour, bot, captcher, dokuwiki, javascript, spam.

by Heiko at January 17, 2012 11:09 PM

January 16, 2012

Montag

Polit-Neulinge: Erfahrungen mit Journalisten

Politiker und die Presse - von jeher ein nicht ganz unkompliziertes Verhältnis. Das, was Journalisten berichten, gefällt vielleicht nicht immer. Manch einer glaubt, er könne Berichterstattung beeinflussen, was ihm aber kräftig auf die Füße fallen wird. Bundespräsident Wulff bekommt das gerade deutlich zu spüren. Aber es gibt natürlich genauso Journalisten, die sich im Umgang mit Politikern nicht ganz fair verhalten. ZAPP hat drei junge Abgeordnete besucht, die ganz neu und frisch in der Politik sind, und mit ihnen über ihre Erfahrungen mit den Medien gesprochen. Ein einseitiger Bericht - nämlich rein aus Sicht dieser Politiker.

Die ersten 30 Tage im Leben zweier Nymphensittiche

Gordita und Falcor hatten einen One Night Stand. Heraus kamen zwei kleine Sittiche, deren Entwicklung im ersten Lebensmonat feingliedrig auf Video dokumentiert wurden. Sehr interessante Einblicke für Nicht-Vogelbesitzer, die die Spanne von “Awww, wie süß” bis “hui, ist das hässlich” abdecken können. (via)

foo/bar

This blog post was created on 2012-01-16 at 19:21 and last modified on 2012-01-16 at 19:28 by Heiko. It is tagged with journalismus, linux, nymphensittich, politiker, ram.

by Heiko at January 16, 2012 06:21 PM

January 15, 2012

blog:constant_kalman

Estimating a constant value using kalman filtering

To get started with kalman filters I decided to program a very simple example: estimating a constant value with heavy noise. Already such a simple example shows how powerful kalman filters are. My example shows the how to estimate a constant signal of 1. The noise is normal distributed with a variance of 25. Therefore the SNR is only 1/25=0.04, which makes it very hard to give a good estimate of the value. The kalman filter doesn't seem to care much, after a few hundred samples he gives a very good estimate. Impressive! Here's my python code:

from matplotlib.pyplot import *
import numpy as np
import numpy.random as rand
 
l = 1000
noise_variance = 5
signal = 1
noise = noise_variance * rand.randn(l)
s = signal + noise
 
A = 1
C = 1
Q_w = 0
 
x_hat = np.zeros(l)
P = np.zeros(l) 
P[0] = 10000
 
for i in range(1, l):
    x_hat[i] = A * x_hat[i - 1]
    P[i] = A * P[i - 1] * A + Q_w
    K = P[i] * C / (C * P[i] * C + noise_variance)
    x_hat[i] = x_hat[i] + K * (s[i] - C * x_hat[i])
    P[i] = (1 - K * C) * P[i]
 
figure()
title('PCA')
plot(range(len(s)), s)
plot(range(len(s)), signal * np.ones(l))
plot(range(len(s)), x_hat)
show()

by admin at January 15, 2012 08:31 PM

January 13, 2012

Freitag

Nginx überholt IIS

Ich habe es ja bereits geahnt 1), nun haben es andere bestätigt: Microsofts Webserver IIS ist auf Platz 3 abgerutscht. Auf Platz 1 ist mit Abstand nach wie vor Apache, gefolgt nun von Nginx.

HTTP Status Cats

Und da wir gerade beim Thema Webserver sind, passend dazu die HTTP Status Cats 8-)

207 Multi-Status

401 Unauthorized

406 Not Acceptable

The Films of Steven Spielberg

Awesome!

foo/bar

1) auch wenn 100 Server nicht ganz repräsentativ sind

This blog post was created on 2012-01-13 at 14:01 and last modified on 2012-01-13 at 19:10 by Heiko. It is tagged with apache, cats, http, iis, nginx, sklave, spielberg.

by Heiko at January 13, 2012 01:01 PM

January 12, 2012

Task & Mail Addons for Mozilla Thunderbird

I was searching for some plugin for Mozilla Thunderbird to track all my tasks. I wanted something easy-to-use and small as well. I've found Task And Mail addons which completely meets my requirements.

This blogs post was created on 2012-01-12 at 11:27 by Tomas Pavlatka. It is tagged with addon, mozilla, task and mail, thunderbird.

by Tomas Pavlatka at January 12, 2012 09:27 AM

简单的Linux作业管理——simpleJobM

我的要求很简单,用nohup让程序在后台运行,完成后给邮箱发个邮件就行了。搜索了一些管理软件,没怎么看明白如何用,似乎还涉及并行啊,节点管理一类。于是自己写了个。

地址:https://github.com/lainme/simpleJobM

需要python3,主要是因为那个print函数。其实稍微改下python2也可以,毕竟没几个print。1)

基本功能就像一开始说的。发邮件用的sendmail,或许以后会改成可以自定义SMTP服务器,谁知道呢。

参数说明

获取帮助

./simpleJobM.py -h

运行一个命令

./simpleJobM.py -r 命令

这里使用nohup来运行命令,并在结束后向指定邮箱发送一封邮件(run.py中定义)。输出结果定向到以开始时间为文件名的文件中,存放于running目录。运行结束后移动到finished目录

列出所有作业

./simpleJobM.py -l [running/finished]

列出所有正在运行的作业,或者已经完成的作业。

删除一个正在运行的作业

./simpleJobM.py -d ID

根据ID进行删除,ID可以通过-l来获取

清除已完成作业的目录

./simpleJobM.py -c

这会删除finished目录

1) 根据依云的Comment加了 from __future__ import print_function

by lainme at January 12, 2012 08:07 AM

January 11, 2012

Little known PHP features: method chaining, enabling you to call methods the short way

Since PHP5, methods can return objects (including $this). This enables you to chain the method calls after preparing your class by returning the object itself. Therefore, “Method chaining” may save you e.g. much copy & paste or chars to type, reducing typing time for dozens of $obj->method() calls.

<?php
 
//common way
class foo {	
    public function one() {
        echo "one ";
    }
    public function two() {
        echo "two ";
    }
    public function three() {
        echo "three\n\n";
    }
}
$object = new foo();
$object->one();
$object->two();
$object->three();
 
 
//with method chaining (note the "return $this;")
class bar {	
    public function one() {
        echo "one ";
        return $this;
    }
    public function two() {
        echo "two ";
        return $this;
    }
    public function three() {
        echo "three\n\n";
        return $this;
    }
}
$object = new bar();
$object->one()
       ->two()
       ->three();
?>

I did not made any performance measurements right now… so I can't say if method chaining is faster/slower in common environments or not. And to be honest, I don't use method chaining for myself:

  • You simply can't see if a class supports method chaining without trying it or looking at its source.
  • The need for all these return $this; within the class methods.
  • IMHO, both reasons are leading to inconsistent coding styles and behaviors in real world applications containing 3rd party classes.

This blog post was created on 2012-01-11 at 12:48 by Andreas Haerter. It is tagged with php, webdev.

by Andreas Haerter at January 11, 2012 11:48 AM

January 10, 2012

Longest Bridge in the world

I was reading newspaper today morning and there'we a list of the most impressive bridges in the world. One of them was Danyang–Kunshan Grand Bridge in China with information, that its length is more than 160 km. I didn't believe so I went to internet to recheck it and it's true.

 Danyang–Kunshan Grand Bridge

I like to use always something that I know to give me a picture of something I cannot even imagine. I cannot imagine bridge lengths 160 km, but I know, that route from Limassol to Nicosia is around 80 km. So this bridge is like route to Nicosia and back. It means it's very long :D.

I know that everything is possible especially in China, but this bridge really impressed me.

This blogs post was created on 2012-01-10 at 17:11 and last modified on 2012-01-10 at 17:11 by Tomas Pavlatka. It is tagged with bridge, china, danyang, kunshan.

by Tomas Pavlatka at January 10, 2012 03:11 PM

Count files in directories in Linux

I had a problem with numbers of files in my VPS. I had to find directories with a lot of files and chech whether I need them or not. Following code shows me number of files for each directory so I can have an idea which directory I should check.

for i in *; do
printf "%10d %s\n" `find "$i"|wc -l` "$i"
done|sort -n

Thanks for Jafrus [CZE] for this code.

This blogs post was created on 2012-01-10 at 07:32 by Tomas Pavlatka. It is tagged with code, count, done, find, for, linux, sort, wc.

by Tomas Pavlatka at January 10, 2012 05:32 AM

How to delete files older than in Linux

I needed to delete files older than 1 day and their name starts with session_ in Linux. Just small note how to do it.

find path/to/folder -name "session_*" -type f -mtime +x -exec rm {} ;
path/to/folder path to folder where files are stored
mtime file's data was modified x * 24 hours ago

Use following script to delete same files but older than couple of minutes.

find path/to/folder -name "session_*" -type f -mmin +x -exec rm {} ;
path/to/folder path to folder where files are stored
mmin file's data was modified x minutes ago

This blogs post was created on 2012-01-10 at 07:17 and last modified on 2012-01-10 at 07:18 by Tomas Pavlatka. It is tagged with code, delete, find, linux, script.

by Tomas Pavlatka at January 10, 2012 05:17 AM

January 08, 2012

blog:life_magazine_table

Life Magazine Table

A few weeks ago I found a used copy of the book "The Best of Life". The book contains the best photographs of life magazine. I bought the book and decided to use it to improve our living room table. I fragmented the book into single pages and cut out my favorite pictures. Then I arranged the pictures to a collage which fitted onto our table. After I glued the collage to the table I added a Plexiglas in order to protect the pictures from scratches, water and humidity. I'm quite happy with the result and I thinks it looks really cool. Here are some pictures of the finished table:

 Life Magazine Table

 Life Magazine Table

by admin at January 08, 2012 04:13 PM

blog:picture_blues_brothers

Cardboard picture of the Blues Brothers

A few weeks ago I was in the mood to build another piece of art. After a few hours of thinking, I decided to handicraft a picture out of cardboard. I chose a Blues Brothers picture as original reference. I ripped some cardboard to small pieces and glued them on a paper. After that i copied the original on the paper and cut it out. Finally i sprayed the remaining pieces black and attached everything on our white wall.

This is the original picture:

And here's the result: I'm quite happy with the result and it looks really great.

by admin at January 08, 2012 04:13 PM

blog:hidden_markov_model

Hidden Markov Model (Viterbi)

For my master studies I had to code an implementation of the Viterbi-Algorithm for hidden markov models. (http://en.wikipedia.org/wiki/Viterbi_algorithm#Example)

Here's the matlab code I came up with:

% impelementation of viterbi-algorithm for hidden markov models
% wikipedia example http://en.wikipedia.org/wiki/Viterbi_algorithm#Example
% written by thomas niederberger
P_w = [0.6 0.4; 0.3 0.7]; % transition probabilities [sun|sun rain|sun; sun|rain rain|rain]
P_a = [0.6 0.3 0.1; % emission probabilities sun (walk, shop, clean)
       0.1 0.4 0.5]; % emission probabilities rain (walk, shop, clean) 
 
activities = [1 2 3]; % observed emission vector (walk, shop, clean)
 
states = length(P_w);
len = length(activities);
 
%initial guess (prior probabilities)
%calculated separately using eigenvectors for eigenvalue 1
p_sun = 3/7;
p_rain = 1 - p_sun;
 
p_w_x = [p_sun;p_rain];
p_w_xi = [0; 0];
 
Probs = zeros(states, len);
x = 1; % initial step
p_a_x = P_a(:, x);
p_w_x = p_a_x .* p_w_x; % / (p_a_x' * p_w_x) (without scaling)
Probs(:, 1) = p_w_x; % weather probability for day i
 
for i = 2:length(activities)
    p_a_x = (p_w_x * P_a(:, activities(i))');
    p_w_trans = P_w(:);
    p_w_temp = p_a_x(:) .* p_w_trans;
 
    [p_w_x(1), p_w_xi(1)] = max(p_w_temp(1:2));
    [p_w_x(2), p_w_xi(2)] = max(p_w_temp(3:4));
    Probs(:, i) = p_w_x;
    p_w_xi
end
Probs

by admin at January 08, 2012 04:12 PM

January 07, 2012

Pariser

Ein Stapel Infiniband Kabel liegt vor mir, tauglich für 40 Gigabit. Vom selben Herrn Gore, der eben meine Füsse trocken gehalten hat, von fleissigen Mexikanischen Händen zusammengelötet. Ich bin unterwegs um die Welt zu retten und verkable ein Rack.

img_1124.jpg

by Administrator at January 07, 2012 07:53 PM


Subscriptions

Subscribe: planet feed

About

This planet aggregates feeds from blogs powered by DokuWiki. Posts are not necessarily about DokuWiki but reflect the diversity of DokuWiki users.

Do you blog using DokuWiki? Send me a mail and send me a mail with the following info:

  • Your Name
  • The URL to your DokuWiki powered Blog
  • The URL of your full HTML feed
  • A 48x48 avatar image