Archiv der Kategorie: HowTo

WebGL im Chrome unter Ubuntu

Lenovo hat im Thinkpad W520 sowohl eine Intel GPU als auch eine Karte von Nvidia eingebaut (Stichwort: Optimus) und Google Chrome deaktiviert scheinbar die Unterstützung für WebGL sobald er Optimus-Hardware erkennt. Überprüfbar über den Aufruf von

chrome://gpu/

 

Zum Aktivieren von WebGL

chrome://flags/

besuchen und hier den (obersten) Punkt „Software-Rendering-Liste überschreiben“ aktivieren. Nach einem Neustart http://www.chromeexperiments.com/webgl besuchen und mit ein paar wunderschönen Demos testen, ob alles funktioniert hat.

Update: Bei aktivierten WebGL brachte Google Maps gelegentlich das komplette System zum Absturz. Hier könnt ihr gezielt die Nicht-WebGL Version von Google Maps aufrufen. Mehr Informationen direkt bei Google: Klick.

Raspberry Pi: Update owncloud beta to owncloud 6

The final release of owncloud 6 is now available. Just like the update how to for beta 3, here is how to install it manually.

Download the update on your owncloud server

pi@raspberrypi ~ $  wget http://download.owncloud.org/community/owncloud-6.0.0.tar.bz2

pi@raspberrypi ~ $  tar xfv owncloud-6.0.0.tar.bz2

 

Create a backup of the files and database

pi@raspberrypi ~ $  mkdir 2013_12_12_Backup_owncloud_beta3/

pi@raspberrypi ~ $  sudo rsync -a /var/www/owncloud/ /home/pi/2013_12_12_Backup_owncloud_beta3/

pi@raspberrypi ~ $  sudo mysqldump owncloud -u root -p > /home/pi/2013_12_12_Backup_owncloud_beta3/owncloud.sql

 

Copy the update

pi@raspberrypi ~ $  sudo rsync –inplace -rtv owncloud/ /var/www/owncloud/

pi@raspberrypi ~ $  rm -r owncloud owncloud-6.0.0.tar.bz2

 

Visiting the webinterface of your installation will complete the update.

Raspberry Pi: Update owncloud 6 to beta 3

The beta3 update for owncloud 6 is available. Here is how to install it manually.

 

Download the update on your owncloud server

pi@raspberrypi ~ $  wget http://download.owncloud.org/community/testing/owncloud-6.0.0beta3.zip

pi@raspberrypi ~ $  unzip owncloud-6.0.0beta3.zip

 

Create a backup of the files and database

pi@raspberrypi ~ $  mkdir owncloud_bkp

pi@raspberrypi ~ $  sudo rsync -a /var/www/owncloud/ /home/pi/owncloud_bkp/

pi@raspberrypi ~ $  mysqldump owncloud -u root -p > /home/pi/owncloud.sql

 

Copy the update

pi@raspberrypi ~ $  sudo rsync –inplace -rtv owncloud/ /var/www/owncloud/

 

Visiting the webinterface of your installation will complete the update.

owncloud: csync konnte keine lock-Datei erstellen

Ich bekam heute nach dem Start des owncloud clients die Fehlermeldung

owncloud: csync konnte keine lock-Datei erstellen

und der client wollte dementsprechend nicht synchronisieren.

 

Mit ein wenig Google Fu stellte sich raus, dass der Client dieses Problem wohl gelegentlich hat. Manuelles löschen der lock Datei im Benutzerverzeichnis behebt das Problem.

[pat@earth ~]$ rm .local/share/data/ownCloud/lock

Raspberry Pi: Selfhosted cloud with ownCloud 6 beta

Quick writeup on how to install the new owncloud 6 beta on your raspberry Pi.

Disclaimer: If you want something superfast, leave this site now. If you’re looking for a really cheap way to get your own cloud (No NSA. So yay!) and give some use to your raspberry pi which is sitting on the shelf since months, here you go. Just don’t expect a 1 to 1 dropbox/drive/$whatever clone.

Prequirements: Working Raspberry Pi with Raspbian (path etc. may vary on other distributions) and a running webserver with php and ssl.

Installation on the Pi
Download the package from here, extract it, move it to the right location and set the correct user rights:

pi@raspberrypi ~ $ wget http://download.owncloud.org/community/testing/owncloud-6.0.0beta1.zip
pi@raspberrypi ~ $ unzip owncloud-6.0.0beta1.zip
pi@raspberrypi ~ $ sudo mv owncloud /var/www/
pi@raspberrypi ~ $ sudo chown -R www-data:www-data /var/www/owncloud
pi@raspberrypi ~ $ cd /var/www/owncloud/

We need to change a few settings in the php config.

pi@raspberrypi /var/www/owncloud $ sudo vi /etc/php5/fpm/php.ini

Replace

upload_max_filesize = 2M
post_max_size = 8M

with

upload_max_filesize = 1024M
post_max_size = 1024M

and add some lines to the end of the file (we will install apc later):

