Skip to content

Instantly share code, notes, and snippets.

openapi: '3.0.2'
info:
title: Local REST API for Obsidian
description: |
You can use this interface for trying out your Local REST API in Obsidian.
Before trying the below tools, you will want to make sure you press the "Authorize" button below and provide the API Key you are shown when you open the "Local REST API" section of your Obsidian settings. All requests to the API require a valid API Key; so you won't get very far without doing that.
When using this tool you may see browser security warnings due to your browser not trusting the self-signed certificate the plugin will generate on its first run. If you do, you can make those errors disappear by adding the certificate as a "Trusted Certificate" in your browser or operating system's settings.
version: '1.0'
@tgran2028
tgran2028 / style hide.css
Created July 5, 2024 23:56
Style sheet used by Google for their Style sheets guide.
body {
background-color: #fff;
color: #333;
font-family: sans-serif;
font-size: 10pt;
margin-right: 100px;
margin-left: 100px;
}
h1,
@tgran2028
tgran2028 / path-util.py
Created June 28, 2024 01:30
Shell command line tool for managing path
#!/usr/bin/env python3
import enum
import os
import sys
from pathlib import Path
from typing import List, Literal, Optional
import click
import rich
@tgran2028
tgran2028 / default.condarc
Created June 21, 2024 04:28
Default config values for condarc
# ######################################################
# ## Channel Configuration ##
# ######################################################
# # channels (sequence: primitive)
# # aliases: channel
# # env var string delimiter: ','
# # The list of conda channels to include for relevant operations.
# #
# channels:
@tgran2028
tgran2028 / export-WSL-images.ps1
Last active June 18, 2024 22:48
Export all WSL distribtions (minus docker images) to tarballs
<#
.SYNOPSIS
Exports WSL distributions to tar.gz files, excluding built-in docker distributions.
.PARAMETER None
.EXAMPLE
.\export-wsl-images.ps1
Exports all WSL distributions to tar.gz files.
@tgran2028
tgran2028 / Query-WindowsSearch.ps1
Last active June 10, 2024 15:30
Query Windows Search SearchIndex table by SQL query
<#
.SYNOPSIS
Executes a Windows Search query and returns the result as a DataTable.
.DESCRIPTION
The Query-WindowsSearch function executes a Windows Search query using the specified SQL statement and returns the result as a DataTable.
.PARAMETER Sql
The SQL statement to be executed for the Windows Search query.
@tgran2028
tgran2028 / install_ruby.sh
Last active April 22, 2024 06:00
Use rbenv and ruby-build to install Ruby.
#!/bin/bash
#
# Ruby Installation Script for OpenProject
# https://www.openproject.org/docs/development/development-environment-ubuntu/
#
# This script installs Ruby using rbenv and ruby-build on Ubuntu.
# It assumes the user has administrative privileges and uses Bash shell.
# Install dependencies required for rbenv and Ruby
@tgran2028
tgran2028 / apt-config-examples
Created April 4, 2024 17:17
Index of apt package manager options
/* This file is an index of all APT configuration directives.
Instead of actual values the option has the type as value.
Additional explanations and possible values might be detailed in a comment.
Most of the options have sane default values,
unless you have specific needs you should NOT include arbitrary
items in a custom configuration.
In some instances involving filenames it is possible to set the default
directory when the path is evaluated. This means you can use relative
@tgran2028
tgran2028 / envjson.py
Last active April 4, 2024 04:15
Shell command to write environment key/values as JSON to stdout
#!/usr/bin/env python3
#
# envjson.py
"""
Dumps alphanumerically sorted environment variables to stdout in JSON format.
Usage:
./envjson.py # Replace with the actual script name
"""
@tgran2028
tgran2028 / safe-edit-global-env-file.sh
Created April 4, 2024 03:56
Script for making updates to /etc/environment file. Includes various safeguards, and records of all changes
#!/bin/bash
# Define the name of the revised environment file.
REVISED_ENV_FILE='e.sh'
# Check if REVISED_ENV_FILE exists, if not, execute the following commands.
if [ ! -f "$REVISED_ENV_FILE" ]; then
# Copy the default system environment file to the revised file.
cp /etc/environment "$REVISED_ENV_FILE"