Not sure why this is not default, but can change this.
In Settings > Tools > Terminal change the "Shell path" and add your project path.
Windows: cmd.exe /K cd C:\your_project_path
Linux/Mac: ? (please leave a comment)
Posts mit dem Label Webentwicklung werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Webentwicklung werden angezeigt. Alle Posts anzeigen
Donnerstag, 19. November 2015
Donnerstag, 15. Oktober 2015
PHPStorm: fatal: protocol error: bad line length character: Erro
In PHPStorm I got with git pull and git push this error:
fatal: protocol error: bad line length character: Erro
An error has occurred while processing the shared archive file.
Unable to unmap shared space.
While command line and tortoise worked fine.
Fixed it by changing in PHPStorm settings in Version Control > Git:
"SSH executable" from "Build-in" to "Native"
Only toke me a few hours to figure this out :D
fatal: protocol error: bad line length character: Erro
An error has occurred while processing the shared archive file.
Unable to unmap shared space.
While command line and tortoise worked fine.
Fixed it by changing in PHPStorm settings in Version Control > Git:
"SSH executable" from "Build-in" to "Native"
Only toke me a few hours to figure this out :D
Mittwoch, 22. April 2015
Index strikes back!
Das war ein Spaß heute. Es fing an, das PhpStorm keine Datei auf den Server geladen hat. Stattdessen reagiert es einfach nicht mehr. Remote Host öffnen... hängt. FileZilla... hängt. SSH.. ls.. hängt... hängt.... zeigt unendlich viele backup Dateien der index.php:
index.php.bak.553785435d2a1
index.php.bak.5537866e6dd85
index.php.bak.5537879a7f265
index.php.bak.553788c6b1cd0
index.php.bak.553789f2c3d3f
index.php.bak.553785435d2a1
index.php.bak.5537866e6dd85
index.php.bak.5537879a7f265
index.php.bak.553788c6b1cd0
index.php.bak.553789f2c3d3f
$ rm index.php.bak.*
/bin/rm: Argument list too long
Google... stackoverflow ftw
$find . -maxdepth 1 -name "index.php.bak.*" -print0 | xargs -0 rm
Haha, gewonnen, alles gut. Upload geht wieder. Remote Host... zweigt schon wieder index.php.bak.553793529fb77
$ ls -la
-rw-rw-rw-. 1 apache apache index.php.bak.553790fab8794
-rw-rw-rw-. 1 apache apache index.php.bak.553792268158b
-rw-rw-rw-. 1 apache apache index.php.bak.553793529fb77
Alle 5 Minuten wird eine erstelle. Von apache, also irgendein Script...
$ crontab -e
Ist leer.
$ ls /etc/cron.*
Auch nichts dabei.
$ grep "index.php." -R *
Wieder nichts...
Schließlich findet sich im Apache Log der entscheidende Hinweis. Ein verschlüsseltes Fremd-Modul wird von außen alle 5 min. aufgerufen und macht irgendeinen mist.
Hersteller ist informiert. Derweil heißt es fleißig löschen...
Freitag, 23. Januar 2015
Detect client speed using JavaScript
You can detect how long it toke for the browser to load the page. With load I mean the download time. Have a look at window.performance it contains all the timings. Also see html5rocks.
Note that this works best it the page size is large. For small pages the TCP/IP overhead for is large compared to your download time. My page was about 19304 bytes and I was able to detect mobile vs desktop.
Also see this stackoverflow question.
This does not work for IE8 and Safari
if (window.performance && window.performance.timing) { var download_time = (window.performance.timing.responseEnd - window.performance.timing.responseStart); var speed = ($('html').html().length) / download_time; if (speed < 400) { alert('slow'); } else { alert('fast'); } }
Note that this works best it the page size is large. For small pages the TCP/IP overhead for is large compared to your download time. My page was about 19304 bytes and I was able to detect mobile vs desktop.
Also see this stackoverflow question.
This does not work for IE8 and Safari
Mittwoch, 17. Dezember 2014
IE Post empty with NTLM
With NTLM login enabled sometimes data send with POST is missing. This is because IE has an internal timeout and tries to recheck NTLM.
With fiddler you can see the problem. One hacky solution is to catch this request and response with a fake answer. After this the IE will send the normal POST data.
To get the correct NTLM response use fiddle during a NTLM login. Switch the inspector to "Auth" and look for the "Type: 1" response and replace below with long string behind "WWW-Authenticate: NTLM". Place this at the top of your page and it will catch and respond to any IE NTLM request.
Note: This might be a security risk. Make sure to check the user Session and send him to your NTLM login is needed.
With fiddler you can see the problem. One hacky solution is to catch this request and response with a fake answer. After this the IE will send the normal POST data.
To get the correct NTLM response use fiddle during a NTLM login. Switch the inspector to "Auth" and look for the "Type: 1" response and replace
$headers = apache_request_headers();
$auth = $headers['Authorization'];
if ($auth && substr($auth,0,5) == 'NTLM ')
{
$msg = base64_decode(substr($auth, 5));
if ($msg[8] == "\x01") {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: NTLM ' );
exit;
}
}
Note: This might be a security risk. Make sure to check the user Session and send him to your NTLM login is needed.
Donnerstag, 6. November 2014
webid-solutions ing-diba Warteschleife schummeln
Ich liebe Web-Anwendungen, vor allem wenn sie sauber geschrieben sind. Vor allem weil das JavaScript schön Open Source ist und man als Anwender die frei Kontrolle über die UI hat.
So habe ich neulich ein Konto bei der ING-DiBa angelegt und die bequeme Legitimation per Video-Call genutzt. Leider hängt man dabei recht lange auf der Webseite www.webid-solutions.de/diba und wartet auf einen Ansprechpartner. Besonders nervig, dass man nur alle 30 Sekunden neu Versuchen kann und dann wartet man wieder.
Die Warte Zeit kann man aber gut nutzen um eben mal den Source Code auf zu machen und die callSkype() Funktion zu suchen. Dort ist schnell die lästige alert() Meldung, dass man doch 30 Sekunden warten soll ersetzt durch ein automatisches neu versuchen. Einfach F12 und die Funktion in die Console kopieren und schon ist das Warten vorbei:
So habe ich neulich ein Konto bei der ING-DiBa angelegt und die bequeme Legitimation per Video-Call genutzt. Leider hängt man dabei recht lange auf der Webseite www.webid-solutions.de/diba und wartet auf einen Ansprechpartner. Besonders nervig, dass man nur alle 30 Sekunden neu Versuchen kann und dann wartet man wieder.
Die Warte Zeit kann man aber gut nutzen um eben mal den Source Code auf zu machen und die callSkype() Funktion zu suchen. Dort ist schnell die lästige alert() Meldung, dass man doch 30 Sekunden warten soll ersetzt durch ein automatisches neu versuchen. Einfach F12 und die Funktion in die Console kopieren und schon ist das Warten vorbei:
function callSkype() {
var xmlhttp;
var theUrl = "https://webid-gateway.de//service/skypename/cn/000112/ai/160746000";
var d = new Date();
var t = d.getTime();
clickcounter = clickcounter + 1;
if (clickcounter == 2) {
document.getElementById("callback_box").style.display = "block";
}
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.responseText !== "") {
window.location = "skype:"+xmlhttp.responseText +"?call&video=true";
} else {
// nein ich möchte nicht warten
// sondern es direkt nochmal probieren:
callSkype();
}
}
}
xmlhttp.open("GET", theUrl, true);
xmlhttp.send(null);
lastClick = t;
}
callSkype();
Mittwoch, 18. Juni 2014
Passwörter verschicken
Webanwendungen sollte nie Passwörter verschicken sondern nur einen Passwort-Rest Link. Trotzdem kommt es in der Praxis leider manchmal vor das man jemand ein Passwort schicken will und der Empfänger leider kein GPG oder S/MIME hat.
Hier kann man dann ein passwort-geschützes Archiv schicken oder aber wenn sonst wirklich nichts geht einen Dienst wie https://onetimesecret.com/ benutzen. Das am besten jedoch nur, wenn man die Open Source Version selbst installiert hat. Mit https natürlich! Onetimesecret zeigt den Content nur einmal an und dann nie wieder.
Hier kann man dann ein passwort-geschützes Archiv schicken oder aber wenn sonst wirklich nichts geht einen Dienst wie https://onetimesecret.com/ benutzen. Das am besten jedoch nur, wenn man die Open Source Version selbst installiert hat. Mit https natürlich! Onetimesecret zeigt den Content nur einmal an und dann nie wieder.
Dienstag, 6. Mai 2014
Evercookie -- never forget
Schlimm was es alles gibt. Evercookie ist sowas von dem man eigentlich nicht will dass es jemand weiß, damit es niemand verwendet. Man muss es aber doch ansprechen damit man sich davor schützen kann.
Ein normaler Cookie ermöglicht es Nutzer zu verfolgen. Der Nutzer hat jedoch die Möglichkeit Cookies zu löschen, zu deaktivieren oder in einen Privaten Modus zu wechseln. Evercookie zielt darauf den Tracking-Code überall wo nur möglich zu speichern um den Nutzer in jedem Fall zu verfolgen, egal wie sehr er sich dagegen wehrt. Aktuell wird man den Cookie nicht mal im Privaten Modus von Chrome los.
Ein normaler Cookie ermöglicht es Nutzer zu verfolgen. Der Nutzer hat jedoch die Möglichkeit Cookies zu löschen, zu deaktivieren oder in einen Privaten Modus zu wechseln. Evercookie zielt darauf den Tracking-Code überall wo nur möglich zu speichern um den Nutzer in jedem Fall zu verfolgen, egal wie sehr er sich dagegen wehrt. Aktuell wird man den Cookie nicht mal im Privaten Modus von Chrome los.
Montag, 5. Mai 2014
Nettes JavaScript Rätsel-Spiel
Links hat man eine 2D ASCII Welt in der man rumlaufen kann. Rechts ein JavaScript, dass die Welt generiert und steuert. Es gilt das Script an den erlaubten Stellen so zu ändern das man links zum Ausgang kommt: untrusted
Die 2D Welt basiert übrigens auf rot.js. Ein JavaScript Framework für 2D roguelike Spiele in ASCII Graphik. Mit Pathfinding, Lightning, Field of View (FOV) in einem Canvas. Schick!
Die 2D Welt basiert übrigens auf rot.js. Ein JavaScript Framework für 2D roguelike Spiele in ASCII Graphik. Mit Pathfinding, Lightning, Field of View (FOV) in einem Canvas. Schick!
Mittwoch, 23. April 2014
Internet Explorer Virtual Test Mashines
Microsoft bietet kostenlos VMs mit Internet Explorer (ab IE6) für Windows, Mac und Linux als VMWare und VirtualBox.
Mittwoch, 9. April 2014
Fiddler Https Web Debugging
Mit Fiddler kann man super einfach in http und https Verbindungen reinschauen. Man muss nichts einstellen oder einrichten, nur für https muss man nochmal kurz auf "Ja" klicken. Toll!
Mittwoch, 12. März 2014
Magento Export Customers
If you need to export customer data for Excel this script does the job. If you upload and execute it. A file.csv with you customers will be created. The UTF-8 CSV file can be imported in Excel. Don't forget to delete both files afterwords. Also note that personal records should not be mailed without encryption.
I converted the code to html using hilite.me looks nice, what do you think?
<?php require_once("app/Mage.php"); Mage::app(); Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); $collection = Mage::getModel('customer/customer') ->getCollection() ->addAttributeToSelect('*'); $fp = fopen('file.csv', 'w'); foreach($collection as $customer) { $customerAddressId = $customer->getDefaultBilling(); if ($customerAddressId){ $address = Mage::getModel('customer/address')->load($customerAddressId); $fields = array( $address->getData('company'), $customer->getData('prefix'), $customer->getFirstname(), $customer->getLastname(), $address->getData('street'), $address->getData('postcode'), $address->getData('city'), $address->getCountry(), $customer->getData('email') ); fputcsv($fp, $fields); var_dump($fields); echo "<br>"; } } ?>
I converted the code to html using hilite.me looks nice, what do you think?
Mittwoch, 30. Oktober 2013
The World is using Chrome Browser
Just in case you didn't know since 2012 Chrome is the most used web browser in the world.
IE is now second with only 20-30% usage. Closely followed by Firefox.
IE is now second with only 20-30% usage. Closely followed by Firefox.
Montag, 30. September 2013
PHP Versionen vergleichen
PHP verhält sich wie so vieles nicht in allen Versionen gleich. Um schnell einen Überblick zu bekommen wie sich ein Script in verschiedenen PHP Versionen verhält, kann man es bei 3v4l.org rein schmeißen und bekommt das Ergebnis für über 80 Versionen übersichtlich aufgeschlüsselt.
Brauch man nicht oft, aber manchmal ist das Gold wert!
Brauch man nicht oft, aber manchmal ist das Gold wert!
Montag, 19. August 2013
PHP Debug Bar
In PHP mal schnell ein paar Debug Nachrichten, die SQL Querys und Expections schick ausgeben: http://phpdebugbar.com/
Freitag, 15. Februar 2013
JavaScript "use strict";
In JavaScript gibt es einen strict mode, der hilft viele Fehler zu vermeiden. Leider unterstütz IE ihn erst ab Version 10, aber zum Entwickeln macht es Sinn ihn zu benutzen.
Mehr dazu: Stackoverflow Meinungen, MDN Doku, Verbreitung, Tutorial
Mehr dazu: Stackoverflow Meinungen, MDN Doku, Verbreitung, Tutorial
Montag, 6. Februar 2012
Tools für Webapp Entwicklung und Debuggen
Weinre ist ein Debugger für Phonegap Apps. Man bindet ein Javascript ein und sieht dann Firebug ähnlich DOM Inspector, Styles und Console vom Rechner aus. Leider noch nicht für Windows Phone.
Ganz nebenbei hier noch ein interessanter Editor: Sublime Text. Kostet zwar 79$, aber man kann ihn ohne Limit kostenlos testen.
Ganz nebenbei hier noch ein interessanter Editor: Sublime Text. Kostet zwar 79$, aber man kann ihn ohne Limit kostenlos testen.
Mittwoch, 4. Januar 2012
HTML5 Erneuerungen für Input Felder
HTML5 bietet einige praktische Erneuerungen, wie zum Beispiel autofocus="autofocus" um einem Login Feld nach dem Laden den Focus zu geben.
Weitere nützliche Features wie required oder pattern findet man bei homepage-total.de.
Weitere nützliche Features wie required oder pattern findet man bei homepage-total.de.
Mittwoch, 14. Dezember 2011
Javascript Weiterleitung und Privacy Preferences
Stackoverflow Entdeckungen des Tages:
- Javascript redirect: window.location.replace
- P3P: Platform for Privacy Preferences
Dienstag, 13. Dezember 2011
Netbeans Plugins und Einstellungen
Eine kleine Sammlung von Netbeans Plugins und Einstellungen die ich benutzte.
Plugins
Plugins
- Deutsche Sprachprüfung
- Dateien mit anderem Encoding öffnen (Plugin im Attachment)
Einstellungen: Tools > Options
- Tabs anstelle von Leerzeichen: Editor > Formatting: Number of Spaces per Indent = Tab Size = 4 und kein Harken bei "Expand Tabs to Spaces"
- PHP Klammern in neuer Zeile: Editor > Formatting > Language: PHP > Category: Braces > Alle auf "New Line" und in Category: Alignment > Bei "else, elseif", "catch"
- UTF-8 als default: Im Netbeans ordner in /etc/netbeans.conf: -J-Dfile.encoding=UTF-8
Abonnieren
Posts (Atom)