Debian SSL / HTTPS mit Apache2 einrichten

Einleitung

Hi,
seit der weltweiten Überwachung der NSA wissen wir alle das Verschlüsselung wichtig ist. Wie Ihr selbst HTTPS auf eurer Seite einrichtet zeige ich heute in einem kurzen Tutorial. Ich weise noch mal darauf hin das selbst erstellte Zertifikate bitte nur Lokal und zu Testzwecken genutzt werden sollten. Ok dann lasst uns beginnen.

Voraussetzungen:

Ihr benötigt Debian mit installiertem OpenSSL Modul und den Apache2 Webserver. Den Rest werden wir hier zusammen installieren.

SSL Zertifikat erstellen / generieren

Mit Hilfe von OpenSSL können wir uns in relativ wenigen Schritten ein eigenes Zertifikat erstellen.

1. Ordner zum speichern des Zertifikates erstellen und dorthin wechseln

mkdir /etc/apache2/ssl
cd /etc/apache2/ssl

3. Jetzt erstellen wir unseren privaten Key

openssl genrsa -out sslcert.key 2048

4. Aus dem Key generieren wir nun eine CSR Datei (Zertifizierungsanforderung oder auch engl. Certificate Signing Request). Diese enthält vereinfacht gesagt die Zertifikats Informationen.

openssl req -new -key sslcert.key -out sslcert.csr

Anschließend muss eine Reihe von Informationen eingegeben werden. In unserem Fall geben wir bei "CommonName" localhost ein da wir das Zertifikat für eine lokale Entwicklungsumgebung erstellen. Sie können auch alle anderen Felder leer lassen und diese mit "Enter" überspringen.

Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

5. Jetzt können wir aus der CSR Datei unser Zertifikat generieren. Die Gültigkeitsdauer des Zertifikates kann mit dem Parameter -days angegeben werden. In unserem Fall ist es 1 Jahr gültig.

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

Apache2 konfigurieren

1. Damit der Apache2 Webserver mit dem Zertifikat umgehen kann aktivieren wir zu nächst das "SSL Modul".

a2enmod ssl

2. Damit der Apache auf auf dem richtigen Port lauscht überprüfen wir die "ports.conf" im Ordner /etc/apache2/

cat /etc/apache2/ports.conf

Die Datei sollte in etwa so aussehen. Wichtig ist das auf Port 443 gelauscht wird.
Listen 80


        Listen 443



        Listen 443



3. Jetzt erstellen wir noch eine neue Vhost Config für den SSL Port.

nano /etc/apache2/sites-available/application-ssl.conf

Diese füllen wir dann mit folgendem Inhalt:

    DocumentRoot /var/www/application/public

    ErrorLog /var/www/application/log/error.log
    CustomLog /var/www/application/log/access.log combined

    SSLEngine on
    SSLCertificateKeyFile /etc/apache2/ssl/sslcert.key
    SSLCertificateFile /etc/apache2/ssl/sslcert.crt

    

        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

    


4. Im letzten Schritt starten wir Apache neu

service apache2 restart

Eure Seite sollte jetzt über https aufrufbar sein. Die Sicherheitswarnung im Firefox / Chrome sind normal, diese könnt Ihr einfach akzeptieren. Ich empfehle euch aber diese Konfiguration nur für Lokale Entwicklungsumgebungen! Für produktive Umgebungen bitte noch mal gründlich in SSL einlesen und ein Zertifikat von einem anerkannten Zertifikatsanbieter nehmen.

PC Spiele Release Kalender 2016 / 2017


Hi,

ich war heute auf der Suche nach einem "PC Spiele Release Kalender" den ich einfach in meinem Google Kalender importieren kann. Leider wurde ich bitter enttäuscht und ich fand nichts in der Form. Deshalb beschloss ich kurzer Hand einen eigenen "PC Spiele Release Kalender" für meinen Google Kalender zu erstellen. In diesem habe ich alle wichtigen neu Erscheinungen der nächsten Zeit eingetragen. Das Ergebnis stelle ich euch hier zur Verfügung.

PC Games Release Kalender 2016/2017

ICAL:
https://calendar.google.com/calendar/ical/m9but2o3kra856b8ige3mlh3hg%40group.calendar.google.com/public/basic.ics

HTML:
https://calendar.google.com/calendar/embed?src=m9but2o3kra856b8ige3mlh3hg%40group.calendar.google.com&ctz=Europe/Amsterdam

Falls Ihr Vorschläge oder Wünsche habt, dann schreibt sie einfach in die Kommentare.

Viel Spass mit dem Kalender.

PS: Er wird auch regelmäßig gepflegt.

Grüße

Daten Quelle:
http://www.gamestar.de/releaseliste/
http://www.pcgameshardware.de/Spiele-Thema-239104/Specials/PC-Spiele-2016-1168561/

Debug SplObjectStorage, ArrayObject und update Xdebug

