Skip to content

Instantly share code, notes, and snippets.

View mdtrooper's full-sized avatar

Miguel de Dios Matias mdtrooper

View GitHub Profile
@MicahElliott
MicahElliott / demo.txt
Created January 13, 2012 22:10
Display all the possible toilet fonts for a string.
banner
### ###
# # # # # ###### ## #### #### # # ###
# # # # # # # # # # # # # ###
# # # #### ##### # # #### # # # #
# # # # # # ###### # # # #
# # # # # # # # # # # # # # ###
### ###### # # # ###### # # #### #### # # ###
@waylan
waylan / subprocess_pipe.md
Created April 10, 2012 19:12
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
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# 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-z0-9' | fold -w 32 | head -n 1
@blooalien
blooalien / CoderCat Example.jpg
Last active November 8, 2020 11:13
A simple gimp plugin to easily create cartoon speech bubbles.
CoderCat Example.jpg
@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

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.

@alexdlaird
alexdlaird / daemon.cpp
Last active April 7, 2024 16:54
Useful as a starting point for a C++ based Linux daemon application.
#include <dirent.h>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <sys/stat.h>
#include <syslog.h>
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active February 25, 2024 00:06 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@fnky
fnky / ANSI.md
Last active May 3, 2024 17:31
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@aaferrari
aaferrari / No code diagram.txt
Last active May 7, 2020 23:43
ASCII diagram compatible with ditaa (https://github.com/stathissideris/ditaa). Output is https://i.imgur.com/phq0Yf9.png after processing
La felicidad de las nocode tools.
+----------------+ +--------+
|👤 Usuario feliz| |{d} |
+------------+---+ |Fichero |
| |proyecto|
| /--+--------+
| |
v v
+------+
|{io} |
@aaferrari
aaferrari / bloglenovo comments stats.py
Last active February 11, 2020 09:34
Obtiene la cantidad de comentarios que hay en los posts de bloglenovo.es (funciona con Python 2 y 3)
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
unichr=chr