Skip to content

Instantly share code, notes, and snippets.

@bmaupin
bmaupin / open-source-sso.md
Last active July 19, 2024 08:06
Comparison of some open-source SSO implementations

ⓘ This list is not meant to be exhaustive and is not guaranteed to be maintained. See the comments for updates and alternative options.

(Items in bold indicate possible concerns)

Keycloak WSO2 Identity Server Gluu CAS OpenAM Shibboleth IdP
OpenID Connect/OAuth support yes yes yes yes yes yes
Multi-factor authentication yes yes yes yes yes yes
Admin UI yes yes yes yes yes no
OpenJDK support yes yes partial² yes
@bynil
bynil / config-git-proxy.txt
Last active January 23, 2024 12:37
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@zyzsdy
zyzsdy / letv_getUrl.php
Last active April 23, 2018 09:39
PHP用乐视云视频绝对地址获取器
<?php
//生成api所需信息
$times = time();
$uu = "ab417c1571";//B站uu
$vu = "1233a5fc63";//视频vu
$sign_f = "cfflashformatjsonran".$times."uu".$uu."ver2.2vu".$vu."2f9d6924b33a165a6d8b5d3d42f4f987";//合并签名参数
$sign = md5($sign_f);//计算签名
$api = "http://api.letvcloud.com/gpc.php?cf=flash&sign=".$sign."&ver=2.2&format=json&uu=".$uu."&vu=".$vu."&ran=".$times;//计算api地址
//访问api取得详细信息
$res = file_get_contents($api);
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@w-vi
w-vi / zlib_gzip.py
Created April 1, 2014 15:15
How to call zlib to get the gzip inflate / deflate ... definitely not sure if it works in general but so far haven't found where it doesn't.
import zlib
"""
zlib.compressobj(...) ⇒ deflateInit(...)
compressobj.compress(...) ⇒ deflate(...)
zlib.decompressobj(...) ⇒ inflateInit(...)
decompressobj.decompress(...) ⇒ inflate(...)
"""
def deflate(data, compresslevel=9):
compress = zlib.compressobj(
compresslevel, # level: 0-9
@briangriffey
briangriffey / NinePatchBitmapFactory.java
Last active April 25, 2023 03:06
Create 9-patches simlar to - (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.NinePatch;
import android.graphics.Rect;
import android.graphics.drawable.NinePatchDrawable;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**
public class ThemedView extends View {
public ThemedView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public ThemedView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@cncuckoo
cncuckoo / imgHash.py
Created July 22, 2011 06:10
Wote用python语言写的imgHash.py
#!/usr/bin/python
import glob
import os
import sys
from PIL import Image
EXTS = 'jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'png', 'PNG'
@sit
sit / gitproxy-socat
Created January 20, 2009 02:30
A simple wrapper around socat to use as a git proxy command
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny