Skip to content

Instantly share code, notes, and snippets.

View aspen-roller's full-sized avatar

James Roller, Jr. aspen-roller

View GitHub Profile
@aspen-roller
aspen-roller / example.sh
Last active December 3, 2020 18:41
get latest version of a git repo release #docker #query
# docker-compose
export LATEST_DOCKER_COMPOSE_VERSION=$(curl -sSL "https://api.github.com/repos/docker/compose/releases/latest" | grep -o -P '(?<="tag_name": ").+(?=")')
# docker-ce-cli
export LATEST_DOCKER_CLI_VERSION=$(apt-cache madison docker-ce-cli | awk 'NR==1{print $3}')
@aspen-roller
aspen-roller / db-restore.sql
Last active December 2, 2020 17:15
SQL Server DB Restore (Bob Edition) #mssql
USE [master]
ALTER DATABASE [Admin] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE [Admin] FROM DISK = N'H:\PREPROD\Admin.bak' WITH FILE = 1
, MOVE N'Admin' TO N'D:\Data\QA1\Admin.mdf'
, MOVE N'Admin_log' TO N'H:\TransactionLogs\QA1\Admin.ldf', NOUNLOAD, REPLACE, STATS = 5
ALTER DATABASE [Admin] SET MULTI_USER
GO
@aspen-roller
aspen-roller / add-zscaler.sh
Last active August 29, 2024 15:11
add zscaler cert to Ubuntu #zscaler #ubuntu
#!/bin/bash
# certificate must have .crt extension
sudo cp zscaler.pem /usr/local/share/ca-certificates/zscaler.crt
sudo update-ca-certificates
@aspen-roller
aspen-roller / local-playbook.sh
Last active December 3, 2020 18:39
run ansible playbook locally #ansible
ansible-playbook playbook.yml --connection local -i 127.0.0.1,
@aspen-roller
aspen-roller / example.sh
Last active March 11, 2021 23:25
query cloud resources / images #azure #query #aws
# https://docs.microsoft.com/en-us/cli/azure/query-azure-cli?view=azure-cli-latest
# https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage
# install query editor
# pipe query results as json to jpterm to use this
pip install jmespath-terminal
# live query editor example
az vm list --output json | jpterm
@aspen-roller
aspen-roller / README.md
Last active July 23, 2024 05:44
VSCode: setup SSH on Win10 in DevContainer #vscode #ssh

Setup SSH for VSCode on Windows 10

Configuring SSH to work with VSCode dev containers was not straight forward. Through much trial and error I was finally able to establish SSH connections within the container without having to copy the SSH keys manually. I first started unraveling everything after finding a link to Advanced Container Configuration.

The error I was seeing had the following in it after starting a dev container:

[error] connect ENOENT \.\pipe\openssh-ssh-agent: Error: connect ENOENT \.\pipe\openssh-ssh-agent

I could still navigate the environment and use the terminal, but I did not have access via SSH without manually copying my private and public SSH keys into the containerized environment. The following steps give your dev container access to your ssh keys without any extra work or modifications to your container build.

@aspen-roller
aspen-roller / list-images.sh
Last active January 27, 2021 04:41
List Docker Image Tags #docker #query #azure
# Docker Hub, ubuntu
curl -sSL 'https://registry.hub.docker.com/v2/repositories/library/ubuntu/tags/' | jq '."results"[]["name"]'
# Microsoft Container Registry,
curl -sSL https://mcr.microsoft.com/v2/vscode/devcontainers/base/tags/list
@aspen-roller
aspen-roller / ExampleUsage.ps1
Created October 1, 2020 20:20
Chocolatey install packages
$chocolateyAppList = "googlechrome,firefox,redis-64,7zip,dotnetcore-sdk,dotnetcore-windowshosting"
$dismAppList = "IIS-ASPNET45,IIS-CertProvider,IIS-ManagementService"
Invoke-Expression "InstallApps.ps1 ""$chocolateyAppList"" ""$dismAppList"""
@aspen-roller
aspen-roller / .vimrc
Last active December 3, 2020 18:59
slow vim load because of clipboard and X server #vim #debug
# https://stackoverflow.com/a/17719528
# this response led me to disable the X server connection
# already verified that my DISPLAY was set correctly
# and I have VcXsrv running
set clipboard=exclude:.*
@aspen-roller
aspen-roller / .bash_profile
Last active December 3, 2020 17:39
WSL2 setup #win #wsl2
# automatically start ssh-agent
if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s >& ~/.ssh/ssh-agent
fi
eval `cat ~/.ssh/ssh-agent`
fi