Unser Thema: SplObjectStorage, ArrayObject debuggen

Hallo,
heute dreht sich alles um die Frage:
"Wie kann man PHP Klassen die von SplObjectStorage oder ArrayObject erben debuggen und dessen Inhalt sehen?"

Mein Problem

In meinem PHP Projekt benutze ich viele Collection Klassen die von ArrayObject erben. (Erklärung: ArrayObject ist eine PHP interne Klasse die es erlaubt Objekte so wie Arrays arbeiten zu lassen. PHP.net).

Dabei ist mir aufgefallen das ich den Inhalt von solchen Collections nicht in PHPStorm debuggen kann. Ich erhielt nur Meldungen wie "can not get property".

Nach kurzer Recherche im Internet fand ich ich dann auch die Ursache des Problems.





Die Ursache

Die Ursache des Problems war eine veraltet Xdebug Version. In meinem Fall war es die Version 2.2.3 welche die Darstellung von solchen Objekten nicht unterstützte.

Die Lösung

Das Problem war also gefunden nun musste es nur noch gelöst werden. Der Fehler in Xdebug wurde in der Version 2.3.3 behoben. Also musste ich nur eine Version installieren die >2.3.3 ist. (Xdebug Bug Ticket)

Xdebug updaten >2.3.3

Um Xdebug zu aktualisieren müssen wir eigentlich nur eine aktuelle Version herunterladen diese kompilieren und aktivieren. Wie das geht erkläre ich euch jetzt.

Xdebug Wizard hilft euch

Um einfach die für euch empfohlene Xdebug Version herauszufinden könnt Ihr den von der Xdebug Homepage bereitgestellten Wizard benutzen. Xdebug Wizard

Dem Wizard müsst Ihr nur den Inhalt eurer PHPInfo übergeben. Dazu einfach eine Datei anlegen (z.B. info.php) mit dem Inhalt:
<?php echo phpinfo(); 
Den Inhalt der Seite kopiert Ihr mit Strg + A (alles Markieren) und Strg + C (kopieren) in das Feld auf der Wizard Seite.

Der Wizard erzeugt euch dann eine Ausgabe mit einer passenden Installationsanleitung für euer System.

Xdebug herunterladen und kompilieren

  • In /tmp Verzeichnis wechseln
    • Befehl: cd /tmp
  • Xdebug herunterladen
    • Befehl: wget http://xdebug.org/files/xdebug-2.4.1.tgz
  • Archiv entpacken
    • Befehl: tar -xvzf xdebug-2.4.1.tgz
  • In entpackte Verzeichnis wechseln
    • Befehl: cd xdebug-2.4.1
  • Build initialisieren
    • Befehl: phpize
  • Konfigurieren
    • Befehl: ./configure
  • Builden
    • Befehl: make
  • Kompiliertes Modul in PHP Ordner kopieren
    • Befehl: cp modules/xdebug.so /usr/lib/php5/20121212
  • Falls nötig Extension Pfad anpassen in der php.ini
    • nano /etc/php5/apache2/php.ini
    • Einfügen: zend_extension = /usr/lib/php5/20121212/xdebug.so
Bei mir war der letzte Schritt nicht nötig da in meiner php.ini nur die Extension per Name "xdebug.so" geladen wird.

Wichtig! Nach den Änderungen PHP/Apache neustarten, damit die Änderungen wirksam werden.

Ergebnis

Eure phpinfo Datei sollte nun die aktuell installierte Version von Xdebug anzeigen. In etwa so:
Nachdem alles geklappt hat könnt Ihr nun ohne Probleme solche ArrayObject Klassen debuggen :)

Falls Ihr Probleme oder Anregungen habt schreibt diese bitte in die Kommentare.

Viel Spass und bis bald.

Pokemon Go - Cheater melden bei Niantic



Ja ich oute mich als Pokemon Go Spieler :D. Aber damit bin ich ja zum Glück nicht alleine hier.

Wahrscheinlich haben die meisten von euch es schon selbst erlebt. Man möchte eine Arena einnehmen aber diese wird von unbesiegbar starken Trainern blockiert. Ja ich rede von diesen Cheatern die die Arenen mit Ihrem hoch gelevelten Charakteren und Pokemon besetzen... (lvl 34-40).

Da Niantec jetzt permanente Banns für solche Spieler vergibt wird es Zeit nicht nur untätig rum zu sitzen sondern diese Spieler zu melden.

Hier noch mal der Link zum Niantec Formular: -> Cheater Melden

Das Formular sollte so aussehen:



Es ist wichtig das Ihr auch Screenshots von den Personen macht und diese im Formular hinzufügt. Screenshots kann man unter Android mit der Tastenkombination "Lautstärke runter" + "Power Button" erstellen.

Ich hoffe das wir gemeinsam etwas gegen diese Cheater und Botter unternehmen können und das das Spiel bald Frei von solchen Leuten ist.

