Using 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.
Using 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.
/run/nginx.pid
./run/php7/php-fpm.pid
, PHP7 PHP-FPM config at /etc/php7
.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 |
Python script to clone an existing VPC route table. Script output is a series of AWS CLI calls to create the route table and assign routes.
Update AWS_TARGET_REGION
and SOURCE_ROUTE_TABLE_ID
to suit.
Note: does not currently support NAT Gateways routes due to Boto 2 API limitation.
Set-StrictMode -Version Latest | |
$PASSWORD = "mypassword" | |
# create secure string from plain-text string | |
$secureString = ConvertTo-SecureString -AsPlainText -Force -String $PASSWORD | |
Write-Host "Secure string:",$secureString | |
Write-Host |
Set-StrictMode -Version Latest | |
$payload = @{ | |
"channel" = "#my-channel" | |
"icon_emoji" = ":bomb:" | |
"text" = "This is my message. Hello there!" | |
"username" = "Mr. Robot" | |
} | |
Invoke-WebRequest ` |