Skip to content

Instantly share code, notes, and snippets.

View ThinkSalat's full-sized avatar

Shawn Salat ThinkSalat

View GitHub Profile
@ThinkSalat
ThinkSalat / install.sh
Created October 26, 2023 14:34
VPS Quick setup
#!/bin/sh
# The idea behind this script is to setup a non root user to act as the main admin, allow use of sudo
# and set up SSH keys
# Function to add a user and configure sudo access
add_admin_user() {
read -p "Enter the admin username: " username
echo "Admin username: $username"
@ThinkSalat
ThinkSalat / bitwarden backup.bat
Created September 29, 2023 20:25
Bitwarden backup script
@echo off
:: Set date and time environment variables
for /f %%# in ('wMIC Path Win32_LocalTime Get /Format:value') do @for /f %%@ in ("%%#") do @set %%@
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: User1
::
@ThinkSalat
ThinkSalat / Readwise to Raindrop.js
Last active October 31, 2023 20:11
Syncs your Readwise documents, highlights and annotations to Raindrop. automatically adds new highlights and annotations. Set up the config using the tokens from readwise and raindrop, and leave LASTUPDATE blank as it will gather all your documents and add them to the raindrop collection on the first run. Find RAINDROPCOLLECTIONID using this htt…
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'config.txt');
const logFilePath = path.join(__dirname, 'log.txt');
function readVariables() {
try {
const fileContent = fs.readFileSync(filePath, 'utf-8');
@ThinkSalat
ThinkSalat / custom.js
Last active July 8, 2023 07:22
Page Icon abbreviations for hierarchical links in logseq
const pageIcons = new Map()
function abbreviateNamespace(selector) {
const appContainer = document.getElementById("app-container");
const handleNamespaceHover = (event) => {
const namespaceRef = event.target.closest(selector);
if (!namespaceRef) return;
if (event.type === "mouseenter") {