Meinungen und Vorschläge bitte in die Kommentare.

PHP 7 auf Ubuntu 14 / 15 installieren

Ich erkläre euch hier wie Ihr PHP 7 auf eurem Ubuntu Server mit der Version 14 / 15 installieren könnt.

Der nette Herr Ondřej Surý pflegt nämlich ein PHP 7 Repository welches uns die einfache Installation mittels apt-get ermöglicht. Danke!

// repo hinzufügen und installieren
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.0 

// php7 check
php -v

// verfügbare Module auflisten
sudo apt-cache search php7-*

// alle wichtigen php7 module installieren
sudo apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0-opcache php7.0-json php7.0-tidy php7.0-ldap php7.0-intl php7.0-cli php7.0-common php7.0-xmlrpc libapache2-mod-php7.0 php7.0-soap php7.0-xml php7.0-zip php7.0-mcrypt

// memcached installieren
sudo apt-get install -y php-memcached

Fertig!
Eure Seite sollte nun mit PHP 7 ausgeliefert werden. Um das zu prüfen einfach ein phpinfo(); in euren Code einbauen und ausgeben lassen.

Ich werde jetzt noch einige PHP 7 Tests durchführen und wünsche euch viel Spass mit eurer Installation.

Selbstsigniertes Zertifikat erstellen und mit NGINX benutzen


Hi, wer NGINX und SSL benutzen möchte dazu aber kein Geld ausgeben will kann dies mit einem selbstsignierten Zertifikat machen. Dies wird aber nicht für Produktivsysteme geraten!

Als erstes erstellen wir uns einen Ordner im nginx Verzeichnis wo wir die Zertifikate generieren.
mkdir /etc/nginx/https
cd /etc/nginx/https
Zertifikate erzeugen:
openssl genrsa -out example.key 2048
openssl req -new -key example.key -out example.csr

Dabei kann man einige Daten angeben... oder auch nicht ;)
Country Name (2 letter code) [AU]:DE
State or Province Name (full name) [Some-State]:Mecklenburg-Vorpommern
Locality Name (eg, city) []:Neubrandenburg 
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Example Inc
Organizational Unit Name (eg, section) []:Skunk works
Common Name (e.g. server FQDN or YOUR name) []:example.org
Email Address []:webmaster@example.org

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Unser nun selbst erstelltes Zertifikat wird nun von uns selbst signiert für 730 Tage.
openssl x509 -req -days 730 -in example.csr -signkey example.key -out example.crt

Wir können nun unsere Zertifikate in NGINX einbinden. Dies passiert in der "server {}" Direktive.
server {
        listen 80;
        listen 443 ssl;

        root /var/www/example/root;
        index index.html index.htm;
 
        server_name example.com;

        ssl_certificate /etc/nginx/ssl/example.crt;
        ssl_certificate_key /etc/nginx/ssl/example.key;
}

Nach der Änderung den Webserver neustarten:
service nginx restart (oder /etc/init.d/nginx restart)

https / ssl sollte nun für eure Seite funktionieren. Da die Zertifikate selbst ausgestellt wurden müssen diese im Browser beim aufruf der Seite noch vertraut werden. Wer das nicht will sollte sich ein Zertifikat mit hilfe von "Lets Encrypt" erstellen.

Installieren der neusten NGINX Version unter Ubuntu 15.10


Hi,
ich möchte euch hier zeigen wie Ihr die neuste NGINX Version unter Ubuntu 15.10 installiert.

Das Problem welches Ubuntu hat ist das nicht die neuste Version des Webservers in den Repos vorhanden ist. Aber zum Glück pflegt das NGINX Team ein eigenes "apt" Repository. Und dieses machen wir uns zunutze :)


1. NGINX "Signing Key" hinzufügen
curl http://nginx.org/keys/nginx_signing.key | apt-key add -
2. NGINX Repo zur source list hinzufügen
echo -e "deb http://nginx.org/packages/mainline/ubuntu/ `lsb_release -cs` nginx\ndeb-src http://nginx.org/packages/mainline/ubuntu/ `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
3. Paket Index aktualisieren
apt-get update
4. Neuste NGINX Version installieren :)
apt-get install nginx
5. Fertig!
nginx -v
Du solltest nun die aktuelle Versionsnummer deines NGINX Webservers sehen.

Hinweiß: Die hier installierte Version beinhaltet das HTTP2 / SSL Modul bereits

[Off Topic] - Leipzig Cinestar Sneak Google Kalender


Hi,
mal ein Off Topic Thema hier :) Da ich gern mit meiner Freundin in die Sneak im Leipziger Cinestar gehen und ich dazu einen Kalender angelegt habe welche Filme gekommen sind, möchte ich diesern hier gern für interessierte teilen.

Der Kalender wird von Google Kalender gehostet und wird regelmäßig von mir gepflegt.

