Skip to content

Instantly share code, notes, and snippets.

@Makeshift
Makeshift / tutorial.md
Last active May 6, 2024 17:17
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active April 18, 2024 23:13
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@plembo
plembo / DisableMFAForAADUser.md
Last active April 16, 2024 12:17
Disable MFA for an individual Azure AD User

Disabling MFA for an Azure AD User

Azure AD MFA is not enabled by default for AAD and Microsoft 365 users, but it will be if during setup an admin chooses to Enable Security Defaults on Azure AD (as most will when prompted to do so: after all, who in their right mind wouldn't require MFA?).

However, there are situations where being able to toggle MFA on or off for a particular user can be useful. For example, in a development or test tenant when working with sample code from Microsoft that doesn't account for MFA (like a simple Microsoft Graph console app). This procedure involves disabling Security Defaults on AAD.

@ByteHamster
ByteHamster / ConscryptProviderInstaller.java
Last active June 25, 2022 21:47
ConscryptProviderInstaller Proof-Of-Concept
/*
* This class would be distributed as a small library to be included in apps.
* The library does NOT need the (large) Conscrypt dependency.
*/
package de.danoeh.antennapod.core;
import android.content.Context;
import android.content.pm.PackageManager;
@Karewan
Karewan / Android: TLS 1.3 with OkHttp + Conscrypt on all Android versions (Tested on 4.1+)
Last active February 8, 2024 07:56
Android: TLS 1.3 with OkHttp and Conscrypt on all Android versions (Tested on 4.1+)
// Android 4.1+
dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
implementation 'org.conscrypt:conscrypt-android:2.5.2'
}
// Android 5.0+
dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'org.conscrypt:conscrypt-android:2.5.2'
@jkpl
jkpl / Dockerfile
Last active February 13, 2023 15:22
saml2aws Docker image
FROM debian:stable-slim
RUN apt-get update && \
apt-get install -y ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
ENV SAML2AWS_VERSION=2.16.0
ENV SAML2AWS_DOWNLOAD_URL=https://github.com/Versent/saml2aws/releases/download/v${SAML2AWS_VERSION}/saml2aws_${SAML2AWS_VERSION}_linux_amd64.tar.gz
RUN curl -L "$SAML2AWS_DOWNLOAD_URL" -o saml2aws.tar.gz && \
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@juanpabloaj
juanpabloaj / logging_env.py
Last active March 1, 2024 13:09
python logging, log level with environment variable
import os
import logging
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper()
logging.basicConfig(level=LOGLEVEL)
@mendhak
mendhak / apigateway.tf
Last active April 24, 2024 10:52
Terraform - API Gateway with greedy path (proxy+) calling httpbin. Also includes deployment
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
@BoD
BoD / .travis.yml
Last active October 27, 2020 13:25
Travis build file for Android: the whole file
language: java
dist: trusty
jdk: oraclejdk8
before_cache:
# Do not cache a few Gradle files/directories (see https://docs.travis-ci.com/user/languages/java/#Caching)
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache: