Skip to content

Instantly share code, notes, and snippets.

@ilyaevseev
ilyaevseev / server.py
Last active Dec 17, 2019 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
View server.py
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
View set_qdisc.bash
#!/bin/bash -ue
#
# Sets up mq+$shed combo for given interface.
#
# NB! To not degrade upload speeds, fq should only be used on kernels >= 3.19:
# https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9878196578286c5ed494778ada01da094377a686
#
if [ $# -ne 2 ] || [ -z "$1" ] || [ -z "$2" ]; then
echo "usage: $0 interface scheduler" >&2
View set_irq_affinity.sh
#!/bin/bash
#
# Copyright (c) 2014, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@ilyaevseev
ilyaevseev / webcrawler.js
Created Jan 26, 2016 — forked from antivanov/webcrawler.js
Simple PhantomJS-based web crawler library
View webcrawler.js
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};