ICAL:
https://calendar.google.com/calendar/ical/rvhe37u6olp5rtj7tegbg9l1rg%40group.calendar.google.com/public/basic.ics

HTML:
https://calendar.google.com/calendar/embed?src=rvhe37u6olp5rtj7tegbg9l1rg%40group.calendar.google.com&ctz=Europe/Amsterdam

Viel Spass damit und vielleicht sieht man sich mal in der Sneak ;)
Grüße

NGINX - Passwortschutz für Ordner / Verzeichnis

Manchmal ist es sinnvoll einige seiner Internet Seiten mit einem Passwort zu schützen. Meistens wenn Webseiten noch nicht fertig sind oder bestimmte Ordner einfach nicht jedem Zugänglich sein sollen.

Der NGINX Webserver bietet dazu eine einfache Möglichkeit dieses Ziel zu erreichen. Mit dem meist Standardmäßig installierten NGINX Modul "ngx_http_auth_basic_module" kann man einen einfachen Passwortschutz realisieren. Zur Validierung wir der Benutzername und das Passwort verwendet (HTTP Basic Authentication).

Der Benutzer und das Passwort werden dazu in eine separate Datei gespeichert. Um diese Datei einfach zu erstellen benötigt man das Paket "apache2-utils".


  sudo apt-get install apache2-utils

Mit dem Befehl htpasswd erzeugt man nun eine Datei für einen bestimmten Benutzer (in dem Fall "admin"). Außerdem speichern wir die Datei direkt in das NGINX Verzeichnis.


  sudo htpasswd -c /etc/nginx/admin.htpasswd admin

Mann muss das Passwort 2 mal eingeben.

Anschließend muss man noch die NGINX Konfiguration anpassen. Hier ein kleines Beispiel.
server {
    server_name mypage.tld www.mypage.tld;
    
    listen 80 default_server;
    
    root /var/www;
    
    location /admin {
        auth_basic "Zugriff nicht erlaubt";
        auth_basic_user_file /etc/nginx/admin.htpasswd;
    }
}

Am Ende muss man noch den Webserver neustarten und schon sollte es funktionieren.

  sudo /etc/init.d/nginx restart

Fertig!
Euer Verzeichnis sollte jetzt geschützt sein. z.B. www.mypage.tld/admin

Quelle: Link

Ubuntu/Debian SSH Key erzeugen


Ubuntu SSH Key erzeugen und mit Github und Gitlab verwenden

Um sich ohne Passwort zu authentifizieren benötigt man oft einen SSH Key (Public Key). Hier in diesem Artikel erkläre ich euch kurz wie Ihr diesen erzeugen und benutzen könnt. (Artikel ist für Ubuntu/Debian System gedacht).
Bei dem Public-Key-Verfahren wird eine asymmetrische Verschlüsselung genutzt um den Benutzer zu authentifizieren. Der (oder die) öffentliche(n) Schlüssel des Benutzers befindet sich dabei in der Datei ~/.ssh/authorized_keys des Zielsystems, der private Schlüssel in einer Datei (meist id_rsa) im Verzeichnis ~/.ssh auf dem lokalen System, wo er zusätzlich von einer "pass phrase" geschützt wird. Wenn man sich nun mit der Public-Key-Methode auf einem SSH-Server anmelden möchte, so schickt der Server dem Klienten eine zufällig generierte Challenge. Der Klient verschlüsselt diesen Datenblock mit seinem privaten Schlüssel, (wofür nötigenfalls die Passphrase abgefragt wird,) und wenn der Server diesen Chiffre mit dem zugehörigen öffentlichen Schlüssel wieder entschlüsseln kann, ist die Identität des Benutzers bestätigt. Quelle

SSH Key erzeugen

ssh-keygen -t rsa -b 4096 

Erzeugt eine ähnlich aussehende Ausgabe:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
24:55:ee:67:83:72:82:55:5f:b9:b4:09:2a:fa:56:a1 user@client.local
The key's randomart image is:
+--[ RSA 4096]----+
|                 |
|                 |
|                 |
|         +    .  |
|        S    E   |
|         .  + +  |
|          .o . o.|
|         o.oo. oo|
|          ==o.BO+|
+-----------------+

SSH Ordner

Der erstellte Key sollte nun in eurem SSH Ordner unter ... zu finden sein.
/home/user/.ssh/

SSH anzeigen und zu Github/Gitlab kopieren

Nun den Inhalt des Public Keys (.pub) in euren Github / Gitlab Account unter SSH Keys hinterlegen. Einfach den Inhalt der Datei mit dem Befehl cat ausgeben lassen und kopieren.
cat id_rsa.pub


Fertig :)

PHPStorm Portable machen

PHPStorm Portable machen (in separaten Ordner installieren)

