Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View duffney's full-sized avatar
⌨️
Coding

Josh Duffney duffney

⌨️
Coding
View GitHub Profile
@alexedwards
alexedwards / go-update
Created November 22, 2023 14:53
Bash script for updating Go
#!/bin/bash
# Check if the version argument is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <go_version>"
exit 1
fi
# Version number provided as an argument
version="$1"
@murrahjm
murrahjm / psinventory.ps1
Created September 18, 2019 13:02
ansible dynamic inventory script in powershell
#!/usr/bin/env powershell
if ($args -contains '--list') {
$output = @{
'all' = @('server1.domain.com', 'server2.domain.com')
'webservers' = @('server1.domain.com')
'_meta' = @{
'hostvars' = @{
'server1.domain.com' = @{
myvar = 'metavariable'
@JustinGrote
JustinGrote / Enable-PowershellSSHRemoting.ps1
Created December 28, 2018 01:44
Enable Powershell Core 6 SSH Remoting on Windows
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Enabled Powershell Remoting Over SSH.
.NOTES
Currently assumes you have installed openssh and powershell core, preferably via chocolatey as such:
choco install powershell-core -y
choco install openssh -y -params '"/SSHServerFeature /PathSpecsToProbeForShellEXEString:$env:programfiles\PowerShell\*\pwsh.exe"'
#>
[CmdletBinding()]
@markwragg
markwragg / mactweaks.md
Last active April 25, 2023 18:10
Mac tweaks

Changes to my Mac

Turn off "press and hold" for foreign letters, allowing you to then press and hold for repeat letters. Open Terminal and run:

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

Then you need to close/reopen any app before it takes effect.

Make the dock appear faster when using auto hide:

@benjamincharity
benjamincharity / autonomous.txt
Last active April 12, 2024 22:20
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@MarkTiedemann
MarkTiedemann / download-latest-release.ps1
Last active March 4, 2024 18:39
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@danidiaz
danidiaz / netrw.txt
Created October 7, 2016 20:57
Vim's netrw commands.
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
@bsara
bsara / git-ssh-auth-win-setup.md
Last active April 22, 2024 13:49
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config