bloginfo('name');

bloginfo('description');

Archives Posts

How to setup HTTPS for your Apache2

Februar 23rd, 2009 by Blu:RayNe

Basic Information

First off, you need a SSL-Certificate for HTTPS. This certificates are usualy checked by your browser against SSL providers such as VeriSign for validity. If the outcame is invalid, some website may have been replaced with a fake-version by a hacker. The result is, that your browser warns you that the certificate for the site is invalid and it probalby was hacked or stuff like this (there was also a bug on creating invalid certificates on Debian-Linux some time ago *G*).

Anyway, you can still add the certificate as exception and get SSL-connection to the website, so no one is seeing what you are actually doing on that site or what data is beeing transferred (e.g. your E-Mail Client).

Basic Setup

The easiest way to setup this stuff is as of following (assuming using Debian/Ubuntu and Apache2):

$ apt-get install openssl
$ mkdir -P /etc/apache2/ssl/
$ openssl req $@ -new -x509 -days 365 -nodes -out server.crt -keyout server.key

Then add something like this to your Apache2-Configuration:

NameVirtualHost 443

<VirtualHost *:443>

SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
# SSLProtocol -all +TLSv1 +SSLv3
SSLProtocol all -SSLv2

[...]

</VirtualHost>

Basically, that’s it! Don’t forget to restart apache and also note that SSL2 is outdated and therefore unsecure. Be aware of that on using MSIE-Browsers from Microsoft! So i just disallowed it here in the example above. It also has opions set for using Basic HTTP-Auth on HTTPS and sets also some SSL-specific apache environmental veriables.

If Apache doesn’t start up look under /var/log/apache2/ for error messages!

Extended Setup

Some snippets if you already have a server key or want need to create your own, for having it signed and so on. If you set a password for a server key – which is indeed required for secuerity reasons – note, that Apache asks for it on startup.

Create a server key

openssl genrsa -des3 -out server.key 1024

You can convert the secure key to an unsecure („without password“):

$ openssl rsa -in server.key -out server.key.insecure

Create a basic  certificate for your key by using this:

$ openssl req -new -key server.key -out server.csr

Then sign it:

$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Same stuff with insecure key:

$ openssl x509 -req -days 365 -in server.csr -signkey server.key.insecure -out server.crt

Archives Posts

MSIE – Dante’s Inferno for Linux (or Web Developers)

Dezember 21st, 2008 by Blu:RayNe

ies4linux is a nice project that brings MSIE 5.0, 5.5, 6.0 and 7 to Linux under WINE.

Filed under Allgemein, Browser, Linux having No Comments »

Archives Posts

Ubuntu: Is the intrepid ibex still jumping?

Oktober 31st, 2008 by Blu:RayNe

Or update day: it still jumps over the rocks, but seems it got one foot hurt: keyboard mapping doesn’t work for me anymore – the arrow keys are not mapped rightly.

At least Ubuntu is a big distro, so there are already tickets for it:

https://bugs.launchpad.net/ubuntu/+bug/255861

https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/255008

Damn. I should have waited another week, but i don’t want to go back anymore. At least all other things still seem to work and my Nautilus now has tabs. The update took about 40mins and worked fine. Good job!

setxkbmap -model evdev
setxkbmap -model evdev -layout de -option lv3:ralt_switch

Hmmm.. works… partly :(

If i just knew that Fedora works now better. I tested out the latest version a month ago and it made up a very stable and fresh impression. Perhaps i’ll give it another try one day.

Well, i guess i’ll make up a new version of my xmodmap.rc now :/

Filed under Linux having No Comments »

Archives Posts

YouTube and transcoding video with vixy.net

August 12th, 2008 by Blu:RayNe

I hate all those low quality videos from YouTube. You know there is that trick to concenate &fmt=18 to YouTube-URLs to have it access the new servers with higher quality videos and better bandwidth performance, but still that does not makes me happy.

Having FLV is ok for me, although I dislike non-standard container formats. But the point is copying those FLVs for friends often ends up by them complaining not beeing able to play the files on their Windows or Mac. The same problem persists on the iPod or my mobile phone that just understands 3GP in the moment.

So i end up having to convert the files… or transcoding them.

Conversion vs. Transcoding

Converting usally means decoding the video to a full video-picture – probably with or without any post-processing– and loosing the visual information that was artifically added again by encoding. Also, most of the  bitstream-information on the decoded stream is also lost, because you only see a the picture and not what abstract data is behind.

That is the place where transcoding comes into play: It transcodes the data be going deep into the input stream directly translating it the the output stream. The “visual step“ between encoding and deocoding is skipped, because not necessary. In the end we have not only faster conversion process, but have also retained all possible quality. 

Ok, if input and output en/decoding algorithms differ too much or you wanna resize the video you still have to convert the videos. Point is that the algorithms used in input and output stream have to be similar to each other (beeing often MPEG4 on nowadays video material).

I discovered vixy (which is based on ffmpeg) und does a nice job on transcoding. On windows and Mac you have a GUI limited to YouTube. The Online-Converter itself seems to be always overloaded. So, time to compile our FLV 2 MPEG4 Tool ourselves (for Ubuntu/Debian):

$ apt-get install apt-get install libavcodec-dev libavformat-dev libavutil-dev ffmpeg subversion
$ apt-get build-dep ffmpeg
$ mkdir flv2mpeg4
$ cd flv2mpeg4
$ svn co https://vixynet.svn.sourceforge.net/svnroot/vixynet/trunk/flv2mpeg4/ .
$ cd src
$ gcc -O3 -o flv2mpeg4 avformat_writer.c dcprediction.c flv2mpeg4.c fetch.c flvdecoder.c m4vencode.c mp3header.c -lavformat -lavcodec -lavutil -I/usr/include/ffmpeg -L/usr/lib
$ cp flv2mpeg4 /usr/bin

A last word to YouTube. I don’t suggest uploading to it in no way!

  • They manipulate view counters on videos with strong political content (e.g. 200 views and 300 comments?)
  • Everything you upload, belongs to them! Read the terms!
  • Quality still sucks  (it’s for the american market; but we have broadband here in germany!)
  • Servers are often damn slow, espacially at 23:00 CEST+1 when all americans go on the site
Filed under Linux, Netzwelt having No Comments »

Archives Posts

„Sehr geehrter Kunde, Ihre Mail ist Spam!“

Juli 16th, 2008 by Blu:RayNe

Und das sag ich immer wieder, da es anscheinend noch unzählige Leute in der Druck/IT-Branche gibt, die eigentlich hier nichts zu suchen hätten. Ich erhalte immer noch viel zu Mails ohne Subject und ohne eindeutigen Bodytext, der mir beschreiben würde, um was es eigentlich geht. Manchmal fehlt sogar die Ansprache, oder Footer mit Firmenadresse.

Selbst ist man damit oft zu Rücksprachen gezwungen, die oft lange überflüssige Telefongespräche nach sich ziehen. Aber besser wenn der Kunde von selbst anruft, da gibt es noch andere Möglichkeiten…

–„Neee.. ich habe Ihre E-Mail nicht gesehen.. ich glaube ich hab da nichts bekommen… moment… ich guck mal… ah.. hier.. Spam.. naja.. die Mail is ja auch Spam…“
– „Wie! Spam?! Meine Mail ist doch keine Spam… !“ (sichtlich verblüfft)
– „Kein Subject, kein Inhalt und nur eine PDF als Anhang wäre unter meiner Sichtweise auch Spam… und schließlich ist die Absenderadresse fälschbar. Oder was würde sie unter Sichtweise des Anti-Spam-Programms sagen?“

Und dann gab es gestern noch die Frage an mich: „Warum hast du die UPS-Mail nicht bearbeitet, die ich dir weitergeleitet habe?“. Und ich sagte nur „UPS-Mails haben keine .EXE-Änhange und kommen nicht von tfds.vddseew@hotmail.com“ *seufz*

Hierbei handelte es sich wieder einmal um Vorgesetzte…

Filed under Berufsalltag, Browser, Fun, Linux having No Comments »

Archives Posts

Commonly used Debian repositiories

Juli 4th, 2007 by Blu:RayNe

Ok, here some often needed debian repositiories for your /etc/apt/sources.list. This article will get updated when needed.

# Unoffical packages that harm debian licenses
deb http://ftp.debian-unofficial.org/debian etch main contrib non-free restricted

# Distribution Mirror server from 1&amp;1
deb http://update.rootmaster.info/debian stable  main contrib non-free
deb http://update.rootmaster.info/debian-non-US stable/non-US main contrib non-free

# Distribution Mirror server from Strato
deb http://ftp.serverkompetenz.de/debian/ etch main contrib non-free

# Offical Debian
deb http://http.us.debian.org/debian stable main contrib non-free

# Debian security updates
deb http://security.debian.org/debian-security stable/updates main contrib non-free

# Up-to-date Apache, PHP and MySQL
# deb http://dotdeb.netmirror.org/ stable all
# deb-src http://dotdeb.netmirror.org/ stable all
deb http://packages.dotdeb.org etch all

# mplayer, ffmpeg and so on…
deb http://www.debian-multimedia.org etch main

# Mono
deb http://www.mindtouch.com/apt/ sarge main contrib non-free#

# Updates for viruses &amp; spam filters
deb http://volatile.debian.net/debian-volatile sarge/volatile main contrib
deb http://people.debian.org/~dexter php5.1 sarge
deb-src http://people.debian.org/~dexter php5.1 sarge
deb http://www.os-works.com/debian testing main

# Backports – if you really need them!
# deb http://www.backports.org/debian/ sarge-backports main contrib non-free
 

Filed under Allgemein, Linux having No Comments »

Archives Posts

Backup remotely via Perl

Mai 29th, 2007 by Blu:RayNe

Ok, i guess you love that cheap servers only with FTP and HTTP, and minimal PHP4-Timeout and lame CGI and no real possibility but to do a good backup job. Well, Perl was once a dominant language and can do much for you.

The benefits of following backup solutions are as follows:

  • Backup is done via calling an URL
  • that invokes the mysqldump utility to backup your database to a local director, that is preferable outside the webroot
  • the data is then gzipped
  • old backups are automatically deleted
  • and then backed up via FTP to another server
  • and while a second server gets the backup it is more secure than having all on a single server

Put this in you cgi-bin folder and remotely call it via CURL or test it via the browser. Don’t forget tot set chmod 755 for the files! If you backup to a directory in the webroot don’t forget to protect that directory by e.g. setting a up an .htacess-file!

#!/usr/bin/perl -w

use CGI;
use POSIX qw(strftime);
use Time::Local;

$query    = new CGI();
$file     = $query->param(‘file’);
$filename = $query->param(‘filename’);

print "Content-Type: text/plain\n\n";
# print "Content-type: application/octet-stream\n";
# print "Content-Disposition: attachment; filename=".$filename."\n";
# print "Pragma: no-cache\n";
# print "bash ".$file;

sub backupMysql
{
    my ($host)     = $_[0];
    my ($username) = $_[1];
    my ($password) = $_[2];
    my ($database) = $_[3];
    my ($title) = $_[4];

    $time = time;
    $filename = $title."-".$database."-".strftime("%Y%m%d-%H%S", localtime($time));
    print "Backup of \"".$title."\" (".$database.")…";
    system "mysqldump -e –add-drop-table –add-locks –allow-keywords -h".$host." -u".$username." -p".$password." ".$database." > ../../backup/".$filename.".sql";
    # print "GZip ".$filename."…\n";
    system "gzip ../../backup/".$filename.".sql";
    # print "Unlink ".$filename.".sql…\n";
    unlink "../../backup/".$filename.".sql";
    print "done.\n";
}

# Delete previous backups
if (-d "../backup/") {
    $where = "../backup/";
    while (defined($next = <$where/*.sql.gz>)) {
        unlink($next);
    }
}

backupMysql("<em>host</em>", "<em>username</em>", "<em>password</em>", "<em>database</em>", "<em>mybackupname</em>");

 

Optional .htaccess-File:

<Files ~ ".*(sql|gz|tar)">
    Deny from all
</Files>
 

Then call the URL by cronjob:

#!/bin/sh

remoteAddress="<em>ftp://user@yourftp.com</em> -p <em>password</em>"
localAddress="<em>/home/Backup/mybackupname</em>"

timeThreshold=15
mirrordirOptions="-v –keep-files  –no-chown –no-chmod  –num-backups 30 –mtime-threshold $timeThreshold "

echo "Backup to $localAddress — `date +"%a, %C.%B %Y"`"
echo -n "[`date +%H:%M:%S`] Killing runnung instances of mirrordir…"

/usr/bin/killall -9 mirrordir &amp;2>1 > /dev/null
echo "done."

mkdir -p $localAddress/htdocs > /dev/null

echo  "[`date +%H:%M:%S`] Backup of relevant databases…"
curl http://www.yourdomain.com/cgi-bin/backup/mysql.cgi
echo "done."

echo -n "[`date +%H:%M:%S`] Backup of remote FTP…"
/usr/bin/mirrordir $mirrordirOptions $remoteAddress $localAddress/htdocs
echo "done."

echo "[`date +%H:%M:%S`] Finished."
 

If you don’t have mirrordir or curl install it via aptitude install mirrordir curl on your debian box.

Filed under Allgemein, Datenbanken, Linux having No Comments »

Archives Posts

How to install Java and FOP on your linux box

Mai 20th, 2007 by Blu:RayNe

Debian or other Linux-Distributions do not include Java by default, so you first have to install the JVM. This is done in Debian by downloading the JVM binary distriubtion  from sun and then building a DEB-Package with the tools form java-package that you install by dpkg -i.

But let’s do that step-by-step:

Installing JAVA on your Debian box

  1. You’ll need the JavaVM, so get it at http://java.sun.com/ and search for the latest version. The filename should be something like jdk-1_5_0-linux-i586.bin.
  2. If not yet done, install the tools from java-package as root-user:
    apt-get install java-package

  3. Then build a DEB-Package from the downloaded file. This can and should be done only as standard user (no root!)
    fakeroot make-jpkg <java-binary-package-name>.bin

  4. If everything goes fine, you should see something like
    The Debian package has been created in the currentdirectory. You can install the package as root (e.g.dpkg -i sun-j2sdk1.5_1.5.0+update00_i386.deb).
  5. Then just install the package by ther given command:
    dpkg -i <created-package-name>.deb

  6. Check if it works by typing java -version. Following should be seen as standard and root user:
    java version "1.5.0"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

Installing Apache FOP on your Debian box

  1. Check if Java is installed and running.
  2. Get the latest binary from http://xmlgraphics.apache.org/fop/ . The file should be named something like fop-0.93-bin-jdk1.4.tar.gz.
  3. Extract the contents of the archive by tar -zxvf <fop-tarball>. This should results in a directory called fop-0.93.
  4. Move the directory to /usr/local/lib
    mv fop-0.93 /usr/local/lib
  5. Make a symlink for the directory without the version number
    ln -s /usr/local/lib/fop-0.93 /usr/local/lib/fop
  6. Make a symlink for the command line wrapper script in your /usr/bin
    ln -s /usr/local/lib/fop/fop /usr/bin/fop
  7. Edit /usr/bin/fop and put following at the beginning of the file (and below the header comment section!):
    export FOP_HOME=/usr/local/lib/fop

  8. Test the installation not only by typing fop -v, but instead by converting a fo file. This is necessary, because the command line wrapper is still very experimental:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

    <fo:layout-master-set>
      <fo:simple-page-master master-name="A4">
      <fo:region-body /><
      </fo:simple-page-master>

    </fo:layout-master-set>

    <fo:page-sequence master-reference="A4">
      <fo:flow flow-name="xsl-region-body">
        <fo:block>Hello World!</fo:block>
      </fo:flow>
    </fo:page-sequence>
    </fo:root>

More help

You can get in-depth installation guides and instructions here:

Archives Posts

Hilfe! Postfächer sind weg!

Mai 15th, 2007 by Blu:RayNe

Und hier wieder ein lustiger Witz für alle Linux- und Unix-Nutzer (inkl. Mac OSX):

- „Du Markus, nur dass du bescheid weißt ab 20:00 sind die Postfächer vom Exchange-Server abgeschaltet?“

- „Hä?! Wieso das?! Server-Update?“

- „Nein, der Exchange-Server muss defragmentieren.“

Archives Posts

STASI 2.0 – Schäuble tyrannisiert den LinuxTag 2007

Mai 10th, 2007 by Blu:RayNe

Nach dieser News auf heise.de musste einfach gehandelt werden:

Betreff [LinuxTag 2007] Mit Schäuble auf dem Programm gehe ich nicht hin!
To orga@linuxtag.org
CC schwobe@linuxtag.org
CC projects@linuxtag.org



Hallo lieber Organisatoren und sonstige Beteiligte,

eigentlich hätte ich mich schon auf die Veranstaltung sehr gefreut, jedoch musste ich erahren dass Bundesinnenminister Schäuble die Schirmherrschaft an sich gerissen hat. Dieser Mensch verkörpert für mich alles was Linux nicht ist, und er ist ein eindeutiger Grund warum ich eben meine Bahntickets storniert habe.

Linux verkörpert für mich Kooperation, gegenseitige Hilfe und Freiheit. Dieser Mensch – nein ich hätte ich noch andere Worte für Ihn – ist das genaue Gegenteil von allem was Linux bedeutet. Unter Ihm sehe ich jemanden, der von Technik weniger Ahnung hat als mein Hund, jemanden der am liebsten seine eigene Privatarmee hätte und versucht mit seiner Politik das Volk zu kriminalisieren und der Mündigkeit zu berauben. Ich finde diese Aussagen kaum übertrieben, eher aber eine mögliche Zukunftsvision, wenn diese Mensch noch länger an der Macht bleibt.

Es ist eine Schande, dass gerade Ihr ihm ein öffentliches Sprachrohr für seine Politik gebt, und es zulässt dass er viele durch seine falschen Ansichten beeinflußt. Normalerweise haben Vertreter der Konzepte von OSS nicht viele Möglichkeiten über die Miss-Stände oder der Dissinformation über die Sicherheits-Politk entgegenzuwirken – und ihr gebt diesen Menschen gerade am LinuxTag ein Sprachrohr?! Bitte!

Andere sehen es genau so wie ich, und ich werde mit mein bestes tun, die News über seine Herrschaft am LinuxTag weiter zu verbreiten.

Deswegen ladet diesen Menschen bitte einfach aus! Wir brauchen Ihn nicht, und sicherlich wär mir ein oder mehrere Euro nicht zu Schade um die Veranstaltung mitzufinanzieren. Ich bin mir sicher es geht auch ohne diesen Unfried Schäuble!

MfG
.mg

Und es geht weiter – hier ein Interview mit dem Bundesdatenschutzbeauftragten, dem anscheinend auch nur noch Sarkasmus in Anbetracht der Ohnmacht gegenüber der freiwilligen Selbstzensur der Gesellschaft übrig bleibt.

Mein Tipp: einfach mal auf volksverdummende Populärmedien wie Rotations-Radiostationen und Privatfernsehen verzichten. Damit kann man sehr schön sehen, wie sich die Gesellschaft verändert.

Im Moment würde ich jedenfalls lieber in einem sauerstoff-leeren Raum ersticken, statt hier weiter auf Erden zu sein. Nein, Vampire und andere Unsterbliche gab es wirklich – sie haben sich nur wegen Frust an der Gesellschaft selbst umgebracht </Sarkasmus>

Filed under Allgemein, Linux, Security having 2 Comments »

« Previous Entries