Skip to content

Instantly share code, notes, and snippets.

View michaeltcoelho's full-sized avatar
🎢

Michael Coelho michaeltcoelho

🎢
View GitHub Profile
@michaeltcoelho
michaeltcoelho / collector-logs.txt
Created September 7, 2022 09:47
Opentelemetry Collector Contrib version v0.58.0
2022-08-25:19:32:49,109 INFO [config.py:17] Updating logging exporter
2022-08-25:19:32:49,110 INFO [config.py:20] Updating otlp exporter
2022-08-25T19:32:49.780Z info service/telemetry.go:103 Setting up own telemetry...
2022-08-25T19:32:49.783Z info service/telemetry.go:138 Serving Prometheus metrics {"address": ":8888", "level": "basic"}
2022-08-25T19:32:49.784Z debug components/components.go:28 Stable component. {"kind": "exporter", "data_type": "traces", "name": "otlp", "stability": "stable"}
2022-08-25T19:32:49.786Z debug components/components.go:28 Stable component. {"kind": "processor", "name": "batch", "pipeline": "traces", "stability": "stable"}
2022-08-25T19:32:49.786Z info components/components.go:30 In development component. May change in the future. {"kind": "processor", "name": "spanmetrics", "pipeline": "traces", "stability": "in development"}
2022-08-25T19:32:49.786Z info spanmetricsprocessor@v0.58.0/processor.go:93 Building spanmetricsprocessor {"kind": "processor", "name": "spanmetric
@michaeltcoelho
michaeltcoelho / README.md
Last active August 25, 2020 17:04
Create SSL certificates with Subject Alternative Names extensions

Creating SSL Certificates - SAN Extensions

** Replace $(...) with information of yours.

First create the san.conf

[ req ]
default_bits       = 2048
distinguished_name = req_distinguished_name
@michaeltcoelho
michaeltcoelho / CS-Study-Guide.md
Last active October 26, 2019 14:03
Subjects i want to study

Operating Systems

Introduction to Operating Systems - Video - Link

Advanced Operating Systems - Video - Link

The Unix Programming Environment - Book - Link

Programming

// auth.js in nuxtjs/store
export const state = () => {
return {
session: {
user: null,
token: null
}
}
}
@michaeltcoelho
michaeltcoelho / Makefile
Last active December 20, 2018 16:08
Lint python files on pre-commit
.PHONY: githooks
githooks:
@git config core.hooksPath .githooks
@michaeltcoelho
michaeltcoelho / gist:188611df91791cea310272eda6cf6496
Last active December 18, 2018 23:01
Running MSSQLServer on Docker
Running the SQL SERVER container
docker run -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=teste123$ --name medizin -p 1400:1433 -v data:/var/opt/mssql -dd mcr.microsoft.com/mssql/server:2017-latest
Change SA user password
docker exec -it medizin /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P ‘teste123$’ -Q 'ALTER LOGIN SA WITH PASSWORD=“teste123$”’
Creating backup folder inside the container
@michaeltcoelho
michaeltcoelho / s3_multipart_upload.py
Created August 11, 2018 20:54 — forked from fabiant7t/s3_multipart_upload.py
Parallel S3 multipart upload with retries
import logging
import math
import mimetypes
from multiprocessing import Pool
import os
from boto.s3.connection import S3Connection
from filechunkio import FileChunkIO
@michaeltcoelho
michaeltcoelho / import_users_from_csv.rb
Created January 28, 2018 13:15
Import users from csv
require 'csv'
namespace :user_importer do
desc "Import users from a CSV file"
task :import, [:csv_file] => [:environment] do |_, args|
abort "Please specify the CSV file to import" if args[:csv_file].blank?
CSV.foreach(args[:csv_file], col_sep: ';', headers: true) do |new_user|
user = User.find_by_email(new_user['email'])
if user
@michaeltcoelho
michaeltcoelho / gunicorn_profile.py
Created December 12, 2017 12:23
Gunicorn Python cProfile for Python 3.6
import cProfile
import pstats
from io import StringIO
import logging
import os
import time
PROFILE_LIMIT = int(os.environ.get("PROFILE_LIMIT", 30))
PROFILER = bool(int(os.environ.get("PROFILER", 1)))
@michaeltcoelho
michaeltcoelho / reading_csv.py
Created November 3, 2017 17:06
Reading a csv from an url
"""Reading a csv file from an url."""
import csv
import codecs
import requests
url = ''
response = requests.get(url, stream=True, timeout=300)
csv_reader = csv.reader(