Skip to content

Instantly share code, notes, and snippets.

View euqen's full-sized avatar
🇵🇱

Eugene Shilin euqen

🇵🇱
View GitHub Profile
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@tcotav
tcotav / prom_nodex_coreos.md
Created April 18, 2016 19:44
Running Prometheus's node_exporter in Docker container for use with CoreOS nodes

ref: (prometheus/node_exporter#66)

docker pull prom/node-exporter
docker run -d -p 9100:9100 -v "/proc:/host/proc" -v "/sys:/host/sys" -v "/:/rootfs" --net="host" prom/node-exporter -collector.procfs /host/proc -collector.sysfs /host/proc -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
@evenfrost
evenfrost / golance-export.js
Last active November 6, 2015 18:04
Adds 'Export' button to work diary for easier reports creation
(() => {
'use strict';
let copy = () => {
let area = document.createElement('textarea');
let notificaitons = angular.element('*[ng-app]').injector().get("uiNotifications");
let titles = [];
let dateArray = new Date().toJSON().slice(0, 10).split('-');
let date = [dateArray[1], dateArray[2], dateArray[0]].join('/');
@iio7
iio7 / benchmark.md
Last active March 17, 2023 14:36
Benchmarking MongoDB, MariaDB and PostgreSQL with Apache, Nginx and PHP.

Benchmarking MongoDB, MariaDB and PostgreSQL

I am currently in the process of building a new API that will get requested in three steps and perform three actions in a row.

  1. A product will be listed (select based upon user input).
  2. The QTY will be updated upon ordering.
  3. A customer name and address will be inserted.

No relation is needed.

@wdullaer
wdullaer / install.sh
Last active October 9, 2024 19:47
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@pasupulaphani
pasupulaphani / after_res_hooks.js
Last active January 22, 2025 08:14
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups