Skip to content

Instantly share code, notes, and snippets.

@aschober
aschober / ssh-on-android-linux-terminal.md
Created March 19, 2025 04:41
Setup SSH and Tailscale on Android 15 Linux Terminal App

Setup SSH and Tailscale on Linux Terminal App

This guide outlines the steps to set up an SSH server and Tailscale on a fresh Debian installation inside the Android Linux Terminal App. After completing these steps, you'll be able to securely SSH into the Linux environment running on your Android device from any remote machine over the internet using Tailscale.

  1. Update package lists and upgrade installed packages to the latest versions:

    sudo apt update && sudo apt upgrade -y
    
@memchr
memchr / import_env
Created August 28, 2023 18:43
import_env
#!/usr/bin/env bash
set -e
[[ -n $HYPRLAND_DEBUG_CONF ]] && exit 0
USAGE="\
Import environment variables
Usgae: $0 <command>
Commands:
@juxuanu
juxuanu / auto-protonvpn.md
Last active March 26, 2025 07:53
Systemd user service to autoconnect to ProtonVPN through their the CLI utility

Service definition: ~/.config/systemd/user/auto-protonvpn.service

[Unit]
Description=ProtonVPN Connection
After=network-online.target
BindsTo=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/protonvpn-cli ks --off ; /usr/bin/protonvpn-cli connect -f

yt-dlp termux full installation guide.md

Prepare

  1. Install Termux from Github: https://github.com/termux/termux-app/releases
  2. Download the apk and install it -> Note that installing termux from Play Store is highly discouraged.

In Termux:

pkg update
@quangIO
quangIO / wezterm.lua
Created March 15, 2022 15:08
My wezterm config with tmux-like bindings
local wezterm = require 'wezterm';
return {
color_scheme = "Dracula",
-- colors = {
-- background = "#0c0e14",
-- },
window_decorations = "NONE",
font = wezterm.font("Iosevka"),
font_size = 10.0,
-- dpi = 192.0,
@jsliang
jsliang / yearlyMoc.js
Last active May 8, 2024 19:05
Yearly MOC Generator - Obsidian Templater User Script
/**
* @author Jui-Shan (Jenny) Liang <jsliang.tw@gmail.com>
* @param {Object} tp the `tp` object of the Templater plugin
* @param {Object} options options for configuring the year to generate the MOC and the file name format
* @param {string} options.YEAR what year to generate the MOC; default to the current year
* @param {string} options.YEARLY_FORMAT filename format of yearly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.QUARTER_FORMAT filename format of quarterly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.MONTH_FORMAT filename format of monthly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.WEEK_FORMAT filename format of weekly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.DAY_FORMAT filename format of daily notes; format reference: https://momentjs.com/docs/#/displaying/format/
@kepano
kepano / obsidian-web-clipper.js
Last active June 21, 2025 01:04
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@pooladkhay
pooladkhay / sway.config
Created May 31, 2021 20:48
SwayWM bindings for keyboard backlight
# https://github.com/haikarainen/light
#
# Bindings for keyboard backlight
bindsym XF86KbdBrightnessUp exec light -As "sysfs/leds/smc::kbd_backlight" 10
bindsym XF86KbdBrightnessDown exec light -Us "sysfs/leds/smc::kbd_backlight" 10
```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed ) {
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}
@johnrichardrinehart
johnrichardrinehart / nixos_in_virtualbox.md
Last active January 27, 2025 17:11
NixOS from "scratch" as Virtualbox Guest

Steps

New VirtualBox Machine

  1. Create a new disk image (I use VDI for compatibility with VirtualBox)
  2. Allocate some RAM (>6 GiB to start)
  3. Add some video memory and enable 3D acceleration, if needed
  4. Optional: Enable EFI (instead of BIOS)
  5. Attach nixos-minimal ISO for installation
  6. Boot into the ISO

Inside the Live CD

UEFI instructions