Hier erkläre ich euch wie Ihr die beliebte PHP IDE - PHPStorm portabel machen könnt. Das bedeutet das Programm wird komplett in einem separaten Ordner installiert und auch von dort gestartet. Wo der Ordner liegt (z.B. auf einem USB Stick, Festplatte) ist völlig egal.

Schritt 1: PHPStorm herunterladen

Am besten ladet Ihr PHPStorm von der offiziellen Herstellerseite herunter.
Link: https://www.jetbrains.com/phpstorm/download/

Linux: Archiv in euren wunsch Ordner extrahieren
Windos: PHPStorm Installation in euren Wunschordner vornehmen

Schritt 2: idea.properties im Ordner /bin anpassen

Jetzt müssen wir eine wichtige Anpassung in der idea.properties Datei vornehmen. Diese findet Ihr in dem Ordner /bin eurer PHPStorm installation.

In der Datei tauschen wir die Variablen:
  ${user.home} gegen ${idea.home}

Wichtig!: Die Zeilen müssen einkommentiert werden.

idea.config.path=${idea.home}/.WebIde/config
idea.system.path=${idea.home}/.WebIde/system
idea.plugins.path=${idea.home}/plugins
idea.log.path=${idea.home}/log

Mehr Infos zur Datei idea.proteries: Klick hier

Schritt 3: PHPStorm starten

Im Ordner /bin könnt Ihr nun die phpstorm.sh ausführen und PHPStorm starten.

Fertig. Eure Installation ist nun portable.

Xdebug.ini für Remote Debugging in PHPStorm


Komplett voreingestellte xdebug.ini für Ubuntu 14.04 direkt zur Verwendung mit PHPStorm.
Download: xdebug.ini


Code:
[debug]
zend_extension=xdebug.so

; Using Xdebug
;
; Q:  phpinfo() reports that Xdebug is installed and enabled, yet I still don't get any stacktraces when an error
;     happens.
; A1: You have to search through all your PHP libraries and include files for any "set_error_handler" calls.
;     If there are any, you have to either comment it out, or change the body of the handler function to call
;     xdebug_* api functions.
; A2: You do not have set [display_errors] to 1 in php.ini
; Q:  Xdebug doesn't format output.
; A:  Make sure you have PHP's [html_errors] set to 1 in php.ini
; Q:  The debug client doesn't receive any connections, what do I do wrong?
; A:  You probably forgot to set the environment variable or to add the necessary information to your URL. See the
;     documentation for more information.
;
;
; Related Links:
;
; FAQ: http://xdebug.org/docs/faq
; Related Settings: http://www.xdebug.org/docs/all_settings
;
;
; Author: Frank Göldner
; Stand : Nov 2011



; ===| basics |===

; Controls which IDE Key Xdebug should pass on to the DBGp debugger handler. The default is based on environment
; settings. First the environment setting DBGP_IDEKEY is consulted, then USER and as last USERNAME. The default is set
; to the first environment variable that is found. If none could be found the setting has as default ''.
; Type: string, Default value: *complex*
xdebug.idekey = "PHPSTORM"

; This is the base url for the links from the function traces and error message to the manual pages of the function
; from the message. It is advisable to set this setting to use the closest mirror.
; Type: string, Default value: http://www.php.net
xdebug.manual_url = "http://de.php.net/"

; Controls the protection mechanism for infinite recursion protection. The value of this setting is the maximum level
; of nested functions that are allowed before the script will be aborted.
; Type: integer, Default value: 100
xdebug.max_nesting_level = 110



; If this setting is 1, then stacktraces will be shown by default on an error event. You can disable showing
; stacktraces from your code with xdebug_disable(). As this is one of the basic functions of Xdebug, it is advisable
; to leave this setting set to 1.
; Type: boolean, Default value: 1
xdebug.default_enable = 1

; When this setting is set to on, the tracing of function calls will be enabled just before the script is run. This
; makes it possible to trace code in the auto_prepend_file.
; Type: boolean, Default value: 0
;xdebug.auto_trace = 0

; When this setting is set to 1, Xdebug will show a stack trace whenever an exception is raised - even if this
; exception is actually caught.
; Type: integer, Default value: 0
xdebug.show_exception_trace = 0

; If this setting is 1, then Xdebug will disable the @ (shut-up) operator so that notices, warnings and errors are no
; longer hidden.
; Type: boolean, Default value: 0, Introduced in Xdebug 2.1
xdebug.scream = 0

; If this setting is 1, Xdebug will color var_dumps and stack traces output when in CLI mode.
; Type: boolean, Default value: 0, Introduced in Xdebug 2.2
xdebug.cli_color = 1




; ===| level of detail |===

; When this setting is set to something != 0 Xdebug's generated stack dumps in error situations will also show all
; variables in the top-most scope. Beware that this might generate a lot of information, and is therefore turned off
; by default.
; Type: integer, Default value: 0
xdebug.show_local_vars = 0

