wrk -c 100 -t 4 -d 10 http://127.0.0.1:8080/
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
class BinaryNode: | |
__slots__ = ("value", "left", "right") | |
def __init__(self, value=None, left=None, right=None): | |
self.value = value | |
self.left = left | |
self.right = right | |
def __repr__(self): | |
return f"<BinaryNode value={self.value}; {1 if self.left else 0 + 1 if self.right else 0} children>" | |
#!/bin/bash | |
text=$(cat -) | |
request="{ | |
'input':{ | |
'ssml':'<speak>$text</speak>' | |
}, | |
'voice':{ | |
'languageCode':'en-gb', | |
'name':'en-GB-Wavenet-D', |
import { io } from 'socket.io-client'; | |
import * as SentrySDK from '@sentry/react'; | |
import { | |
call, | |
fork, | |
takeEvery, | |
put, | |
race, | |
take, | |
} from 'redux-saga/effects'; |
wrk -c 100 -t 4 -d 10 http://127.0.0.1:8080/
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
Read all data (tables, views, sequences), as if having SELECT rights on those objects, and USAGE rights on all user-created schemas.
db_name
with the relevant database name.Database
section of the script.#!/bin/bash | |
################################################################################ | |
# | |
# Helper variables to print text using some colors. | |
# | |
################################################################################ | |
# Restore to default colours | |
RESTORE='\033[0m' |
<!-- Facebook Pixel Code Example --> | |
<script> | |
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; | |
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, | |
document,'script','//connect.facebook.net/en_US/fbevents.js'); | |
fbq('init', '1234567890'); | |
fbq('track', "PageView"); |
[Unit] | |
Description=Download IP Geolocation Database from Maxmind.com | |
[Service] | |
Type=oneshot | |
WorkingDirectory=/tmp | |
ExecStart=/bin/sh -c "\ | |
mkdir -p /home/core/ip_database \ | |
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz ; \ | |
gunzip GeoLite2-City.mmdb.gz ; \ | |
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5 ; \ |