Skip to content

Instantly share code, notes, and snippets.

View caveman-dick's full-sized avatar

Richard Mayes caveman-dick

View GitHub Profile
@lukeplausin
lukeplausin / transfer_ssm_file.sh
Last active December 7, 2025 14:54
Transfer a file to EC2 SSM instance without using S3 (SSM only)
# This script will explain how to transfer a file to EC2 using SSM ONLY!
# You will need to have permission to run SSM commands on the target machine and have sudo access as well
# Infos
INSTANCE_ID=i-1234567890
FILE_NAME=the_file.tar.gz
# Step 1: Run command on machine to install netcat and dump from port to filename
# < Start session
@kohlikohl
kohlikohl / script.js
Last active September 27, 2023 08:41
Fix VSTS code coverage reporting by inlining CSS
let fs = require("fs-jetpack"),
path = require("path"),
inline = require("inline-css");
// This inlines the css of the HTML coverage output as VSTS
// strips all external CSS files
const CODE_COVERAGE_DIRECTORY = "./coverage";
const files = fs.find(CODE_COVERAGE_DIRECTORY, { matching: "*.html" });
@jchandra74
jchandra74 / PowerShell Customization.md
Last active December 25, 2025 13:11
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@davidfowl
davidfowl / Example1.cs
Last active February 11, 2026 04:57
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@javierarques
javierarques / protractorAPICheatsheet.md
Last active December 9, 2025 08:09
Protractor API Cheatsheet
@nickbayley
nickbayley / alt-ssh-copy-id.md
Last active September 5, 2024 12:09
Simple Alternative to ssh-copy-id

Simple Alternative to ssh-copy-id

Replace user with the name of the user you want to ssh as.

Replace the ip with the ip of the machine / host / vps you want to connect to.

cat ~/.ssh/id_rsa.pub | ssh user@ip "cat >> ~/.ssh/authorized_keys"
@altrive
altrive / Get-VMConsole.ps1
Created January 13, 2014 10:52
Sample code to handle Hyper-V VM keyboard via CIM namespace "root\virtualization\v2"
#Requires -Version 3
#Requires -RunAsAdministrator
function Get-VMConsole
{
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string] $VMName
)
@dgoguerra
dgoguerra / p4merge-git-tool.md
Last active February 27, 2026 12:08
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@rippo
rippo / Action result
Last active October 4, 2019 02:18
To show how you could test a NHibernate session.Query<T> on a controller
[NHibernateActionFilter]
public class MemberController
private readonly IDbService db;
public MemberController(IDbService db)
{
this.db = db;
}