Skip to content

Instantly share code, notes, and snippets.


Miguel de Dios Matias mdtrooper

View GitHub Profile
waylan /
Created Apr 10, 2012
Writing to a python subprocess pipe

Here's a few things I tried to write output to a python subprocess pipe.

from subprocess import Popen, PIPE

p = Popen('less', stdin=PIPE)
for x in xrange(100):
    p.communicate('Line number %d.\n' % x)
earthgecko /
Last active Oct 13, 2021
shell/bash generate random alphanumeric string
# bash generate random alphanumeric string
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
blooalien / CoderCat Example.jpg
Last active Nov 8, 2020
A simple gimp plugin to easily create cartoon speech bubbles.
denji /
Last active Oct 24, 2021
NGINX tuning for best performance

Moved to git repository:

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

fnky /
Last active Oct 24, 2021
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
aaferrari / No code diagram.txt
Last active May 7, 2020
ASCII diagram compatible with ditaa ( Output is after processing
View No code diagram.txt
La felicidad de las nocode tools.
+----------------+ +--------+
|👤 Usuario feliz| |{d} |
+------------+---+ |Fichero |
| |proyecto|
| /--+--------+
| |
v v
|{io} |
aaferrari / bloglenovo comments
Last active Feb 11, 2020
Obtiene la cantidad de comentarios que hay en los posts de (funciona con Python 2 y 3)
View bloglenovo comments
import re, json
from requests import request
from sys import version_info
if version_info.major == 2:
from urllib import urlencode
elif version_info.major == 3:
from urllib.parse import urlencode
View bloglenovo statistics.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 3 columns, instead of 1. in line 8.
Enlace Titulo Comentarios De 50 gramos a 8 kilos, mini altavoces y super loros para el móvil 1 iGrill, el termómetro digital que controlas desde tu smartphone 1 Así serán los cuadros del futuro 2 ¿Es necesario desenchufar la tablet una vez cargada? 0 ¿Cuál es la mejor manera de limpiar la pantalla del móvil y tablet? 0 Entrevista a Aymar de Lencquesaing en el blog Xataka 0 Lenovo presenta resultados y habla de sus productos. Artículo en TIC BEAT 0
View BBC-Radio-pls.m3u
#EXTINF:-1,BBC - Radio 1
#EXTINF:-1,BBC - Radio 2
#EXTINF:-1,BBC - Radio 3
#EXTINF:-1,BBC - Radio 4
#EXTINF:-1,BBC - Radio 4 LW