Skip to content

Instantly share code, notes, and snippets.

@kamikat
kamikat / sshtunnel
Last active August 29, 2015 14:07
Systemd simple session-level SSH Tunnel Service
#!/bin/bash
_KEY=$1
shift 1
if [ -z "$SSH_AUTH_SOCK" ]
then
SSH_AUTH_SOCK=`ss -xl | grep -o "/run/user/$UID/keyring-.*/ssh"`
if [ -z "$SSH_AUTH_SOCK" ]
@hwdsl2
hwdsl2 / .MOVED.md
Last active May 19, 2024 06:28
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
@mblondel
mblondel / kernel_kmeans.py
Last active January 4, 2024 11:45
Kernel K-means.
"""Kernel K-means"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils import check_random_state
@shawnbot
shawnbot / d3-compat.js
Created November 29, 2012 02:00
d3 "mouseenter" and "mouseleave" event support
(function() {
// get a reference to the d3.selection prototype,
// and keep a reference to the old d3.selection.on
var d3_selectionPrototype = d3.selection.prototype,
d3_on = d3_selectionPrototype.on;
// our shims are organized by event:
// "desired-event": ["shimmed-event", wrapperFunction]
var shims = {
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using: