Skip to content

Instantly share code, notes, and snippets.

View marcusdb's full-sized avatar

Marcus David Bronstein marcusdb

  • porto, Portugal
View GitHub Profile
@marcusdb
marcusdb / ntp
Created June 22, 2016 15:22
ntp
sudo service ntp stop
sudo ntpdate -s ntp.ubuntu.com
sudo service ntp start
find . -name "*.pdf" -print0 | xargs -0 rm
find . -name "*.req" -print0 | xargs -0 -I file mv file ../
ssh -i KEY -C2qTnN -D 8080 USER@HOST
@marcusdb
marcusdb / Program.cs
Created March 21, 2017 17:52
runge-Kutta Method for Solving Differential Equations c#
using System;
using System.Collections.Generic;
namespace Orbital
{
public class RK
{
public struct fValues
@marcusdb
marcusdb / push_node_exporter.sh
Created September 15, 2017 14:43
push node_exporter metrics to push gateway
curl -s http://localhost:9100/metrics | curl --data-binary @- http://pushgateway.example.org:9091/metrics/job/some_job/instance/some_instance
up vote
336
down vote
accepted
The following command removes all global npm modules. Note: this does not work on Windows. For a working Windows version, see Ollie Bennett's Answer.
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
@marcusdb
marcusdb / Enhanced NGINX logstash parser
Created October 11, 2017 17:36 — forked from csamsel/Enhanced NGINX logstash parser
Enhanced NGINX logstash parser to include upstream response time and request length fields
Enhanced NGINX logstash parser:
NGINX log format:
log_format enhanced '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent $request_length "$http_referer" "$http_user_agent" $request_time $upstream_response_time';
access_log /var/log/nginx/access.log enhanced;
error_log /var/log/nginx/error.log;
logstash pattern (/opt/logstash/pattern/nginx):
@marcusdb
marcusdb / install.sh
Created October 18, 2017 17:33 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@marcusdb
marcusdb / delete_old_filebeat_indices.sh
Created December 13, 2017 19:55 — forked from ricsiga/delete_old_filebeat_indices.sh
delete old filebeat indices from elasticsearch
#!/bin/bash
index=$(date --date='14 days ago' +%Y.%m.%d)
curl -s -XDELETE "http://localhost:9200/filebeat-$index?pretty"