The default install for Mongodb does not configure log rotation.
In /etc/logrotate.d/mongod
/var/log/mongodb/*.log {
daily
rotate 30
compress
dateext
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| # Ruby = 5.times { |i| puts i } | |
| # Coffee = (1).times (i) -> console.log i | |
| Number.prototype.times = (cb) -> | |
| i = -1; | |
| while (++i < this) then cb(i) | |
| +this | |
| # Ruby = 1.upto(5) { |i| puts i } | |
| # Coffee = (1).upto 5, (i) -> console.log i | |
| Number.prototype.upto = (t, cb) -> |
| import { MongoClient } from 'mongodb'; | |
| import promisify from 'es6-promisify'; | |
| let _connection; | |
| const connect = () => { | |
| if (!process.env.MONGO_CONNECTION_STRING) { | |
| throw new Error(`Environment variable MONGO_CONNECTION_STRING must be set to use API.`); | |
| } |
process — это объект, позволяющий получить информацию о типе запущенного процесса (рендеринг или основной процесс), версию Chrome и Electron, а также путь до выполняемого js-файла.
Объект File — это абстракция над нативным File, передающая стандартному HTML5 file API путь к физическому расположению файла в файловой системе пользователя.
| /* | |
| In Ethereum, a contract can be written so that it returns a value for eth_call. | |
| A Dapp can then check for success or error value of eth_call, before calling eth_sendTransaction, | |
| to take advantage of eth_call effectively being a "preview" of the code flow that the transaction | |
| will take. In traditional client-server, clients can't ask servers beforehand what's going to | |
| happen when the client makes a call; with Dapps contracts can be written so that clients can ask | |
| for a "preview" of what is going to happen, before any funds/ethers are actually utilized | |
| (eth_call does not cost any ethers). | |
| Note: it is possible that in between eth_call and when eth_sendTransaction is actually mined, |
| from pprint import pformat | |
| from typing import Any | |
| from pygments import highlight | |
| from pygments.formatters import Terminal256Formatter | |
| from pygments.lexers import PythonLexer | |
| def pprint_color(obj: Any) -> None: | |
| """Pretty-print in color.""" |
| # ------------------------------------------------- | |
| # CDN CONFIGURATION | |
| # ------------------------------------------------- | |
| # Show "Not Found" 404 errors in place of other NGINX errors | |
| error_page 403 /404; | |
| error_page 404 /404; | |
| error_page 405 /404; | |
| error_page 500 501 502 503 504 /404; | |
| location /404 { |
| # How to set up Oplog Tailing on your Meteor application on Ubuntu. (production environment) | |
| # We are going to create a replica set with only one member (the primary) so as to benefit from oplog tailing. | |
| # More: https://github.com/meteor/meteor/wiki/Oplog-Observe-Driver | |
| # 1. Stop MongoDB | |
| $ sudo service mongodb stop | |