Check which filesystem doesn't have any space left:
sudo df -h
Check which folder uses this space most:
sudo find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n
function constants() { | |
const data = { | |
T: { // levha kalınlıkları | |
single: 3, | |
double: 5 | |
}, | |
tCostFactor: { // levha maliyetleri | |
single: 5.5, | |
double: 8.5 | |
}, |
import {execSync} from 'child_process' | |
const service = 'some_service' | |
const containerId = execSync(`docker ps -f name=${service} --quiet`).toString().trim() |
// filtering something by its lifetime with slonik | |
const filterByLifetimeQuery = sql` | |
select id | |
from eventlog | |
where | |
code=${code} and | |
payload=${sql.json(payload)} and | |
created_at + interval '1 second' * ${parseInt(ctx.threshold)} > now() | |
` |
user nginx; | |
worker_processes auto; | |
error_log syslog:server=unix:/dev/log notice; | |
pid /var/run/nginx.pid; | |
#load_module modules/ngx_http_brotli_filter_module.so; | |
#load_module modules/ngx_http_brotli_static_module.so; | |
events { | |
worker_connections 1024; |
#!/bin/bash | |
SAMPLE_DIR=/mnt/some-volume | |
# change ownership of the directory and all of its contents | |
chown -R cmsman:cmsteam $SAMPLE_DIR | |
# change permissions of the directory and all of its contents | |
chmod -R u=rwX,g=rwX,o-rwx $SAMPLE_DIR | |
# set uid and gid | |
chmod -R u+s $SAMPLE_DIR |
openssl genrsa -out cms_auth_key.pem 4096 | |
openssl rsa -in cms_auth_key.pem -outform PEM -pubout -out cms_auth_key_public.pem |
/* | |
* | |
* Purformance | |
* | |
* Simply use mark and measure methods similar to native performance api. | |
* | |
* Native performance methods are not supported by browsers | |
* and there is no better way to measure performance than Date.getTime() | |
* in those cases. | |
* |
Check which filesystem doesn't have any space left:
sudo df -h
Check which folder uses this space most:
sudo find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n
/* | |
* | |
* usage: node server.js folder port | |
* - folder is "." by default which is the current directory where node has been executed. | |
* - port is "8080" by default and you can specify any available port in your OS. | |
* | |
*/ | |
const http = require('http') | |
const fs = require('fs') |
function configureTimeAgo(element) { | |
const elementID = element.getAttribute('id') | |
let updater = setInterval(function() { | |
const elementStillExistInDOM = document.getElementById(elementID) | |
if (!elementStillExistInDOM) { | |
clearInterval(updater) | |
return; | |
} | |
const seconds = (Date.now() - parseFloat(element.dataset.timestamp)) / 1000 |