Skip to content

Instantly share code, notes, and snippets.

View eliezerfot123's full-sized avatar

Eliezer Romero eliezerfot123

View GitHub Profile
@eliezerfot123
eliezerfot123 / README.md
Created July 25, 2022 21:10 — forked from mau21mau/README.md
Configure Celery + Supervisor With Django
@eliezerfot123
eliezerfot123 / nginx-tuning.md
Created July 8, 2022 15:37 — forked from denji/nginx-tuning.md
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.

@eliezerfot123
eliezerfot123 / comprobar_url
Last active May 3, 2022 02:57
COMPROBAR QUE UNA WEB ESTE DISPONIBLE EN PYTHON
rewimport httplib
import urlparse
# funcion que se encarga de obtener respuesta del estatus del servidor web
def get_server_status_code(url):
# descarga sólo el encabezado de una URL y devolver el código de estado del servidor.
host, path = urlparse.urlparse(url)[1:3]
try:
conexion = httplib.HTTPConnection(host)
conexion.request('HEAD', path)
@eliezerfot123
eliezerfot123 / get_ip_with_url.py
Created May 11, 2016 18:00
Obtener IP desde una lista de URL Con python
import socket
f = open("urls.txt")
num_line = sum(1 for line in f)
f.close()
with open("urls.txt", "r") as ins:
array = []
for line in ins:
print socket.gethostbyname(line.strip())
/* en la metodología de ducks siempre vamos a tener 3 fases por app: Constantes, reducer y acciones*/
import axios from "axios";
import { act } from "react-dom/cjs/react-dom-test-utils.production.min";
// Constantes
const dataInicial = {
array: []
}
@eliezerfot123
eliezerfot123 / combox_dependientes.html
Created December 24, 2013 03:19
ComboBox dependientes con ajax y html5.
<html>
<head>
<title>
COMBOBOX
</title>
<script type="text/javascript">
function cargarSelect2(valor) {
var arrayValores=new Array(
new Array(1,1,"opcion1-1"),
import Vue from 'vue'
import './plugins/bootstrap-vue'
import App from './App.vue'
import router from './router'
import {
BootstrapVue,
IconsPlugin
} from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
@eliezerfot123
eliezerfot123 / send_sms.py
Created September 11, 2013 15:55
Como enviar mensaje con gammu vía python. Teléfono de prueba ALCATEL 0T-800A
#!/usr/bin/env python
# Ejemplo de como enviar SMS usando gammu y python
import gammu
import sys
# se crea un objeto stateMachine, para hablar con el telefono
sm = gammu.StateMachine()
# Leer la configuracion desde (~/.gammurc)
// 1. Go to https://twitter.com/following.
// 2. Keep scrolling to the bottom repeatedly until all your followers are loaded.
// 3. Run this in your console.
[].slice.call(document.querySelectorAll('.unfollow-text')).forEach(function(button) {
button.click();
});

Parar todos los contenedores

docker stop $(docker ps -a -q)

Eliminar todos los contenedores

docker rm $(docker ps -a -q)

Eliminar todas las imágenes

docker rmi $(docker images -q)