Skip to content

Instantly share code, notes, and snippets.

@remi
remi / shc.js
Last active March 2, 2022 14:32
Extract JSON object from https://smarthealth.cards QR code
// Extract JSON payload from SHC QR code (without any kind of private/public key verification)
// Credits + inspiration
// https://github.com/dvci/health-cards-walkthrough/blob/main/SMART%20Health%20Cards.ipynb
// Usage
// $ node shc.js "shc:/01234569…"
const zlib = require("zlib");
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active August 19, 2024 03:36
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@delfuego
delfuego / docker-block-enforcement.sh
Last active March 5, 2017 03:05 — forked from clems4ever/custom-chain-enforcement.service
docker-swarm iptables FORWARD custom chain enforcement
#!/bin/bash
CUSTOM_CHAIN=DOCKER-BLOCK
DELAY=10
NEW_RULE="-o docker0 -j ${CUSTOM_CHAIN}"
chain_exists()
{
[ $# -lt 1 -o $# -gt 2 ] && {
echo "Usage: chain_exists <chain_name> [table]" >&2
@clems4ever
clems4ever / custom-chain-enforcement.service
Last active July 18, 2019 17:49
docker-swarm iptables FORWARD custom chain enforcement
[Unit]
Description=Public filter enforcement Service
[Service]
Type=simple
ExecStart=/home/user/custom-chain-enforcement.sh
KillMode=mixed
TimeoutStartSec=0
RestartSec=0
@cludden
cludden / howto-installing-vault-on-aws-linux.md
Created February 3, 2016 00:30
HOWTO: Installing Vault on AWS Linux

HOWTO: Installing Vault On AWS Linux

This is quick howto for installing vault on AWS Linux, mostly to remind myself. At the end of this tutorial, you'll have a working vault server, using s3 for the backend, self signed certificates for tls, and supervisord to ensure that the vault server is always running, and starts on reboot.

Setting up S3

First things first, let's set up an s3 bucket to use as the storage backend for our s3 instance.

  1. From the AWS Mangement Console, go to the S3 console.

  2. Click on the Create Bucket button

@gokulkrishh
gokulkrishh / media-query.css
Last active November 10, 2024 02:00
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
sudo apt-get -y install build-essential devscripts quilt nano
sudo apt-get -y build-dep openssl
apt-get source openssl
cd openssl-*
nano debian/rules # Remove no-ssl2 in args
dch -n 'Allow dangerous v2 protocol'
dpkg-source –commit
debuild -uc -us
sudo dpkg -i ../*ssl*.deb
sudo apt-get -y install build-essential devscripts quilt
sudo apt-get -y build-dep openssl
apt-get source openssl
cd openssl-*
quilt pop -a # This removes updates
vi debian/patches/series # Remove no-ssl2.patch
vi debian/rules # Remove no-ssl2 in args
quilt push -a # Re-applies the updates
dch -n 'Allow dangerous v2 protocol'
dpkg-source –commit
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000