Skip to content

Instantly share code, notes, and snippets.

@pdvcs
pdvcs / ruby-asdf-ubuntu.md
Created January 1, 2023 19:46
Install Ruby with `asdf` on Ubuntu

Install Ruby with asdf on Ubuntu

Ruby needs the following dependencies:

sudo apt install git curl autoconf bison build-essential \
    libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
    libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
@pdvcs
pdvcs / setup-ssh-agent.sh
Last active January 8, 2024 03:31
Set up ssh-agent
#!/bin/bash
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && echo "Please source this script" && exit 1
ssh-add -l > /dev/null 2>&1
export RET=$?
export ADDKEY=1
if [[ $RET == 2 ]]; then
# unable to connect to ssh-agent, so start it
eval $(ssh-agent -s)
@pdvcs
pdvcs / asdf-cheatsheet.md
Last active February 15, 2025 18:32
asdf cheatsheet: frequently used asdf commands (asdf-vm.com)

asdf Cheatsheet (updated for version 0.16)

asdf v0.16 is a breaking change, it's now a Go binary rather than a collection of bash scripts.

Install

Install asdf with your OS or other package manager, or manually download it.

If you have eget installed, install asdf with:

@pdvcs
pdvcs / setup-git-ssh.sh
Created August 28, 2022 01:09
Set up ssh-agent for Git
#!/bin/bash
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && echo "Please source this script (source ~/setup-git-ssh)" && exit 1
ssh-add -l > /dev/null 2>&1
export RET=$?
if [[ $RET == 2 ]]; then
# unable to connect to ssh-agent, so start it
eval $(ssh-agent -s)
else
@pdvcs
pdvcs / upgrade-go.sh
Last active January 8, 2024 03:48
Upgrade a Go installation
#!/bin/bash
set -e
mkdir -p ~/.local/etc
touch ~/.local/etc/installed_go_version
TMP_WORK_DIR=$(mktemp -d)
pushd $TMP_WORK_DIR > /dev/null 2>&1
LATEST_GO_VER=$(curl -s 'https://go.dev/VERSION?m=text' | head -1)
INSTALLED_GO_VER=$(cat ~/.local/etc/installed_go_version)
@pdvcs
pdvcs / .fdignore
Last active May 22, 2022 21:45
zsh setup
.git/
node_modules/
venvs/
mod/
target/
build/
.local/
go/src/golang.org/
go/src/github.com/google/
test/
@pdvcs
pdvcs / .tmux.conf
Last active January 8, 2024 02:51
tmux 3 config
# ~/.tmux.conf for tmux 3
set -sg escape-time 20
set -g default-terminal 'screen-256color'
setw -g mouse on
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
@pdvcs
pdvcs / colours-tmux.sh
Created May 13, 2022 22:27
Colours associated with tmux colour names
#!/bin/bash
printf "tmux colours\n\n"
for i in {0..255}; do
printf "\x1b[38;5;${i}mcolour%d\x1b[0m " "${i}"
if (( i % 10 == 0 && i > 1 )); then
echo " "
fi
done
#!/usr/bin/env python
import os
import sys
class ArgOptions:
natural_grouping = True
order_by_date = False
@pdvcs
pdvcs / hello-raylib.c
Last active March 4, 2022 00:18
Compile a "hello world" raylib program
/*******************************************************************************************
*
* raylib [core] example - Basic window
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or