Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.
I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.
Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.
I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.
| # Basically the nginx configuration I use at konklone.com. | |
| # I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
| # | |
| # To provide feedback, please tweet at @konklone or email [email protected]. | |
| # Comments on gists don't notify the author. | |
| # | |
| # Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
| # Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
| server { |
| 10 Ways To Improve Your Google Rank: | |
| 1. Focus on your content. Make sure you provide a quality content. | |
| 2. Regularly update your website. | |
| 3. Pointing Links to your Website. | |
| 4. Page Authority. | |
| 5. Use a site map(sample: https://gist.github.com/MicBrain/e5125d4b861c3071c63560b51ee66634) | |
| 6. Effectively use "keyword" and "description" HTML Meta Tags. Make sure that the content of the website matches to these 2 tags. | |
| 7. Effectively use <title> tag. | |
| 8. Use ALT text on images. |
| package main | |
| import ( | |
| "time" | |
| ) | |
| type LazyInt chan func() int | |
| // Can't use pointer receiver: invalid operation: l <- (func literal) (send to non-chan type *LazyInt) | |
| func (l LazyInt) Future(i int) { |
| # Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands) | |
| gpg --gen-key | |
| # maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
| # check current keys: | |
| gpg --list-secret-keys --keyid-format LONG | |
| # See your gpg public key: | |
| gpg --armor --export YOUR_KEY_ID | |
| # YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333) |
| // create a bookmark and use this code as the URL, you can now toggle the css on/off | |
| // thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
| javascript: (function() { | |
| var elements = document.body.getElementsByTagName('*'); | |
| var items = []; | |
| for (var i = 0; i < elements.length; i++) { | |
| if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
| items.push(elements[i]); | |
| } | |
| } |
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |
| # pull the official mongo docker container | |
| docker pull mongo | |
| # create network | |
| docker network create my-mongo-cluster | |
| # create mongos | |
| docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017 | |
| docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018 | |
| docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019 |
| # Install https://www.vaultproject.io/ | |
| brew install vault | |
| # Start dev vault server in a separate terminal | |
| vault server -dev | |
| # ==> Vault server configuration: | |
| # ... | |
| # Unseal Key: 7ACQHhLZY5ivzNzhMruX9kSa+VXCah3y87hl3dPSWFk= | |
| # Root Token: 858a6658-682e-345a-e4c4-a6e14e6f7853 |