Skip to content

Instantly share code, notes, and snippets.

View plutec's full-sized avatar

Antonio Sánchez plutec

View GitHub Profile
@oborichkin
oborichkin / tls_client.py
Last active July 5, 2024 08:06
Simple TLS client and server on python
import socket
import ssl
from tls_server import HOST as SERVER_HOST
from tls_server import PORT as SERVER_PORT
HOST = "127.0.0.1"
PORT = 60002
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS.md
Last active June 19, 2024 15:50
Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

Update 28 July 2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Update 23 May 2020: This guide is ALREADY OUTDATED and might no longer work with new versions of Ubuntu and VirtualBox. Please consider switching to the updated guide instead. I will no longer respond to the replies to this gist. Thank you.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

@patik
patik / styles.css
Last active April 20, 2024 06:59 — forked from joshbode/numbered_headings.md
Numbered Headings in Markdown via CSS
body { counter-reset: h1counter h2counter h3counter h4counter h5counter h6counter; }
h1 { counter-reset: h2counter; }
h2 { counter-reset: h3counter; }
h3 { counter-reset: h4counter; }
h4 { counter-reset: h5counter; }
h5 { counter-reset: h6counter; }
h6 {}
h2:before {
@tablatronix
tablatronix / esptelnetansi.ino
Created August 25, 2016 14:52
Arduino ESP8266 telnet server with some ansi experiments
/**
* Arduino ESP8266 telnet server with some ansi experiments
* @author: shawn_a
*/
#include <ESP8266WiFi.h>
#include <Arduino.h>
/* Set these to your desired AP credentials. */
const char *APssid = "ESPap";
@plutec
plutec / Subprocess_class.py
Last active August 22, 2023 02:27
Class to create a subprocess with a watchdog
import time
import subprocess
import datetime
"""
This class is used to execute a subprocess including a watchdog
"""
class Subprocess(object):
def __init__(self, cmd, cwd=None, stdout=None):
self.cmd = cmd
@Diviei
Diviei / middleware.py
Created April 1, 2015 10:17
Hide admin panel for unprivileged users
# -*- coding: utf-8 -*-
from django.http import HttpResponseNotFound
class AdminSiteSecurizeMiddleware(object):
"""Hide admin panel for unprivileged users"""
def process_response(self, request, response):
"""
Return a 404 Not Found page if there is no authenticated user
or if user has no enough privileges
"""
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)