This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pgmetrics run at: 14 Feb 2020 4:58:16 PM (now) | |
| PostgreSQL Cluster: | |
| Name: PostgreSQL | |
| Server Version: 11.0 (Ubuntu 11.0-1.pgdg16.04+2) | |
| Server Started: 14 Feb 2020 4:41:59 PM (16 minutes ago) | |
| System Identifier: 6615636975566673716 | |
| Timeline: 2 | |
| Last Checkpoint: 14 Feb 2020 4:55:12 PM (3 minutes ago) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Forked from https://gitlab.com/moviuro/moviuro.bin/blob/master/lie-to-me | |
| set -e | |
| _target="127.0.0.1" | |
| _format="unbound" | |
| __usage () { | |
| cat << EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Step 1) Replace url with git@github.com | |
| git config --global url."git@github.com:".insteadOf "https://github.com/" | |
| Step 2) Add github ssh-key | |
| ssh-keygen -t ed25519 -f ~/.ssh/github | |
| chmod 0600 ~/.ssh/github | |
| Step 3) Add ssh key on VM and configure it on .ssh/config | |
| Host github.com | |
| User git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user www-data; | |
| worker_processes 2; | |
| error_log /var/log/nginx/nginx.log; | |
| pid /run/nginx.pid; | |
| worker_rlimit_nofile 8192; | |
| ## 4096 Workers per process | |
| events { | |
| use epoll; | |
| worker_connections 4096; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re, requests, json; | |
| from html.parser import HTMLParser | |
| class SSLParser(HTMLParser): | |
| def handle_data(self, data): | |
| self.result.append(data) | |
| def setup(self): | |
| self.result = []; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| const bodyParser = require('body-parser') | |
| const app = express() | |
| // app.use(function (req, res, next) { | |
| // req.rawBody = ''; | |
| // req.setEncoding('utf8'); | |
| // req.on('data', function (chunk) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * https://css-tricks.com/snippets/css/font-stacks/ | |
| * https://css-tricks.com/snippets/css/system-font-stack/ | |
| */ | |
| /* Times New Roman-based stack */ | |
| font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
| /* Modern Georgia-based serif stack */ | |
| font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var buff = new Buffer(100); | |
| fs.open(file, 'r', function(err, fd) { | |
| fs.read(fd, buff, 0, 100, 0, function(err, bytesRead, buffer) { | |
| var start = buffer.indexOf(new Buffer('mvhd')) + 17; | |
| var timeScale = buffer.readUInt32BE(start, 4); | |
| var duration = buffer.readUInt32BE(start + 4, 4); | |
| var movieLength = Math.floor(duration/timeScale); | |
| console.log('time scale: ' + timeScale); | |
| console.log('duration: ' + duration); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # vim:fileencoding=utf-8 | |
| """ [NAME] script or package easy description | |
| [DESCRIPTION] script or package description | |
| """ | |
| from datetime import datetime | |
| from argparse import ArgumentParser | |
| import pprint |