Skip to content

Instantly share code, notes, and snippets.

View erm3nda's full-sized avatar
😑
Expressionless master

m3nda erm3nda

😑
Expressionless master
  • n0n3
  • localhost
View GitHub Profile
@erm3nda
erm3nda / cpulimit-daemonize-sample.php
Last active November 27, 2015 04:52
Run some processes to show cpulimit work
<?php
/**
* PHP cpulimit daemon
*
* PHP cpulimit daemon checks for http calls with REQUEST_URI and limites those processes.
* This is related to https://github.com/opsengine/cpulimit/issues/40#issuecomment-73372492
* and http://www.tronko.es/servers/cpulimit-howto/
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
@erm3nda
erm3nda / wordpress-sqlite-instant-install.sh
Last active December 10, 2015 00:04 — forked from bburky/instant-wordpress.sh
Instant wordpress with sqlite3 install automation
#!/bin/bash
# One line original script:
# curl -L https://gio.io/wp.sh | bash
# One line ES_es:
# curl -L https://git.io/v4dSJ | bash
# You can define port by setting variable PORT before exec the script, otherwise fallback to 8080.
# curl -L https://git.io/v4dSJ | PORT=8888 bash
@erm3nda
erm3nda / CustomRules.js
Created April 4, 2016 01:44 — forked from y3rsh/CustomRules.js
Fiddler Custom Rules
import System;
import System.IO;
import System.Windows.Forms;
import Microsoft.VisualBasic;
import Fiddler;
// GLOBALIZATION NOTE:
// Be sure to save this file with UTF-8 Encoding if using any non-ASCII characters
// in strings, etc.
//
@erm3nda
erm3nda / python-alsaaudio-applause-counter.py
Last active June 5, 2016 15:55
Detects applauses and does count them, plus replay them later, looped
#!/usr/bin/python
## This is an example of a simple sound capture script that counts Applauses (or other louder sounds).
## U can adjust the data value to fit your desired sound by it's amount of data lenght value
## The script opens an ALSA pcm for sound capture and several modules. Set
## various attributes of the capture, and reads in a loop,
## Volume is getting porcentual to medium values of starting noise, not just a fixed value, but not bulletproof
## Adjust your volume settings or change the desired value on `sound_raise`.
## TODO: Ad proper methods names and values
## TODO: Convert to a class
@erm3nda
erm3nda / text2speech-remote.sh
Last active June 20, 2016 14:57
vozme.com online text 2 speech service with bash
#!/bin/bash
# sample url: http://vozme.com/speech/es-fm/5d/5d40a31e1164b793c6200780c5dafb5e.mp3
# set a random filename for wget tmp data (html output)
# used 3:-33 instead 1:-32 to avoid $1 argument clash
tmpfile=/tmp/`< /dev/urandom tr -dc A-Za-z0-9 | head -c${2:-33}`.txt
tmpaudio=/tmp/`< /dev/urandom tr -dc A-Za-z0-9 | head -c${2:-33}`.mp3
# argument checking for $1 ("use quoted text")
if [ -z "$1" ]
@erm3nda
erm3nda / python-network-tests.py
Last active September 3, 2016 00:04
Some tools for IP and websites with Python
# This is one of my regular scripts, i'd like to create my own functions to understand how everything works.
# Usually, when it comes to ip checking, people don't fully understand how it works, and tend to do some BAD checks.
# The MOST realiable way to check an IP it's let the system to tell you, cuz every language having networking can do that, need to do that.
# There's a few functions that uses various Python modules and functions to check and test IP and hostnames in many ways.
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
import sys, re, socket, urllib2, httplib
from urlparse import urlparse
@erm3nda
erm3nda / blizzard-scrapper.php
Last active January 2, 2017 08:09
Blizzard user data scrapper like a thread from PHP CLI
<?php
/**
* database.php
*
* Database access
*
* @category Data scrapper
* @package Blizzard
* @author erm3nda
@erm3nda
erm3nda / cpulimit.py
Last active January 19, 2017 14:39
That's how you limit CPU usage of a process using signal module
#!/usr/bin/env python
import time, os, sys, signal
sleeptime = waketime = 0.01
def send(signal, pids):
for pid in pids:
os.kill(pid, signal)
@erm3nda
erm3nda / souncloud-autoplay.user.js
Last active January 19, 2017 14:41
Enables autoplay for SoundCloud via userscript. Just cuz i bored doing a click everytime i join...
// ==UserScript==
// @name soundcloud autoplay
// @author erm3nda at gmail.com
// @author-www http://erm3nda.github.io
// @post-www http://erm3nda.github.io/2016/04/28/soundcloud-autoplay-gm-userscript.html
// @namespace souncloud-autoplay
// @icon http://files.softicons.com/download/social-media-icons/simple-icons-by-dan-leech/png/32x32/soundcloud.png
// @description Does autoplay first track of given category
// @include https://soundcloud.com/*
// @include https://soundcloud.com/charts/top/*
@erm3nda
erm3nda / registro.py
Created March 4, 2017 21:55
Python basic txt list manager CLI
#!/user/local/env python
# -*- coding:utf8 -*-
import os
import platform
filename = "registros"
if not os.path.isfile(filename):
open(filename, "w+").close()