Skip to content

Instantly share code, notes, and snippets.

View duffney's full-sized avatar
⌨️
Coding

Josh Duffney duffney

⌨️
Coding
View GitHub Profile
@duffney
duffney / term-cheatsheet.md
Last active November 4, 2023 13:05
keyboard shortcuts for the terminal

tmux

Desc. keys
split panel vertical Ctrl+b %
split horizontal Ctrl+b "
navigate panes Ctrl+b arrow keys
@duffney
duffney / readingList.md
Last active December 3, 2023 22:54
Duffney's Reading List

zsh, oh-my-zsh, exa

sudo apt install zsh -y
chsh -s $(which zsh)

sudo apt install wget git
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

sudo apt install exa
@duffney
duffney / subcommands.go
Created April 25, 2022 21:07
Using the flags package in Go to create sub-commands
package subcommands
import (
"flag"
"fmt"
"os"
)
func main() {
uploadCmd := flag.NewFlagSet("upload", flag.ExitOnError)
@duffney
duffney / main.go
Created April 25, 2022 21:05
Azure Blob Cli using the flags package
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
@duffney
duffney / logseqTimeBlockerTemplate.md
Last active April 18, 2022 20:19
logseqTimeBlockerTemplate.md
  • Time-blocker

    template:: time-blocker template-including-parent:: false
    • Daily Metrics

        - TODO Write: 1 hour
        - TODO Learn to Code: 30 minutes
        - TODO Read: 25 pages
      
    • Engineer's Daybook

      • Notes:
@duffney
duffney / Dockerfile
Created September 12, 2021 14:57
become ansible pip issue temp fix
FROM centos:centos7
RUN yum check-update; \
yum install -y gcc libffi-devel python3 epel-release; \
yum install -y openssh-clients; \
yum clean all; \
yum install ansible -y;
@duffney
duffney / configure-ansible-centos.sh
Created February 24, 2021 18:44
configure-ansible-centos.sh
#!/bin/bash
# Update all packages that have available updates.
sudo yum update -y
# Install Python 3 and pip.
sudo yum install -y python3-pip
# Upgrade pip3.
sudo pip3 install --upgrade pip
@duffney
duffney / becomeansible-2-10-dockerfile.md
Last active October 23, 2020 02:30
Dockerfile and supporting links for Ansible 2.10 for become Ansible

Dockerfile

FROM centos:centos7
COPY requirements-azure /tmp
RUN yum check-update; \
yum install -y gcc libffi-devel python3 epel-release; \
yum install -y openssh-clients; \
curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo; \
yum install -y powershell; \
$keyName = '{keyName}'
ssh-keygen -f $keyName -t rsa -N '""' -b 4096 -C '{email}'
$publicKey = (Get-Content "$keyName.pub" -Raw).ToString()
gh auth login
gh api "repos/{userName}/{repo}/keys" -f "key=$publicKey" -f "title=ROkey" -F read_only="true"