upload_tmp_dir = /srv/www/owncloud/data/temp
extension = apc.so
apc.enabled = 1
apc.include_once_override = 0
apc.shm_size = 256

Create the directory for uploads

pi@raspberrypi /var/www/owncloud $ sudo mkdir -p data/temp
pi@raspberrypi /var/www/owncloud $ sudo chown -R www-data:www-data data

After editing your webserver config according to the documentation, visit http://localhost/owncloud or http://raspberryip/owncloud and check for error messages. In my case, I got two:

1. PHP module GD is not installed. Please ask your server administrator to install the module.

So I needed to install this:

pi@raspberrypi /var/www/owncloud $ sudo aptitude install php5-gd

And

2. No database drivers (sqlite, mysql, or postgresql) installed.

Of course. After some searching and reading the official documentation about the database configuration, I decided to use MySQL as backend. Mainly because there will be at least two persons using the system. So I installed the mysql-server and php5-mysql package.

pi@raspberrypi /var/www/owncloud $sudo aptitude install mysql-server php5-mysql

After settings the root password, connect to your mysql server. Create a user for owncloud and a database.

pi@raspberrypi /var/www/owncloud $ mysql -u root -h localhost -p
CREATE USER ‚owncloud’@’localhost‘ IDENTIFIED BY ‚password‘;
CREATE DATABASE IF NOT EXISTS owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO ‚owncloud’@’localhost‘ IDENTIFIED BY ‚password‘;
QUIT

Return to http://localhost/owncloud or http://raspberryip/owncloud and complete the setup process.

Some tips to improve performance:
There are a few guides and tips on the net on how to improve performance of owncloud on your pi. Here are some of them.

1. Install the PHP Accelerator (see modified php.ini at the top)

pi@raspberrypi /var/www/owncloud $ sudo aptitude install php-apc

2. Use a cronjob to update the database and fasten up the webinterface. Open the crontab for the webserver user:

pi@raspberrypi /var/www/owncloud $ sudo crontab -u www-data -e

For updates every 15 minutes add:

*/15 * * * * php -f /var/www/owncloud/cron.php

On the webinterface go to Administration -> Cron and change the setting to Cron.

3. Disable unused apps. Disable all apps you don’t need.

 

Installation of the owncloud ubuntu client

pat@think:~$ wget http://download.opensuse.org/repositories/isv:ownCloud:devel/xUbuntu_13.10/Release.key
pat@think:~$ sudo apt-key add Release.key
pat@think:~$ echo ‚deb http://download.opensuse.org/repositories/isv:ownCloud:devel/xUbuntu_12.04/ /‘ >> sudo tee /etc/apt/sources.list.d/owncloud-client.list
pat@think:~$ sudo aptitude update
pat@think:~$ sudo aptitude install owncloud-client

Sources: http://doc.owncloud.org/server/5.0/admin_manual/installation/installation_others.html#nginx-configuration http://doc.owncloud.org/server/5.0/admin_manual/configuration/background_jobs.html#cron-jobs http://doc.owncloud.org/server/5.0/admin_manual/configuration/configuration_database.html http://jankarres.de/2013/10/raspberry-pi-owncloud-server-installieren/ (german) http://cloudlog.de/owncloud-langsam-diese-tipps-machen-owncloud-schneller/ (german)

Raspberry Pi: nginx Webserver with PHP and SSL

Installing the needed packages:

pi@raspberrypi ~ $ sudo aptitude install nginx php5-fpm php5-cgi php5-cli php5-common

There are different version of nginx available. For a comparison take a look at the debian wiki: https://wiki.debian.org/Nginx

Create the needed directory and php test file for later:

pi@raspberrypi ~ $ sudo mkdir /var/www
pi@raspberrypi ~ $ echo „<?php phpinfo(); ?>“ | sudo  tee /var/www/index.php
pi@raspberrypi ~ $ sudo chown -R www-data:www-data /var/www

Setting up SSL:

pi@raspberrypi ~ $ sudo mkdir /etc/nginx/conf.d/ssl && cd /etc/nginx/conf.d/ssl
pi@raspberrypi /etc/nginx/conf.d/ssl $ sudo openssl genrsa -out server.key 2048
pi@raspberrypi /etc/nginx/conf.d/ssl $ sudo openssl req -new -key server.key -out server.csr
pi@raspberrypi /etc/nginx/conf.d/ssl $ sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

And finally configure nginx:

pi@raspberrypi /etc/nginx/conf.d/ssl $ sudo vi /etc/nginx/sites-available/default

server {
listen 80;
root /var/www;
index index.php index.html index.htm;
server_name localhost;
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
try_files $uri $uri/ /index.html;
}
}

# HTTPS server
#
server {
listen 443;
server_name localhost;
root /var/www;
autoindex on;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/conf.d/ssl/server.crt;
ssl_certificate_key /etc/nginx/conf.d/ssl/server.key;
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
try_files $uri $uri/ /index.html;
}
}

Visit http://localhost or https://localhost and you should see your php configuration.

WLAN Bridge mit dd-wrt

Da ich vorher mehrfach daran gescheitert bin einen Router als WLAN Bridge einzurichten und mit dieser Anleitung für dd-wrt endlich das gewünschte Ergebnis hatte, möchte ich die Vorgehensweise einmal kurz hier festhalten:

Primärer Router (Fritzbox) hat die 192.168.11.1. Bridge nachher die 192.168.11.2.

  1. Wireless, Wireless security die korrekten Sicherheitseinstellungen eintragen. Save, apply.
  2. Wireless, Basic settings den Modus auf Client Bridge wechseln.
  3. Network Mode, Channel, SSID etc. identisch zum Router. Save, apply.
  4. Setup, Basic setup eine IP aus dem selben Subnetz (z.B. 192.168.11.2) als local IP eintragen. IP des Routers (192.168.11.1) bei Gateway IP eintragen. Apply.
  5. Webseite unter der neuen IP (192.168.11.2) neuladen und anmelden.
  6. Security, Firewall alles außer „Filter Multicast“ unter Block Wan Requests abwählen. Save.
  7. SPI Firewall deaktivieren. Apply.
  8. Setup, Advanced routing den Operation Mode auf router ändern. Apply.

Sollte es danach nicht möglich sein, Hosts im Internet zu erreichen und ihr die Meldung erhaltet

pat@thinkpad:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.11.2: icmp_seq=2 Redirect Host(New nexthop: 192.168.11.1)
From 192.168.11.2: icmp_seq=3 Redirect Host(New nexthop: 192.168.11.1)

navigiert zu Wireless, Basic Settings. Ändert Default GW Mode auf Manual und tragt die primäre IP eures Routers ein (hier: 192.168.11.1).

Samba Freigaben mit Leerzeichen mounten

Weil ich es ständig nachschauen muss und dem ein oder anderen evtl. hilft:

Leerzeichen im Freigabenamen werden in der /etc/fstab mit \040 dargestellt. Ein Eintrag sieht dann zum Beispiel so aus:

//IP/Freigegebener\040Ordner /mnt/ziel cifs noauto,users,uid=1000, gid=100,file_mode=0755,dir_mode=0750,iocharset=utf8,credentials=~/.smbcredentials 0 0

(Zeilenumbruch nur zur Formatierung)

EDIT: Einige Feedreader haben wohl ein Problem mit der Zeichenkette. \ 0 4 0 (Backslash – Null – Vier – Null)

Raspberry Pi: Mount and unmount truecrypt on startup and shutdown

My Raspberry Pi functions as a lokal NAS and data haven for backing up remote servers and all my clients. The data is stored in a truecrypt container on an external usb harddrive. The drive is mounted on bootup, as well as the decrypted container. If you follow my notes, please be aware that the password to unlock the files is stored in cleartext in the automount script and could show up when running e.g. ps. So maybe this isn’t the right solution when you grant access to your Pi to other people.

 

Create the two directories to mount the external harddrive and the truecrypt container.

sudo mkdir /mnt/{usb,truecrypt}

If you use NTFS as a filesystem on your external drive, install the ntfs-3g package and try mounting the it manually first:

pi@raspberrypi ~ $ sudo aptitude install ntfs-3g
pi@raspberrypi ~ $ mount -t ntfs-3g /dev/sda1 /mnt/usb

When everything works, add the permanent mount entry to your /etc/fstab:

/dev/sda1 /mnt/usb ntfs-3g defaults 0 0

To automount the truecrypt container on startup, install truecrypt like explained here and create the two init scripts for mounting and unmounting the container.

/etc/init.d/tc_mount

#!/bin/bash
### BEGIN INIT INFO
# Provides:          tc_mount
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2
# Default-Stop:
# Short-Description: tc_mount
# Description:      Mount the truecrypt container
### END INIT INFO
echo „Mounting truecrypt container“
/usr/local/bin/truecrypt -t -k „“ –protect-hidden=no –mount /mnt/usb/crypt /mnt/truecrypt/ -v -m=nokernelcrypto -p ‚YOURPASSWORD‘
exit 0

/etc/init.d/tc_unmount

#!/bin/bash
### BEGIN INIT INFO
# Provides:          tc_unmount
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:
# Default-Stop:      0 1 6
# Short-Description: tc_unmount
# Description:       Unmount the truecrypt container
### END INIT INFO
echo „Unmounting truecrypt containers“
/usr/local/bin/truecrypt -d
exit 0

And add them to the correct runlevels:

pi@raspberrypi ~ $ sudo update-rc.d tc_mount start 02 2 .
pi@raspberrypi ~ $ sudo update-rc.d tc_unmount stop 02 0 1 6 .

 

Sources:

http://debianforum.de/forum/viewtopic.php?f=34&t=123447

https://www.linuxquestions.org/questions/debian-26/run-this-command-when-the-computer-shutdown-or-reboot-683851/