Skip to content

Instantly share code, notes, and snippets.

View lemon-sh's full-sized avatar
🍋
archbtw

./lemon.sh lemon-sh

🍋
archbtw
View GitHub Profile
@lemon-sh
lemon-sh / ansicraft.rs
Last active October 29, 2023 21:46
Rust program to convert text with ANSI sequences into Minecraft /tellraw JSON
use std::io::{stdin, Read};
use cansi::v3::*;
use serde::Serialize;
fn cansi_to_mc_color(color: Color) -> &'static str {
match color {
Color::Black => "black",
Color::Red => "red",
Color::Green => "green",
Color::Yellow => "gold",
#!/bin/bash
MOUNTPOINT="/media/crypt"
CRYPTNAME="cryptroot"
set -euo pipefail
[[ $(id -u) -ne 0 ]] && {
echo "This script must be run as root"
exit 1
}
@lemon-sh
lemon-sh / ytaria.sh
Created November 12, 2021 15:32
script for downloading yt videos using yt-dlp but with aria2c as the downloader
#!/bin/bash
# by lemon.sh
set -euo pipefail
[[ $# -ne 2 ]] && echo "Usage: $0 <youtube link> <output filename>" && exit 1
type yt-dlp &>/dev/null || { echo "Error: yt-dlp is not available."; exit 10; }
type aria2c &>/dev/null || { echo "Error: aria2c is not available."; exit 11; }
type ffmpeg &>/dev/null || { echo "Error: ffmpeg is not available."; exit 12; }
; LemonTimer 1.0
; A simple desktop clock written in x86 ASM
; by ./lemon
format PE
entry start
include 'win32ax.inc'
section '.data' data readable writeable