Skip to content

Instantly share code, notes, and snippets.

@eddy-22
eddy-22 / example.zsh
Last active August 3, 2023 15:11 — forked from mattmc3/optparsing_demo.zsh
Zsh option parsing example
function yy() {
zmodload zsh/zutil
function breakout() { echo -e "$1" && exit 1}
local flag_url
local output="./%(artist)s/%(title)s.%(ext)s"
local flag_song
local flag_format='bestaudio[ext=m4a]'
@eddy-22
eddy-22 / error_handling.py
Created December 9, 2022 21:55 — forked from zachlagden/error_handling.py
pycord - Error handling useful code, because noone can remember everything :)
"""
Copyright (c) 2022, Zach Lagden
All rights reserved.
"""
import discord
from discord.ext import commands
from datetime import datetime
import coloredlogs
@eddy-22
eddy-22 / cloudflare-delete-all-records.sh
Created October 4, 2022 04:12 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
TOKEN="xxxxxxxxxxxxxxxxxxx"
ZONE_ID=2222222222222222222222222
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
@eddy-22
eddy-22 / github-actions-notes.md
Created September 16, 2021 02:22 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions
@eddy-22
eddy-22 / Vagrantfile
Created August 15, 2021 23:57 — forked from mike-hearn/Vagrantfile
Multi-machine Vagrant config with private networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
:name => "server1",
:eth1 => "192.168.205.10",
:mem => "1024",
:cpu => "1"
@eddy-22
eddy-22 / Readme.md
Created July 5, 2021 13:38 — forked from Touexe/Readme.md
youtube-dl and yt-dlp best commands

Youtube-dl

youtube-dl -f best --ignore-errors --no-mtime --embed-thumbnail -o %%(title)s.%%(ext)s --merge-output-format mp4 --external-downloader aria2c --external-downloader-args "-c -j 16 -x 16 -s 16 -k 2M" URL

Yt-dlp

yt-dlp -f best -c --ignore-errors --no-mtime --embed-subs --embed-thumbnail -o %%(title)s.%%(ext)s --add-metadata --merge-output-format mp4 --downloader aria2c --downloader-args "-c -j 16 -x 16 -s 16 -k 2M" URL

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if Vagrant.has_plugin?("vagrant-proxyconf")

tmux/tmuxinator cheatsheet

tmux

As configured in my dotfiles, here and here.

Command line

$ tmux                           -> start new
$ tmux new -s myname             -> start new w/session name
$ tmux a  #  (or at, or attach)  -> attach
$ tmux a -t myname               -> attach to named

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r