Skip to content

Instantly share code, notes, and snippets.

@Geczy
Geczy / migrate.sh
Last active July 27, 2024 15:53
Migrate Coolify to a new server
#!/bin/bash
# This script will backup your Coolify instance and move everything to a new server. Docker volumes, Coolify database, and ssh keys
# 1. Script must run on the source server
# 2. Have all the containers running that you want to migrate
# Configuration - Modify as needed
sshKeyPath="$HOME/.ssh/your_private_key" # Key to destination server
destinationHost="server.example.com"
@jangroth
jangroth / dendron-to-obsidian.py
Created March 25, 2023 04:53
Converts dendron note structure to obsidian note structure
# converts dendron note structure to obsidian note structure
# - removes frontmatter
# - adds tags
# - converts internal links
# - ignores empty (frontmatter-only) notes
#
# use at your own risk
import glob
import re
@hasssan
hasssan / jiraToDendronTaskPage.js
Last active August 9, 2022 05:40 — forked from idelem/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) or Tasks - Usual for posting links to resources in README.md files
javascript: (function () {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData('Text', text);
} else if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
var textarea = document.createElement('textarea');
textarea.textContent = text;
textarea.style.position = 'fixed';
/* Prevent scrolling to bottom of page in MS Edge.*/
@wlib
wlib / LICENSE
Last active April 30, 2024 17:07
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@idelem
idelem / titleUrlMarkdownClip.js
Last active July 17, 2024 20:48 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@hdnl
hdnl / daily_template.md
Last active March 29, 2024 18:44
Template to faciliate taking daily notes in Markdown, featuring start and end day reflections, schedule, and logging

Start-of-Day Reflections

I am grateful for...

What would make today great?

@ChrAlpha
ChrAlpha / gist:65a6f402d1b984ea17feaa4ae314e8dd
Created March 21, 2020 14:05
Windows Terminal Configuration
Setting 基础配置(默认位置 `C:\Users\{{UserName}}\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json`):
```
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
@mjameswh
mjameswh / rename_es_index.sh
Last active August 18, 2023 20:59
Demonstration of how to rename an ElasticSearch index using the Index Clone API, introduced in ES 7.4. This is the cUrl based version. See here for details: https://stackoverflow.com/a/59397746/2887657 .
source_index=source_index
target_index=target_index
elastic_search_server=elasticsearch:9200
# Make sure the source index is actually open
curl -X POST "${elastic_search_server}/${source_index}/_open"
# Put the source index in read-only mode
curl -X PUT "${elastic_search_server}/${source_index}/_settings" \
@necojackarc
necojackarc / Set up Vim with clipboard on Ubuntu on WSL2.md
Last active December 28, 2023 02:45
Set up Vim on Ubuntu on Windows Subsystem for Linux 2 (WSL2) to share clipboard

This explains how to set up Vim on Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2) in order to share the clipboard between Windows and Ubuntu.

Environments

  • Windows 10 Home
  • Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2)

Steps

  1. Build Vim with the clipboard option enabled
  2. Set up VcXsrv Windows X Server
@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active July 22, 2024 22:17
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe