Mal wieder nur die halbe Wahrheit über Viren und Linux

5. Februar 2012 Keine Kommentare

Die halbe Wahrheit über Viren und Linux auf SPON Umstieg auf Linux: Nie wieder Viren. Mein eeepc mit Ubuntu als OS hatte den DNSChanger (http://blog.botfrei.de/2011/11/trojaner-andert-dns-einstellungen/, http://www.dns-ok.de/).

Der eeepc wurde von meinen Nichten und Neffen nur zum Surfen genutzt, Niemand hatte root Rechte. Werden nicht kontinuierlich Updates eingespielt gibt es dieselben Probleme wie unter Windows…

KategorienInternet Tags:

cross domain post request using jQuery <= 1.6 fails

29. Januar 2012 Keine Kommentare


$.ajax({
'type' : 'POST',
'dataType' : 'json'
'url' : 'another-remote-server',
...
});

JQuery 1.6 and lower has a bug with cross-domain XHR. According to Firebug no requests except OPTIONS were sent.

Found here: http://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript

KategorienJavaScript Tags: , ,

Updating database structure fails

5. Juni 2011 Keine Kommentare

Following the instruction on Redspark Framework Quickstart I created 3 simple database tables without any timestamp or id fields. After creating the module using:
$ php RedSparkInstaller/latest/redspark_model_create.php
I tried to update the database structure

Klicken Sie im Browser im noch geöffneten Backend unter System > Wartung beim Punkt Datenbankstruktur aktualisieren auf LOS. Die Änderungen werden automatisch auf die DB übertragen.

but this fails with the following log message

==> log/Exception_Warning.log <==
[05-Jun-2011 16:33:54] (xxx)/(latest) [42000] SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'id'
/xxx/redspark/library/zend/1.11.x/Zend/Db/Statement/Pdo.php 234

The solution is to fix the model xml configuration:
$ svn diff
Index: latest/xxx/RsModule/Articles/Model/Xml/Category.xml
===================================================================
--- latest/xxx/RsModule/Articles/Model/Xml/Category.xml       (revision 11)
+++ latest/xxx/RsModule/Articles/Model/Xml/Category.xml       (working copy)
@@ -10,7 +10,7 @@
<subgroup>
<field>
<db_field>id</db_field>
-   <db_definition>int(12) NOT NULL default '' auto_increment</db_definition>
+  <db_definition>int(12) NOT NULL auto_increment</db_definition>
<db_primary>TRUE</db_primary>
<database_only>TRUE</database_only>
</field>

KategorienCoding, PHP Tags:

Create an empty RedSpark Application fails

5. Juni 2011 Keine Kommentare


[kuborgh@kb projects]$ cd redspark/application/
[kuborgh@kb application]$ php RedSparkInstaller/latest/redspark_app_clone.php

PHP Fatal error: Class 'RedSparkCore_RsToolbox_Cli' not found in /xxx/redspark/application/RedSparkInstaller/latest/redspark_app_clone.php on line 60

Only the directory with the current version exists after checkout:

$ ls /xxx/redspark/application/RedSparkCore/
1.3.x

Solution: Create a symbolic link for the latest version:

$ cd /xxx/redspark/application/RedSparkCore/
$ ln -s 1.3.x latest

KategorienCoding, PHP Tags:

MySQL – Select MD5()

3. Juni 2011 Keine Kommentare

Ubuntu 64, Server with MySQL Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

phpmyadmin

SELECT MD5( 'admin123' )
Result:
3031393230323361376262643733323530353136663036396466313862353030

console

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 90
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT MD5( 'admin123' );
+----------------------------------+
| MD5( 'admin123' ) |
+----------------------------------+
| 0192023a7bbd73250516f069df18b500 |
+----------------------------------+
1 row in set (0.00 sec)

wtf…

KategorienCoding Tags: ,

Redspark – error handling

3. Juni 2011 Keine Kommentare

Redspark overwrites the default error handling…
/* Error Handling as Exception */
require_once ('../bootstrap/error.php');

Error logs are located at log/*.log

Kategoriendefault Tags:

Redspark

3. Juni 2011 Keine Kommentare

Redspark einrichten:

  1. http://www.redsparkframework.de/Dokumentation/Tutorials/Installation.htm
  2. Redspark zip/Punkt 3: RedSpark-Step-by-Step-Installation.htm

  3. $ unzip RedsparkFrameworkSvn.zip
    $ cd redspark
    $ svn update
    $ chmod o+w log/ temp/ htdocs/static/ application/RedSparkInstaller/data/ application/RedSparkInstaller/data/auth/ application/RedSparkInstaller/data/ini/ config/ config/develop.ini config/bootstrap.ini
    $ vi config/bootstrap.ini

    Change default Application to “RedSparkInstaller/latest” if necessary :
    default = "RedSparkInstaller/latest";
    ;default = "RedSparkKickstart/latest";

    Open http://whatever.redspark/ and follow the instructions
  4. The admin password for the RedSparkKickstart backend login is “admin” and not your password from RedSparkInstaller
KategorienPHP Tags:

Running PHP 5.3 and 5.2 in parallel

1. Juni 2011 Keine Kommentare

Running PHP 5.2 as fcgi on debian with apache2

  • Download PHP 5.2 from http://php.net
  • Extract the archive (tar xvzf php-5.2.X.tar.bz2)
  • Change to the new directory (cd php-5.2.X)
  • Run the configure script, we used the following options (“php52″ is the name for configuration/data directories, instead of “php5″) thx to klausi.fsinf.at:

    ./configure --prefix=/usr/share/php52\
    --datadir=/usr/share/php52\
    --mandir=/usr/share/man\
    --bindir=/usr/bin/php52\
    --with-libdir=lib64\
    --includedir=/usr/include\
    --sysconfdir=/etc/php52/apache2\
    --with-config-file-path=/etc/php52/cli\
    --with-config-file-scan-dir=/etc/php52/conf.d\
    ...
    --enable-force-cgi-redirect --enable-fastcgi

  • make…
  • Create the config directory /etc/php52:

    $ sudo mkdir /etc/php52
  • Link configuration from /etc/php5 or create new configurations:

    $ sudo ln -s /etc/php5/cli /etc/php52/cli
    $ sudo ln -s /etc/php5/conf.d /etc/php52/conf.d
  • PHP 5.2 configuration complete
  • Create a new virtualhost (simple example):
    • Create directories:

      $ mkdir /var/www/customer
      $ mkdir /var/www/customer/conf
      $ mkdir /var/www/customer/fcgi
      $ mkdir /var/www/customer/htdocs
    • Create php.ini for this new customer:

      $ cp /etc/php52/cli/php.ini /var/www/customer/conf/php.ini
    • Change the open_basedir to something like:

      open_basedir = /var/www/customer/:/tmp/
    • Create fcgi wrapper in /var/www/customer/fcgi/php-fcgi-starter:

      $ vi /var/www/customer/fcgi/php-fcgi-starter

      Add the following code:

      #!/bin/sh
      PHPRC="/var/www/customer/conf/"
      export PHPRC
      export TMPDIR=/tmp
      exec /usr/bin/php52/php-cgi
    • Change owner and permissions:

      $ chown www-data:www-data -R /var/www/customer
      $ chmod u=r,g=r /var/www/customer/conf/php.ini
      $ chmod u+x,g+x /var/www/customer/fcgi/php-fcgi-starter
    • Create new vhost with:

      ...
      AddHandler fcgid-script .php
      ...

      ...
      # fcgi php 5.2 config
      Options -Indexes FollowSymLinks MultiViews ExecCGI
      FCGIWrapper /var/www/customer/fcgi/php-fcgi-starter .php
      ...

  • have fun!
KategorienCoding, PHP Tags: , , ,

Google Analytics: Wer Google Analytics nutzt, muss auch darüber informieren…

31. Mai 2011 Keine Kommentare

Gerade erst entdeckt… vielleicht doch in Zukunft mal die AGBs lesen…

Diese Website benutzt Google Analytics, einen Webanalysedienst der Google Inc. (Google) Google Analytics verwendet sog. Cookies, Textdateien, die auf Ihrem Computer gespeichert werden und die eine Analyse der Benutzung der Website durch Sie ermöglicht. Die durch den Cookie erzeugten Informationen…

blog.seibert-media.net

KategorienInternet Tags: , , ,

SVN Umzug von Server a auf b…

25. April 2010 Keine Kommentare

… sollte ganz leicht sein, trotzdem bin ich gestolpert:

  • svn: REPORT request failed on '/aaa/!svn/vcc/default'
    svn: Found malformed header in revision file

    oder
    svn: PROPFIND request failed on '/aaa'
    svn: Missing node-id in node-rev

    SVN Backup wurde nicht binär übertragen.
  • svn: PROPFIND request failed on '/bbb'
    svn: Could not open the requested SVN filesystem

    SVN Versionen überprüfen (svnadmin –version). Mein bbb Repository wurde für Version 1.5 erstellt, auf dem Server 1.4.
    libsvn1 1.4.2dfsg1-3
    libapache2-svn 1.4.2dfsg1-3
  • SVN Repository downgrading von 1.5 auf 1.4 … nicht schön… lieber Server updaten…
    1. Created a dump of the v1.5 repository named myproject_1_5.dump using the command “svnadmin dump myproject > myproject_1_5.dump”.
    2. Created a new repository that was compatible with v1.4 using the command “svnadmin create –pre-1.5-compatible myproject2″.
    3. Imported the v1.5 dump file into the new myproject2 with the command “svnadmin load myproject2 < myproject_1_5.dump”
    4. Created a dump of the v1.4 repository named myproject_1_4.dump using the command “svnadmin dump > myproject_1_4.dump”.
    5. Uploaded project_1_4.dump to the hosting account.
    6. Created a new repository: svnadmin create myproject
    7. Loaded the new data dump: svnadmin load myproject < myproject_1_4.dump”.

    Thx to mc-kenna.com

KategorienCoding, Internet Tags: