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 / cpulimit-daemonize-sample.php
Last active November 27, 2015 04:52
Run some processes to show cpulimit work
* PHP cpulimit daemon
* PHP cpulimit daemon checks for http calls with REQUEST_URI and limites those processes.
* This is related to
* and
* 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 / javascript-check.php
Last active May 9, 2023 20:39
Check if javascript is enabled from the PHP server
* The simplest way i found to check javascript vía PHP
* Not to run code if javascript, to tell server if a client
* has enabled Javascript. Check at $_SESSION['js'] for 1/0 true/false
* Need cookie to run
* I've not wrapped into a class nor a function because lazy
* It's easy too to put a include_once("javascript-check.php")
erm3nda /
Last active December 10, 2015 00:04 — forked from bburky/
Instant wordpress with sqlite3 install automation
# One line original script:
# curl -L | bash
# One line ES_es:
# curl -L | bash
# You can define port by setting variable PORT before exec the script, otherwise fallback to 8080.
# curl -L | PORT=8888 bash
erm3nda /
Last active March 27, 2023 11:41
Creates and serves a fresh wordpress sqlite powered install from scratch
# wp-cli basic install script with sqlite database.
# requires installing wp-cli.phar following instructions from
# Download wp-package, by default does download en_US package (--locale="en_US")
wp core download --locale="es_ES"
# U can later install another language package
# wp core language es_ES --activate
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
// @author-www
// @post-www
// @namespace souncloud-autoplay
// @icon
// @description Does autoplay first track of given category
// @include*
// @include*
erm3nda /
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 / 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;
// Be sure to save this file with UTF-8 Encoding if using any non-ASCII characters
// in strings, etc.
erm3nda /
Last active June 5, 2016 15:55
Detects applauses and does count them, plus replay them later, looped
## 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 / javascript-audio-tag-extras.js
Last active January 21, 2019 17:11
Javascript html5 audioplayer swapper and remember me function
This code it's a mix of some good javascript fixes, a cookie manager, and audio tag features.
It ads those functions:
- Auto stop other players when starting a new one (avoid multiple sounds at time)
- Remember status of player via cookie, to autostart radio if the user wants.
Related links:
erm3nda /
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