; When this setting is set to something != 0 Xdebug's human-readable generated trace files will show the difference in
; memory usage between function calls. If Xdebug is configured to generate computer-readable trace files then they will
; always show this information.
; Type: integer, Default value: 0
xdebug.show_mem_delta = 0

; Controls the amount of array children and object's properties are shown when variables are displayed with either
; xdebug_var_dump(), xdebug.show_local_vars or through Function Traces. This setting does not have any influence on the
; number of children that is send to the client through the Remote Debugging feature.
; Type: integer, Default value: 128
xdebug.var_display_max_children = 256

; Controls the maximum string length that is shown when variables are displayed with either xdebug_var_dump(),
; xdebug.show_local_vars or through Function Traces. This setting does not have any influence on the amount of data
; that is send to the client through the Remote Debugging feature.
; Type: integer, Default value: 512
xdebug.var_display_max_data = 1024

; Type: integer, Default value: 3
; Controls how many nested levels of array elements and object properties are when variables are displayed with either
; xdebug_var_dump(), xdebug.show_local_vars or through Function Traces. This setting does not have any influence on the
; depth of children that is send to the client through the Remote Debugging feature.
xdebug.var_display_max_depth = 3

; This setting, defaulting to 0, controls whether Xdebug should add variable assignments to function traces.
; Type: boolean, Default value: 0, Introduced in Xdebug 2.1
xdebug.collect_assignments = 0

; This setting, defaulting to 1, controls whether Xdebug should write the filename used in include(), include_once(),
; require() or require_once() to the trace files.
; Type: boolean, Default value: 1
xdebug.collect_includes = 1

; This setting, defaulting to 0, controls whether Xdebug should collect the parameters passed to functions when a
; function call is recorded in either the function trace or the stack trace.
;
; The setting defaults to 0 because for very large scripts it may use huge amounts of memory and therefore make it
; impossible for the huge script to run. You can most safely turn this setting on, but you can expect some problems in
; scripts with a lot of function calls and/or huge data structures as parameters. Xdebug 2 will not have this problem
; with increased memory usage, as it will never store this information in memory. Instead it will only be written to
; disk. This means that you need to have a look at the disk usage though.
;
; This setting can have four different values. For each of the values a different amount of information is shown. Below
; you will see what information each of the values provides. See also the introduction of the feature Stack Traces for
; a few screenshots.

; Value   Argument Information Shown
; 0       None.
; 1       Type and number of elements (f.e. string(6), array(8)).
; 2       Type and number of elements, with a tool tip for the full information 1.
; 3       Full variable contents (with the limits respected as set by xdebug.var_display_max_children,
;         xdebug.var_display_max_data and xdebug.var_display_max_depth.
; 4       Full variable contents and variable name.
; Type: integer, Default value: 0
xdebug.collect_params = 4

; This setting, defaulting to 0, controls whether Xdebug should write the return value of function calls to the trace
; files.
; Type: boolean, Default value: 0
xdebug.collect_return = 0

; This setting tells Xdebug to gather information about which variables are used in a certain scope. This analysis can
; be quite slow as Xdebug has to reverse engineer PHP's opcode arrays. This setting will not record which values the
; different variables have, for that use xdebug.collect_params. This setting needs to be enabled only if you wish to
; use xdebug_get_declared_vars().
; Type: boolean, Default value: 0
xdebug.collect_vars = 0

; * = COOKIE, FILES, GET, POST, REQUEST, SERVER, SESSION. These seven settings control which data from the superglobals
; is shown when an error situation occurs. Each php.ini setting can consist of a comma seperated list of variables from
; this superglobal to dump, but make sure you do not add spaces in this setting. In order to dump the REMOTE_ADDR and
; the REQUEST_METHOD when an error occurs, add this setting:
; xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
;
; Type: string, Default value: Empty
; xdebug.dump.* = ?

; Controls whether the values of the superglobals as defined by the xdebug.dump.* settings whould be shown or not.
; Type: boolean, Default value: 1
xdebug.dump_globals = 1

; Controls whether the values of the superglobals should be dumped on all error situations (set to 0) or only on the
; first (set to 1).
; Type: boolean, Default value: 1
xdebug.dump_once = 1

; If you want to dump undefined values from the superglobals you should set this setting to 1, otherwise leave it set
; to 0.
; Type: boolean, Default value: 0
xdebug.dump_undefined = 0

; Controls whether Xdebug should enforce 'extended_info' mode for the PHP parser; this allows Xdebug to do file/line
; breakpoints with the remote debugger. When tracing or profiling scripts you generally want to turn off this option as
; PHP's generated oparrays will increase with about a third of the size slowing down your scripts. This setting can not
; be set in your scripts with ini_set(), but only in php.ini.
; Type: integer, Default value: 1
xdebug.extended_info = 1

; By default Xdebug overloads var_dump() with its own improved version for displaying variables when the html_errors
; php.ini setting is set to 1. In case you do not want that, you can set this setting to 0, but check first if it's not
; smarter to turn off html_errors.
; Type: boolean, Default value: 1, Introduced in Xdebug 2.1
xdebug.overload_var_dump = 1




; ===| remote settings |===

; This switch controls whether Xdebug should try to contact a debug client which is listening on the host and port as
; set with the settings xdebug.remote_host and xdebug.remote_port. If a connection can not be established the script
; will just continue as if this setting was 0.
; Type: boolean, Default value: 0
xdebug.remote_enable = 1

; Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote Debugging). When
; this setting is set to 1, Xdebug will always attempt to start a remote debugging session and try to connect to a
; client, even if the GET/POST/COOKIE variable was not present.
; Type: boolean, Default value: 0
xdebug.remote_autostart = 0

; If enabled, the xdebug.remote_host setting is ignored and Xdebug will try to connect to the client that made the HTTP
; request. It checks the $_SERVER['REMOTE_ADDR'] variable to find out which IP address to use. Please note that there
; is no filter available, and anybody who can connect to the webserver will then be able to start a debugging session,
; even if their address does not match xdebug.remote_host.
; Type: boolean, Default value: 0, Introduced in Xdebug 2.1
xdebug.remote_connect_back = 1

; Selects the host where the debug client is running, you can either use a host name or an IP address. This setting is
; ignored if xdebug.remote_connect_back is enabled.
; Type: string, Default value: localhost
xdebug.remote_host = "192......"
; deine UNIDEV IP falls ifconfig gesperrt -> ip -4 -o addr show eth0 | awk -F"[/, ]" '{print $7 }'
;xdebug.remote_host = "127.0.0.1"

; This setting can be used to increase (or decrease) the time that the remote debugging session stays alive via the
; session cookie.
; Type: integer, Default value: 3600, Introduced in Xdebug 2.1
xdebug.remote_cookie_expire_time = 3600

; Can be either 'php3' which selects the old PHP 3 style debugger output, 'gdb' which enables the GDB like debugger
; interface or 'dbgp' - the debugger protocol. The DBGp protocol is more widely supported by clients. See more
; information in the introduction for Remote Debugging.
;
; Note: Xdebug 2.1 and later only support 'dbgp' as protocol.
; Type: string, Default value: dbgp
xdebug.remote_handler = "dbgp"

; If set to a value, it is used as filename to a file to which all remote debugger communications are logged. The file
; is always opened in append-mode, and will therefore not be overwritten by default. There is no concurrency protection
; available. The format of the file looks something like:
; Log opened at 2007-05-27 14:28:15
; ->
;
;
; Type: string, Default value:
; xdebug.remote_log =

; Selects when a debug connection is initiated. This setting can have two different values:
; req
;   Xdebug will try to connect to the debug client as soon as the script starts.
; jit
;   Xdebug will only try to connect to the debug client as soon as an error condition occurs.
; Type: string, Default value: req
xdebug.remote_mode = "req"

; The port to which Xdebug tries to connect on the remote host. Port 9000 is the default for both the client and the
; bundled debugclient. As many clients use this port number, it is best to leave this setting unchanged.
; Type: integer, Default value: 9000
xdebug.remote_port = 9002




; ===| trace options |===

; When this setting is set to on, the tracing of function calls will be enabled just before the script is run. This
; makes it possible to trace code in the auto_prepend_file.
; Type: boolean, Default value: 0
xdebug.auto_trace = 0

; When this setting is set to 1, you can trigger the generation of trace files by using the XDEBUG_TRACE GET/POST
; parameter, or set a cookie with the name XDEBUG_TRACE. This will then write the trace data to defined directory.
; In order to prevent Xdebug to generate trace files for each request, you need to set xdebug.auto_trace to 0.
; Type: boolean, Default value: 0, Introduced in Xdebug 2.2
xdebug.trace_enable_trigger = 0

; When set to '1' the trace files will be appended to, instead of being overwritten in subsequent requests.
; Type: integer, Default value: 0
xdebug.trace_options = 0

; The directory where the tracing files will be written to, make sure that the user who the PHP will be running as has
; write permissions to that directory.
; Type: string, Default value: /tmp
;xdebug.trace_output_dir = "/data/h.test/projects/_tracer/"

; This setting determines the name of the file that is used to dump traces into. The setting specifies the format with
; format specifiers, very similar to sprintf() and strftime(). There are several format specifiers that can be used to
; format the file name. The '.xt' extension is always added automatically.

