Skip to content

Instantly share code, notes, and snippets.

View dppereyra's full-sized avatar

DPPereyra dppereyra

View GitHub Profile
@dppereyra
dppereyra / color-theme.json
Created November 21, 2022 06:04
Blue Mood Theme based on Emacs theme by Nelson Loyola / Syohei YOSHIDA modified for Windows Terminal
{
"background": "#104E8B",
"black": "#000000",
"blue": "#205C94",
"brightBlack": "#88aaff",
"brightBlue": "#00CDCD",
"brightCyan": "#F5DEB3",
"brightGreen": "#7FFF00",
"brightPurple": "#00FFFF",
"brightRed": "#FF6347",
@dppereyra
dppereyra / alacritty.yml
Created August 2, 2022 11:56 — forked from rnyrnyrny/alacritty.yml
my alacritty config file for win10 wsl2
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
@dppereyra
dppereyra / revert-a-commit.md
Created May 18, 2018 10:59 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@dppereyra
dppereyra / Makefile
Created May 18, 2018 06:12 — forked from bbengfort/Makefile
Basic Python Project files - my Makefile and the dependencies that I have in everything.
# Shell to use with Make
SHELL := /bin/bash
# Set important Paths
PROJECT := # Set to your project name
LOCALPATH := $(CURDIR)/$(PROJECT)
PYTHONPATH := $(LOCALPATH)/
PYTHON_BIN := $(VIRTUAL_ENV)/bin
# Export targets not associated with files
@dppereyra
dppereyra / haproxy.cfg
Created May 16, 2018 20:23 — forked from yuvadm/haproxy.cfg
A basic HAProxy configuration for a proxy server with stats
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
@dppereyra
dppereyra / prometheus.md
Created May 12, 2018 06:47 — forked from petarnikolovski/prometheus.md
Prometheus 2.x installation on Ubuntu 16.04 server.

Installing Prometheus on Ubuntu 16.04

This gist is a compilation of two tutorials. You can find the original tutorials here and here. What should you know before using this? Everything can be executed from the home folder. For easier cleanup at the end you can make directory where you'll download everything, and then just use rm -rf .. Although, you should be careful. If some strange bugs arise unexpectedly somewhere sometimes, just keep in mind that some user names have underscores in them (this is probably nothing to worry about).

Create Users

sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Prometheus Monitoring User" prometheus
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Alertm

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@dppereyra
dppereyra / Microsoft_ASR.py
Created March 2, 2018 13:47 — forked from jellis505/Microsoft_ASR.py
Microsoft Bing Speech API Wrapper in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import httplib
import uuid
import json
class Microsoft_ASR():
def __init__(self):
@dppereyra
dppereyra / uuid.js
Created December 23, 2017 10:33 — forked from jcxplorer/uuid.js
UUID v4 generator in JavaScript (RFC4122 compliant)
function uuid() {
var uuid = "", i, random;
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i == 8 || i == 12 || i == 16 || i == 20) {
uuid += "-"
}
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16);
}
@dppereyra
dppereyra / source.py
Last active July 12, 2017 14:36
Flatten List
def flatten1(list_):
'''Flatten nested list of integers into a single list.
Args:
list_ (list): list to be flattened
Returns:
Iterable[int]: the flattened list.
'''
result = []