Skip to content

Instantly share code, notes, and snippets.

View SamuelDudley's full-sized avatar

Samuel Dudley SamuelDudley

  • Canberra - Australia
View GitHub Profile
@mtigas
mtigas / gist:952344
Last active June 20, 2024 11:22
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@mattgorecki
mattgorecki / socketio.py
Created November 18, 2011 03:23
Sending an event to a node.js socket.io server from Python.
import websocket
import thread
import time
import sys
from urllib import *
class SocketIO:
def __init__(self):
self.PORT = 5000
self.HOSTNAME = '127.0.0.1'
@jacobian
jacobian / pip-cache-install.py
Created May 1, 2012 05:22
Install a package from your local pip download cache without touching the 'net.
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.cfg:
[install]
@subnivean
subnivean / parasurf.py
Last active April 5, 2018 23:42
python: Parametric 2D Surface Class
import numpy as np
from scipy.interpolate import RectBivariateSpline, bisplev
class ParaSurf(object):
def __init__(self, u, v, xyz, bbox=[-0.25, 1.25, -0.5, 1.5], ku=3, kv=3):
"""Parametric (u,v) surface approximation over a rectangular mesh.
Parameters
----------
@kevinhughes27
kevinhughes27 / opencv_blackfly.cpp
Last active January 24, 2024 19:39
A simple program showing how to capture from a Point Grey Research Camera and display the image using OpenCV
#include "FlyCapture2.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace FlyCapture2;
int main()
@glennzw
glennzw / evil.py
Last active August 19, 2021 13:37
Simple Python library to manage wireless network connection.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# glenn@sensepost.com / @glennzw
# Handle wireless networking from Python
# The name (evil.py) is a play on 'wicd'
from subprocess import Popen, call, PIPE
import errno
from types import *
import logging
import sys
@roxlu
roxlu / test_fex_load_image.cpp
Created August 22, 2014 13:22
Examples on how to load + reuse memory using rx_load_png and rx_load_jpg
/*
test_fex_load_image
-------------------
Plain test which loads + reloads a couple of images and reallocating the
previously allocated buffer when needed. Just a tiny test to speed up
the image loading process.
*/
@tetkuz
tetkuz / README.md
Last active February 13, 2024 16:49
GStreamer stream to HTML5

Description

[Server] GStreamer ---> HTML [Client]

Require

  • gstreamer-1.x
  • Browser which supports video tag of HTML5

debian

@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active May 23, 2024 07:53
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@zapstar
zapstar / client.py
Created June 8, 2018 09:01
Python Asyncio SSL client and server examples
#!/usr/bin/env python3
import asyncio
import ssl
@asyncio.coroutine
async def echo_client(data, loop):
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_ctx.options |= ssl.OP_NO_TLSv1