Skip to content

Instantly share code, notes, and snippets.

@mendhak
mendhak / Dockerfile
Last active May 9, 2023 11:21 — forked from jkpl/Dockerfile
saml2aws Docker image, updated to work with symlink and get latest version
FROM debian:stable-slim
RUN apt-get update && \
apt-get install -y ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
RUN CURRENT_VERSION=$(curl -Ls https://api.github.com/repos/Versent/saml2aws/releases/latest | grep 'tag_name' | cut -d> curl -L "https://github.com/Versent/saml2aws/releases/download/v${CURRENT_VERSION}/saml2aws_${CURRENT_VERSION}_linu> tar xvfz saml2aws.tar.gz && \
mv saml2aws /usr/local/bin/saml2aws && \
chmod +x /usr/local/bin/saml2aws && \
@mendhak
mendhak / dummy-web-server.py
Created August 25, 2017 21:33 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else. Also prints POST body
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@mendhak
mendhak / msysgit2unix-socket.py
Last active March 25, 2020 21:20 — forked from duebbert/msysgit2unix-socket.py
Script to help Bash on Ubuntu on Windows use KeeAgent's TCP socket file - so ssh can use KeePass installed on Windows 10
#!/usr/bin/python3
"""
msysGit to Unix socket proxy
============================
This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows).
It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the
ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other
@mendhak
mendhak / InteractiveScrollView.java
Last active February 21, 2023 08:25 — forked from marteinn/InteractiveScrollView.java
ScrollView with a OnBottomReachedListener for Android
package se.marteinn.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
/**
* Triggers a event when scrolling reaches bottom.
import time
import socket
def collect_metric(name, value, timestamp):
sock = socket.socket()
sock.connect( ("localhost", 2003) )
sock.send("%s %d %d\n" % (name, value, timestamp))
sock.close()
def now():
return int(time.time())