This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printf "\033]52;c;%s\007" "$(base64 | tr -d '\n')" | |
# https://jvns.ca/til/vim-osc52/ | |
# Instructions: | |
# $ sudo nano /usr/local/bin/pbcopy | |
# paste this script | |
# $ sudo chmod +x /usr/local/bin/pbcopy | |
# example usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem rust coreutils for windows setup - https://github.com/uutils/coreutils/releases | |
rem run as admin | |
coreutils.exe ln -s coreutils.exe ln.exe | |
ln -s -f coreutils.exe [.exe | |
ln -s -f coreutils.exe arch.exe | |
ln -s -f coreutils.exe b2sum.exe | |
ln -s -f coreutils.exe b3sum.exe | |
ln -s -f coreutils.exe base32.exe | |
ln -s -f coreutils.exe base64.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"encoding/binary" | |
"fmt" | |
"log" | |
"os" | |
"strconv" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy to ~/.config/fish/functions/ | |
function mc | |
if not test -d "/tmp/mc-$USER" | |
mkdir -p "/tmp/mc-$USER" | |
end | |
set SHELL_PID %self | |
set MC_PWD_FILE "/tmp/mc-$USER/mc.pwd.$SHELL_PID" | |
/usr/bin/mc -P $MC_PWD_FILE $argv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.config/fish/config.fish | |
if test -z (pgrep ssh-agent | string collect) | |
eval (ssh-agent -c) | |
set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK | |
set -Ux SSH_AGENT_PID $SSH_AGENT_PID | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/nodesource/distributions/wiki/How-to-migrate-to-the-new-repository (for bash) | |
# Remove the GPG keyring file associated with the old repository | |
sudo rm /etc/apt/keyrings/nodesource.gpg | |
# Remove the old repository's list file | |
sudo rm /etc/apt/sources.list.d/nodesource.list | |
# Define the desired Node.js major version | |
set NODE_MAJOR 20 | |
# Update local package index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"os/exec" | |
"strings" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://en.wikipedia.org/wiki/RSA_(cryptosystem) | |
// Least common multiple | |
function lcm(a, b) { | |
let min = (a > b) ? a : b; | |
while (true) { | |
if (min % a === 0 && min % b === 0) { | |
break; | |
} | |
min++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set TMP_DIR "/tmp" | |
function get_latest_go_version | |
set GO_DEV_DL_PAGE "https://go.dev/dl/" | |
set LATEST_VERSION (curl -sL $GO_DEV_DL_PAGE | grep -oP 'go\d+(\.\d+)+\.linux-amd64\.tar\.gz' | awk -F '.linux-amd64.tar.gz' '{print $1}' | sort -V | tail -n 1 | sed 's/go//') | |
echo $LATEST_VERSION | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: ./update_go.sh version (example 1.20.4)" | |
exit 1 | |
fi | |
GO_VERSION=$1 | |
GO_ARCHIVE="go${GO_VERSION}.linux-amd64.tar.gz" | |
GO_DOWNLOAD_URL="https://go.dev/dl/${GO_ARCHIVE}" |
NewerOlder