Skip to content

Instantly share code, notes, and snippets.

@nahun
nahun / README.md
Last active May 18, 2024 19:36
NetBox with Okta SSO using OAuth

NetBox with Okta SSO using OAuth

This is an example setup with NetBox using Okta for authentication. It uses the Python Social Auth library that is supported in NetBox starting in v3.1.

See the NetBox docs on SSO.

This is written to support NetBox v3.1.

Okta Setup

An OIDC application is required in Okta.

@rougier
rougier / make-box.el
Last active May 18, 2024 19:35
Emacs: add borders around some part of a buffer
;;; make-box.el --- Box around part of a buffer -*- lexical-binding: t -*-
;; Copyright (C) 2024 Nicolas P. Rougier
;; Maintainer: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
;; Version: 0.1.0
;; Package-Requires: ((emacs "27.1"))
;; Keywords: convenience
;; This file is not part of GNU Emacs.
@Ravarcheon
Ravarcheon / spectralRotation.py
Created May 18, 2024 13:23
rotates an audio file by 90 degrees in the spectrum while being a reversible process with minimal loss (only floating point errors which are like -150 dB but thats literally silence ahaha~)
import numpy as np
import soundfile as sf
from scipy.fftpack import fft, ifft
def rotateSignal(signal,flip):
if flip:
signal = signal[::-1]
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft
rotSig = np.real(ifft(x))
@sile
sile / 0_raft.md
Last active May 18, 2024 19:34
Raft(分散合意アルゴリズム)について
@tatsumoto-ren
tatsumoto-ren / subs.md
Last active May 18, 2024 19:34
Japanese Subtitles

📓 Table of Contents 📚 Resources ✉️ Chat


kitsunekko.net jp subtitles

A large repository of japanese subtitles that is updated reasonably often and has a clean design.| The most popular one, you can upload your own subs.| Often have to be retimed.

@vivekhaldar
vivekhaldar / cut_silence.py
Last active May 18, 2024 19:32
Python script to cut out silent parts from a video. Uses moviepy.
#!/usr/bin/env python
#
# Based on a script by Donald Feury
# https://gitlab.com/dak425/scripts/-/blob/master/trim_silenceV2
# https://youtu.be/ak52RXKfDw8
import math
import sys
import subprocess
import os
@supechicken
supechicken / autologin-chromeos.md
Last active May 18, 2024 19:32
[Tutorial] Auto sign-in on ChromeOS startup

Auto sign-in on ChromeOS startup

Overview

In some scenarios, it is inconvenient/unnecessary to login with a password, for example, when using Chromebook as a home server or kiosk.

However, ChromeOS doesn't provide any way to enable auto-login or to disable the sign-in password (there was such a feature on macOS many years ago). And Google have no interest in adding this functionality also.

Recently I installed ChromeOS on my HTPC, planning to use it as a TV box (and the same trouble annoyed me). So I created a program to do it for me.

@tcoppex
tcoppex / c_nostd.txt
Last active May 18, 2024 19:31
Writing C software without the standard library [Linux Edition] - Franc[e]sco's Gopherspace
###################################################################
Writing C software without the standard library
Linux Edition
###################################################################
There are many tutorials on the web that explain how to build a
simple hello world in C without the libc on AMD64, but most of them
stop there.
I will provide a more complete explanation that will allow you to
build yourself a little framework to write more complex programs.
@truemogician
truemogician / upgrading_postgresql_in_windows.md
Last active May 18, 2024 19:28
Upgrading PostgreSQL in Windows

Upgrading PostgreSQL in Windows

The official documentation for PostgreSQL provides a guide to upgrading using pg_upgrade. However, it can be a bit like a treasure hunt with hidden traps. This gist will walk you through a clear and robust method for upgrading PostgreSQL on Windows, using the upgrade from version 14 to 16 as an example.

1. Install the New Version of PostgreSQL

Before you embark on the upgrade journey, make sure you have the new version installed. This is because the pg_upgrade utility used during the upgrade process belongs to the newer version.

To get started, visit the official download page, download the installer, and run it. A word of caution: do not overwrite the old installation, as you'll need its binaries and data for the upgrade.

@OrionReed
OrionReed / dom3d.js
Last active May 18, 2024 19:29
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