Skip to content

Instantly share code, notes, and snippets.

View garenyondem's full-sized avatar
:shipit:

Garen Yöndem garenyondem

:shipit:
View GitHub Profile
@subfuzion
subfuzion / curl.md
Last active May 31, 2024 09:45
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Dev-Dipesh
Dev-Dipesh / ELK with Nginx.md
Last active January 24, 2024 14:34
Setting up Elasticsearch, Logstash and Kibana with Nginx.

ELK (Elasticsearch Logstash Kibana)

Though we're focused more on server setup procedure in this document, I will still give a very brief explanation in laymen terms for ELK. To those who are starting new in this stack, must have already heard of MVC (Model View Controller), so take it like this:

  • Model => Elasticsearch (for Storage, Indexing & Search)
  • View => Kibana (for DataViz & G-Man, yeah the one in half life 😏)
  • Controller => Logstash (For Logs & Filtering)

@wojteklu
wojteklu / clean_code.md
Last active June 2, 2024 19:48
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@vlucas
vlucas / encryption.js
Last active June 1, 2024 12:17
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@stilist
stilist / monitoring.md
Last active October 27, 2020 05:36
Notes on site reliability

Monitoring

Alerting

  • base rate fallacy: given 1% false positive, 1% false negative, and 99.9% uptime: 9.1% chance positive predictive value (true positive)
  • sensitivity (% true positives) vs specificity (% not false positive)
  • ‘Alert liberally; page judiciously. Page on symptoms, rather than causes.’
  • ‘An alert should communicate something specific about your systems in plain language: “Two Cassandra nodes are down” or “90% of all web requests are taking more than 0.5s to process and respond.”’
  • ‘Not all alerts carry the same degree of urgency.’
  • ‘Many alerts will not be associated with a service problem, so a human may never even need to be aware of them. […] should generate a low-urgency alert that is recorded in your monitoring system for future reference or investigation but does not interrupt anyone’s work.’
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const AppendInitVect = require('./appendInitVect');
const getCipherKey = require('./getCipherKey');
function encrypt({ file, password }) {
// Generate a secure, pseudo random initialization vector.
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const getCipherKey = require('./getCipherKey');
function decrypt({ file, password }) {
// First, get the initialization vector from the file.
const readInitVect = fs.createReadStream(file, { end: 15 });
@TRtomasz
TRtomasz / stremio-server.json
Created December 12, 2018 10:06
Stremio fast settings
{
"serverVersion": "4.3.4",
"appPath": "Path to the stremio-server",
"cacheRoot": "Path to the cache-folder",
"cacheSize": 2147483648,
"btMaxConnections": 200,
"btHandshakeTimeout": 20000,
"btRequestTimeout": 4000,
"btDownloadSpeedSoftLimit": 4194304,
"btDownloadSpeedHardLimit": 39321600,
@ahacke
ahacke / github_ssh_keepass.md
Last active March 13, 2023 07:05
Guide on how to setup github ssh keys with keepass

Github SSH with KeePass

Requirements

  • Git
  • Github Account
  • KeePass with KeeAgent
  • Putty Package
    • plink
    • puttygen