function Shape(x,y) {
this.x = x;
this.y = y;
}A function compare_json_data(source_data_a,source_data_b), accepting structures populated with data loaded from json.load() and comparing for equality.
$ ./compare.py
Compare JSON result is: TrueThe current PHP ssh2 extension via PECL won't compile under PHP7.
Using a more recent version via PHP's GitHub we can make this work.
$ sudo apt-get install autoconf libssh2-1-dev
$ curl -LO https://github.com/php/pecl-networking-ssh2/archive/master.zip
$ unzip master.zip
$ cd pecl-networking-ssh2-masterUsing json.dump() with Python 2, indent argument is limited to number of spaces only - no ability for tabs use.
Class JSONTabIndentFileWriter provides a file-like object which will rewrite json.dump() output indending from spaces to tabs.
Firstly, backup the existing zone to a zone file. Resulting file will always be placed in C:\Windows\system32\dns - this can't be controlled:
$ dnscmd /zoneexport myzone.com myzone-backup-file.zone
To restore the zone, firstly move our myzone-backup-file.zone file back into C:\Windows\system32\dns, then:
A basic set of systemd units for starting Nginx and PHP-FPM daemons on system startup.
- Ensures Nginx web server has started before the PHP-FPM process.
- Nginx pid file placed at
/run/nginx.pid. - PHP-FPM pid file placed at
/run/php7/php-fpm.pid, PHP7 PHP-FPM config at/etc/php7. - Based on usage with Ubuntu 16.04LTS / 18.04LTS.
Unit files are placed in /etc/systemd/system and enabled with:
| #!/bin/bash | |
| function URLEncode { | |
| local dataLength="${#1}" | |
| local index | |
| for ((index = 0;index < dataLength;index++)); do | |
| local char="${1:index:1}" | |
| case $char in |