; The possible format specifiers are:
;
; Spec Meaning                                  Example Format     Example Filename
; %c   crc32 of the current working directory   trace.%c           trace.1258863198.xt
; %p   pid                                      trace.%p           trace.5174.xt
; %r   random number                            trace.%r           trace.072db0.xt
; %s   script name²                             cachegrind.out.%s  cachegrind.out._home_httpd_html_test_xdebug_test_php
; %t   timestamp (seconds)                      trace.%t           trace.1179434742.xt
; %u   timestamp (microseconds)                 trace.%u           trace.1179434749_642382.xt
; %H   $_SERVER['HTTP_HOST']                    trace.%H           trace.kossu.xt
; %R   $_SERVER['REQUEST_URI']                  trace.%R           trace._test_xdebug_test_php_var=1_var2=2.xt
; %U   $_SERVER['UNIQUE_ID']³                   trace.%U           trace.TRX4n38AAAEAAB9gBFkAAAAB.xt
; %S   session_id (from $_COOKIE if set)        trace.%S           trace.c70c1ec2375af58f74b390bbdd2a679d.xt
; %%   literal %                                trace.%%           trace.%%.xt
;
; ²This one is not available for trace file names.
; ³New in version 2.2. This one is set by Apache's mod_unique_id module
; Type: string, Default value: trace.%c
xdebug.trace_output_name = "trace.%c"

; The format of the trace file.Value  Description
; 0   shows a human readable indented trace file with: time index, memory usage, memory delta (if the setting
;     xdebug.show_mem_delta is enabled), level, function name, function parameters (if the setting
;     xdebug.collect_params is enabled), filename and line number.
; 1   writes a computer readable format which has two different records. There are different records for entering a
;     stack frame, and leaving a stack frame. The table below lists the fields in each type of record. Fields are tab
;     separated.
;
; Fields for the computerized format:
; Record type 1      2           3           4           5             6               7                                           8                                   9           10
; Entry       level  function #  always '0'  time index  memory usage  function name   user-defined (1) or internal function (0)   name of the include/require file    filename    line number
; Exit        level  function #  always '1'  time index  memory usage  -------------------------------------------------------  empty  -------------------------------------------------------
;
; See the introduction of Function Traces for a few examples.
; Type: integer, Default value: 0
xdebug.trace_format = 0




; ===| Profiling |===

; When this setting is set to 1, profiler files will not be overwritten when a new request would map to the same file
; (depnding on the xdebug.profiler_output_name setting. Instead the file will be appended to with the new profile.
; Type: integer, Default value: 0
xdebug.profiler_append = 0

; Enables Xdebug's profiler which creates files in the profile output directory. Those files can be read by KCacheGrind
; to visualize your data. This setting can not be set in your script with ini_set(). If you want to selectively enable
; the profiler, please set xdebug.profiler_enable_trigger to 1 instead of using this setting.
; Type: integer, Default value: 0
xdebug.profiler_enable = 0

; When this setting is set to 1, you can trigger the generation of profiler files by using the XDEBUG_PROFILE GET/POST
; parameter, or set a cookie with the name XDEBUG_PROFILE. This will then write the profiler data to defined directory.
; In order to prevent the profiler to generate profile files for each request, you need to set xdebug.profiler_enable
; to 0.
; Type: integer, Default value: 0
xdebug.profiler_enable_trigger = 0

; The directory where the profiler output will be written to, make sure that the user who the PHP will be running as
; has write permissions to that directory. This setting can not be set in your script with ini_set().
; Type: string, Default value: /tmp
;xdebug.profiler_output_dir = "/data/f.goeldner/projects/profiler/"

; This setting determines the name of the file that is used to dump traces into. The setting specifies the format with
; format specifiers, very similar to sprintf() and strftime(). There are several format specifiers that can be used to
; format the file name.
;
; See the xdebug.trace_output_name documentation for the supported specifiers.
; Type: string, Default value: cachegrind.out.%p
xdebug.profiler_output_name = "cachegrind.out.%p"

Linux Bash History durchsuchen und Limit erhöhen


Linux Bash History durchsuchen und Speicherlimit erhöhen


Viele kennen vielleicht das Problem das man auf der Konsole ein komplexen Befehl ausgeführt hatte aber diesen nicht mehr vollständig kennt. Da in Linux ausgeführte Befehle standardmä0ig in der Bash History (~/.bash_history) gespeichert werden ist es relativ leicht seine bereits genutzten Befehle wieder zu finden. Um die History zu durchsuchen genügt es diesen Befehl auszuführen:

Bash History durchsuchen:
  history | grep "MeinSuchwort"

Die History speichert Standardmäßig 2000 Befehle. Einigen Leuten ist das aber einfach zu wenig und Sie hätten gern das Ihre History 10.000 Einträge speichert. Um das zu ermöglichen muss man folgende Änderungen vornehmen.

Bash History Limit erhöhen:
bashrc bearbeiten:
 
  nano ~/.bashrc

Limit anpassen:
 
  HISTSIZE=10000
  HISTFILESIZE=10000

HISTSIZE - Anzahl der zu speichernden Befehle in der Bash Session
HISTFILESIZE - Anzahl der enthaltenen Zeilen die in die history Datei gespeichert werden

Viel Spass beim erweitern eurer Bast History ;)