docker exec -it -u postgres example-db psql; # login interactively SELECT * FROM pg_stat_activity WHERE datname = ‚example‘; # check open connections to database example # (there shall be none, otherwise you can not drop the database) SELECT pg_terminate_backend (pg_stat_activity.pid) […]
„autobench – Automates the benchmarking of web servers using httperf. autobench is used to to automate web server benchmarking. It runs httperf against the specified host or hosts, ramping up the number of requested connections, and logging the results in […]
Travis CI for Complete Beginners If you’re not familiar with continuous integration and don’t already have a repository that you want to build, this guide will show you what it is all about. You need to sign up for a […]
No matter if you decide to for <?php session_start(); $_SESSION[’UniqueRandomTemporaryID’] = ‚h0ss5qul55mpev38uaduca31c0‘; # or $_COOKIE[’UniqueRandomTemporaryID’] = ‚h0ss5qul55mpev38uaduca31c0‘; ?> it will set a cookie this way or another. Cookies are sent by the server to the browser and only the domain […]
( ! ) Parse error: syntax error, unexpected ‚::‘ (T_PAAMAYIM_NEKUDOTAYIM), expecting ‚&‘ or variable (T_VARIABLE) in /some/code.php on line 1321 „T_PAAMAYIM_NEKUDOTAYIM“ Its Hebrew for „double colon„. http://stackoverflow.com/questions/592322/php-expects-t-paamayim-nekudotayim Did you know that ZEND (PHP) is a israeli company? onyourlinuxcommandline# php-cgi […]
From a flexibility point of View: This is totally correct. But what from a RAM point of view. Why have every .php script instanciate a new version of class config.php? I created an easy small class: class Config { […]
get in a bash shell: php -m; # list all currently activated and installed extensions [PHP Modules] bcmath bz2 calendar Core ctype curl date dba dom ereg exif fileinfo filter ftp gd gettext hash iconv imap intl json libxml mbstring […]
Fast summary: PHP + easy learning, probably better for fast prototypes/small projects – grown language, not coding standards enforced = bad for large projects (upgrade project from PHP4->5 is ugly) Ruby – hard to learn and understand (need to understand full […]
https://en.wikipedia.org/wiki/MongoDB MongoDB (from „humongous“) is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational databasestructure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in […]
file: ClassUser.php <?php include("ExampleClass.php"); $class_instance = new ExampleClass(); $class_instance->setExample("example sucks"); echo($class_instance->getExample()); $class_instance->NewProperty = "You just created a new propertey of the class, that is not defined per default"; $class_instance->AnotherProperty = "You just created a new propertey of the class, that […]
if you do a mysql_select_db and you get the 1046 … it could be that the user has no access rights to that database… the error message is missleading!
… on a debian/ubuntu system… sometimes you need to know (when setting up PDT Eclipse and XDebug) where you php binary is. i found mine via: find / -name php|grep cgi /usr/lib/cgi-bin/php /etc/php5/cgi/php.ini
was taken from some pretty old heise c’t script. // Prüfe, ob die Empfänger/Absenderadresse einem gültigen MX-Host angehört Zu jeder Domain in einer Mailadresse (nach dem @-Zeichen) sollte ein Mail Exchange Resource Record (MX-RR) im Domain Name System (DNS) eingetragen sein. Die […]
Whenever a BitCoin-exchange is hacked it lowers people’s trust in the BitCoin system making the prices for BitCoins go down. Then probably come up again 😀 But there is no such thing as „perfect software“ so this time it’s a […]
global and permanent: activate logging to file and html output: vim /etc/php5/cgi/php.ini # open up your default configuration file, how to find the default config check here ; check that these options are On error_reporting = E_ALL & ~E_DEPRECATED & […]
create a new file in your web root lighttpd / apache: vim /var/www/info.php with the content: <?php phpinfo(); ?> access your webserver with your browser http://192.168.1.222/info.php you should get something like this: Loaded Configuration File /etc/php5/cgi/php.ini
es klingt wie ein schlechter witz….. es ist nicht (!) trivial, eine datenbank zu durchsuchen. es ist einfacher, das backup.sql einer datenbank in einem Programm ihrer wahl (Browser?, text editor?) zu öffnen und nach dem gesuchten string zu suchen. credits: http://stackoverflow.com/questions/562457/search-for-all-occurrences-of-a-string-in-a-mysql-database komischerweise […]
unfortunately, it’s not so easy to get a weather forecast widget running for your website… because (e.g. google, yahoo and co) they want to make money with providing this services… so they limit your or charge you. i tried weather underground […]