This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
# -*- encoding: utf-8 -*- | |
# requires a recent enough python with idna support in socket | |
# pyopenssl, cryptography and idna | |
from OpenSSL import SSL | |
from cryptography import x509 | |
from cryptography.x509.oid import NameOID | |
import idna | |
from socket import socket |
'use strict'; | |
const crypto = require('crypto'); | |
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key | |
const IV = "5183666c72eec9e4"; // set random initialisation vector | |
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex'); | |
const phrase = "who let the dogs out"; | |
var encrypt = ((val) => { |
[Unit] | |
Description=Keeps a tunnel to 'remote.example.com' open | |
After=network.target | |
[Service] | |
User=autossh | |
# -p [PORT] | |
# -l [user] | |
# -M 0 --> no monitoring | |
# -N Just open the connection and do nothing (not interactive) |
fun <T> LiveData<T>.observeOnce(lifecycleOwner: LifecycleOwner, observer: Observer<T>) { | |
observe(lifecycleOwner, object : Observer<T> { | |
override fun onChanged(t: T?) { | |
observer.onChanged(t) | |
removeObserver(this) | |
} | |
}) | |
} | |
//Using | |
liveData.observeOnce(this, Observer<Password> { |
I used this for migrating git repos from Bitbucket to Github. It uses git's --mirror
flag for cloning and pushing to also transfer all tags and branches.
It would be helpful to have SSH keys set up on both ends. Then all you should have to do is to make sure the hardcoded orgname
is set to the appropriate one for both the source and destination.
Once I migrated repos, I used this to replace my origin url locally (assumes using ssh):
sed -i s/bitbucket.org:orgname/github.com:orgname/g .git/config
require('dotenv/config') | |
const express = require('express') | |
const multer = require('multer') | |
const AWS = require('aws-sdk') | |
const uuid = require('uuid/v4') | |
const app = express() | |
const port = 3000 |
# Install SSL Wildcard Certificate | |
sudo certbot certonly --manual --preferred-challenges=dns --email [email protected] --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d *.mydomain.com | |
# SSL Vulnerability Testing | |
docker run --rm -ti drwetter/testssl.sh -U mydomain.com | |
# Online testing tool | |
# https://www.ssllabs.com/ssltest/analyze.html?d=mydomain.com&latest |