Skip to content

Instantly share code, notes, and snippets.

@0xdevalias
0xdevalias / accessing-apple-screen-time-data.md
Last active November 9, 2024 09:24
Some notes on accessing / exporting Apple's Screen Time data
@xenophonf
xenophonf / satosa-quickstart.md
Last active June 14, 2023 13:38
SATOSA Quick Start Guide Using SAMLtest

This deploys SATOSA 8.0.0, at the end of which an interested party could perform a basic, end-to-end test of the current SATOSA release using SAMLtest (https://samltest.id/). Run all commands in a root shell.

  1. Install Debian 11 (Bullseye). This is essentially the Docker image build process, only it uses the SATOSA release (etc.) on PyPI:
apt update
apt dist-upgrade -y
apt install -y \
    curl \
    git \
@byron70
byron70 / gist:42b3a1849468626f025439642b0cfa3d
Created April 17, 2020 18:41
gitlab convert relative times to absolute
// ==UserScript==
// @name GitLab Local Time
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Show time instead of relative time in UI
// @author Byron Mann
// @match https://yourdomain.gitlab.domain.com/*
// @grant none
// ==/UserScript==
@earonesty
earonesty / ntf.py
Last active January 31, 2023 10:50
NamedTemporaryFile drop in replacement that deletes on gc, not close(), and supports mode=None
import os, tempfile, gc
class TemporaryFile:
def __init__(self, name, io, delete):
self.name = name
self.__io = io
self.__delete = delete
def __getattr__(self, k):
@lizthegrey
lizthegrey / attributes.rb
Last active September 24, 2024 14:33
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
(ns openscad-experiments.helpers
(:require [scad-clj.model :as m]
[scad-clj.scad :refer [write-scad]]))
(defn render [object]
(spit "render.scad" (write-scad object)))
(defn y-split [obj]
(let [box (m/cube 10 10 10)
holed-obj (m/difference obj (m/scale [1.005 1.2 1.005] box))
@jamesog
jamesog / README.md
Last active September 14, 2023 11:47
Yubikey SSH without GPG

Yubikey as an SSH key

All other guides I've seen (https://github.com/drduh/YubiKey-Guide being the most prolific) tell you to use the Yubikey's smartcard (PKCS#11) features with GnuPG via gpg-agent.

STOP THE MADNESS!

OpenSSH has supported OpenSC since version 5.4. This means that all you need to do is install the OpenSC library and tell SSH to use that library as your identity.

Prequisites

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active December 27, 2024 18:58
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@dgkim5360
dgkim5360 / cheatsheet-pdb.md
Created October 13, 2017 07:52
DIY stuffs for the first steps of Python pdb, summarized from https://pymotw.com/3/pdb

Starting the Debugger

From the command line

$ python3 -m pdb myscript.py  

Within the interpreter

$ python3
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active November 13, 2024 15:10
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com