Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
from collections import namedtuple
import socket
import struct
usbip_user_op_common = namedtuple('usbip_user_op_common', 'version code status')
usbip_usb_device = namedtuple('usbip_usb_device', 'path busid busnum devnum speed idVendor idProduct bcdDevice bDeviceClass bDeviceSubClass bDeviceProtocol bConfigurationValue bNumConfigurations bNumInterfaces')
usbip_header_basic = namedtuple('usbip_header_basic', 'command seqnum devid direction ep')
@styblope
styblope / docker-api-port.md
Last active May 4, 2024 20:17
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@mathiasbynens
mathiasbynens / web-platform-status-links.md
Last active April 16, 2024 02:54
Web platform status links
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@rcolinray
rcolinray / gl_ffmpeg.cpp
Created November 19, 2013 20:54
OpenGL-FFMpeg integration
// Use OpenGL 3.0+, but don't use GLU
#define GLFW_INCLUDE_GL3
#define GLFW_NO_GLU
#include <GL/glfw.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
extern "C" {
@btmills
btmills / autopoke.js
Created July 9, 2013 08:33
Run this while on https://www.facebook.com/pokes to beat an opponent into submission.
var dashboard = document.getElementsByClassName('pokesDashboard')[0];
window.setInterval(function () {
var pokes = dashboard.getElementsByClassName('uiIconText');
for (var i = 0; i < pokes.length; i++)
pokes[i].click();
}, 1000);