Install ffmpeg
brew install ffmpeg
Download file through url, like this:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
| # Install SSL Wildcard Certificate | |
| sudo certbot certonly --manual --preferred-challenges=dns --email me@mydomain.com --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 |
Install ffmpeg
brew install ffmpeg
Download file through url, like this:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
| 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 |
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
| 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> { |
| [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) |
| '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) => { |
| # -*- 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 |
| # The initial version | |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi | |
| # My favorite from the comments. Thanks @richarddewit & others! | |
| set -a && source .env && set +a |