Skip to content

Instantly share code, notes, and snippets.

View mmngreco's full-sized avatar
:octocat:
Viming...

mg20400 mmngreco

:octocat:
Viming...
View GitHub Profile
@mmngreco
mmngreco / index.html
Last active June 12, 2021 11:17 — forked from mrts/index.html
Example of Gitgraph.js usage
<!DOCTYPE html>
<html>
<head>
<!-- Load the JS file -->
<script src="https://cdn.jsdelivr.net/npm/@gitgraph/js"></script>
</head>
<body>
<!-- DOM element in which we'll mount our graph -->
<div id="graph-container"></div>
@mmngreco
mmngreco / README.md
Created April 5, 2021 06:27 — forked from masdeseiscaracteres/README.md
Rolling apply on numpy arrays using Pandas internals
@mmngreco
mmngreco / fuckda.py
Created February 8, 2021 21:55 — forked from astrojuanlu/fuckda.py
Uso de certificados de la FNMT con Python
# coding: utf-8
#
# fuckda.py - Uso de certificados de la FNMT con Python
#
# Autor: Juan Luis Cano Rodríguez <juanlu001@gmail.com>
#
# Instrucciones:
#
# 1. Exportar certificado (CERTIFICADO.p12)
# https://www.sede.fnmt.gob.es/preguntas-frecuentes/exp-imp-y-elim-de-certificados
@mmngreco
mmngreco / lily58-keyboard.org
Created October 3, 2020 22:58 — forked from braun-steven/lily58-keyboard.org
Lily58 Pro Parts List
@mmngreco
mmngreco / usage_example.py
Created May 27, 2020 09:56 — forked from masdeseiscaracteres/usage_example.py
Parallelizing with Dask & Dask Distributed
from distributed import Client, as_completed
from dask import delayed
from time import sleep
import numpy as np
from pprint import pprint
# Define a time-consuming task
def foo(n):
print("Starting the {:d}-second task".format(n))
@mmngreco
mmngreco / rounding_decimals.md
Created April 14, 2020 13:19 — forked from jackiekazil/rounding_decimals.md
How do I round to 2 decimals in python?

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

@mmngreco
mmngreco / install_netextender_ubuntu_64_bit
Created March 30, 2020 23:31 — forked from egobude/install_netextender_ubuntu_64_bit
Install NetExtender | Ubuntu 64 Bit
1. go to https://sslvpn.demo.sonicwall.com/cgi-bin/welcome
2. log in with demo/password
3. click on NetExtender icon, this will download a tar.gz with the client
4. sudo ln -s /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.6
5. sudo ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.6
6. un-tar the client, make install script executable and launch install
@mmngreco
mmngreco / clean-up-boot-partition-ubuntu.md
Created March 19, 2020 08:05 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
from progress.bar import Bar
bar = Bar('Processing', max=20)
for i in range(20):
# Do some work
bar.next()
bar.finish()